/* ==========================================================================
   JESSICA XIE — Portfolio, Edition 2026
   An independent publication about one designer's work.

   Contents
   01  Tokens (colour, type, space, motion) + light/dark
   02  Base & typography roles
   03  Grid
   04  Masthead & navigation (the hand-drawn oval)
   05  Shared editorial parts (labels, receipts, CLICK links, script)
   06  Cover (home)
   07  Selected work: features a–f
   08  Note, Also-in-this-edition, closing page, colophon
   09  Index of work
   10  Project feature template + image blocks
   11  About, contact, erratum
   12  Motion, preview cursor, print
   ========================================================================== */

/* 01 — TOKENS ------------------------------------------------------------- */
:root {
  /* Brand palette (from the brand sheet) */
  --c-paper: #F5F4F0;
  --c-paper-2: #F5F2E3;
  --c-cream: #FDFBE2;
  --c-grey: #D9D9D9;
  --c-white: #FFFFFF;
  --c-ink: #0B0B0A;
  --c-pink: #F973B8;          /* the brand pink: dots, drawing trail, soft accents */
  --c-pink-ink: #C2307E;      /* the same pink, deep enough for text and links (4.75:1 on paper) */

  /* Semantic roles — light */
  --bg: var(--c-paper);
  --fg: var(--c-ink);
  --muted: #5F5D57;           /* 6.1:1 on paper */
  --line: #CBC9C1;
  --line-strong: var(--c-ink);
  --panel: var(--c-paper-2);
  --hi: var(--c-cream);
  --ink-accent: var(--c-pink-ink); /* script words, active dots, focus ring */
  --link: var(--c-pink-ink);  /* links: readable pink */
  --grain-opacity: .035;

  /* Type families: max three */
  --display: Jost, "Futura", "Century Gothic", "Helvetica Neue", Arial, sans-serif;
  --sans: Jost, "Futura", "Century Gothic", "Helvetica Neue", Arial, sans-serif;
  --script: "Ballet", "Snell Roundhand", cursive;

  /* Type — three sizes, nothing smaller than 14px:
       text 14px (labels and running text) · menu 16px (mobile menu tab and items) · titles 20px
     Only the title grows with the screen; the hero name is the logo and sits outside this system. */
  --t-xs: .875rem;                                          /* small 14px: labels, captions, metadata, nav, menu tab */
  --t-menu: 1rem;                                           /* menu 16px: mobile menu tab and items */
  --t-body: .875rem;                                        /* text 14px: all running text, intros, links */
  --t-h3: 1.25rem;                                          /* medium 20px: intros, subtitles, list titles, menu */
  --t-script: 2.1875rem;                                    /* Ballet words 35px (not the hero name / intro) */
  --t-h1: 1.25rem;                                          /* title 20px: every heading (h1, h2) */
  --t-name: clamp(3.330rem, 15vw, 14.107rem);               /* the hero name only */
  /* every older name points at one of these four */
  --t-h2: var(--t-h1); --t-lead: var(--t-h3); --t-display: var(--t-h1); --t-mega: var(--t-h1);
  --fs-label: var(--t-xs); --fs-small: var(--t-xs); --fs-body: var(--t-body); --fs-lead: var(--t-h3);
  --fs-h3: var(--t-h3); --fs-h2: var(--t-h1); --fs-h1: var(--t-h1);
  --fs-display: var(--t-h1); --fs-mega: var(--t-h1); --fs-nameplate: var(--t-name);

  /* Grid & space */
  --cols: 4;
  --gap: clamp(12px, 1.6vw, 24px);
  --m: clamp(16px, 4vw, 60px);
  --s-1: .5rem; --s-2: 1rem; --s-3: 1.5rem; --s-4: 2.5rem;
  --s-5: clamp(3rem, 6vw, 6rem);
  --s-6: clamp(4.5rem, 10vw, 10rem);
  --head-h: 3.75rem;

  /* Motion */
  --ease: cubic-bezier(.2, .7, .1, 1);
  --t-fast: .25s;
  --t-slow: .9s;

  color-scheme: light;
}

/* Light (#F5F4F0) is the default for everyone. Dark only appears when the
   reader explicitly presses the toggle. */
:root[data-theme="dark"] {
  --bg: #121211; --fg: #F2F0EA; --muted: #A9A69F; --line: #34332F; --line-strong: #F2F0EA;
  --panel: #1B1B19; --hi: #2A2818; --ink-accent: #1EBDB5; --link: #1EBDB5; --grain-opacity: .035;
  color-scheme: dark;
}
@media (min-width: 40rem) { :root { --cols: 8; } }
@media (min-width: 64rem) { :root { --cols: 12; --head-h: 4rem; } }

/* 02 — BASE ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--head-h) + 1rem); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-feature-settings: "ss01" 0, "cv11" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, video, svg { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
h1, h2, h3, h4, p, ol, ul, dl, dd, blockquote { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
em, i { font-style: italic; }
sup { font-size: .55em; vertical-align: super; line-height: 0; }
::selection { background: var(--c-cream); color: var(--c-ink); }
:focus-visible { outline: 2px solid var(--ink-accent); outline-offset: 3px; border-radius: 2px; }
[hidden] { display: none !important; }

.skip {
  position: absolute; left: var(--m); top: -4rem; z-index: 100;
  background: var(--fg); color: var(--bg); padding: .6rem 1rem;
  font: 500 var(--fs-label)/1 var(--sans); letter-spacing: .09em; text-transform: uppercase;
}
.skip:focus { top: .5rem; }

/* Typography roles */
.label {
  font-family: var(--sans);
  font-size: var(--fs-label);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.lead {
  font-family: var(--display);
  font-size: var(--t-body);
  line-height: 1.6;
  letter-spacing: -.012em;
  font-weight: 400;
}
.script {
  font-family: var(--script);
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-accent);
}
.caps {
  font-family: var(--sans);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: -.02em;
}

