/* ─────────────────────────────────────────────────────────────
   Reset, typography, layout primitives, motion
   ───────────────────────────────────────────────────────────── */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, p, figure, blockquote, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }

a { color: inherit; text-decoration: none; }

/* Focus: never remove it, just make it match the palette. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: var(--ink); color: var(--paper); }

/* ── Typography ─────────────────────────────────────────────── */

/* Korean has no inter-word breaking opportunity by default, so a long
   headline snaps mid-word ("하 / 루가"). keep-all restores word-boundary
   wrapping; break-word is the escape valve for an unbreakable URL. */
:lang(ko) {
  word-break: keep-all;
  overflow-wrap: break-word;
}

.display {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: var(--fs-display);
  line-height: var(--lh-display);
  letter-spacing: var(--ls-display);
  text-wrap: balance;
}

.h1, .h2, .h3 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
  text-wrap: balance;
}
.h1 { font-size: var(--fs-h1); }
.h2 { font-size: var(--fs-h2); }
.h3 { font-size: var(--fs-h3); }

.lead {
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--ink-80);
  text-wrap: pretty;
}

.prose { max-width: var(--maxw-prose); text-wrap: pretty; }
.prose p + p { margin-top: 1em; }

/* Section eyebrow: small, wide-tracked, terracotta. */
.eyebrow {
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--accent-text);
}

/* Rotated section marker running up the left edge. */
.vlabel {
  font-size: var(--fs-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--accent-text);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  margin: 0;
}

/* Italic emphasis inside a display heading, in the accent. The serif
   italic is the whole point - don't let a fallback synthesise it. */
.display em, .h1 em, .h2 em {
  font-style: italic;
  color: var(--accent-text);
}

.muted { color: var(--ink-60); }
.small { font-size: var(--fs-small); }

.mono {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

/* ── Layout ─────────────────────────────────────────────────── */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--space-4xl); }
.section--tight { padding-block: var(--space-3xl); }
.section--flush-top { padding-top: 0; }

.grid12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-lg) var(--gutter);
}

/* Full-bleed escape hatch for images inside a .wrap. */
.bleed {
  width: 100vw;
  margin-inline: calc(50% - 50vw);
}

.rule { height: 1px; background: var(--rule); border: 0; }

.stack > * + * { margin-top: var(--space-md); }
.stack-lg > * + * { margin-top: var(--space-xl); }

/* ── Buttons ────────────────────────────────────────────────── */

/* Square-cornered, wide-tracked, uppercase. Nothing here is a pill -
   the rounded shape fought the editorial type. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 1rem 1.9rem;
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-radius: 0;
  transition: background var(--dur-med) var(--ease-out),
              color var(--dur-med) var(--ease-out),
              border-color var(--dur-med) var(--ease-out);
}

.btn--solid {
  background: var(--coal);
  color: var(--paper);
  border: 1px solid var(--coal);
}
.btn--solid:hover { background: var(--accent-text); border-color: var(--accent-text); }

.btn--outline {
  background: transparent;
  color: var(--accent-text);
  border: 1px solid var(--accent);
  padding-block: 0.8rem;
}
.btn--outline:hover { background: var(--accent-text); border-color: var(--accent-text); color: var(--paper); }

/* On the sand footer the outline needs a touch more weight. */
.btn--onDark { padding: 1rem 1.9rem; }

/* Over photography: a coal button would sink into the scrim. */
.btn--light {
  background: var(--paper);
  color: var(--coal);
  border: 1px solid var(--paper);
}
.btn--light:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

.btn--outlineLight {
  background: transparent;
  color: var(--paper);
  border: 1px solid rgb(253 251 247 / 0.5);
  padding-block: 0.95rem;
}
.btn--outlineLight:hover {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--coal);
}

/* Text link sitting on a rule that wipes to the accent on hover. */
.link-rule {
  display: inline-block;
  padding-bottom: 0.65rem;
  font-size: var(--fs-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--accent);
  transition: color var(--dur-fast);
}
.link-rule:hover { color: var(--accent-text); }

.link {
  display: inline-flex;
  align-items: center;
  /* WCAG 2.2 minimum target; at eyebrow size the line box alone
     leaves these at ~21px. */
  min-height: 1.5rem;
  gap: 0.5em;
  padding-bottom: 2px;
  background-image: linear-gradient(var(--ink), var(--ink));
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size var(--dur-med) var(--ease-out);
}
.link:hover { background-size: 100% 1px; }
.link .arrow { transition: transform var(--dur-med) var(--ease-out); }
.link:hover .arrow { transform: translateX(4px); }

/* ── Media ──────────────────────────────────────────────────── */

/* Ratio boxes keep the grid from reflowing while images load. */
.media {
  position: relative;
  overflow: hidden;
  background: var(--sand-200);
}
.media > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media--4x5  { aspect-ratio: 4 / 5; }
.media--3x2  { aspect-ratio: 3 / 2; }
.media--16x9 { aspect-ratio: 16 / 9; }
.media--1x1  { aspect-ratio: 1 / 1; }

/* Slow push-in on hover — reads as "alive" without being a carousel. */
.media--zoom > img {
  transition: transform var(--dur-slow) var(--ease-out);
}
a:hover .media--zoom > img,
.media--zoom:hover > img { transform: scale(1.04); }

/* ── Scroll reveal ──────────────────────────────────────────── */

/* The .js-reveal flag is only set once site.js confirms
   IntersectionObserver exists — otherwise content must stay visible.
   One-shot keyframes rather than a standing `transition`: a declared
   transition that is waiting for a class leaves a phantom animation
   pinned at time 0, so the page never reports itself as settled. */
.js-reveal [data-reveal] { opacity: 0; }
.js-reveal [data-reveal].is-in {
  animation: revealUp var(--dur-slow) var(--ease-out) forwards;
}
@keyframes revealUp {
  from { opacity: 0; transform: translateY(1.5rem); }
  to   { opacity: 1; transform: none; }
}

.js-reveal [data-reveal-img] > img { opacity: 0; }
.js-reveal [data-reveal-img].is-in > img {
  animation: revealImg 1.2s var(--ease-out) forwards;
}
@keyframes revealImg {
  from { opacity: 0; transform: scale(1.06); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .js-reveal [data-reveal],
  .js-reveal [data-reveal-img] > img {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
}

/* ── Utility ────────────────────────────────────────────────── */

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  z-index: var(--z-overlay);
  padding: 0.75rem 1.25rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  transform: translateY(-200%);
  transition: transform var(--dur-fast) var(--ease-out);
}
.skip-link:focus { transform: none; }
