/* ==========================================================================
   Minimal Cozy — Conway C. Liao
   Editorial design system: 12-col grid, TWK Lausanne (sans) + TWK Ghost (serif),
   scroll-driven colour atmosphere.
   ========================================================================== */

/* Fonts ------------------------------------------------------------------- */
@font-face { font-family: 'Lausanne'; src: url('/assets/fonts/TWKLausanne-300.woff2') format('woff2'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Lausanne'; src: url('/assets/fonts/TWKLausanne-300Italic.woff2') format('woff2'); font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: 'Lausanne'; src: url('/assets/fonts/TWKLausanne-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Lausanne'; src: url('/assets/fonts/TWKLausanne-400Italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Lausanne'; src: url('/assets/fonts/TWKLausanne-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Ghost'; src: url('/assets/fonts/TWKGhost-Thin.woff2') format('woff2'); font-weight: 100; font-style: normal; font-display: swap; }
@font-face { font-family: 'Ghost'; src: url('/assets/fonts/TWKGhost-Light.woff2') format('woff2'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Ghost'; src: url('/assets/fonts/TWKGhost-LightItalic.woff2') format('woff2'); font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: 'Ghost'; src: url('/assets/fonts/TWKGhost-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Ghost'; src: url('/assets/fonts/TWKGhost-Italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }

/* Tokens ------------------------------------------------------------------ */
:root {
  /* Palette — pulled from the gradient business-card reference */
  --paper:    #F3F1EC;
  --fog:      #D9D8D4;
  --slate:    #AEB6B5;
  --ink:      #1E1B1A;
  --charcoal: #3E3D3C;
  --oxblood:  #48202A;
  --mauve:    #CDB9C6;
  --saffron:  #EFB04A;
  --sand:     #E9CF9C;
  --sage:     #8FB485;
  --moss:     #5E7B5A;

  /* Live atmosphere values (overwritten every frame by motion.js) */
  --bg: var(--paper);
  --fg: var(--ink);
  --g1: var(--paper);
  --g2: var(--paper);
  --g3: var(--paper);
  --shift: 0;
  --muted: color-mix(in srgb, var(--fg) 55%, transparent);
  --rule:  color-mix(in srgb, var(--fg) 22%, transparent);

  /* Type */
  /* CJK fallbacks so Chinese characters (e.g. 廖晟瑋) render in a matching style */
  --sans: 'Lausanne', 'Helvetica Neue', Helvetica, Arial, 'PingFang TC', 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
  --serif: 'Ghost', 'Times New Roman', Georgia, 'Songti TC', 'Noto Serif TC', 'PMingLiU', serif;
  --t-label: 11px;
  --t-small: 13px;
  --t-body: clamp(16px, 1.05vw + 6px, 18px);
  --t-lead: clamp(21px, 1.6vw + 6px, 30px);
  --t-h3: clamp(26px, 2.4vw + 6px, 44px);
  --t-statement: clamp(34px, 4.6vw, 84px);
  --t-display: clamp(56px, 10.4vw, 200px);
  --t-mega: clamp(160px, 30vw, 520px);

  /* Grid */
  --cols: 12;
  --margin: clamp(16px, 2.6vw, 44px);
  --gutter: clamp(12px, 1.6vw, 24px);
  --header-h: 64px;

  /* Rhythm */
  --space-s: clamp(48px, 6vw, 96px);
  --space-m: clamp(80px, 10vw, 180px);
  --space-l: clamp(120px, 16vw, 280px);

  /* Grain — size and amount come from Site settings → Grain */
  --grain-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 220' preserveAspectRatio='none'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --grain-size: 220px;
  --grain-opacity: .14;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-inout: cubic-bezier(.65, 0, .35, 1);
}

/* Base -------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-weight: 300;
  font-size: var(--t-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: inherit; }
figure { margin: 0; }
::selection { background: var(--saffron); color: var(--ink); }
:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }

.label {
  font-family: var(--sans);
  font-size: var(--t-label);
  font-weight: 400;
  letter-spacing: .08em;
  text-transform: uppercase;
  line-height: 1.35;
}
.muted { color: var(--muted); }
.serif { font-family: var(--serif); }

/* Grid -------------------------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  column-gap: var(--gutter);
  padding-inline: var(--margin);
}
.col { grid-column: var(--start, auto) / span var(--span, 12); min-width: 0; }

@media (max-width: 760px) {
  :root { --cols: 6; --header-h: 56px; }
  .col { grid-column: 1 / -1; }
  .col[data-m-span] { grid-column: auto / span var(--m-span); }
}

.grid-overlay { position: fixed; inset: 0; pointer-events: none; z-index: 90; display: none; }
.grid-overlay .grid { height: 100%; }
.grid-overlay .grid::before { content: none; }
html.show-grid .grid-overlay { display: block; }
.grid-overlay .grid > span { background: rgba(239, 176, 74, .12); border-inline: 1px solid rgba(239, 176, 74, .35); }

/* Atmosphere -------------------------------------------------------------- */
.atmosphere { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg); }
.atmosphere__field {
  position: absolute; inset: -10% 0;
  background: linear-gradient(180deg, var(--g1) 0%, var(--g2) 50%, var(--g3) 100%);
  background-size: 100% 160%;
  background-position: 50% calc(var(--shift) * 100%);
}
.atmosphere__orb {
  position: absolute;
  width: 90vmax; height: 90vmax;
  left: 50%; top: 50%;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--g2), transparent 70%);
  opacity: .55;
  filter: blur(40px);
  transform: translate(calc(-50% + (var(--shift) - .5) * 40vw), calc(-50% + (var(--shift) - .5) * -30vh));
}
.atmosphere__grain {
  position: absolute; inset: -50%;
  opacity: var(--grain-opacity);
  mix-blend-mode: overlay;
  background-image: var(--grain-svg);
  background-size: var(--grain-size);
}

/* Masthead + folio -------------------------------------------------------- */
.masthead {
  position: fixed; inset: 0 0 auto; z-index: 50;
  height: var(--header-h);
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  column-gap: var(--gutter);
  align-items: center;
  padding-inline: var(--margin);
  color: var(--fg);
  transition: transform .6s var(--ease-out);
}
.masthead.is-hidden { transform: translateY(-100%); }
.masthead__name { grid-column: 1 / span 4; font-family: var(--serif); font-weight: 400; font-size: 19px; letter-spacing: -.005em; white-space: nowrap; }
.masthead__role { grid-column: 6 / span 3; }
.masthead__nav { grid-column: 9 / -1; display: flex; justify-content: flex-end; gap: clamp(14px, 2vw, 32px); }
.masthead__nav a { font-size: var(--t-small); font-weight: 400; position: relative; padding-block: 4px; }
.masthead__nav a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease-out);
}
.masthead__nav a:hover::after, .masthead__nav a[aria-current='page']::after { transform: scaleX(1); transform-origin: left; }

