@font-face {
  font-family: 'Pretendard Variable';
  src: url('assets/PretendardVariable.woff2') format('woff2-variations');
  font-weight: 45 920;
  font-display: swap;
}

:root {
  --page: #f4f1ea;
  --surface: #fffdf8;
  --ink: #1b1a17;
  --ink-muted: #6f6a5f;
  --line: rgba(27, 26, 23, 0.12);
  --accent: #23478f;
  --shadow: 0 18px 40px -22px rgba(58, 50, 34, 0.55);
  --radius: 10px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #141311;
    --surface: #1e1c19;
    --ink: #ece8df;
    --ink-muted: #948d80;
    --line: rgba(236, 232, 223, 0.16);
    --accent: #8fb0f0;
    --shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.8);
  }
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: 'Pretendard Variable', -apple-system, BlinkMacSystemFont,
    'Apple SD Gothic Neo', 'Noto Sans KR', system-ui, sans-serif;
  font-feature-settings: 'ss01';
  -webkit-font-smoothing: antialiased;
  word-break: keep-all; /* 한글이 단어 중간에서 잘리지 않게 한다 */
}

/* ── 상단 워드마크 ─────────────────────────────────── */

.masthead {
  display: flex;
  align-items: center;
  height: 72px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 56px);
}

.wordmark {
  color: inherit;
  text-decoration: none;
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

/* ── 인트로 ────────────────────────────────────────── */

.intro {
  max-width: 1400px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 64px) clamp(20px, 4vw, 56px) clamp(44px, 6vw, 84px);
}

.intro h1 {
  margin: 0;
  max-width: 16ch;
  font-size: clamp(2.5rem, 6.4vw, 4.75rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.intro p {
  margin: clamp(16px, 2vw, 24px) 0 0;
  max-width: 46ch;
  color: var(--ink-muted);
  font-size: clamp(0.975rem, 1.3vw, 1.125rem);
  line-height: 1.65;
}

/* ── 작업 그리드 ───────────────────────────────────── */

.works {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 56px) clamp(72px, 10vw, 140px);
}

.group + .group { margin-top: clamp(56px, 7vw, 96px); }

.group-title {
  margin: 0 0 clamp(20px, 2.4vw, 32px);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(32px, 3.4vw, 52px) clamp(20px, 2.4vw, 36px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.card a {
  display: block;
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius);
  outline-offset: 5px;
}

.card a:focus-visible {
  outline: 2px solid var(--accent);
}

.shot {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: box-shadow 0.45s var(--ease), transform 0.45s var(--ease);
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 880 / 526;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.6s var(--ease);
}

.meta {
  display: block;
  padding-top: 18px;
}

.meta .name {
  display: block;
  font-size: 1.0625rem;
  font-weight: 650;
  letter-spacing: -0.012em;
}

.meta .cat {
  display: block;
  margin-top: 5px;
  color: var(--ink-muted);
  font-size: 0.875rem;
}

@media (hover: hover) {
  .card a:hover .shot {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
  }

  .card a:hover .shot img { transform: scale(1.035); }
}

/* ── 진입 리빌: 카드가 뷰포트에 들어올 때 순서대로 올라온다 ──
   숨김 상태는 .js 아래에만 둔다. 스크립트가 없거나 실패하면 카드가 그냥 보인다. */

.js .card {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: calc(var(--stagger, 0) * 70ms);
}

.js .card.is-visible {
  opacity: 1;
  transform: none;
}

/* ── 반응형 ────────────────────────────────────────── */

@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .intro h1 { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .js .card {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .shot,
  .shot img { transition: none; }

  .card a:hover .shot img { transform: none; }
}
