:root {
  --bg: #f7f6f3;
  --fg: #2b2e31;
  --sub: #5d6166;
  --line: #e2dfd8;
  --tile: #dcdad4;
  --hover: #efede8;
  --card: #fbfaf7;
  --field: #ffffff;
  --line-strong: var(--line-strong);
  --danger: #b3261e;
  --danger-line: #e6b8b4;
  --ok: #1b7f3b;
  --font: 'Albert Sans', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
* { box-sizing: border-box; }
html { color-scheme: light; }

/* 다크 모드: 기기 설정을 따르되, 직접 바꾸면 그 선택을 기억한다 (html[data-theme]) */
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #121214;
  --fg: #e9e8e4;
  --sub: #a3a2a7;
  --line: #2c2c30;
  --tile: #202024;
  --hover: #1a1a1d;
  --card: #17171a;
  --field: #1c1c20;
  --line-strong: #3b3b41;
  --danger: #ff8a80;
  --danger-line: #6b3a36;
  --ok: #6fd08c;
}
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.75 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }
.caps { font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; }

/* header */
.head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 32px; padding: 24px clamp(20px, 3vw, 40px); border-bottom: 1px solid var(--line); }
.head.over { position: absolute; inset: 0 0 auto; z-index: 2; border-bottom-color: transparent; color: #fff; }
.logo { font-size: 17px; letter-spacing: 0.32em; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 32px; }
.theme-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; opacity: 0.82; transition: opacity 0.3s; }
.theme-btn:hover { opacity: 1; }
.theme-btn svg { width: 18px; height: 18px; }
.theme-btn .moon { display: none; }
:root[data-theme='dark'] .theme-btn .moon { display: block; }
:root[data-theme='dark'] .theme-btn .sun { display: none; }
html.theme-switch *, html.theme-switch *::before, html.theme-switch *::after { transition: none !important; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.4s; animation-timing-function: ease; }
.nav a { position: relative; display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; opacity: 0.82; transition: opacity 0.3s; }
.nav a::after { content: ''; position: absolute; left: 0; right: 0.24em; bottom: 10px; height: 1px; background: currentColor; transform: scaleX(0); transition: transform 0.4s var(--ease); }
.nav a:hover, .nav a[aria-current='page'] { opacity: 1; }
.nav a:hover::after, .nav a[aria-current='page']::after { transform: scaleX(1); }

/* hero */
.hero { position: relative; min-height: min(720px, 92vh); color: #fff; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; background: #6e7379; }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1s ease; }
.slide.on { opacity: 1; }
.slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide.ph { display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, 0.55); }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.1) 45%, rgba(0, 0, 0, 0.25)); pointer-events: none; }
.hero-body { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 40px; padding: 0 clamp(20px, 3vw, 40px) 40px; }
.hero h1 { font-weight: 300; font-size: clamp(34px, 5vw, 60px); line-height: 1.15; letter-spacing: -0.01em; margin: 0; max-width: 14em; }
.hero-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.btn-line { display: inline-flex; align-items: center; min-height: 48px; padding: 0 28px; border: 1px solid currentColor; text-decoration: none; transition: background 0.3s, color 0.3s; }
.hero .btn-line { border-color: rgba(255, 255, 255, 0.85); }
.hero .btn-line:hover { background: #fff; color: #2b2e31; }
.btn-line.dark:hover { background: var(--fg); color: var(--bg); }
.pager { display: flex; align-items: center; gap: 24px; font-size: 13px; letter-spacing: 0.1em; }
.pager button { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; transition: transform 0.3s; }
.pager .next:hover { transform: translateX(3px); }
.pager .prev:hover { transform: translateX(-3px); }

/* sections */
.view { animation: fade 0.5s ease both; }
.view[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.rise { animation: rise 0.9s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.wrap { max-width: 820px; margin: 0 auto; padding: 56px 24px 96px; }
.wrap.wide { max-width: 2200px; padding-inline: clamp(20px, 3vw, 40px); } /* 헤더와 같은 좌우 여백, 큰 화면에서도 폭을 활용 */
.wrap.narrow { max-width: 680px; padding-top: 40px; }
.page-title { font-weight: 300; font-size: 32px; margin: 0 0 32px; }
.about { max-width: 640px; margin: 0 auto; padding: 72px 24px 96px; text-align: center; }
.about .label { color: var(--sub); margin: 0 0 16px; }
.about .text { font-weight: 300; font-size: 20px; line-height: 1.7; margin: 0; }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 40px; }
.links a { border-color: var(--line-strong); padding: 0 24px; min-height: 44px; }
.links a:hover { background: var(--hover); }

/* list rows (developer, blog) */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rows a { display: grid; grid-template-columns: 96px 1fr auto; gap: 4px 20px; align-items: baseline; padding: 22px 8px; border-bottom: 1px solid var(--line); text-decoration: none; transition: background 0.25s; }
.rows a:hover { background: var(--hover); }
.rows .meta { font-size: 12px; letter-spacing: 0.1em; color: var(--sub); }
.rows .title { display: block; font-size: 22px; }
.rows .desc { color: var(--sub); }
.rows .go { color: var(--sub); }
.rows .go span { display: inline-block; transition: transform 0.3s; }
.rows a:hover .go span { transform: translateX(4px); }
@media (max-width: 640px) { .rows a { grid-template-columns: 1fr; } }
.empty { border: 1px dashed var(--line-strong); padding: 48px 24px; text-align: center; color: var(--sub); }
.empty code { color: var(--fg); }

/* gallery */
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; margin-bottom: 32px; }
.chips, .modes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.modes-label { color: var(--sub); margin-right: 4px; }
.chip { min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--sub); transition: background 0.25s, color 0.25s, border-color 0.25s; }
.chip:hover { color: var(--fg); border-color: var(--line-strong); }
.chip[aria-pressed='true'] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.group + .group { margin-top: 48px; }
.group-title { font-weight: 300; font-size: 22px; margin: 0 0 16px; display: flex; align-items: baseline; gap: 10px; }
.count { font-size: 12px; color: var(--sub); letter-spacing: 0.1em; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: clamp(8px, 1vw, 16px); }
.shot { display: block; aspect-ratio: 4 / 5; background: var(--tile); overflow: hidden; cursor: zoom-in; transition: opacity 0.3s; -webkit-touch-callout: none; user-select: none; }
.shot:hover { opacity: 0.85; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; -webkit-user-drag: none; }