.folio {
  position: fixed; inset: auto 0 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 var(--margin) 18px;
  color: var(--fg);
  pointer-events: none;
}
.folio__section { transition: opacity .4s; }

@media (max-width: 760px) {
  .masthead__name { grid-column: 1 / span 3; font-size: 17px; }
  .masthead__alt { display: none; }
  .masthead__role { display: none; }
  .masthead__nav { grid-column: 4 / -1; gap: 14px; }
  .masthead__nav a { font-size: 12px; }
  .masthead__nav a.nav-secondary { display: none; }
  .folio { padding-bottom: 12px; }
}

/* Page + transitions ------------------------------------------------------ */
.page { display: block; outline: none; transition: opacity .5s var(--ease-inout); }
.page.is-leaving { opacity: 0; }

.module { position: relative; padding-block: var(--space-m); }
.module[data-spacing='s'] { padding-block: var(--space-s); }
.module[data-spacing='l'] { padding-block: var(--space-l); }
.module[data-spacing='none'] { padding-block: 0; }
.module + .module[data-spacing='tight'] { padding-top: 0; }

.module-head { margin-bottom: clamp(32px, 4vw, 64px); align-items: end; }
.module-head__label { grid-column: 1 / span 3; }
.module-head__title { grid-column: 4 / span 7; font-family: var(--serif); font-weight: 300; font-size: var(--t-h3); line-height: 1.05; letter-spacing: -.01em; }
.module-head__aside { grid-column: 11 / span 2; text-align: right; }
@media (max-width: 760px) {
  .module-head > * { grid-column: 1 / -1 !important; text-align: left; }
  .module-head__label { margin-bottom: 12px; }
}

/* Type animation primitives ---------------------------------------------- */
/* text-indent must not inherit into each word (it would shift and clip them); the right padding leaves room for italic overhang. */
.split .w { display: inline-block; overflow: hidden; vertical-align: top; text-indent: 0; padding: 0 .06em .1em 0; margin: 0 -.06em -.1em 0; }
.cw { display: inline-block; white-space: nowrap; }
.split .w > span { display: inline-block; transform: translate3d(0, 105%, 0); transition: transform 1.1s var(--ease-out); transition-delay: calc(var(--i, 0) * 45ms + var(--d, 0ms)); }
.split.is-in .w > span { transform: none; }

.fade { opacity: 0; transform: translate3d(0, 24px, 0); transition: opacity 1s var(--ease-out), transform 1.2s var(--ease-out); transition-delay: var(--d, 0ms); }
.fade.is-in { opacity: 1; transform: none; }

.scrub .sw { opacity: .16; transition: opacity .25s linear; }
.scrub .sw.on { opacity: 1; }

mark {
  color: inherit;
  background: linear-gradient(90deg, var(--saffron), var(--mauve)) no-repeat 0 88% / 0% .32em;
  transition: background-size 1.4s var(--ease-out) .25s;
  padding-inline: .04em;
}
.is-in mark, .scrub.is-in mark { background-size: 100% .32em; }

/* Rich text from the CMS. Bold steps up one weight rather than synthesising a heavy one. */
strong, b { font-weight: 500; }
u, s { text-decoration-thickness: max(1px, .05em); text-underline-offset: .14em; }
/* Split text sets each word in an inline-block, which an ancestor's decoration can't reach. */
.split u .w > span { text-decoration: underline; text-decoration-thickness: max(1px, .05em); text-underline-offset: .14em; }
.split s .w > span { text-decoration: line-through; text-decoration-thickness: max(1px, .05em); }
.split u s .w > span, .split s u .w > span { text-decoration-line: underline line-through; }

.rule { height: 1px; background: var(--rule); transform-origin: left; transform: scaleX(0); transition: transform 1.4s var(--ease-out); }
.is-in .rule, .rule.is-in { transform: none; }

/* Media + placeholders ---------------------------------------------------- */
.frame { position: relative; overflow: hidden; aspect-ratio: var(--ratio, 3 / 2); background: color-mix(in srgb, var(--fg) 8%, transparent); }
.frame[data-ratio='16:9'] { --ratio: 16 / 9; }
.frame[data-ratio='4:5'] { --ratio: 4 / 5; }
.frame[data-ratio='3:2'] { --ratio: 3 / 2; }
.frame[data-ratio='9:16'] { --ratio: 9 / 16; }
.frame > img, .frame > video, .frame > .ph {
  position: absolute; inset: -8% 0; width: 100%; height: 116%; object-fit: cover;
  transform: translate3d(0, calc(var(--px, 0) * 1%), 0) scale(1.02);
  will-change: transform;
}
/* Clip the children, not the frame: IntersectionObserver ignores fully clipped targets. */
.reveal > * { clip-path: inset(100% 0 0 0); transition: clip-path 1.4s var(--ease-out); transition-delay: var(--d, 0ms); }
.reveal.is-in > * { clip-path: inset(0 0 0 0); }

