/* ==========================================================================
   FRAME / 01 — base: tokens, type, header, menu, shared pieces
   ========================================================================== */

@font-face { font-family: "Bodoni Moda"; src: url("../assets/fonts/bodoni-moda-latin.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Bodoni Moda"; src: url("../assets/fonts/bodoni-moda-italic-latin.woff2") format("woff2"); font-weight: 400 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter Tight"; src: url("../assets/fonts/intertight-latin.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

/* Animatable tone tokens: the page colour glides between light and dark sections */
@property --bg   { syntax: "<color>"; inherits: true; initial-value: #0b0b0a; }
@property --fg   { syntax: "<color>"; inherits: true; initial-value: #eeebe4; }
@property --mut  { syntax: "<color>"; inherits: true; initial-value: rgba(238, 235, 228, 0.55); }
@property --line { syntax: "<color>"; inherits: true; initial-value: rgba(238, 235, 228, 0.16); }

:root {
  --ink: #0d0d0c;
  --paper: #f1efe9;
  --night: #0b0b0a;
  --bone: #eeebe4;
  --serif: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --sans: "Inter Tight", "Helvetica Neue", Arial, system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.76, 0, 0.24, 1);
  --gut: clamp(20px, 4.2vw, 72px);
  --hdr-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--night); }
html.is-locked { overflow: hidden; padding-right: var(--sbw, 0px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0; min-width: 320px;
  background: var(--bg); color: var(--fg);
  font-family: var(--sans); font-size: 1rem; line-height: 1.55; font-weight: 400;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  transition: --bg 0.9s var(--ease-io), --fg 0.9s var(--ease-io), --mut 0.9s var(--ease-io), --line 0.9s var(--ease-io);
  overflow-x: clip;
}
body[data-tone="light"] { --bg: var(--paper); --fg: var(--ink); --mut: rgba(13, 13, 12, 0.56); --line: rgba(13, 13, 12, 0.16); }
body[data-tone="dark"]  { --bg: var(--night); --fg: var(--bone); --mut: rgba(238, 235, 228, 0.56); --line: rgba(238, 235, 228, 0.18); }
body { background-color: var(--bg); }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p, figure, dl, dd, address { margin: 0; font-style: normal; }
::selection { background: var(--fg); color: var(--bg); }

:focus-visible { outline: 1.5px solid currentColor; outline-offset: 4px; }

.skip { position: fixed; left: 12px; top: -60px; z-index: 500; padding: 12px 18px; background: var(--paper); color: var(--ink); font-size: 0.85rem; transition: top 0.2s; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 1560px; margin-inline: auto; padding-inline: var(--gut); }
.wrap--wide { max-width: 1760px; }

/* Type */
.lbl { font-family: var(--sans); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; line-height: 1.5; }
.lbl > span + span::before { content: "/"; margin: 0 0.9em; opacity: 0.4; }

.h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.6rem, 7.2vw, 7.2rem); line-height: 0.96; letter-spacing: -0.025em; }
.h2 em, .hero__title em, .finale__title em, .proj__title em, .pv__title em { font-style: italic; font-weight: 400; }

.sec-lbl { display: flex; gap: 0.8em; color: var(--mut); margin-bottom: clamp(1.4rem, 3vw, 2.4rem); }
.sec-lbl span { color: var(--fg); }

.sec-head { display: grid; gap: 1.6rem; padding-block: clamp(4.5rem, 11vw, 10rem) clamp(2.5rem, 6vw, 5rem); }
.sec-head__note { color: var(--mut); font-size: 0.95rem; max-width: 26ch; }
@media (min-width: 900px) {
  .sec-head { grid-template-columns: 1fr auto; align-items: end; }
  .sec-head .sec-lbl { grid-column: 1 / -1; margin-bottom: 0; }
  .sec-head__note { text-align: right; justify-self: end; }
}

/* Header */
.hdr { position: fixed; inset: 0 0 auto 0; z-index: 120; color: #fff; mix-blend-mode: difference; transition: transform 0.6s var(--ease); pointer-events: none; }
.hdr.is-hidden { transform: translateY(-110%); }
.hdr__in { display: flex; align-items: center; justify-content: space-between; gap: 2rem; height: var(--hdr-h); padding-inline: var(--gut); pointer-events: auto; }
.hdr > .hdr__in > * { pointer-events: auto; }

.logo { font-family: var(--sans); font-size: 0.86rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; white-space: nowrap; }
.logo i { font-style: normal; font-weight: 300; margin-inline: 0.15em; opacity: 0.8; }

.nav { display: none; }
.nav ul { display: flex; gap: clamp(1.6rem, 3vw, 3.2rem); }
.nav a { position: relative; display: inline-block; padding-block: 0.7em; font-size: 0.72rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0.35em; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform 0.6s var(--ease); }
.nav a:hover::after, .nav a.is-active::after { transform: scaleX(1); transform-origin: left; }

.burger { position: relative; width: 44px; height: 44px; margin-right: -10px; }
.burger span { position: absolute; left: 10px; right: 10px; height: 1.5px; background: currentColor; transition: transform 0.6s var(--ease), top 0.6s var(--ease); }
.burger span:first-child { top: 18px; }
.burger span:last-child { top: 26px; }
.menu-open .burger span:first-child { top: 22px; transform: rotate(45deg); }
.menu-open .burger span:last-child { top: 22px; transform: rotate(-45deg); }
@media (min-width: 900px) { .nav { display: block; } .burger { display: none; } }

/* Mobile menu */
.mnav { position: fixed; inset: 0; z-index: 110; display: flex; flex-direction: column; justify-content: space-between; padding: calc(var(--hdr-h) + 12px) var(--gut) calc(28px + env(safe-area-inset-bottom)); background: var(--night); color: var(--bone); visibility: hidden; clip-path: inset(0 0 100% 0); transition: clip-path 0.9s var(--ease-io), visibility 0s linear 0.9s; overflow-y: auto; }
.menu-open .mnav { visibility: visible; clip-path: inset(0); transition: clip-path 0.9s var(--ease-io), visibility 0s; }
.mnav ul { margin-block: auto; }
.mnav li { border-bottom: 1px solid rgba(238, 235, 228, 0.14); overflow: hidden; }
.mnav li a { display: flex; align-items: baseline; gap: 1.1rem; padding-block: 0.16em; font-family: var(--serif); font-size: clamp(2.6rem, 12.5vw, 4.4rem); line-height: 1.1; letter-spacing: -0.02em; transform: translateY(105%); transition: transform 0.6s var(--ease); }
.menu-open .mnav li a { transform: none; transition: transform 1s var(--ease); transition-delay: calc(0.3s + var(--i) * 70ms); }
.mnav li a span { font-family: var(--sans); font-size: 0.68rem; letter-spacing: 0.16em; opacity: 0.55; }
.mnav__foot { display: grid; gap: 0.4rem; margin-top: 2rem; font-size: 0.9rem; color: rgba(238, 235, 228, 0.6); }
.mnav__foot a { color: var(--bone); }
@media (min-width: 900px) { .mnav { display: none; } }

/* Progressive image reveal (mask slides away, image settles) */
.ph { position: relative; overflow: hidden; background: var(--line); }
.ph__in { position: absolute; inset: -8% 0; will-change: transform; }
.ph img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.14); transition: transform 1.8s var(--ease); }
.ph::after { content: ""; position: absolute; inset: -1px; z-index: 2; background: var(--bg); transform-origin: 50% 0; transition: transform 1.3s var(--ease-io); pointer-events: none; }
.ph.is-in::after, html:not(.js) .ph::after { transform: scaleY(0); }
.ph.is-in img, html:not(.js) .ph img { transform: scale(1); }
.ph--plain::after { display: none; }
.ph--plain img { transform: none; }

/* Custom cursor */
.cur { position: fixed; left: 0; top: 0; z-index: 400; width: 96px; height: 96px; margin: -48px 0 0 -48px; pointer-events: none; display: none; }
.cur span { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: var(--bone); color: var(--ink); font-size: 0.66rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; transform: scale(0); transition: transform 0.5s var(--ease); }
.cur.is-on span { transform: scale(1); }
@media (hover: hover) and (pointer: fine) { .cur { display: block; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .cur { display: none !important; }
}