/* 03 — GRID ---------------------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  column-gap: var(--gap);
  padding-inline: var(--m);
}
.grid > * { grid-column: 1 / -1; min-width: 0; }

/* 04 — MASTHEAD ------------------------------------------------------------ */
.masthead {
  position: sticky; top: 0; z-index: 50;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  column-gap: var(--gap);
  align-items: center;
  height: var(--head-h);
  padding-inline: var(--m);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.oval {
  position: absolute; pointer-events: none; overflow: visible;
  fill: none; stroke: currentColor; stroke-width: 1.1; stroke-linecap: round;
}
.oval path { vector-effect: non-scaling-stroke; }

.masthead > * { grid-row: 1; }
.logo {
  grid-column: 1 / span 2;
  justify-self: start;
  position: relative; display: inline-flex; align-items: center;
  padding: .5em 1.05em;
  font: 500 var(--t-xs)/1 var(--sans); letter-spacing: .07em; text-transform: uppercase;
  white-space: nowrap; z-index: 2;
}
.logo .oval { inset: -1px -3px; width: calc(100% + 6px); height: calc(100% + 2px); }
.logo:hover .oval path { stroke: var(--ink-accent); }


.theme-toggle {
  grid-column: 3 / -1; justify-self: end; z-index: 2;
  display: inline-flex; gap: .25em; color: var(--muted); padding: .6rem 0;
  white-space: nowrap;
}
.theme-toggle { font: 400 var(--t-xs)/1 var(--sans) !important; letter-spacing: .01em !important; text-transform: none !important; }
.theme-toggle .tt-l { color: var(--fg); }
:root[data-theme="dark"] .theme-toggle .tt-l { color: var(--muted); }
:root[data-theme="dark"] .theme-toggle .tt-d { color: var(--fg); }

/* Mobile navigation: a cream tab ("bladje") on the left edge that slides out */
.nav {
  position: fixed; right: 0; top: 34vh; z-index: 3;
  display: flex; flex-direction: row-reverse; align-items: center;
  transform: translateX(var(--panel-w));
  transition: transform .45s var(--ease);
  --panel-w: 10rem;
}
.menu-open .nav { transform: none; }
.nav-panel {
  width: var(--panel-w); min-height: 13rem;
  display: flex; align-items: center;
  padding: 1.75rem 1.5rem 1.75rem 1.9rem;
  background: var(--c-cream); color: var(--c-ink); border-radius: 22px 0 0 22px;
}
.nav ol { display: grid; gap: .35rem; }
.nav li a { display: block; font: 400 var(--t-menu)/1.3 var(--sans); letter-spacing: .01em; text-transform: uppercase; }
.nav-t { position: relative; display: inline-block; }
.nav-t .oval { inset: -.3em -.55em; width: calc(100% + 1.1em); height: calc(100% + .6em); stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .7s var(--ease); }
.nav li a[aria-current="page"] .oval { stroke-dashoffset: 0; }
.nav li a:hover .oval { stroke-dashoffset: 0; color: var(--ink-accent); }
.menu-tab {
  align-self: center; margin-right: -1px;
  background: var(--c-cream); color: var(--c-ink); border-radius: 16px 0 0 16px;
  padding: 1.1rem .7rem; font-size: var(--t-xs); letter-spacing: .12em;
}
.menu-tab span { display: block; writing-mode: vertical-rl; }
.no-js .nav { transform: none; }

@media (min-width: 40rem) {
  .logo { grid-column: 1 / span 3; }
  .theme-toggle { grid-column: 6 / -1; }
}

@media (min-width: 64rem) {
  :root { --head-h: 2.75rem; }
  .masthead { display: flex; justify-content: space-between; align-items: center; gap: 2rem; }
  .nav { position: static; transform: none; transition: none; display: block; flex: 1; }
  .nav-panel { width: auto; min-height: 0; padding: 0; background: none; color: inherit; border-radius: 0; display: block; }
  .menu-tab { display: none; }
  .nav ol { display: flex; justify-content: space-around; }
  .nav li a { display: inline-block; font: 400 var(--t-xs)/1 var(--sans); letter-spacing: .01em; text-transform: none; padding: .4rem 0; }
  .nav-t .oval { inset: -.55em -.9em; width: calc(100% + 1.8em); height: calc(100% + 1.1em); }
  .theme-toggle { font: 400 var(--t-xs)/1 var(--sans); letter-spacing: .01em; text-transform: none; }
}

/* 05 — SHARED EDITORIAL PARTS ---------------------------------------------- */
/* The receipt: metadata set like a till slip, with dotted leaders */
.receipt { font-size: var(--fs-small); line-height: 1.35; font-variant-numeric: tabular-nums; }
.receipt div {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1.25rem;
  padding: .52rem 0; border-bottom: 1px dotted var(--line-strong);
}
.receipt div:first-child { border-top: 1px solid var(--line-strong); }
.receipt dt { font: 500 var(--fs-label)/1.3 var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); flex: none; }
.receipt dd { text-align: right; }
.receipt a { text-decoration: underline; text-underline-offset: .15em; }

/* CLICK links — pink, underlined; a nod to the early web */
.click {
  font-family: var(--display);
  font-size: var(--t-body);
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .16em;
  transition: text-decoration-thickness var(--t-fast), background-color var(--t-fast);
}
.click:hover { font-style: italic; }

.also-title { font-size: var(--t-h1) !important; }
.section-title, .also-title, .cs-title {
  display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .12em;
  font-size: var(--t-display); line-height: .9; font-weight: 400;
}
.section-title .script, .also-title .script, .cs-title .script {
  font-size: 1em; line-height: .6; margin-right: -.08em; position: relative; z-index: 1;
  transform: translateY(.06em) rotate(-4deg); transform-origin: left bottom; display: inline-block;
}
.section-title .caps, .also-title .caps, .cs-title .caps { font-size: var(--t-h3); letter-spacing: -.03em; }

/* 06 — HERO --------------------------------------------------------------- */
.cover { position: relative; isolation: isolate; }
.cover-bg { position: absolute; inset: 0; z-index: -1; background-size: cover; background-position: center 38%; }
.cover-bg::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(245,244,240,.1) 0%, rgba(245,244,240,.22) 62%, var(--bg) 100%); }
:root[data-theme="dark"] .cover-bg::after { background: linear-gradient(180deg, rgba(18,18,17,.55) 0%, rgba(18,18,17,.7) 65%, var(--bg) 100%); }

.hero4 {
  min-height: calc(100svh - var(--head-h));
  display: grid; grid-template-rows: auto 1fr auto;
  padding: clamp(1rem, 2vw, 1.75rem) var(--m) clamp(2.5rem, 6vw, 5rem);
}
.h4-top { display: flex; justify-content: space-between; gap: .5rem 1.5rem; flex-wrap: wrap; letter-spacing: .12em; }
.h4-top span:nth-child(2) { display: none; }
.h4-center { align-self: center; justify-self: center; position: relative; text-align: center; padding-block: 2rem; }
.h4-name {
  margin: 0; font-family: var(--script); font-weight: 400; font-style: normal;
  font-size: var(--t-name); line-height: 1.05; letter-spacing: 0; white-space: nowrap;
}