/* viewer — 배경은 순수 검정(#000): OLED 에서는 픽셀이 꺼진다 */
dialog.viewer { border: 0; padding: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; background: #000; color: #fff; overflow: hidden; -webkit-touch-callout: none; user-select: none; }
dialog.viewer::backdrop { background: #000; }
dialog.viewer[open] { animation: v-open 0.36s var(--ease) both; }
dialog.viewer.closing { animation: v-close 0.26s ease-in both; }
@keyframes v-open { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }
@keyframes v-close { from { opacity: 1; transform: none; } to { opacity: 0; transform: scale(0.97); } }
.v-canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.v-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 24px 20px; display: flex; flex-direction: column; gap: 2px; background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent); pointer-events: none; }
.v-caption span { font-size: 12px; letter-spacing: 0.08em; color: #cfcfcf; }
.v-loading { position: absolute; top: 20px; left: 24px; color: #bbb; transition: opacity 0.3s; }
.v-loading[hidden], .v-btn[hidden] { display: none; }
.v-btn { position: absolute; color: #fff; min-width: 44px; min-height: 44px; background: rgba(0, 0, 0, 0.5); border: 1px solid rgba(255, 255, 255, 0.28); transition: background 0.25s, color 0.25s, border-color 0.25s; }
.v-btn:hover { background: rgba(255, 255, 255, 0.14); }
.v-top { position: absolute; top: 16px; right: 16px; display: flex; align-items: center; gap: 8px; }
.v-top .v-btn { position: static; }
.v-close { padding: 0 16px; }
.v-auto { padding: 0 14px; white-space: nowrap; }
.v-auto[aria-pressed='true'] { background: #fff; color: #000; border-color: #fff; }
.v-prev, .v-next { top: 50%; transform: translateY(-50%); font-size: 26px; line-height: 1; }
.v-prev { left: 12px; } .v-next { right: 12px; }
/* 감상 모드: 메뉴·캡션·진행 막대를 모두 숨겨 사진만 보인다 (자동 재생은 계속 동작) */
.v-top, .v-caption, .v-loading, .v-progress, .v-prev, .v-next { transition: opacity 0.35s ease, visibility 0s; }
dialog.viewer.immersive .v-top, dialog.viewer.immersive .v-caption, dialog.viewer.immersive .v-loading,
dialog.viewer.immersive .v-progress, dialog.viewer.immersive .v-prev, dialog.viewer.immersive .v-next { opacity: 0; visibility: hidden; transition: opacity 0.35s ease, visibility 0s 0.35s; pointer-events: none; }
.v-hint { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); padding: 8px 14px; background: rgba(255, 255, 255, 0.14); color: #fff; font-size: 11px; white-space: nowrap; max-width: calc(100vw - 24px); overflow: hidden; text-overflow: ellipsis; opacity: 0; pointer-events: none; transition: opacity 0.4s; }
.v-hint.show { opacity: 1; }
.v-progress { position: absolute; top: 0; left: 0; height: 2px; width: 100%; background: rgba(255, 255, 255, 0.75); transform: scaleX(0); transform-origin: left; pointer-events: none; }
.v-progress.run { animation: v-prog 4s linear forwards; }
@keyframes v-prog { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* detail (project, post) */
.back { color: var(--sub); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.back:hover { color: var(--fg); }
.detail h1, .detail .p-name { font-weight: 300; font-size: 44px; line-height: 1.15; margin: 12px 0 8px; }
.detail .lead { color: var(--sub); margin: 0 0 32px; }
.detail h2 { font-weight: 400; font-size: 20px; margin: 40px 0 12px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); gap: 16px; margin: 32px 0 36px; padding: 18px 0; border-block: 1px solid var(--line); font-size: 14px; }
.facts dt { font-size: 10px; letter-spacing: 0.2em; color: var(--sub); text-transform: uppercase; }
.facts dd { margin: 2px 0 0; }
.detail ul { padding-left: 1.2em; }
.btn-line[aria-disabled='true'] { color: var(--sub); border-style: dashed; pointer-events: none; }
.foot { border-top: 1px solid var(--line); padding: 28px clamp(20px, 3vw, 40px) 40px; color: var(--sub); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.foot a { text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* developer: 넓은 화면에서는 왼쪽 앱 목록 + 오른쪽 상세 */
.dev-detail { display: none; }
@media (min-width: 960px) {
  .dev-split { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: clamp(40px, 6vw, 96px); align-items: start; }
  .dev-detail { display: block; position: sticky; top: 24px; max-width: 780px; }
  .dev-detail.swap { animation: dev-in 0.4s var(--ease) both; }
  .dev-split .rows a { grid-template-columns: 56px 1fr; padding: 18px 12px; }
  .dev-split .rows .title { font-size: 20px; }
  .dev-split .rows .go { display: none; }
  .dev-split .rows a[aria-current='true'] { background: var(--hover); }
}
@keyframes dev-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