.ph { display: block; background: linear-gradient(180deg, var(--ph-a, #4E4C4B), var(--ph-b, #45202A) 55%, var(--ph-c, #CDB9C6)); }
.ph::after {
  content: ''; position: absolute; inset: 0; opacity: calc(var(--grain-opacity) * 1.6); mix-blend-mode: overlay;
  background-image: var(--grain-svg); background-size: calc(var(--grain-size) * .8);
}

.frame__tag { position: absolute; left: 14px; bottom: 12px; z-index: 2; color: rgba(255,255,255,.85); mix-blend-mode: difference; }

.caption { display: flex; justify-content: space-between; gap: 24px; padding-top: 12px; }
.caption > :last-child { text-align: right; }

/* ==========================================================================
   Modules
   ========================================================================== */

/* 01 Hero ----------------------------------------------------------------- */
.m-hero { min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; padding-block: calc(var(--header-h) + 24px) clamp(56px, 7vw, 96px); overflow: hidden; }
.m-hero[data-align='center'] { justify-content: center; }
.m-hero__media { position: absolute; inset: 0; z-index: -1; }
.m-hero__media .frame { position: absolute; inset: 0; aspect-ratio: auto; height: 100%; }
.m-hero__kicker { grid-column: 1 / span 6; margin-bottom: clamp(20px, 3vw, 40px); }
.m-hero__title {
  grid-column: 1 / -1;
  font-family: var(--serif); font-weight: 300;
  font-size: var(--t-display); line-height: .88; letter-spacing: -.035em;
  transform: translate3d(0, calc(var(--hp, 0) * -18vh), 0);
}
.m-hero[data-size='l'] .m-hero__title { font-size: clamp(52px, 8.4vw, 150px); line-height: .92; }
.m-hero__title em { font-style: italic; }
.m-hero__title .line { display: block; }
.m-hero__title .line:nth-child(2) { padding-left: calc((100% + var(--gutter)) / 12 * 2); transform: translate3d(calc(var(--hp, 0) * 8vw), 0, 0); }
.m-hero__title .line:nth-child(3) { padding-left: calc((100% + var(--gutter)) / 12 * 4); transform: translate3d(calc(var(--hp, 0) * -6vw), 0, 0); }
.m-hero__foot { margin-top: clamp(40px, 6vw, 88px); row-gap: 24px; opacity: calc(1 - var(--hp, 0) * 2.2); }
.m-hero__intro { grid-column: 7 / span 5; font-size: var(--t-lead); line-height: 1.3; }
.m-hero__meta { grid-column: 1 / span 5; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px var(--gutter); align-content: end; }
.m-hero__meta dt { color: var(--muted); }
.m-hero__meta dd { margin: 2px 0 0; font-size: var(--t-small); font-weight: 400; }
@media (max-width: 760px) {
  .m-hero__title .line:nth-child(n) { padding-left: 0; }
  .m-hero__title .line:nth-child(2) { padding-left: 12vw; }
  .m-hero__intro { order: -1; }
}

/* 02 Chapter -------------------------------------------------------------- */
.m-chapter { min-height: 100svh; display: grid; align-content: space-between; padding-block: calc(var(--header-h) + 24px) clamp(56px, 7vw, 96px); overflow: hidden; }
.m-chapter[data-height='half'] { min-height: 64svh; }
.m-chapter__top { align-items: start; }
.m-chapter__label { grid-column: 1 / span 3; }
.m-chapter__aside { grid-column: 10 / -1; text-align: right; }
.m-chapter__num {
  position: absolute; right: calc(var(--margin) - .06em); top: 50%;
  font-family: var(--serif); font-weight: 100; font-size: var(--t-mega); line-height: .8; letter-spacing: -.05em;
  transform: translate3d(0, calc(-50% + var(--cp, 0) * -20vh), 0);
  opacity: .9; pointer-events: none; font-variant-numeric: lining-nums;
}
.m-chapter__title { grid-column: 1 / span 9; font-family: var(--serif); font-weight: 300; font-size: clamp(48px, 7.6vw, 140px); line-height: .92; letter-spacing: -.03em; }
.m-chapter__title sup { font-family: var(--sans); font-size: .22em; letter-spacing: 0; vertical-align: top; position: relative; top: .35em; margin-left: .2em; }
.m-chapter__sub { grid-column: 1 / span 5; margin-top: 28px; font-size: var(--t-lead); line-height: 1.3; }

/* 03 Text ----------------------------------------------------------------- */
.m-text__label { grid-column: 1 / span 3; padding-top: .6em; }
.m-text__body { grid-column: var(--start, 4) / span var(--span, 8); }
.m-text[data-style='statement'] .m-text__body { font-family: var(--serif); font-weight: 300; font-size: var(--t-statement); line-height: 1.04; letter-spacing: -.02em; }
.m-text[data-style='statement'] .m-text__body p { margin-bottom: .5em; }
.m-text[data-style='statement'] em { font-style: italic; }
.m-text[data-style='lead'] .m-text__body { font-size: var(--t-lead); line-height: 1.32; }
.m-text[data-style='body'] .m-text__body { max-width: 62ch; }
.m-text[data-style='body'] .m-text__body p { margin-bottom: 1.15em; }
.m-text[data-style='columns'] .m-text__body { columns: 2; column-gap: var(--gutter); }
.m-text[data-style='columns'] .m-text__body p { break-inside: avoid; }
.m-text[data-style='quote'] .m-text__body { font-family: var(--serif); font-weight: 300; font-style: italic; font-size: clamp(32px, 3.8vw, 68px); line-height: 1.08; letter-spacing: -.015em; text-indent: -.42em; }
.m-text__cite { display: block; margin-top: 32px; font-style: normal; }
.m-text a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
@media (max-width: 760px) { .m-text[data-style='columns'] .m-text__body { columns: 1; } .m-text__label { margin-bottom: 16px; } }

/* 04 Media ---------------------------------------------------------------- */
.m-media__fig { grid-column: var(--start, 1) / span var(--span, 12); }
.m-media[data-width='full'] .grid { padding-inline: 0; }
.m-media[data-width='full'] .caption { padding-inline: var(--margin); }

/* 05 Gallery -------------------------------------------------------------- */
.m-gallery__items { row-gap: clamp(32px, 4vw, 64px); align-items: end; }
.m-gallery[data-layout='stagger'] .m-gallery__item:nth-child(even) { margin-top: clamp(80px, 14vw, 240px); }
.m-gallery[data-layout='stagger'] .m-gallery__items { align-items: start; }
.m-gallery[data-layout='filmstrip'] .m-gallery__items { display: flex; gap: var(--gutter); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 16px; scrollbar-width: thin; }
.m-gallery[data-layout='filmstrip'] .m-gallery__item { flex: 0 0 auto; width: clamp(240px, 32vw, 520px); scroll-snap-align: start; }
.m-gallery[data-layout='filmstrip'] .m-gallery__item[data-ratio='9:16'] { width: clamp(180px, 20vw, 320px); }
.m-gallery[data-layout='filmstrip'] .m-gallery__item[data-ratio='16:9'] { width: clamp(300px, 48vw, 760px); }
@media (max-width: 760px) {
  .m-gallery__item.col { grid-column: auto / span 3; }
  .m-gallery__item.col:only-child, .m-gallery__item.col[data-ratio='16:9'] { grid-column: 1 / -1; }
  .m-gallery[data-layout='stagger'] .m-gallery__item:nth-child(even) { margin-top: 64px; }
}

/* 06 Split ---------------------------------------------------------------- */
.m-split .grid { align-items: stretch; }
.m-split__media { grid-column: 1 / span var(--media-span, 6); }
.m-split__copy { grid-column: calc(var(--media-span, 6) + 2) / -1; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; }
.m-split[data-side='right'] .m-split__media { grid-column: calc(13 - var(--media-span, 6)) / -1; order: 2; }
.m-split[data-side='right'] .m-split__copy { grid-column: 1 / calc(12 - var(--media-span, 6)); }
.m-split__title { font-family: var(--serif); font-weight: 300; font-size: var(--t-h3); line-height: 1.05; letter-spacing: -.01em; margin-top: 16px; }
.m-split__sub { margin-top: 10px; }
.m-split__body { display: grid; grid-template-columns: repeat(var(--body-cols, 1), minmax(0, 1fr)); gap: var(--gutter); font-size: var(--t-small); line-height: 1.55; max-width: 64ch; }
.m-split__body[data-cols='2'] { --body-cols: 2; }
@media (max-width: 760px) {
  .m-split__media, .m-split[data-side='right'] .m-split__media, .m-split__copy, .m-split[data-side='right'] .m-split__copy { grid-column: 1 / -1; }
  .m-split__media, .m-split[data-side='right'] .m-split__media { order: 0; margin-bottom: 32px; }
  .m-media__fig, .m-gallery__item { margin-top: 0 !important; }
  .m-split__body[data-cols='2'] { --body-cols: 1; }
}

/* 07 Highlights ----------------------------------------------------------- */
.m-highlights[data-style='stats'] .m-highlights__items { row-gap: 48px; }
.hl-stat { grid-column: auto / span 3; padding-top: 18px; position: relative; }
.hl-stat .rule { position: absolute; top: 0; left: 0; right: 0; }
.hl-stat__value { font-family: var(--serif); font-weight: 300; font-size: clamp(56px, 7vw, 128px); line-height: .9; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .m-highlights__items > .hl-stat:has([data-word]) { grid-column: 1 / -1; } }
.hl-stat__value[data-word] { font-size: clamp(40px, 4.6vw, 84px); letter-spacing: -.025em; }
/* Three highlights share the row in thirds rather than leaving a gap. */
@media (min-width: 761px) { .hl-stat:first-child:nth-last-child(3), .hl-stat:first-child:nth-last-child(3) ~ .hl-stat { grid-column: auto / span 4; } }
.hl-stat__label { margin-top: 18px; }
.hl-stat__body { margin-top: 8px; font-size: var(--t-small); color: var(--muted); max-width: 32ch; }

.m-highlights[data-style='cards'] .m-highlights__items { row-gap: clamp(48px, 6vw, 96px); }
.hl-card { display: block; grid-column: auto / span 4; }
.hl-card[data-size='l'] { grid-column: auto / span 8; }
.hl-card[data-size='m'] { grid-column: auto / span 6; }
.hl-card .frame { transition: transform 1s var(--ease-out); }
.hl-card .frame > .ph, .hl-card .frame > img { transition: filter 1s var(--ease-out); }
.hl-card:hover .frame > .ph, .hl-card:hover .frame > img { filter: saturate(1.25) brightness(1.04); }
.hl-card__meta { display: flex; justify-content: space-between; gap: 16px; padding-top: 14px; }
.hl-card__title { font-family: var(--serif); font-weight: 300; font-size: clamp(24px, 2vw + 6px, 38px); line-height: 1.05; letter-spacing: -.01em; margin-top: 8px; }
.hl-card__title .arrow { display: inline-block; transition: transform .6s var(--ease-out); font-family: var(--sans); font-size: .6em; vertical-align: .2em; margin-left: .3em; }
.hl-card:hover .hl-card__title .arrow { transform: translateX(8px); }
.hl-card__body { margin-top: 10px; font-size: var(--t-small); color: var(--muted); max-width: 44ch; }
.hl-card__num { font-family: var(--sans); }
@media (max-width: 760px) {
  .hl-stat { grid-column: auto / span 3; }
  .hl-card, .hl-card[data-size] { grid-column: 1 / -1; }
}

/* 08 Index ---------------------------------------------------------------- */
.ix { list-style: none; margin: 0; padding: 0; grid-column: 1 / -1; }
.ix__row { position: relative; }
.ix__link {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter);
  align-items: baseline; padding-block: clamp(16px, 1.8vw, 26px);
  transition: padding .6s var(--ease-out), color .4s;
}
.ix__row .rule { position: absolute; left: 0; right: 0; bottom: 0; }
.ix__row:first-child::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--rule); }
.ix__year { grid-column: 1 / span 1; font-variant-numeric: tabular-nums; }
.ix__title { grid-column: 2 / span 6; font-family: var(--serif); font-weight: 300; font-size: clamp(26px, 2.6vw + 4px, 52px); line-height: 1; letter-spacing: -.015em; }
.ix__client { grid-column: 8 / span 2; }
.ix__role { grid-column: 10 / span 2; }
.ix__go { grid-column: 12 / span 1; text-align: right; opacity: 0; transform: translateX(-12px); transition: opacity .4s, transform .6s var(--ease-out); }
.ix:hover a.ix__link { color: var(--muted); }
.ix:hover a.ix__link:hover { color: var(--fg); padding-left: 16px; }
.ix__link:hover .ix__go { opacity: 1; transform: none; }
@media (max-width: 760px) {
  .ix__link { grid-template-columns: 48px 1fr; row-gap: 6px; }
  .ix__year { grid-column: 1; }
  .ix__title { grid-column: 2; }
  .ix__client, .ix__role { grid-column: 2; }
  .ix__role { display: none; }
  .ix__go { display: none; }
}