.h4-script {
  margin-top: clamp(.5rem, 1.5vw, 1.5rem);
  font: 400 var(--t-lead)/1 var(--sans); letter-spacing: .45em; text-transform: uppercase;
  padding-left: .45em;
}
/* Hero intro: the name "writes" itself left to right, then PORTFOLIO settles in. Once, on load. */
@media (prefers-reduced-motion: no-preference) {
  .js .h4-name {
    padding: .2em .4em; margin: -.2em -.4em;   /* room for the script's swashes inside the mask */
    -webkit-mask-image: linear-gradient(90deg, #000 0 44%, transparent 56% 100%);
            mask-image: linear-gradient(90deg, #000 0 44%, transparent 56% 100%);
    -webkit-mask-size: 240% 100%; mask-size: 240% 100%;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-position: 100% 0; mask-position: 100% 0;
    animation: jx-write 2.1s cubic-bezier(.5, .1, .25, 1) .25s forwards;
  }
  .js .h4-script { opacity: 0; letter-spacing: .9em; animation: jx-settle 1.1s cubic-bezier(.2, .7, .2, 1) 1.9s forwards; }
}
@keyframes jx-write { to { -webkit-mask-position: 0 0; mask-position: 0 0; } }
@keyframes jx-settle { to { opacity: 1; letter-spacing: .45em; } }
.h4-bottom { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 1.5rem 2rem; }
.h4-deck { grid-column: 1 / -1; max-width: 34ch; font-size: var(--fs-small); line-height: 1.5; }
.h4-statement { text-align: right; line-height: 1.5; letter-spacing: .12em; }
.h4-scroll { display: none; justify-self: start; letter-spacing: .12em; border-bottom: 1px solid currentColor; padding-bottom: .2rem; }
.h4-scroll span { display: inline-block; transition: transform var(--t-fast) var(--ease); }
.h4-scroll:hover span { transform: translateY(.2rem); }
@media (min-width: 40rem) {
  .h4-top span:nth-child(2) { display: inline; }
}
@media (min-width: 64rem) {
  .h4-bottom { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); }
  .h4-deck { grid-column: 1 / 5; }
  .h4-scroll { display: block; grid-column: 6 / 8; justify-self: center; }
  .h4-statement { grid-column: 10 / 13; justify-self: end; }
}


/* Selected work — a numbered modular grid (glossary-page reference) */
.sw-grid {
  --cell: calc((100vw - 2 * var(--m)) / 6 * .72);
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: var(--cell);
  padding-inline: var(--m); margin-top: var(--s-3);
}
.cell-n { pointer-events: none; padding-top: .45rem; }
.cell-n::before { content: ""; display: block; width: 3px; height: 3px; border-radius: 50%; background: var(--muted); opacity: .7; }
.sw-img { grid-column: var(--c) / span var(--cs); grid-row: var(--r) / span var(--rs); padding-top: 1.35rem; z-index: 1; display: block; }
.sw-img { align-self: start; }
.sw-img span { display: block; overflow: hidden; }
.sw-img img { width: 100%; height: auto; transition: transform 1.1s var(--ease); }
.sw-img:hover img { transform: scale(1.03); }
.sw-text { grid-column: var(--c); grid-row: var(--r); align-self: start; margin-top: 1.35rem; padding: 0 1rem .6rem 0; background: var(--bg); z-index: 1; font-size: var(--t-xs); line-height: 1.35; }
.sw-text h3 { font: 500 var(--t-xs)/1.3 var(--sans); letter-spacing: .05em; text-transform: uppercase; }
.sw-text h3 a:hover, .sw-text h3 a:focus-visible { text-decoration: underline; text-underline-offset: .2em; }
.sw-text p { margin-top: .45rem; max-width: 24ch; }
.sw-meta { color: var(--muted); }
.sw-more { display: inline-block; margin-top: .6rem; font-size: var(--t-xs); border-bottom: 1px solid currentColor; }
.cell-m { display: none; }
@media (max-width: 39.99rem) {
  .sw-grid { --cell: calc((100vw - 2 * var(--m)) / 4 * .85); grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cell-d { display: none; }
  .cell-m { display: block; }
  .sw-img { grid-column: var(--mc) / span 3; grid-row: var(--mr) / span var(--mrs); }
  .sw-text { grid-column: var(--mc) / span 3; grid-row: var(--mr) / span 2; padding-right: 0; }
}

/* 07 — SELECTED WORK ------------------------------------------------------- */
.selected { padding-bottom: var(--s-5); }
.section-head { padding-block: var(--s-5) var(--s-3); align-items: end; row-gap: 1rem; }
.section-head .label { color: var(--muted); }
@media (min-width: 64rem) {
  .section-title { grid-column: 1 / 10; grid-row: 1 / 3; }
  .sh-a { grid-column: 10 / 13; grid-row: 1; align-self: start; text-align: right; padding-top: 1rem; border-top: 1px solid var(--line-strong); }
  .sh-b { grid-column: 10 / 13; grid-row: 2; align-self: end; text-align: right; }
}

/* 08 — NOTE / ALSO / CLOSING / COLOPHON ------------------------------------ */
.note { padding-block: calc(var(--s-6) * 1.4) var(--s-6); row-gap: var(--s-5); }
.note-label { border-top: 1px solid var(--line-strong); padding-top: .65rem; }
.note-portrait { width: 62%; }
.note-text p {
  font-family: var(--display); font-size: var(--t-xs); line-height: 1.6; letter-spacing: 0;
  text-indent: 2.2em; max-width: 40ch;
}
.note-side { display: grid; gap: 1.75rem; }
@media (min-width: 64rem) {
  .note-portrait { grid-column: 1 / 4; grid-row: 2 / 4; width: auto; }
  .note-text { grid-column: 5 / 13; grid-row: 2; }
  .note-side { grid-column: 5 / 10; grid-row: 3; }
}

.also { padding-block: var(--s-5); row-gap: 2rem; }
.also-list { border-top: 1px solid var(--line-strong); }
.also-row a {
  display: grid; grid-template-columns: 2.2rem 1fr auto; column-gap: 1rem; align-items: baseline;
  padding: .75rem 0; border-bottom: 1px solid var(--line);
}
.ar-n { font: 500 var(--fs-label)/1 var(--sans); letter-spacing: .09em; color: var(--muted); }
.ar-t { font-family: var(--display); font-size: var(--t-xs); line-height: 1.2; letter-spacing: 0; }
.ar-d { display: none; }
.ar-y { font-size: var(--fs-small); color: var(--muted); font-variant-numeric: tabular-nums; }
.also-row a:hover .ar-t, .also-row a:focus-visible .ar-t { font-style: italic; }
@media (min-width: 64rem) {
  .also-title { grid-column: 1 / 5; position: sticky; top: calc(var(--head-h) + 2rem); align-self: start; flex-direction: column; align-items: flex-start; }
  .also-list { grid-column: 5 / 13; grid-row: 1 / 3; }
  .also-row a { grid-template-columns: 3rem 1fr 12rem 5rem; }
  .ar-d { display: block; font-size: var(--fs-small); color: var(--muted); }
  .ar-y { text-align: right; }
  .also-more { grid-column: 1 / 5; grid-row: 2; align-self: end; }
}

.colophon { margin-top: var(--s-5); }
.closing { padding-block: calc(var(--s-6) * 1.4) var(--s-6); border-top: 1px solid var(--line-strong); position: relative; }
.closing-label { color: var(--muted); padding-top: .65rem; }
/* ASCII flow trail behind the closing page */
.closing > .ascii-trail { grid-column: auto; grid-row: auto; position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.closing > :not(.ascii-trail) { position: relative; z-index: 1; }

/* Home closing section: brand pink (turquoise in dark mode), faded in from the page */
.colophon--big {
  --foot-bg: #F8D5E4;          /* powder pink: brand pink softened towards paper */
  --foot-ink: #0B0B0A;
  --foot-muted: rgba(11, 11, 10, .72);
  --trail: var(--c-pink);
  --fade: clamp(10rem, 24vw, 22rem);
  margin-top: 0;
}
:root[data-theme="dark"] .colophon--big {
  --foot-bg: #123F3D;          /* deep teal: turquoise without the glare */
  --foot-ink: #F5F2E3;
  --foot-muted: rgba(245, 242, 227, .78);
  --trail: #1EBDB5;
}
.colophon--big .closing {
  border-top: 0;
  padding-block: calc(var(--fade) * .8) clamp(2.5rem, 5vw, 4.5rem);
  color: var(--foot-ink);
  background: linear-gradient(180deg, var(--bg) 0, var(--foot-bg) var(--fade), var(--foot-bg) 100%);
}
.colophon--big .closing-label { margin: 0; }
.colophon--big .closing-body { margin-top: clamp(6rem, 16vw, 14rem); justify-items: end; text-align: right; }
.colophon--big .closing-body p { margin-left: auto; }
.colophon--big .closing-mail {
  font-family: var(--sans); font-size: var(--fs-label); font-weight: 500; line-height: 1.35;
  letter-spacing: .12em; text-transform: uppercase;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .3em;
}
.colophon--big .closing-body { gap: .75rem; }
@media (min-width: 64rem) {
  .colophon--big .closing-body { grid-column: 9 / 13; }
}
.colophon--big .closing-label,
.colophon--big .closing-body p { color: var(--foot-muted); }
.colophon--big .closing-mail { color: var(--foot-ink); }
.colophon--big .closing ::selection { background: var(--foot-ink); color: var(--foot-bg); }
.closing > .closing-hint {
  justify-self: center; text-align: center; margin: 0 0 var(--s-4);
  max-width: 72ch; line-height: 1.7; text-wrap: balance; letter-spacing: .12em; color: var(--foot-ink);
  border-bottom: 1px solid currentColor; padding-bottom: .35rem;
}
@media (prefers-reduced-motion: reduce) { .closing-hint { display: none; } }
.closing-body { margin-top: var(--s-4); display: grid; gap: 1rem; }
.closing-body p { max-width: 30ch; color: var(--muted); }
.closing-mail {
  font-family: var(--display); font-size: var(--t-h3); line-height: 1.1; letter-spacing: -.01em;
  color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .12em;
  overflow-wrap: anywhere;
}
.closing-mail:hover { font-style: italic; }
@media (min-width: 64rem) {
  .closing-body { grid-column: 7 / 13; }
}

.colophon-row { padding-block: 1.25rem 2rem; border-top: 1px solid var(--line); row-gap: 1rem; font-size: var(--fs-small); }
.colophon-row .label { color: var(--muted); }
.colophon-row a { text-decoration: underline; text-underline-offset: .15em; }
.c-b { max-width: 52ch; }
@media (min-width: 40rem) {
  .c-b { grid-column: 3 / 9; } .c-c { grid-column: 1 / 5; } .c-d { grid-column: 5 / 9; text-align: right; }
}
@media (min-width: 64rem) {
  .c-b { grid-column: 3 / 8; } .c-c { grid-column: 8 / 11; } .c-d { grid-column: 11 / 13; }
}

/* 09 — INDEX OF WORK ------------------------------------------------------- */
.page-head { padding-top: clamp(1rem, 2vw, 2rem); row-gap: .5rem; }
.ph-a, .ph-b { color: var(--muted); border-bottom: 1px solid var(--line-strong); padding-block: .65rem; }
.ph-a { grid-column: 1 / 3; } .ph-b { grid-column: 3 / -1; text-align: right; }
.page-title {
  display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .1em;
  font-family: var(--display); font-weight: 400; font-size: var(--fs-mega); line-height: .85; letter-spacing: -.035em;
  margin-top: var(--s-3);
}
.page-title .script { font-size: var(--t-h3); transform: rotate(-6deg); display: inline-block; letter-spacing: 0; }
.page-intro { max-width: 34ch; color: var(--muted); margin-top: var(--s-3); }
@media (min-width: 64rem) {
  .ph-a { grid-column: 1 / 7; } .ph-b { grid-column: 7 / 13; }
  .page-intro { grid-column: 9 / 13; grid-row: 3; align-self: end; margin-bottom: 1.5rem; }
  .page-title { grid-column: 1 / 9; }
}

.index { padding-block: var(--s-5); row-gap: 1rem; }
.filters { display: flex; flex-wrap: wrap; gap: .4rem 1.6rem; padding-block: .4rem; }
.filters button {
  position: relative; padding: .55rem .3rem;
  font: 500 var(--t-xs)/1 var(--sans); letter-spacing: .07em; text-transform: uppercase; color: var(--muted);
}
.filters button sup { font-size: 1em; margin-left: .25em; letter-spacing: 0; }
.filters button .oval { inset: -.1em -.5em; width: calc(100% + 1em); height: calc(100% + .2em); stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .6s var(--ease); }
.filters button:hover { color: var(--fg); }
.filters button[aria-pressed="true"] { color: var(--fg); }
.filters button[aria-pressed="true"] .oval { stroke-dashoffset: 0; }
.ix-head { display: none; }
.ix-list { margin-top: 1rem; }
.ix-group { border-top: 1px solid var(--line-strong); padding-top: .65rem; margin-bottom: var(--s-4); }
.ix-year { font-family: var(--display); font-weight: 400; font-size: var(--t-xs); line-height: 1; letter-spacing: -.03em; margin-bottom: .5rem; }
.ix-row a {
  display: grid; grid-template-columns: 4.25rem 1fr; column-gap: 1rem; row-gap: .15rem; align-items: start;
  padding: .85rem 0; border-bottom: 1px solid var(--line);
}
.ix-thumb { grid-row: 1 / 4; grid-column: 1; width: 4.25rem; aspect-ratio: 4 / 5; object-fit: cover; background: var(--panel); }
.ix-n { display: none; }
.ix-t { font-family: var(--display); font-size: var(--fs-h3); line-height: 1.08; letter-spacing: -.015em; }
.ix-d, .ix-c { font-size: var(--fs-small); color: var(--muted); }
.ix-y { display: none; }
.ix-row a:hover .ix-t, .ix-row a:focus-visible .ix-t { font-style: italic; }
@media (min-width: 64rem) {
  .filters { grid-column: 1 / 10; }
  .ix-head, .ix-row a { grid-template-columns: 3.5rem minmax(0, 5fr) minmax(0, 2fr) minmax(0, 3fr) 4.5rem; column-gap: var(--gap); }
  .ix-head { display: grid; color: var(--muted); padding: .5rem 0; margin-left: calc((100% + var(--gap)) / 12 * 2); }
  .ix-head span:last-child { text-align: right; }
  .ix-group { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); }
  .ix-year { grid-column: 1 / 3; position: sticky; top: calc(var(--head-h) + 1rem); align-self: start; font-size: var(--t-xs); }
  .ix-rows { grid-column: 3 / 13; }
  .ix-row a { align-items: baseline; padding: 1rem 0; }
  .ix-thumb { display: none; }
  .ix-n, .ix-y { display: block; font: 500 var(--fs-label)/1 var(--sans); letter-spacing: .09em; color: var(--muted); }
  .ix-y { text-align: right; font-variant-numeric: tabular-nums; }
  .ix-t { font-size: var(--t-h3); }
}

/* Floating preview on hover (pointer devices only) */
.preview {
  position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none;
  width: clamp(180px, 18vw, 300px); opacity: 0; transition: opacity .2s var(--ease);
  will-change: transform;
}
.preview.on { opacity: 1; }
.preview img { width: 100%; border: 0; box-shadow: none; outline: 0; }
@media (hover: none), (pointer: coarse) { .preview { display: none; } }

/* 10 — PROJECT TEMPLATE ---------------------------------------------------- */
.project { padding-bottom: var(--s-4); }
.p-head { padding-top: clamp(1rem, 2vw, 2rem); row-gap: 1rem; align-items: end; }
.crumbs { color: var(--muted); border-bottom: 1px solid var(--line-strong); padding-block: .65rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.crumbs a { text-decoration: underline; text-underline-offset: .15em; }
.p-num { color: var(--muted); margin-top: var(--s-3); }
.p-title { font-family: var(--display); font-weight: 400; font-size: var(--fs-display); line-height: .9; letter-spacing: -.035em; }
.p-s { display: block; font-style: italic; font-size: var(--t-body); letter-spacing: -.01em; color: var(--muted); margin-top: .45em; line-height: 1.15; }
.p-head .receipt { margin-top: var(--s-3); }
@media (min-width: 64rem) {
  .p-num { grid-column: 1 / 9; grid-row: 2; }
  .p-title { grid-column: 1 / 9; grid-row: 3; }
  .p-head .receipt { grid-column: 10 / 13; grid-row: 3; }
}

.p-cover { margin-top: var(--s-4); }
.p-cover img { width: 100%; }
.project--contained .p-cover { margin-inline: var(--m); background: none; padding: clamp(1rem, 3vw, 3rem) 0; display: grid; place-items: center; }
.project--contained .p-cover img { width: auto; max-height: 78vh; }
.project--portrait .p-cover { padding-inline: var(--m); }
.project--portrait .p-cover img { width: auto; max-height: 92vh; margin-left: auto; }
@media (min-width: 64rem) {
  .project--portrait .p-cover img { max-width: 58%; margin-left: calc(100% / 12 * 5); }
}

.p-intro { padding-block: var(--s-5); row-gap: var(--s-3); }
.p-body { display: grid; gap: 1rem; max-width: 60ch; }
.p-docs { margin-top: 1.25rem; padding-top: .75rem; border-top: 1px solid var(--line-strong); }
.p-docs .label { color: var(--muted); }
.p-docs ul { margin-top: .5rem; display: grid; gap: .4rem; }
.p-docs li .label { margin-left: .4rem; }
.p-toc { border-top: 1px solid var(--line-strong); padding-top: .65rem; }
.p-toc .label { color: var(--muted); }
.p-toc ol { margin-top: .6rem; }
.p-toc a { display: flex; gap: .6rem; font-family: var(--display); font-size: var(--fs-h3); line-height: 1.3; }
.p-toc a span { font-family: var(--script); color: var(--ink-accent); font-size: 1em; line-height: 1; }
.p-toc a:hover { font-style: italic; }
@media (min-width: 64rem) {
  .p-intro .lead { grid-column: 1 / 8; font-size: var(--t-body); }
  .p-body { grid-column: 9 / 13; }
  .p-toc { grid-column: 3 / 8; }
}

/* Image blocks */
.b { margin-top: var(--s-5); }
.b figure img, .b figure video { width: 100%; }
.b figcaption { margin-top: .55rem; font-size: var(--fs-small); color: var(--muted); display: flex; gap: .6rem; align-items: baseline; }
.fig-n { font: 500 var(--fs-label)/1 var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--fg); flex: none; }
.b-full figcaption { padding-inline: var(--m); }
.b-heading { margin-top: var(--s-6); row-gap: .75rem; }
.b-heading h2 { border-top: 1px solid var(--line-strong); padding-top: .65rem; }
.b-heading p { font-family: var(--display); font-size: var(--fs-h3); line-height: 1.15; letter-spacing: -.01em; max-width: 28ch; }
.b-pair, .b-trio, .b-row, .b-sheet, .b-scroll { row-gap: var(--gap); align-items: start; }
.b-trio figure:nth-child(n+2) { grid-column: span 2; }
.b-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.b-row > * { grid-column: auto; }
.b-sheet { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: calc(var(--gap) * .6); }
.b-sheet > * { grid-column: auto; }
.b-sheet figure { box-shadow: 0 0 0 1px var(--line); }
.b-scroll-frame {
  height: min(72vh, 860px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--panel); outline-offset: -2px; border: 1px solid var(--line);
  scrollbar-width: thin;
}
.b-scroll .hint { margin-left: auto; font: 500 var(--fs-label)/1 var(--sans); letter-spacing: .09em; text-transform: uppercase; }

@media (min-width: 40rem) {
  .b-pair figure:first-child { grid-column: 1 / 5; }
  .b-pair figure:last-child { grid-column: 5 / 9; }
  .b-stagger figure:last-child { margin-top: 10vw; }
  .b-trio figure { grid-column: span 2 !important; }
  .b-trio figure:first-child { grid-column: 1 / 5 !important; }
  .b-trio figure:nth-child(2) { grid-column: 5 / 9 !important; margin-top: 8vw; }
  .b-trio figure:nth-child(3) { grid-column: 3 / 7 !important; }
  .b-scroll { grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
  .b-scroll > * { grid-column: auto; }
  .b-sheet { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 64rem) {
  .b-wide figure { grid-column: 2 / 13; }
  .b-offset--right figure { grid-column: 5 / 13; }
  .b-offset--left figure { grid-column: 1 / 9; }
  .b-offset--center figure { grid-column: 3 / 11; }
  .b-pair--6-6 figure:first-child { grid-column: 1 / 7; } .b-pair--6-6 figure:last-child { grid-column: 7 / 13; }
  .b-pair--7-5 figure:first-child { grid-column: 1 / 8; } .b-pair--7-5 figure:last-child { grid-column: 8 / 13; }
  .b-pair--5-7 figure:first-child { grid-column: 1 / 6; } .b-pair--5-7 figure:last-child { grid-column: 6 / 13; }
  .b-stagger figure:last-child { margin-top: 9vw; }
  .b-trio figure:first-child { grid-column: 1 / 5 !important; }
  .b-trio figure:nth-child(2) { grid-column: 5 / 9 !important; margin-top: 7vw; }
  .b-trio figure:nth-child(3) { grid-column: 9 / 13 !important; margin-top: 2.5vw; }
  .b-row { grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
  .b-sheet { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* Credits (fashion stories) */
.b-credits { margin-top: var(--s-6); row-gap: var(--s-3); border-top: 1px solid var(--line-strong); padding-top: 1rem; }
.cr-title { font-size: var(--t-h1); font-weight: 400; line-height: .8; }
.cr-title .script { display: inline-block; transform: rotate(-5deg); }
.cr-group h3 { color: var(--muted); margin-bottom: .6rem; }
.cr-group a { text-decoration: none; }
.cr-group a:hover { color: var(--link); text-decoration: underline; }
.cr-group dd { text-align: right; }
@media (min-width: 40rem) { .cr-group { grid-column: span 4; } }
@media (min-width: 64rem) { .cr-title { grid-column: 1 / 4; grid-row: 1 / 3; } .cr-group { grid-column: span 3; } .cr-group:nth-of-type(1) { grid-column: 4 / 7; } }

/* Magazine pages: a horizontal reading strip */
.b-pages { margin-top: var(--s-4); }
.pg-track {
  display: flex; gap: clamp(.5rem, 1vw, 1rem); overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 0 var(--m) 1rem; scroll-padding-inline: var(--m); scrollbar-width: thin; overscroll-behavior-x: contain;
}
.pg { flex: 0 0 auto; scroll-snap-align: start; display: grid; gap: .45rem; }
.pg img { height: min(70vh, 720px); width: auto; max-width: none; box-shadow: 0 0 0 1px var(--line); background: var(--panel); }
.pg .label { color: var(--muted); }
.pg-controls { margin-top: .75rem; align-items: center; }
.pg-controls > * { grid-column: auto !important; }
.pg-controls { grid-template-columns: 1fr auto 1fr; }
.pg-controls button { justify-self: start; padding: .5rem 0; border-bottom: 1px solid currentColor; }
.pg-controls button:last-child { justify-self: end; }
.pg-controls button:disabled { opacity: .3; cursor: default; }
.no-js .pg-controls { display: none; }

/* Chapters (grouped features) */
.chapter { margin-top: var(--s-6); }
.ch-head { row-gap: .9rem; border-top: 1px solid var(--line-strong); padding-top: 1rem; align-items: start; }
.ch-letter { font-family: var(--script); color: var(--ink-accent); font-size: var(--t-display); line-height: .7; }
.ch-title { font-family: var(--display); font-weight: 400; font-size: var(--fs-h1); line-height: .95; letter-spacing: -.035em; }
.ch-text { font-family: var(--display); font-size: var(--fs-h3); line-height: 1.2; max-width: 34ch; }
@media (min-width: 64rem) {
  .ch-letter { grid-column: 1 / 3; grid-row: 1 / 3; }
  .ch-title { grid-column: 3 / 9; }
  .ch-text { grid-column: 3 / 9; }
  .ch-meta { grid-column: 10 / 13; grid-row: 1 / 3; align-self: end; }
}

/* Previous / next */
.p-next { margin-top: var(--s-6); padding-top: 1rem; border-top: 1px solid var(--line-strong); row-gap: 1.5rem; align-items: start; }
.pn { display: grid; gap: .5rem; }
.pn .label { color: var(--muted); }
.pn-t { font-family: var(--display); font-size: var(--fs-h2); line-height: .95; letter-spacing: -.03em; }
.pn:hover .pn-t, .pn:focus-visible .pn-t { font-style: italic; }
.pn-all { justify-self: start; border-bottom: 1px solid currentColor; padding-bottom: .2rem; order: 3; }
.pn-img { display: block; width: 40%; margin-top: .5rem; overflow: hidden; }
.pn-img img { transition: transform 1s var(--ease); }
.pn:hover .pn-img img { transform: scale(1.04); }
@media (min-width: 64rem) {
  .pn-prev { grid-column: 1 / 5; }
  .pn-prev .pn-img { margin-right: auto; }
  .pn-all { grid-column: 6 / 8; justify-self: center; order: 0; }
  .pn-next { grid-column: 9 / 13; text-align: right; justify-items: end; }
  .pn-img { width: 55%; }
}

/* 11 — ABOUT / CONTACT / ERRATUM ------------------------------------------- */
.about-head { padding-top: clamp(1rem, 2vw, 2rem); row-gap: var(--s-3); }
.about-head .ph-a, .about-head .ph-b { margin-bottom: 0; }
.about-title { font-family: var(--display); font-weight: 400; font-size: var(--fs-display); line-height: .92; letter-spacing: -.035em; margin-top: var(--s-2); }
.about-title em { font-style: italic; }
.about-text { display: grid; gap: 1rem; max-width: 58ch; }
.about-quote { font-family: var(--script); color: var(--ink-accent); font-size: var(--t-h2); line-height: 1.05; transform: rotate(-5deg); margin-block: 1rem; }
@media (min-width: 64rem) {
  .about-title { grid-column: 1 / 11; }
  .about-portrait { grid-column: 1 / 6; grid-row: 3 / 6; }
  .about-text { grid-column: 7 / 12; grid-row: 3; padding-top: 1rem; }
  .about-quote { grid-column: 7 / 13; grid-row: 4; }
  .about-facts { grid-column: 7 / 12; grid-row: 5; align-self: end; }
}
.disciplines { padding-block: var(--s-6) 0; row-gap: 1rem; }
.disciplines h2 { color: var(--muted); border-top: 1px solid var(--line-strong); padding-top: .65rem; }
.disc-list { display: flex; flex-wrap: wrap; gap: 0 .45em; font-family: var(--display); font-size: var(--fs-display); line-height: 1; letter-spacing: -.04em; }
.disc-list li:not(:last-child)::after { content: ","; }
.disc-list a:hover span, .disc-list a:focus-visible span { font-style: italic; }
.disc-list sup { font-size: 1em; font-weight: inherit; letter-spacing: 0; color: var(--muted); margin-left: .2em; }
.contact-sheet { padding-block: var(--s-6) var(--s-4); row-gap: 1.25rem; }
.cs-note { color: var(--muted); max-width: 40ch; }
.cs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); margin-top: 1.5rem; }
.cs-item { display: grid; gap: .4rem; }
.cs-item img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; filter: grayscale(1) contrast(1.04); transition: filter .6s var(--ease); }
.cs-item:hover img { filter: none; }
.cs-item .label { color: var(--muted); }
@media (min-width: 40rem) { .cs-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 64rem) {
  .cs-title { grid-column: 1 / 8; }
  .cs-note { grid-column: 9 / 13; align-self: end; }
  .cs-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .cs-item:nth-child(6n+2), .cs-item:nth-child(6n+5) { margin-top: 3rem; }
}

.copy-btn { padding: 0; }
.erratum { padding-block: var(--s-3) var(--s-6); row-gap: var(--s-3); }
.erratum-title { font-family: var(--display); font-weight: 400; font-size: var(--fs-display); line-height: .92; letter-spacing: -.035em; max-width: 14ch; }
.erratum-title em { font-style: italic; }
.erratum-links { line-height: 2; }

/* 12 — MOTION -------------------------------------------------------------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
  .pn-img img { transform: none !important; }
}

@media print {
  .masthead, .preview, .pg-controls, body::after { display: none; }
  body { background: #fff; color: #000; }
}


/* Work and About on the scale */
.page-title { font-size: var(--t-h3); }
.ix-year { font-size: var(--t-xs); }
.ix-t { font-size: var(--t-h3); }
.about-title { font-size: var(--t-h1); }
.about-quote { font-size: var(--t-h2); }
.disc-list { font-size: var(--t-h1); }
.cs-title { font-size: var(--t-h1); }
.about-text .lead { font-size: var(--t-body); }

/* Active states without the hand-drawn oval: italic + a small accent dot.
   (The oval stays only around the JESSICA XIE logo.) */
.nav-t .oval, .filters button .oval { display: none; }
.nav-t::before, .filters button::before {
  content: ""; position: absolute; top: 50%; left: -.75em;
  width: .32em; height: .32em; margin-top: -.16em; border-radius: 50%;
  background: var(--ink-accent); opacity: 0; transform: scale(.4);
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.filters button::before { left: -.45em; }
/* Filters: slant with a transform, not font-style (italic glyphs are wider and push the other filters) */
.filters button { font-style: normal; transition: color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); }
.filters button[aria-pressed="true"], .filters button:hover { font-style: normal; transform: skewX(-10deg); }
/* Nav uses a transform instead of font-style: italic — the real Jost italic face has
   different glyph widths, which would shift the other nav items (justify-content: space-around
   ties every item's position to the others' measured width). A transform is paint-only and
   never affects layout, so hovering one nav item can no longer move the rest. */
.nav li a[aria-current="page"] .nav-t, .nav li a:hover .nav-t { transform: skewX(-10deg); }
.nav li a[aria-current="page"] .nav-t::before,
.filters button[aria-pressed="true"]::before { opacity: 1; transform: none; }

/* Logo: plain wordmark, no oval */
.logo .oval { display: none; }
.logo { padding-inline: 0; }
.logo:hover { color: var(--ink-accent); }

/* Matched row: images share one height, widths follow their aspect ratio */
.b-match .m-row { display: grid; gap: var(--gap); }
@media (min-width: 40rem) {
  .b-match .m-row { display: flex; align-items: flex-start; }
  .b-match .m-row > figure { flex: var(--ar) 1 0; min-width: 0; margin: 0; }
}
@media (min-width: 64rem) { .b-match .m-row { grid-column: 2 / 13; } }
.b-match .m-row > figure { width: var(--pct, 100%); }
@media (min-width: 40rem) { .b-match .m-row > figure { width: auto; } }

/* Hero name: Ballet at name size (all script words use Ballet too) */
.h4-name { font-family: "Ballet", var(--script); }
:root[data-theme="dark"] .nav-t::before, :root[data-theme="dark"] .filters button::before { background: #1EBDB5; }

/* Mobile: a taller closing section with room to draw */
@media (max-width: 63.99rem) {
  /* Account for the stacked scroll-padding-top + scroll-margin-top header clearance
     (2 * --head-h + 3rem) so the section never grows taller than what's actually
     visible once you land on #contact — otherwise the e-mail sinks below the fold. */
  .colophon--big .closing { min-height: calc(100svh - (var(--head-h) * 2) - 4rem); display: flex; flex-direction: column; }
  .colophon--big .closing > .closing-hint { align-self: center; }
  .colophon--big .closing > .closing-label { align-self: flex-start; }
  .colophon--big .closing-hint { font-size: .75rem; line-height: 1.7; max-width: 42ch; margin-bottom: var(--s-3); }
  .colophon--big .closing-body { margin-top: auto; padding-top: var(--s-5); align-self: stretch; }
}

/* Mobile menu tab: bigger, and always fully on screen.
   The nav slides out by its own width minus the tab, so the tab can never be clipped. */
@media (max-width: 63.99rem) {
  .nav { --tab-w: 2.9rem; transform: translateX(calc(100% - var(--tab-w))); }
  .menu-open .nav { transform: none; }
  .menu-tab {
    box-sizing: border-box; flex: none; width: var(--tab-w); margin-right: 0;
    display: flex; align-items: center; justify-content: center;
    min-height: 7.5rem; padding: 1.25rem 0;
    font-size: var(--t-body); font-weight: 500; letter-spacing: .16em;
    border-radius: 18px 0 0 18px;
  }
  .nav-panel { box-sizing: border-box; flex: none; }
}

/* No rubber-band bounce at the page edges (iOS/Android), so drawing at the bottom feels steady */
html, body { overscroll-behavior-y: none; }
/* Mobile: keep the e-mail clear of the fixed menu tab on the right edge */
@media (max-width: 63.99rem) {
  .colophon--big .closing-body { padding-right: calc(var(--tab-w, 2.9rem) + .25rem); }
}

/* Intro: full-screen opening on the home page. The name writes itself, PORTFOLIO settles,
   then the page turns up to reveal the index. Once per visit; tap, click or any key skips. */
.intro { display: none; }
.show-intro .intro {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  background: var(--bg); color: var(--fg);
}
.show-intro body { overflow: hidden; }
.intro-inner { text-align: center; padding-inline: var(--m); }
.intro-name {
  margin: 0; font-family: "Ballet", var(--script); font-weight: 400; line-height: 1.1; white-space: nowrap;
  font-size: var(--t-name);
  padding: .2em .45em; margin-inline: -.45em;
  -webkit-mask-image: linear-gradient(90deg, #000 0 44%, transparent 56% 100%);
          mask-image: linear-gradient(90deg, #000 0 44%, transparent 56% 100%);
  -webkit-mask-size: 240% 100%; mask-size: 240% 100%;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: 100% 0; mask-position: 100% 0;
}
.intro-sub {
  margin-top: clamp(.6rem, 1.6vw, 1.6rem);
  font: 400 var(--t-lead)/1 var(--sans); letter-spacing: .9em; text-transform: uppercase;
  padding-left: .45em; opacity: 0;
}
.intro.go .intro-name { animation: jx-write 2.1s cubic-bezier(.5, .1, .25, 1) .15s forwards; }
.intro.go .intro-sub { animation: jx-settle 1.1s cubic-bezier(.2, .7, .2, 1) 1.8s forwards; }
.intro.out { transform: translateY(-100%); transition: transform .9s cubic-bezier(.7, 0, .2, 1); }
.intro.out.quick { transition-duration: .5s; }
/* the hero's own writing animation is skipped when the intro has just shown it */
.show-intro .h4-name, .intro-done .h4-name { animation: none !important; -webkit-mask-image: none !important; mask-image: none !important; }
.show-intro .h4-script, .intro-done .h4-script { animation: none !important; opacity: 1 !important; letter-spacing: .45em !important; }


/* Mobile menu: Home, Work, About (Contact is the closing section of every page anyway) */
/* Contact is in the mobile menu again (audit: the main action must be findable) */

/* Footer row without the colophon sentence: label, e-mail, copyright */

/* Home: the header floats transparent over the hero photo and turns solid
   once the hero (including its fade) has scrolled past it */
body.home .hero4 {
  margin-top: calc(-1 * var(--head-h));
  padding-top: calc(var(--head-h) + clamp(1rem, 2vw, 1.75rem));
  min-height: 100svh;
}
body.home .masthead { transition: background-color .35s var(--ease), border-color .35s var(--ease); }
.head-clear body.home .masthead { background-color: transparent; border-bottom-color: transparent; }

/* The intro is always dark, whatever theme the visitor uses */
.show-intro .intro { background: #121211; color: #F2F0EA; color-scheme: dark; }

/* Work index on mobile: thumbnails keep their width, height follows the image (no cropping) */
.ix-thumb { aspect-ratio: auto; height: auto; object-fit: contain; align-self: start; }
.ix-thumb { background: none; }

/* No grey/pink tap flash on touch screens; keyboard focus rings stay */
html { -webkit-tap-highlight-color: transparent; }
@media (hover: none) { :focus:not(:focus-visible) { outline: none; } }

/* Intro: sit optically above centre (also in tall in-app browsers like Instagram) */
.intro-inner { margin-bottom: 16svh; }

/* Mobile menu tab a little lower on the screen */
@media (max-width: 63.99rem) { .nav { top: 44svh; } }

/* Footer row: name · e-mail · © · back to top (no label)
   phone: name, then e-mail on the right, then © left and back to top right */
.colophon-row { align-items: baseline; }
.c-b { grid-column: 1 / 3; white-space: nowrap; }
.c-c { grid-column: 3 / -1; text-align: right; white-space: nowrap; }
.c-d { grid-column: 1 / 3; text-align: left; }
.c-e { grid-column: 3 / -1; text-align: right; }
@media (min-width: 40rem) {
  .c-b { grid-column: 1 / 5; } .c-c { grid-column: 5 / 9; }
  .c-d { grid-column: 1 / 5; } .c-e { grid-column: 5 / 9; }
}
@media (min-width: 64rem) {
  .c-b { grid-column: 1 / 5; } .c-c { grid-column: 5 / 9; text-align: left; }
  .c-d { grid-column: 9 / 11; } .c-e { grid-column: 11 / 13; }
}
/* Mobile menu tab label: medium (20px), same as the menu items */
@media (max-width: 63.99rem) { .menu-tab { font-size: var(--t-menu); letter-spacing: .14em; } }

/* Every Ballet word is 35px — except the hero name and the intro, which stay large */
.script, .section-title .script, .also-title .script, .cs-title .script, .page-title .script, .cr-title .script,
.p-toc a span, .ch-letter, .about-quote { font-size: var(--t-script); }

/* Work page: one meta line across the full width (the title itself says "Index of work") */
.page-head .ph-full { grid-column: 1 / -1; }
/* The thank-you line: capitals, regular weight, grey */
.colophon--big .closing-hint { text-transform: uppercase; letter-spacing: .12em; font-weight: 400; color: var(--foot-muted); }

/* Contact sheet numbers: regular weight */
.cs-item .label { font-weight: 400; }


/* "View more" links in the accent colour (pink; turquoise in dark mode via --link) */
.sw-more { color: var(--link); }
.sw-more:hover { font-style: italic; }

/* Closing section: same height, but "Contact" and the thank-you line sit higher,
   leaving more open space to draw in. The space taken off the top is added above the e-mail. */
.colophon--big .closing { padding-top: calc(var(--fade) * .3); }
@media (min-width: 64rem) {
  .colophon--big .closing-body { margin-top: calc(clamp(6rem, 16vw, 14rem) + var(--fade) * .5); }
}

/* Desktop header: menu items in capitals like the logo (the Light / Dark toggle stays as is) */
@media (min-width: 64rem) { .nav li a { text-transform: uppercase; letter-spacing: .09em; } }

/* Work index: project titles at 14px, like the list on the home page */
.ix-t { font-size: var(--t-xs); }

/* Content is 14px, structure is 20px — applied to project pages and About:
   sentences under section labels, chapter texts, the chapter list, prev/next titles
   and the disciplines list are content; project and chapter titles stay 20px. */
.b-heading p { font-size: var(--t-body); line-height: 1.6; letter-spacing: 0; max-width: 46ch; }
.ch-text { font-size: var(--t-body); line-height: 1.6; max-width: 46ch; }
.p-toc a { font-size: var(--t-body); line-height: 1.8; }
.p-toc a span { font-size: var(--t-script); }
.pn-t { font-size: var(--t-body); line-height: 1.3; letter-spacing: 0; }
.disc-list { font-size: var(--t-body); line-height: 1.6; letter-spacing: 0; gap: 0 .35em; }

/* Chapter names (Lowside) in capitals, and more air under the dividing line */
.ch-title, .p-toc a { text-transform: uppercase; letter-spacing: .09em; }
.p-toc a span { text-transform: none; letter-spacing: 0; }
.ch-head { padding-top: var(--s-4); }
.ch-letter { line-height: 1; }
.p-toc { padding-top: 1.25rem; }
.p-toc ol { margin-top: 1rem; }

/* Project names in lists in capitals (Work index, More work on Home, previous/next) */
.ix-t, .ar-t, .pn-t { text-transform: uppercase; letter-spacing: .09em; }

/* ── Audit fixes (Oct 24) ─────────────────────────────────────────────── */
/* Project title: the one place on a project page that may be big on large screens */
@media (min-width: 64rem) { .p-t { font-size: 3rem; line-height: 1; letter-spacing: -.02em; } }

/* Bigger tap areas for small text links, without changing how they look */
.colophon-row a, .crumbs a, .pn-all, .click, .sw-more, .h4-scroll, .sh-b a, .closing-mail,
.copy-btn, .ix-row a, .also-row a, .p-docs a { position: relative; }
.colophon-row a::after, .crumbs a::after, .pn-all::after, .click::after, .sw-more::after, .h4-scroll::after,
.sh-b a::after, .closing-mail::after, .copy-btn::after, .p-docs a::after {
  content: ""; position: absolute; inset: -12px -6px;
}

/* Copy address (closing section) */
.closing-copy { display: flex; gap: .75rem; justify-content: flex-end; align-items: baseline; margin: 0; }
.copy-btn { color: var(--foot-ink, var(--fg)); text-decoration: underline; text-underline-offset: .3em; letter-spacing: .12em; }
.copy-btn:hover { font-style: italic; }
.closing-copy [data-copy-status] { color: var(--foot-muted, var(--muted)); }
@media (max-width: 63.99rem) { .nav li a { padding-block: .55rem; } .nav ol { gap: 0; } }
.disc-list a, .cr-group a, .receipt a, .note-side a { position: relative; }
.disc-list a::after, .cr-group a::after, .receipt a::after, .note-side a::after { content: ""; position: absolute; inset: -12px -4px; }

/* Phone: rows with video stack one under the other */
@media (max-width: 39.99rem) { .b-row:has(video) { grid-template-columns: 1fr; } }

/* Copy address flush right with the e-mail; the "Copied." note appears to its left */
.closing-copy { flex-direction: row-reverse; justify-content: flex-start; }
.closing-copy [data-copy-status]:empty { display: none; }
.copy-btn { margin-right: -.12em; }

/* Smooth scrolling for in-page links (Selected work, Contact); instant with reduced motion */
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
#sel-title { scroll-margin-top: calc(var(--head-h) + 2rem); }
/* #contact also sits behind the fixed header's scroll-padding-top (html), which already
   reserves var(--head-h) + 1rem above every anchor. A small negative scroll-margin here
   cancels most of that so landing on Contact tucks the hint right under the header—
   instead of leaving the previous section's tail ("All work →") sitting in view—
   and leaves more of the closing page's canvas actually on screen to draw on. */
#contact { scroll-margin-top: calc(.5rem - var(--head-h)); }

/* ── Scroll motion (only with JS and when the visitor allows motion; class .motion on <html>) ── */
/* Selected work: images are revealed by a mask from the bottom, the text follows a beat later */
.motion .sw-img > span { clip-path: inset(100% 0 0 0); transition: clip-path 1.1s cubic-bezier(.65, 0, .15, 1); }
.motion .sw-img > span img { transform: scale(1.08); transition: transform 1.6s cubic-bezier(.2, .7, .1, 1); }
.motion .sw-img.in > span { clip-path: inset(0 0 0 0); }
.motion .sw-img.in > span img { transform: none; }
.motion .sw-img.in:hover > span img { transform: scale(1.03); }
.motion .sw-text { opacity: 0; transform: translateY(14px); transition: opacity .8s var(--ease) .3s, transform .8s var(--ease) .3s; }
.motion .sw-text.in { opacity: 1; transform: none; }
/* Project pages: the opening image settles from 106% to 100% as you scroll past it */
.motion .p-cover { overflow: hidden; }
.motion .p-cover img { transform: scale(var(--cz, 1.06)); transform-origin: 50% 40%; will-change: transform; }
/* Work index: rows fade in softly, a little staggered */
.motion .ix-row { opacity: 0; transform: translateY(10px); transition: opacity .6s var(--ease) var(--d, 0ms), transform .6s var(--ease) var(--d, 0ms); }
.motion .ix-row.in { opacity: 1; transform: none; }

/* ── project reflection ("Looking back") ── */
.b-reflect { margin-top: var(--s-6); row-gap: var(--s-3); border-top: 1px solid var(--line-strong); padding-top: 1rem; }
.rf-body { display: grid; gap: 1rem; max-width: 60ch; font-size: var(--t-body); line-height: 1.6; }
@media (min-width: 64rem) {
  .rf-title { grid-column: 1 / 4; }
  .rf-body { grid-column: 5 / 11; padding-top: .4rem; }
}

/* weight hierarchy on the index: titles bold (look here first), filters regular */
.filters button { font-weight: 400; }
.ix-t { font-weight: 600; }
.ix-n { font-weight: 400; }
.ix-head, .ix-head * { font-weight: 400; }

/* hover swap: dark → light mockup */
.swap { position: relative; display: block; }
.swap img { display: block; width: 100%; height: auto; }
.swap .swap-b { position: absolute; inset: 0; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s var(--ease); }
.has-swap:hover .swap-b { opacity: 1; }
.swap-hint { display: none; }
@media (hover: hover) { .swap-hint { display: inline; } }
@media (prefers-reduced-motion: reduce) { .swap .swap-b { transition: none; } }