.cursor-preview {
  position: fixed; left: 0; top: 0; z-index: 40; pointer-events: none;
  width: clamp(200px, 22vw, 360px); aspect-ratio: 4 / 5;
  opacity: 0; transform: translate3d(var(--cx, 0), var(--cy, 0), 0) translate(-50%, -50%) scale(.9);
  transition: opacity .4s var(--ease-out), scale .6s;
  overflow: hidden;
}
.cursor-preview.is-on { opacity: 1; }
.cursor-preview > * { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@media (hover: none) { .cursor-preview { display: none; } }

/* 09 Credits / People ----------------------------------------------------- */
.m-credits__people { row-gap: 40px; align-items: start; }
.person { grid-column: auto / span 2; }
.person .frame { margin-bottom: 10px; }
.person__row { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.person__name { font-size: var(--t-small); font-weight: 400; text-align: right; }
.person__handle { display: block; text-align: right; font-size: var(--t-label); color: var(--muted); }
.m-credits[data-style='list'] .m-credits__people { row-gap: 0; }
.m-credits[data-style='list'] .person { grid-column: auto / span 4; padding-block: 16px; border-top: 1px solid var(--rule); }
@media (max-width: 760px) {
  .person { grid-column: auto / span 3; }
  .m-credits[data-style='list'] .person { grid-column: 1 / -1; }
}

/* 10 Wordmark ------------------------------------------------------------- */
.m-wordmark { overflow: hidden; }
.m-wordmark[data-media] { min-height: 100svh; display: flex; flex-direction: column; justify-content: space-between; padding-block: calc(var(--header-h) + 8px) clamp(32px, 4vw, 56px); }
.m-wordmark[data-media][data-position='bottom'] { justify-content: flex-end; }
.m-wordmark[data-media][data-position='bottom'] .wm__cols { order: -1; margin: 0 0 auto; }
.m-wordmark__media { position: absolute; inset: 0; z-index: -1; }
.m-wordmark__media .frame { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; }
.wm {
  grid-column: 1 / -1; position: relative;
  font-family: var(--serif); font-weight: 300; font-size: var(--wm-size, 18vw);
  line-height: .78; letter-spacing: -.045em; white-space: nowrap;
  padding-top: .06em; /* room for the slices above the cap height */
}
.wm[data-font='sans'] { font-family: var(--sans); font-weight: 500; letter-spacing: -.06em; line-height: .74; }
.wm__word { display: inline-block; }
/* slice: stacked copies, each showing only a thin top band, fold down into the word */
.wm__slices { position: absolute; inset: .06em 0 0; pointer-events: none; }
.wm__slice {
  position: absolute; left: 0; top: 0; white-space: nowrap;
  clip-path: inset(0 0 calc(100% - .3em) 0); /* band reaches the x-height, so lowercase words slice too */
  transform: translate3d(0, calc(var(--k) * -.17em * (1 - var(--wp, 1))), 0);
  opacity: calc(1 - var(--wp, 1) * .999);
}
.wm__cols { margin-top: clamp(24px, 3vw, 48px); row-gap: 24px; }
.wm__col { grid-column: auto / span 3; }
.wm__text { margin-top: 6px; font-size: var(--t-small); line-height: 1.45; color: var(--muted); max-width: 30ch; }
@media (max-width: 760px) { .grid.wm__cols > .wm__col { grid-column: auto / span 3; } }

/* 11 Partners ------------------------------------------------------------- */
.pt__head { align-items: baseline; row-gap: 20px; margin-bottom: clamp(48px, 6vw, 96px); }
.pt__word { font-family: var(--serif); font-weight: 300; font-size: clamp(40px, 5.6vw, 108px); line-height: .9; letter-spacing: -.03em; white-space: nowrap; }
.pt__word--l { grid-column: 1 / span 5; transform: translate3d(calc((1 - var(--pp, 1)) * 22vw), 0, 0); }
.pt__word--r { grid-column: 8 / -1; text-align: right; transform: translate3d(calc((1 - var(--pp, 1)) * -22vw), 0, 0); }
.pt__join { grid-column: 6 / span 2; text-align: center; font-family: var(--sans); font-size: clamp(20px, 2vw, 32px); display: inline-block; transform: rotate(calc((1 - var(--pp, 1)) * 180deg)); }
.pt__intro { grid-column: 5 / span 4; text-align: center; margin-top: 12px; }
.pt__grid { row-gap: var(--gutter); }
.logo {
  grid-column: auto / span 3; aspect-ratio: 2 / 1; display: grid; place-items: center;
  background: color-mix(in srgb, var(--fg) 5%, transparent);
  transition: background .5s var(--ease-out);
}
.pt__grid[data-cols='3'] .logo { grid-column: auto / span 4; }
.pt__grid[data-cols='6'] .logo { grid-column: auto / span 2; }
a.logo:hover { background: color-mix(in srgb, var(--fg) 11%, transparent); }
.logo img { max-width: 58%; max-height: 42%; object-fit: contain; filter: grayscale(1); opacity: .85; }
.logo__name { font-family: var(--serif); font-weight: 300; font-size: clamp(18px, 1.7vw, 28px); letter-spacing: -.01em; color: var(--muted); }
@media (max-width: 760px) {
  .grid.pt__head > .pt__word--l { grid-column: 1 / span 4; }
  .grid.pt__head > .pt__join { grid-column: 5 / span 2; text-align: right; }
  .grid.pt__head > .pt__word--r { grid-column: 1 / -1; }
  .grid.pt__grid > .logo { grid-column: auto / span 3; }
}

/* 12 Panels --------------------------------------------------------------- */
.m-panels__items { row-gap: var(--gutter); }
.panel { position: relative; display: block; overflow: hidden; color: #F3F1EC; }
.panel .frame { aspect-ratio: auto; height: 78svh; }
.m-panels[data-height='screen'] .panel .frame { height: calc(100svh - var(--header-h) * 2); }
.panel .frame::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20, 14, 14, .32), transparent 34%); pointer-events: none; }
.panel .frame > * { transition: clip-path 1.4s var(--ease-out), scale 1.2s var(--ease-out), filter .8s var(--ease-out); }
.panel__title {
  position: absolute; left: 14px; right: 14px; top: 10px; z-index: 2;
  font-family: var(--serif); font-weight: 300; font-size: clamp(40px, 4.8vw, 92px); line-height: .9; letter-spacing: -.03em;
  transform: translate3d(calc(var(--pd, 0) * var(--dir, 1) * 3vw), 0, 0);
}
.panel__bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  display: flex; justify-content: space-between; padding: 10px 14px;
  background: var(--bg); color: var(--fg);
  transform: translateY(101%); transition: transform .7s var(--ease-out);
}
.panel.is-in .panel__bar, .reveal.is-in ~ .panel__bar { transform: none; }
.panel:hover .frame > * { scale: 1.04; }
.m-panels__items:hover .panel:not(:hover) .frame > * { filter: saturate(.55) brightness(.8); }
@media (max-width: 760px) { .panel .frame, .m-panels[data-height='screen'] .panel .frame { height: 64svh; } }

/* 13–14 Embeds (Spotify, Strava) ------------------------------------------ */
.emb { align-items: center; row-gap: 32px; }
.emb__copy { grid-column: 1 / span 5; }
.emb__frame { grid-column: 7 / -1; }
.emb[data-side='left'] .emb__frame { grid-column: 1 / span 6; }
.emb[data-side='left'] .emb__copy { grid-column: 8 / -1; order: 2; }
.emb[data-copy='0'] .emb__frame { grid-column: 3 / span 8; }
.emb__title { font-family: var(--serif); font-weight: 300; font-size: var(--t-h3); line-height: 1.05; letter-spacing: -.01em; margin-top: 16px; white-space: pre-line; }
.emb__body { margin-top: 20px; font-size: var(--t-small); line-height: 1.55; max-width: 44ch; color: var(--muted); }
.emb__iframe { display: block; width: 100%; border: 0; border-radius: 12px; }
.emb__ph {
  display: flex; flex-direction: column; justify-content: space-between; padding: 18px; border-radius: 12px;
  background: color-mix(in srgb, var(--fg) 7%, transparent); border: 1px dashed color-mix(in srgb, var(--fg) 25%, transparent);
}
.emb__ph-text { font-family: var(--serif); font-weight: 300; font-size: clamp(22px, 2vw, 32px); line-height: 1.1; max-width: 16ch; }
.m-strava .strava-embed-placeholder, .m-strava iframe { max-width: 100%; }

/* 15 Taste chart ------------------------------------------------------------- */
.tc { align-items: start; row-gap: 40px; }
.tc__side { grid-column: 1 / span 5; }
.tc__title { font-family: var(--serif); font-weight: 300; font-size: var(--t-h3); line-height: 1.02; letter-spacing: -.015em; margin-top: 16px; }
.tc__intro { margin-top: 18px; font-size: var(--t-small); color: var(--muted); max-width: 44ch; }
.tc__list { list-style: none; margin: clamp(28px, 3vw, 48px) 0 0; padding: 0; counter-reset: tc; }
.tc__row {
  display: grid; grid-template-columns: 34px 1fr auto; column-gap: 12px; align-items: baseline;
  padding: 12px 0; border-top: 1px solid var(--rule); cursor: pointer; transition: padding .5s var(--ease-out), color .3s;
}
.tc__row:last-child { border-bottom: 1px solid var(--rule); }
.tc__name { font-family: var(--serif); font-weight: 300; font-size: clamp(20px, 1.5vw + 6px, 28px); line-height: 1.1; }
.tc__note { grid-column: 2 / -1; margin-top: 4px; font-size: var(--t-small); color: var(--muted); }
.tc__list:hover .tc__row:not(.is-active) { color: var(--muted); }
.tc__row.is-active { padding-left: 10px; }
.tc__map { grid-column: 7 / -1; position: sticky; top: calc(var(--header-h) + 12px); }
.tc__mount { position: relative; aspect-ratio: 4 / 5; max-height: calc(100svh - var(--header-h) - 60px); width: 100%; overflow: hidden; background: color-mix(in srgb, var(--fg) 6%, transparent); }
.tc__gl { position: absolute; inset: 0; }
.tc__credit { margin-top: 10px; color: var(--muted); }
.tc__fallback {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(color-mix(in srgb, var(--fg) 9%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--fg) 9%, transparent) 1px, transparent 1px);
  background-size: 48px 48px; background-position: center;
}
.tc__fallback .tc__marker { position: absolute; transform: translate(-50%, -50%); }
.tc__marker { border: 0; padding: 0; background: none; cursor: pointer; }
.tc__pin {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--fg); color: var(--bg); font: 400 10px/1 var(--sans); letter-spacing: .02em;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--bg) 70%, transparent);
  opacity: 0; transform: translateY(-18px) scale(.5);
  transition: opacity .5s var(--ease-out), transform .8s var(--ease-out), background .3s;
  transition-delay: calc(var(--i, 0) * 80ms + 200ms), calc(var(--i, 0) * 80ms + 200ms), 0s;
}
.tc__map.is-in .tc__pin { opacity: 1; transform: none; }
.tc__marker.is-active .tc__pin { background: var(--saffron); color: var(--ink); transform: scale(1.25); transition-delay: 0s; }
.tc__map .mapboxgl-ctrl-attrib { font-family: var(--sans); font-size: 10px; }
@media (max-width: 760px) {
  .grid.tc > .tc__map { grid-column: 1 / -1; order: -1; position: relative; top: 0; }
  .tc__mount { aspect-ratio: 4 / 5; }
}

/* 16–17 Shelves (Books, Films) ------------------------------------------- */
.shelf__grid { row-gap: clamp(40px, 5vw, 72px); align-items: start; }
.shelf__item { display: flex; flex-direction: column; grid-column: auto / span 2; transform: translate3d(0, calc(var(--sp, 0) * var(--dir, 1) * 18px), 0); }
.shelf__row { display: flex; gap: var(--gutter); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 16px; scrollbar-width: thin; }
.shelf__row .shelf__item { flex: 0 0 clamp(150px, 15vw, 240px); scroll-snap-align: start; }
.shelf__item .frame { transition: transform .8s var(--ease-out), box-shadow .8s var(--ease-out); }
a.shelf__item:hover .frame { transform: translateY(-6px) rotate(calc(var(--dir, 1) * -1deg)); }
.shelf__meta { display: flex; justify-content: space-between; padding-top: 12px; }
.shelf__title { margin-top: 6px; font-family: var(--serif); font-weight: 300; font-size: clamp(17px, 1vw + 8px, 22px); line-height: 1.15; }
.shelf__by { margin-top: 6px; }
.shelf__note { margin-top: 8px; font-size: var(--t-small); color: var(--muted); }
.shelf__credit { grid-column: 1 / -1; margin-top: 40px; font-size: 10px; }
/* Book covers sit on a plinth: contained, padded, with a soft shadow. Posters fill the frame. */
.m-books .shelf__item .frame > img { object-fit: contain; padding: 11% 15%; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .22)); }
.shelf__blank-text { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; justify-content: space-between; padding: 14px; color: #F3F1EC; }
.shelf__blank-title { font-family: var(--serif); font-weight: 300; font-size: clamp(18px, 1.4vw + 4px, 26px); line-height: 1.05; }
@media (max-width: 760px) {
  .grid.shelf__grid > .shelf__item { grid-column: auto / span 3; }
  .shelf__item { transform: none; }
}

/* 18 Overlay --------------------------------------------------------------- */
.m-overlay { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.ov { align-items: center; }
.ov > * { grid-row: 1; }
.ov__text {
  grid-column: 1 / -1; z-index: 1; margin: 0;
  font-family: var(--serif); font-weight: 300; font-size: clamp(56px, 12vw, 250px); line-height: .96; letter-spacing: -.02em;
}
.ov__text.is-upper { text-transform: uppercase; letter-spacing: .005em; font-size: clamp(48px, 11vw, 230px); }
.ov__line { display: block; white-space: nowrap; transform: translate3d(calc(var(--op, 0) * var(--dir, 1) * 7vw), 0, 0); }
.ov__media { z-index: 2; transform: translate3d(0, calc(var(--op, 0) * -14vh), 0); }
.ov__media .frame { box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .35); }
.ov__rule { grid-column: 2 / span 1; display: block; width: 1px; height: clamp(60px, 10vw, 140px); margin-top: clamp(32px, 4vw, 64px); background: var(--fg); transform-origin: top; transform: scaleY(0); }
.ov__rule.is-in { transform: scaleY(1); }
@media (max-width: 760px) {
  .ov__line { white-space: normal; }
  .grid.ov > .ov__media { grid-column: 2 / span 4; }
}

/* 19 Immersive --------------------------------------------------------------- */
.m-immersive { padding: 0; }
.m-immersive[data-height='tall'] { height: 180svh; }
.m-immersive[data-height='screen'] { height: 100svh; }
.im__stage { position: sticky; top: 0; height: 100svh; overflow: hidden; display: grid; place-items: center; }
/* Soft top/bottom edges let the page gradient flow into and out of the image. */
.im__bg { position: absolute; inset: 0; -webkit-mask-image: linear-gradient(transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(transparent, #000 10%, #000 90%, transparent); }
.im__bg .frame { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; }
.im__bg .frame > * { --rest: 6px; filter: blur(calc(var(--rest) + (1 - var(--ip, 1)) * 18px)) saturate(1.1); transform: scale(calc(1.06 + (1 - var(--ip, 1)) * .14)); }
.m-immersive[data-blur='none'] .im__bg .frame > * { --rest: 0px; }
.m-immersive[data-blur='heavy'] .im__bg .frame > * { --rest: 18px; }
.im__bg::after {
  content: ''; position: absolute; inset: 0; opacity: .35; mix-blend-mode: overlay; pointer-events: none;
  background-image: var(--grain-svg); background-size: var(--grain-size, 220px);
}
.im__box {
  position: relative; z-index: 1; width: clamp(240px, 30vw, 440px); aspect-ratio: 1; padding: clamp(18px, 2.2vw, 32px);
  display: flex; flex-direction: column; justify-content: space-between; text-align: center;
  background: var(--box-bg); color: var(--box-fg);
  translate: 0 calc((1 - var(--ip, 1)) * 80px);
}
.im__big { margin: 0; font-family: var(--sans); font-weight: 500; font-size: clamp(18px, 2vw, 32px); line-height: 1.02; letter-spacing: -.01em; text-transform: uppercase; }
.im__big .line { display: block; }
.im__mid { margin: 0; font-size: var(--t-small); font-weight: 400; letter-spacing: .02em; }

/* 20 Reveal -------------------------------------------------------------------- */
.m-reveal { min-height: 100svh; padding: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: center; --lens-w: .3; }
.m-reveal[data-lens='s'] { --lens-w: .22; }
.m-reveal[data-lens='l'] { --lens-w: .4; }
.rv__layer { position: absolute; inset: 0; }
.rv__layer .frame { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; }
.rv__soft { -webkit-mask-image: linear-gradient(transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(transparent, #000 8%, #000 92%, transparent); }
.rv__soft .frame > * { filter: blur(26px) saturate(.75) brightness(1.06); transform: scale(1.12); }
.rv__sharp { clip-path: inset(50% 50% 50% 50%); will-change: clip-path; }
.rv__sharp .frame > * { transform: scale(1.12); }
.rv__soft::after, .rv__sharp::after {
  content: ''; position: absolute; inset: 0; opacity: .3; mix-blend-mode: overlay; pointer-events: none;
  background-image: var(--grain-svg); background-size: var(--grain-size, 220px);
}
.rv__copy { position: relative; z-index: 2; pointer-events: none; color: #F3F1EC; align-items: center; }
.rv__copy .label { font-size: clamp(12px, 1.1vw, 16px); letter-spacing: .06em; text-shadow: 0 1px 12px rgba(0, 0, 0, .25); }
.rv__left { grid-column: 2 / span 4; }
.rv__right { grid-column: 8 / span 4; }
.rv__caption {
  position: absolute; left: 0; right: 0; bottom: clamp(48px, 7vw, 96px); z-index: 2; margin: 0; text-align: center; pointer-events: none;
  font-family: var(--serif); font-weight: 300; font-size: clamp(18px, 1.6vw, 28px); letter-spacing: .28em; text-transform: uppercase; color: #F3F1EC;
}
.m-reveal { cursor: crosshair; }
@media (max-width: 760px) {
  .m-reveal { --lens-w: .62; }
  .grid.rv__copy > .rv__left { grid-column: 1 / span 3; }
  .grid.rv__copy > .rv__right { grid-column: 4 / span 3; text-align: right; }
}

/* ==========================================================================
   Templates
   ========================================================================== */

/* Case-study cover ------------------------------------------------------- */
.cs-cover { padding-top: calc(var(--header-h) + clamp(48px, 8vw, 140px)); padding-bottom: clamp(48px, 6vw, 96px); }
.cs-cover__head { align-items: end; row-gap: 32px; }
.cs-cover__eyebrow { grid-column: 1 / span 3; align-self: start; }
.cs-cover__title { grid-column: 4 / -1; font-family: var(--serif); font-weight: 300; font-size: clamp(52px, 8.8vw, 168px); line-height: .9; letter-spacing: -.035em; }
.cs-cover__title sup { font-family: var(--sans); font-size: .16em; letter-spacing: 0; vertical-align: top; position: relative; top: .4em; margin-left: .3em; }
.cs-cover__body { margin-top: clamp(48px, 6vw, 96px); row-gap: 32px; }
.cs-cover__meta { grid-column: 1 / span 6; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px var(--gutter); align-content: start; }
.cs-cover__meta dt { color: var(--muted); }
.cs-cover__meta dd { margin: 4px 0 0; font-size: var(--t-small); font-weight: 400; }
.cs-cover__summary { grid-column: 7 / span 6; font-size: var(--t-lead); line-height: 1.32; }
.cs-cover .rule { grid-column: 1 / -1; margin-top: clamp(48px, 6vw, 96px); }
@media (max-width: 760px) {
  .cs-cover__title { grid-column: 1 / -1; }
  .cs-cover__meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Next project ----------------------------------------------------------- */
.next { display: block; padding-block: var(--space-l) var(--space-m); }
.next__label { grid-column: 1 / span 3; }
.next__title { grid-column: 1 / -1; margin-top: 24px; font-family: var(--serif); font-weight: 300; font-size: var(--t-display); line-height: .88; letter-spacing: -.035em; transition: letter-spacing 1s var(--ease-out); }
.next:hover .next__title { letter-spacing: -.015em; }

/* Essay ------------------------------------------------------------------ */
.essay-head { padding-top: calc(var(--header-h) + clamp(64px, 10vw, 180px)); padding-bottom: clamp(48px, 6vw, 96px); }
.essay-head__meta { grid-column: 1 / span 3; display: flex; flex-direction: column; gap: 6px; padding-top: 1em; }
.essay-head__title { grid-column: 4 / span 8; font-family: var(--serif); font-weight: 300; font-size: clamp(44px, 6.4vw, 120px); line-height: .94; letter-spacing: -.03em; }
.essay-head__dek { grid-column: 4 / span 6; margin-top: 32px; font-size: var(--t-lead); line-height: 1.32; color: var(--muted); }
.t-essay .m-text[data-style='body'] .m-text__body { font-size: clamp(17px, .6vw + 12px, 21px); line-height: 1.6; }
.t-essay .m-text[data-style='body'] .m-text__body p:first-child::first-letter {
  font-family: var(--serif); font-weight: 300; float: left; font-size: 4.6em; line-height: .8; padding: .06em .08em 0 0;
}
.t-essay .m-text[data-style='body'] + .m-text[data-style='body'] .m-text__body p:first-child::first-letter { all: unset; }

/* Footer ----------------------------------------------------------------- */
.site-foot { padding-top: var(--space-l); padding-bottom: 72px; }
.site-foot__cta { grid-column: 1 / -1; font-family: var(--serif); font-weight: 300; font-size: var(--t-display); line-height: .86; letter-spacing: -.04em; }
.site-foot__cta a { display: inline-block; transition: font-style .3s; }
.site-foot__cta a:hover { font-style: italic; }
.site-foot__cols { margin-top: clamp(64px, 8vw, 140px); row-gap: 32px; }
.site-foot__col { grid-column: auto / span 3; display: flex; flex-direction: column; gap: 6px; font-size: var(--t-small); }
.site-foot__col .label { margin-bottom: 8px; }
.site-foot__col a:hover { text-decoration: underline; text-underline-offset: .2em; }
@media (max-width: 760px) { .site-foot__col { grid-column: auto / span 3; } }

/* Loading + 404 ---------------------------------------------------------- */
.state { min-height: 100svh; display: grid; place-items: center; text-align: center; padding: var(--margin); }
.state h1 { font-family: var(--serif); font-weight: 300; font-size: var(--t-display); line-height: .9; letter-spacing: -.035em; }
/* The 404 page carries a game, so its headline steps down a size and clears the header. */
.state:has(.frog) { padding: calc(var(--header-h) + var(--margin)) var(--margin) var(--space-s); }
.state:has(.frog) h1 { font-size: clamp(44px, 7.2vw, 128px); }
.state__somewhere { text-decoration: underline; text-decoration-thickness: .03em; text-underline-offset: .1em; transition: opacity .3s; }
.state__somewhere:hover { opacity: .6; }
.state__sub { margin: 24px auto 0; max-width: 34ch; font-size: var(--t-body); }
/* 404 Frogger */
.frog { width: min(720px, 100%); margin: 40px auto 0; }
.frog__stage { position: relative; width: fit-content; margin: 0 auto; touch-action: none; cursor: pointer; }
.frog__board { display: block; border-radius: 6px; outline: 1px solid var(--rule); outline-offset: 0; }
.frog__splat { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 38%; border-radius: 6px; opacity: 0; transform: scale(1.04); transition: opacity .25s, transform .6s var(--ease-out); pointer-events: none; }
.frog__splat.is-on { opacity: 1; transform: none; }
.frog__note { position: absolute; left: 50%; bottom: 50%; transform: translate(-50%, 50%); padding: 7px 12px; border-radius: 999px; background: var(--fg); color: var(--bg); white-space: nowrap; pointer-events: none; }
.frog__splat.is-on ~ .frog__note { bottom: 16px; transform: translateX(-50%); }
.frog__board:focus-visible { outline: 1px solid var(--fg); }
.frog__bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; width: fit-content; min-width: min(100%, 320px); margin: 12px auto 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.frog__full { padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.frog__full:hover { color: var(--fg); }
/* Full screen (native, or the fallback overlay where the browser has no fullscreen API) */
.frog.is-full { position: fixed; inset: 0; z-index: 1000; width: auto; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; background: var(--bg); }
.frog.is-full .frog__bar { width: auto; min-width: 0; }
.frog-full { overflow: hidden; }

/* Mobile: everything on the grid stacks to full width, except the few
   modules that deliberately pair items two-up. ----------------------------- */
@media (max-width: 760px) {
  .grid > :not(.keep) { grid-column: 1 / -1; }
  .m-gallery__items > .m-gallery__item:not([data-ratio='16:9']),
  .m-highlights__items > .hl-stat,
  .m-credits__people > .person { grid-column: auto / span 3; }
  .m-credits[data-style='list'] .m-credits__people > .person { grid-column: 1 / -1; }
  .cs-cover__summary { order: -1; }
  .m-chapter__num { font-size: 52vw; opacity: .5; }
}

/* Reduced motion ---------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; transition-delay: 0ms !important; animation: none !important; }
  .split .w > span, .fade, .reveal > * { opacity: 1 !important; clip-path: none !important; }
  .split .w > span, .fade { transform: none !important; }
  .scrub .sw { opacity: 1 !important; }
  .frame > img, .frame > video, .frame > .ph { transform: none !important; }
}

/* Admin live preview: edits re-render instantly instead of replaying entrance animations. */
.is-instant .split .w > span, .is-instant .fade, .is-instant .reveal > *, .is-instant .rule, .is-instant mark { transition: none !important; }
