/* GENERATED by tools/build-css.py. Do not edit: edit the files in
   css/ and run the script. This bundle is, in order:
     css/pookalam.css
     css/tools.css
     css/masthead.css
     css/footer.css
     css/cursor.css
     css/kuri.css
*/

/* ===== css/pookalam.css ===== */
/* ==========================================================================
   THE POOKALAM (CLAUDE.md §15e) — one component, used twice.

   A floral carpet from the site's curve vocabulary: leaf petals, a band of
   small conch spirals, lotus petals, teardrops and the conch at its heart, in
   kumkumam with paper-deep and paper details. Its five rings are defined once
   (#pk-r1 to #pk-r5 in the page's shared SVG defs) and each instance draws
   them with <use>, every ring its own SVG and so its own layer.

   1. The first-load intro: a kumkumam field over the hero, the rings spinning
      to a stop, then the field opening like temple doors.
   2. The head of the About field, where its rings turn into place on scroll
      (js/pookalam.js).
   Transform and opacity only.
   ========================================================================== */

.pookalam {
  position: relative;
  aspect-ratio: 1;
}

.pookalam__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  transform-origin: 50% 50%;
}


/* --- 2. The About field ----------------------------------------------------
   A row of its own above the type, in the flow, so it can never sit under
   any of it. */
.about .pookalam {
  width: clamp(11rem, 22vw, 18rem);
  margin: 0 auto var(--about-rhythm);
}

/* Layers only while it can move. */
.about .pookalam.is-live .pookalam__ring { will-change: transform, opacity; }


/* --- 1. The first-load intro -----------------------------------------------
   Prateek's decision, over §4's no-preloader rule. Drawn in the first paint:
   the inline script in the head puts .has-intro on <html> before anything
   renders, and only then is it shown. The rings spin to a stop together over
   --t-base; the halves start to swing open at 0.7 of it, as the rings settle
   their last few degrees, and open slowly, over --t-slow on the --ease-move
   spring: about 1.96s in all. The hero underneath is live throughout, and its
   own sequence is held until the doors start (--intro-hold, hero.css), so the
   conch starts drawing as they open. Any tap, click, key or scroll opens them
   at once (.pk-open). */
:root { --pk-open-at: calc(var(--t-base) * 0.7); }

.pk-intro { display: none; }

html.has-intro .pk-intro {
  display: block;
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-cursor) - 1);
  /* The doors take a tap; the gap between them as they part does not. */
  pointer-events: none;
}

.pk-intro__door {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  overflow: hidden;
  background: var(--kumkumam);
  pointer-events: auto;
  will-change: transform;
  backface-visibility: hidden;
}

/* Each half shows its half of one pookalam, centred on the seam. */
.pk-intro__face {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 200%;
  display: grid;
  place-items: center;
}
.pk-intro__door--l { left: 0; transform-origin: left center; box-shadow: 1px 0 0 var(--kumkumam); }
.pk-intro__door--l .pk-intro__face { left: 0; }
.pk-intro__door--r { right: 0; transform-origin: right center; }
.pk-intro__door--r .pk-intro__face { right: 0; }

.pookalam--intro { width: min(64vmin, 26rem); }

html.has-intro .pookalam--intro .pookalam__ring {
  will-change: transform;
  animation: pk-spin var(--t-base) var(--ease) both;
}
/* Alternating directions, the outer ring spinning furthest. */
.pookalam--intro .pookalam__ring--1 { --pk-spin: -540deg; }
.pookalam--intro .pookalam__ring--2 { --pk-spin: 450deg; }
.pookalam--intro .pookalam__ring--3 { --pk-spin: -360deg; }
.pookalam--intro .pookalam__ring--4 { --pk-spin: 300deg; }
.pookalam--intro .pookalam__ring--5 { --pk-spin: -240deg; }

html.has-intro .pk-intro__door--l { animation: pk-door-l var(--t-slow) var(--ease-move) var(--pk-open-at) both; }
html.has-intro .pk-intro__door--r { animation: pk-door-r var(--t-slow) var(--ease-move) var(--pk-open-at) both; }

/* THE LOGO'S REPLAY CLOSES THE DOORS FIRST (October 2026). On home, .pk-close:
   the doors swing in from the edges over --t-quick, the rings spin and stop
   once they're shut, and the doors reopen as on arrival, all in about 2.5s.
   They close on --ease, not the spring: the spring went about 3% past shut
   and back, which put the pookalam's two halves out of line at the seam.
   They count as shut at 90% of --t-quick (--pk-shut-at), within a pixel of
   closed. The opening swing waits its turn, and fills forwards only, so it
   doesn't hold the doors shut while they're still closing. On a project
   page, .pk-shut: the doors close over the page and stay shut, the
   pookalam straight, while it navigates home, where the first paint shows
   them just so. */
:root { --pk-shut-at: calc(var(--t-quick) * 0.9); }
html.has-intro.pk-close .pk-intro__door--l {
  animation: pk-door-shut-l var(--t-quick) var(--ease) both,
             pk-door-l var(--t-slow) var(--ease-move) calc(var(--pk-shut-at) + var(--pk-open-at)) forwards;
}
html.has-intro.pk-close .pk-intro__door--r {
  animation: pk-door-shut-r var(--t-quick) var(--ease) both,
             pk-door-r var(--t-slow) var(--ease-move) calc(var(--pk-shut-at) + var(--pk-open-at)) forwards;
}
html.has-intro.pk-close .pookalam--intro .pookalam__ring {
  animation: pk-spin var(--t-base) var(--ease) var(--pk-shut-at) both;
}
html.has-intro.pk-shut .pk-intro__door--l { animation: pk-door-shut-l var(--t-quick) var(--ease) both; }
html.has-intro.pk-shut .pk-intro__door--r { animation: pk-door-shut-r var(--t-quick) var(--ease) both; }
html.has-intro.pk-shut .pookalam--intro .pookalam__ring { animation: none; transform: none; }

/* Closing over a page, the pookalam is straight, its rings lined up as at
   rest (.pk-straight: the logo's replay, About, and home arriving from
   either). So a replay's spin is whole turns of each ring's own repeat
   (the teardrop ring repeats every 45°, the centre conch only every 360°),
   and starts and ends lined up; the other rings' turns already are. The
   first-visit intro keeps its own spin. */
html.pk-straight .pookalam--intro .pookalam__ring--4 { --pk-spin: 315deg; }
html.pk-straight .pookalam--intro .pookalam__ring--5 { --pk-spin: -360deg; }

/* ABOUT FROM A PROJECT PAGE (October 2026), .pk-about: the doors closed over
   the project page (morph.js, .pk-shut), and home's first paint shows them
   shut, already at About. No spin: a short beat (--pk-beat), then they
   reopen onto About, the pookalam straight throughout. */
:root { --pk-beat: calc(var(--t-base) * 0.2); }
html.has-intro.pk-about .pk-intro__door--l { animation: pk-door-l var(--t-slow) var(--ease-move) var(--pk-beat) both; }
html.has-intro.pk-about .pk-intro__door--r { animation: pk-door-r var(--t-slow) var(--ease-move) var(--pk-beat) both; }
html.has-intro.pk-about .pookalam--intro .pookalam__ring { animation: none; transform: none; }

@keyframes pk-door-shut-l { from { transform: translateX(-100%); } }
@keyframes pk-door-shut-r { from { transform: translateX(100%); } }

/* Opened early: the same swing, from now. Its own animation names, so it
   starts from closed rather than jumping into the timed one. */
html.has-intro.pk-open .pk-intro__door--l { animation: pk-door-l-now var(--t-slow) var(--ease-move) both; }
html.has-intro.pk-open .pk-intro__door--r { animation: pk-door-r-now var(--t-slow) var(--ease-move) both; }
html.has-intro.pk-open .pk-intro__door { pointer-events: none; }

@keyframes pk-spin { from { transform: rotate(var(--pk-spin)); } to { transform: none; } }

@keyframes pk-door-l {
  from { transform: perspective(1600px) translateX(0) rotateY(0deg); }
  to   { transform: perspective(1600px) translateX(-100%) rotateY(-14deg); }
}
@keyframes pk-door-r {
  from { transform: perspective(1600px) translateX(0) rotateY(0deg); }
  to   { transform: perspective(1600px) translateX(100%) rotateY(14deg); }
}
@keyframes pk-door-l-now {
  from { transform: perspective(1600px) translateX(0) rotateY(0deg); }
  to   { transform: perspective(1600px) translateX(-100%) rotateY(-14deg); }
}
@keyframes pk-door-r-now {
  from { transform: perspective(1600px) translateX(0) rotateY(0deg); }
  to   { transform: perspective(1600px) translateX(100%) rotateY(14deg); }
}

@media (prefers-reduced-motion: reduce) {
  html.has-intro .pk-intro { display: none; }
}

/* ===== css/tools.css ===== */
/* ==========================================================================
   TOOLS (CLAUDE.md §18). The /tools/ index and its four tools. Loaded only
   by those five pages. The shell's own system: tokens, Gambetta for display,
   General Sans for everything else, kumkumam for what's live, the site's
   button and control shapes. Built from the approved mockup (the "Tools —
   Mockup" canvas), whose Newsreader and Figtree stand in for Gambetta and
   General Sans.
   ========================================================================== */

/* Gambetta Italic 400, from Fontshare's package (Fonts/WEB/fonts), as
   shipped: unmodified, no subsetting or conversion (FFL v2.0 §02). Declared
   here, not in fonts.css, so only the tool pages load it; elsewhere the site
   uses no Gambetta italic. Preloaded on /tools/, where the hero sets it. */
@font-face {
  font-family: 'Gambetta';
  src: url('/assets/fonts/Gambetta-Italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  /* A card a shade lighter than the paper, for chips and tiles that sit on
     it (the mockup's #FBF8F2). Mixed from the paper, not a new colour. */
  --tl-card: color-mix(in srgb, var(--paper) 55%, #fff);
  --tl-drop-line: color-mix(in srgb, var(--ink) 30%, var(--paper));
  --tl-hover: color-mix(in srgb, var(--paper-deep) 50%, var(--paper));
  --tl-shadow: 0 1px 0 rgba(36, 28, 24, 0.06), 0 10px 24px rgba(36, 28, 24, 0.1);
  --tl-max: 84rem;
}

/* --- The page ----------------------------------------------------------- */

.tl {
  position: relative;
  z-index: var(--z-content);
  max-width: var(--tl-max);
  margin-inline: auto;
  padding: calc(var(--masthead-h) + var(--sp-m)) var(--gutter) var(--sp-section);
}
.tl p { max-width: none; }
/* Anything a tool hides stays hidden, whatever display its class sets. */
.tl [hidden] { display: none !important; }
.tl-pretty { text-wrap: pretty; }
.tl-balance { text-wrap: balance; }

.tl-cap {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.tl-cap--red { color: var(--kumkumam); }
.tl-cap--muted { color: var(--ink-muted); }
.tl-muted { color: var(--ink-muted); }
.tl-num { font-variant-numeric: tabular-nums; }
.tl-visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.tl-back {
  display: inline-block;
  margin-top: var(--sp-s);
  color: var(--kumkumam);
  text-decoration: none;
}
.tl-back:hover { color: var(--kumkumam-lit); }

/* The head of a tool: eyebrow and title on the left, the line on the right. */
.tl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-s) var(--sp-l);
  padding: var(--sp-l) 0 var(--sp-l);
}
.tl-head__title {
  margin: var(--sp-s) 0 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3.25rem, 6.4vw, 6.5rem);
  line-height: 1;
  letter-spacing: var(--ls-display);
  text-wrap: balance;
}
.tl-head__line {
  margin: 0;
  max-width: 32ch;
  font-size: clamp(1.125rem, 1.4vw, 1.25rem);
  line-height: 1.5;
  color: var(--ink-muted);
  text-wrap: pretty;
}

/* --- Controls: the site's button and control shapes --------------------- */

.tl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  min-height: 44px;
  padding: 0.95em 1.9em;
  border: 1px solid var(--kumkumam);
  border-radius: var(--radius-control);
  background: var(--kumkumam);
  color: var(--paper);
  font: inherit;
  font-size: var(--type-small);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--t-quick) var(--ease), border-color var(--t-quick) var(--ease), color var(--t-quick) var(--ease);
}
.tl-btn:hover { background: var(--kumkumam-lit); border-color: var(--kumkumam-lit); color: var(--paper); }
.tl-btn--line { background: transparent; color: var(--ink); border-color: var(--ink); }
.tl-btn--line:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.tl-btn[disabled], .tl-btn[aria-disabled="true"] { opacity: 0.45; cursor: default; pointer-events: none; }
.tl-btn--wide { width: 100%; }

.tl-link {
  display: inline-block;
  padding: 0.35rem 0;
  border: 0;
  background: none;
  color: var(--kumkumam);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}
.tl-link:hover { color: var(--kumkumam-lit); }

.tl-seg {
  display: flex;
  border: 1px solid var(--ink);
}
.tl-seg__btn {
  flex: 1 1 auto;
  min-height: 44px;
  padding: 0.6rem 1.1rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background-color var(--t-quick) var(--ease), color var(--t-quick) var(--ease);
}
.tl-seg__btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.tl-seg__btn:not([aria-pressed="true"]):hover { background: var(--tl-hover); }
.tl-seg__btn[disabled] { color: color-mix(in srgb, var(--ink) 40%, var(--paper)); cursor: default; background: transparent; }

.tl-toggle {
  min-height: 44px;
  padding: 0.6rem 1rem;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background-color var(--t-quick) var(--ease), color var(--t-quick) var(--ease);
}
.tl-toggle[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.tl :focus-visible, .tl:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.tl-select {
  width: 100%;
  min-height: 48px;
  padding: 0.8rem 1rem;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}
.tl-range { width: 100%; accent-color: var(--kumkumam); }

/* --- The upload bar ----------------------------------------------------- */

.tl-drop {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-s) var(--sp-m);
  padding: 1.375rem 1.5rem;
  border: 1.5px dashed var(--tl-drop-line);
  background: var(--paper-deep);
  transition: background-color var(--t-quick) var(--ease), border-color var(--t-quick) var(--ease);
}
.tl-drop__text { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.tl-drop__icon { flex: none; width: 34px; height: 34px; stroke: var(--kumkumam); }
.tl-drop__words { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tl-drop__title { font-family: var(--font-display); font-size: 1.375rem; line-height: 1.2; }
.tl-drop__sub { font-size: 0.875rem; color: var(--ink-muted); text-wrap: pretty; }
html.tl-dragging .tl-drop { background: var(--tl-hover); border-color: var(--kumkumam); }

/* The big empty drop (Compress & Convert before a file). */
.tl-bigdrop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.375rem;
  min-height: 26rem;
  padding: var(--sp-l) var(--sp-s);
  border: 1.5px dashed var(--tl-drop-line);
  background: var(--paper-deep);
  text-align: center;
  transition: background-color var(--t-quick) var(--ease), border-color var(--t-quick) var(--ease);
}
.tl-bigdrop:hover, html.tl-dragging .tl-bigdrop { background: var(--tl-hover); border-color: var(--kumkumam); }
.tl-bigdrop__title { margin: 0; font-family: var(--font-display); font-size: clamp(2.25rem, 4vw, 2.75rem); line-height: 1.05; }
.tl-bigdrop__sub { margin: 0; font-size: 1rem; color: var(--ink-muted); text-wrap: pretty; }
.tl-bigdrop__icon { width: 56px; height: 56px; stroke: var(--kumkumam); }

/* Messages: one line, in words. */
.tl-note {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink-muted);
  text-wrap: pretty;
}
.tl-alert {
  margin: 0;
  padding: 0.9rem 1rem;
  border-inline-start: 3px solid var(--kumkumam);
  background: var(--tl-card);
  font-size: 0.9375rem;
  line-height: 1.5;
  text-wrap: pretty;
}
.tl-alert[hidden] { display: none; }

.tl-rule { border-top: 1px solid var(--rule); }

/* The steps on the Crop Previewer: a big red number and a title. */
.tl-step { display: flex; align-items: baseline; gap: 0.875rem; margin: 0; }
.tl-step b { font-family: var(--font-display); font-weight: 400; font-size: 2.5rem; line-height: 1; color: var(--kumkumam); }
.tl-step span { font-family: var(--font-display); font-size: 1.875rem; line-height: 1.1; }

/* Small live indicator while a tool works. */
.tl-busy { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: var(--ink-muted); }
.tl-busy::before {
  content: "";
  width: 0.55rem; height: 0.55rem; border-radius: 50%;
  background: var(--kumkumam);
  animation: tl-pulse calc(var(--t-base) * 1.2) var(--ease) infinite;
}
.tl-busy[hidden] { display: none; }
@keyframes tl-pulse { 0%, 100% { opacity: 0.25; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1); } }

/* --- Index: /tools/ ----------------------------------------------------- */

.tx-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: var(--sp-xl) 6rem;
  align-items: end;
  padding: var(--sp-xl) 0 var(--sp-xl);
}
.tx-hero__copy { display: flex; flex-direction: column; gap: 2.25rem; }
.tx-eyebrow { display: flex; align-items: center; gap: 0.875rem; margin: 0; color: var(--kumkumam); }
.tx-eyebrow::before { content: ""; width: 40px; height: 1px; background: currentColor; }
.tx-hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  /* Capped at 7.9rem, the size it reaches at 1440 (Prateek's call, an
     exception to §12 for this one headline): the column stops growing at
     1440, so a larger headline broke after "Free," at 1920. */
  font-size: clamp(3.5rem, 8.8vw, 7.9rem);
  line-height: 1.04;
  letter-spacing: var(--ls-mega);
  text-wrap: balance;
}
/* Gambetta Italic, the real cut (above), never a slant the browser makes
   up: if the file is missing, this sets upright rather than faked. */
.tx-hero__title em { font-style: italic; font-synthesis-style: none; font-synthesis: none; color: var(--kumkumam); }
.tx-hero__line {
  margin: 0;
  max-width: 32ch;
  font-size: clamp(1.1875rem, 1.6vw, 1.4375rem);
  line-height: 1.5;
  color: var(--ink-muted);
  text-wrap: pretty;
}

.tx-toc__label { margin: 0 0 1.125rem; }
.tx-toc ol { list-style: none; margin: 0; padding: 0; }
.tx-toc li { margin: 0; }
.tx-toc a {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 1rem;
  padding: 1.375rem 0;
  border-top: 1px solid var(--rule);
  color: var(--ink);
  text-decoration: none;
  transition: color var(--t-quick) var(--ease);
}
.tx-toc li:last-child a { border-bottom: 1px solid var(--rule); }
.tx-toc a:hover { color: var(--kumkumam); }
.tx-toc__n { font-size: 0.8125rem; letter-spacing: 0.16em; color: var(--kumkumam); }
.tx-toc__name { font-family: var(--font-display); font-size: 1.75rem; line-height: 1.1; }
.tx-toc__arr { display: inline-block; transition: transform var(--t-quick) var(--ease); }
.tx-toc a:hover .tx-toc__arr { transform: translateX(8px); }

/* The tiles: two columns, the second dropped, as the home grid staggers. */
.tx-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 2.5rem;
  row-gap: 4.5rem;
  padding-bottom: var(--sp-xl);
}
.tx-tiles > .tx-tile:nth-child(even) { margin-top: 11.25rem; }
.tx-tile {
  display: flex;
  flex-direction: column;
  color: var(--ink);
  text-decoration: none;
  scroll-margin-top: calc(var(--masthead-h) + 1.5rem);
}
.tx-tile:hover { color: var(--ink); }
.tx-tile:focus-visible { outline: 2px solid var(--kumkumam); outline-offset: 6px; }
.tx-art { position: relative; overflow: hidden; aspect-ratio: 5 / 4; background: var(--paper-deep); }
.tx-body {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 1.5rem;
  row-gap: 0.625rem;
  padding: 1.875rem 2rem 2rem;
}
/* The wash: kumkumam bleeds in from the left, as on the home cards. */
.tx-body::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--kumkumam);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-slow) var(--ease);
}
.tx-body > * { position: relative; transition: color calc(var(--t-quick) * 0.5) var(--ease); }
.tx-n { grid-row: 1 / span 3; font-family: var(--font-display); font-size: 2.75rem; line-height: 1; color: var(--kumkumam); }
.tx-name { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(2rem, 2.8vw, 2.5rem); line-height: 1.05; letter-spacing: -0.015em; text-wrap: balance; }
.tx-desc { margin: 0; max-width: 38ch; font-size: 1.0625rem; line-height: 1.55; color: var(--ink-muted); text-wrap: pretty; }
.tx-open { padding-top: 0.5rem; color: var(--kumkumam); }
.tx-go { display: inline-block; transition: transform var(--t-quick) var(--ease); }

.tx-tile:focus-visible .tx-body::before { transform: scaleX(1); }
.tx-tile:focus-visible .tx-body > *, .tx-tile:focus-visible .tx-body > * * { color: var(--paper); }
@media (hover: hover) {
  .tx-tile:hover .tx-body::before { transform: scaleX(1); }
  .tx-tile:hover .tx-body > *, .tx-tile:hover .tx-body > * * { color: var(--paper); }
  .tx-tile:hover .tx-go { transform: translateX(10px); }
}

/* Each cover moves on hover, transform and opacity only. Going in runs long
   and soft; coming out runs quicker, so nothing lingers. */

/* 01 the weigh-in: the number rolls like an odometer, the bar settles. */
.tx-weigh { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 1.75rem; padding: 0 14%; }
.tx-window { height: 8.25rem; overflow: hidden; }
.tx-roll { display: flex; flex-direction: column; font-family: var(--font-display); font-size: 6.5rem; line-height: 8.25rem; color: var(--kumkumam); letter-spacing: -0.03em; white-space: nowrap; transition: transform var(--t-quick) var(--ease); }
.tx-scale { display: flex; flex-direction: column; gap: 0.5rem; }
.tx-scale__label { display: flex; justify-content: space-between; font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-muted); }
.tx-scale__label--red { color: var(--kumkumam); }
.tx-bar { height: 12px; background: var(--ink); }
.tx-bar--after { background: var(--kumkumam); transform-origin: left; transform: scaleX(0.42); transition: transform var(--t-quick) var(--ease); }
.tx-ruler { display: flex; justify-content: space-between; align-items: flex-start; height: 10px; margin-top: 2px; opacity: 0.35; transition: opacity var(--t-quick) var(--ease); }
.tx-ruler span { width: 1px; height: 5px; background: var(--ink); }
.tx-ruler span:nth-child(6n + 1) { height: 10px; }

/* 02 the swatch book: chips fan out one after another, then settle. */
.tx-chip { position: absolute; left: calc(50% - 56px); top: calc(50% - 84px); width: 112px; background: var(--tl-card); box-shadow: 0 1px 0 rgba(36,28,24,.06), 0 14px 30px rgba(36,28,24,.14); transform-origin: 50% 150%; transform: rotate(var(--r)); transition: transform var(--t-quick) var(--ease); }
/* A block: as an inline span its height was ignored and the chips showed
   no colour at all (fixed November 2026). */
.tx-chip__top { display: block; height: 150px; transform-origin: bottom; transition: transform var(--t-quick) var(--ease); }
.tx-chip__words { display: flex; flex-direction: column; gap: 2px; padding: 0.625rem 0.75rem 0.75rem; }
.tx-chip__name { font-family: var(--font-display); font-size: 0.9375rem; color: var(--ink); }
.tx-chip__hex { font-size: 0.625rem; letter-spacing: 0.12em; color: var(--ink-muted); font-variant-numeric: tabular-nums; }

/* 03 the proof sheet: a ripple runs across, then each verdict is stamped. */
.tx-sheet { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 9%; }
.tx-cells { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; width: 100%; max-width: 440px; }
.tx-cell { position: relative; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 1.875rem; line-height: 1; }
.tx-cell--same { background: repeating-linear-gradient(45deg, transparent 0 5px, color-mix(in srgb, var(--ink) 12%, var(--paper-deep)) 5px 6px); }
.tx-stamp { position: absolute; right: 5px; bottom: 5px; padding: 2px 4px; border: 1.2px solid currentColor; font-family: var(--font-body); font-size: 0.5rem; font-weight: 700; letter-spacing: 0.1em; opacity: 0.5; transform: rotate(-8deg) scale(0.9); transition: opacity var(--t-quick) var(--ease); }

/* 04 the light table: sunrise, the hills drift apart, the frames slide. */
.tx-table { position: absolute; inset: 0; background: radial-gradient(ellipse 70% 60% at 50% 50%, var(--tl-card) 0%, var(--paper) 70%); }
.tx-photo-wrap { position: absolute; left: 50%; top: 50%; width: 64%; aspect-ratio: 16 / 10; transform: translate(-50%, -50%); }
.tx-photo { position: absolute; inset: 0; overflow: hidden; background: #C9B49A; box-shadow: 0 18px 40px rgba(36,28,24,.16); }
.tx-photo__in { position: absolute; inset: 0; transition: transform var(--t-quick) var(--ease); }
.tx-sky { position: absolute; left: 0; right: 0; top: 0; height: 58%; background: #E7C9A9; }
.tx-sun { position: absolute; left: 62%; top: 20%; width: 15%; aspect-ratio: 1; border-radius: 50%; background: var(--kumkumam-lit); transform: translateY(40%); transition: transform var(--t-quick) var(--ease); }
.tx-hill-back { position: absolute; left: -10%; right: 30%; bottom: 0; height: 52%; background: #6E5A48; border-radius: 50% 50% 0 0; transition: transform var(--t-quick) var(--ease); }
.tx-hill-front { position: absolute; left: 35%; right: -15%; bottom: 0; height: 40%; background: #3D3128; border-radius: 50% 50% 0 0; transition: transform var(--t-quick) var(--ease); }
.tx-crop { position: absolute; box-sizing: border-box; transition: transform var(--t-quick) var(--ease); }
.tx-crop--a { left: 6%; top: -12%; width: 45%; height: 124%; border: 1.5px solid var(--kumkumam); box-shadow: 0 0 0 999px rgba(244,238,226,.42); }
.tx-crop--b { left: 34%; top: 0; width: 62.5%; height: 100%; border: 1.5px dashed var(--ink); }
.tx-crop__label { position: absolute; white-space: nowrap; font-size: 0.625rem; font-weight: 600; letter-spacing: 0.16em; }
.tx-crop--a .tx-crop__label { left: -1px; top: 0; transform: translateY(-100%); padding-bottom: 6px; color: var(--kumkumam); }
.tx-crop--b .tx-crop__label { right: -1px; bottom: 0; transform: translateY(100%); padding-top: 6px; color: var(--ink); }

@media (hover: hover) {
  .tx-tile:hover .tx-roll { transform: translateY(-50%); transition: transform calc(var(--t-base) * 1.1) var(--ease) 80ms; }
  .tx-tile:hover .tx-bar--after { transform: scaleX(0.14); transition: transform var(--t-slow) cubic-bezier(.34, 1.32, .5, 1); }
  .tx-tile:hover .tx-ruler { opacity: 0.8; }
  .tx-tile:hover .tx-chip { transform: rotate(calc(var(--r) * 1.6)) translateY(-18px); transition: transform calc(var(--t-base) * 1.2) cubic-bezier(.34, 1.25, .5, 1) calc(var(--i) * 55ms); }
  .tx-tile:hover .tx-chip__top { transform: scaleY(1.08); transition-duration: calc(var(--t-base) * 1.1); }
  .tx-tile:hover .tx-cell { animation: tx-ripple calc(var(--t-base) * 0.8) var(--ease) both; animation-delay: calc(var(--i) * 45ms); }
  .tx-tile:hover .tx-stamp { animation: tx-stamp calc(var(--t-base) * 0.55) cubic-bezier(.34, 1.56, .64, 1) both; animation-delay: calc(var(--i) * 45ms + 260ms); }
  .tx-tile:hover .tx-photo__in { transform: scale(1.05); transition-duration: calc(var(--t-base) * 1.6); }
  .tx-tile:hover .tx-sun { transform: translateY(-35%); transition-duration: calc(var(--t-base) * 1.8); }
  .tx-tile:hover .tx-hill-back { transform: translateX(-5%); transition-duration: calc(var(--t-base) * 1.6); }
  .tx-tile:hover .tx-hill-front { transform: translateX(6%); transition-duration: calc(var(--t-base) * 1.6); }
  .tx-tile:hover .tx-crop--a { transform: translateX(64%); transition: transform calc(var(--t-base) * 1.2) cubic-bezier(.34, 1.2, .5, 1) 100ms; }
  .tx-tile:hover .tx-crop--b { transform: translateX(-30%); transition: transform calc(var(--t-base) * 1.2) cubic-bezier(.34, 1.2, .5, 1) 220ms; }
}
@keyframes tx-ripple { 0% { transform: scale(1); } 35% { transform: scale(0.88); } 100% { transform: scale(1); } }
@keyframes tx-stamp { 0% { opacity: 0; transform: rotate(-24deg) scale(2.1); } 60% { opacity: 1; } 100% { opacity: 1; transform: rotate(-8deg) scale(1); } }

.tx-credits {
  max-width: 62ch;
  margin: 0;
  padding-top: var(--sp-m);
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--ink-muted);
  text-wrap: pretty;
}
.tx-credits a { color: var(--ink-muted); }

@media (max-width: 56rem) {
  .tx-hero { grid-template-columns: minmax(0, 1fr); padding: var(--sp-l) 0; gap: var(--sp-l); }
  .tx-tiles { grid-template-columns: minmax(0, 1fr); row-gap: 3.5rem; }
  .tx-tiles > .tx-tile:nth-child(even) { margin-top: 0; }
  .tx-body { padding: 1.5rem 1.25rem 1.625rem; column-gap: 1rem; }
  .tx-n { font-size: 2.25rem; }
  .tx-roll { font-size: clamp(4rem, 18vw, 6.5rem); }
}
@media (max-width: 26rem) {
  .tx-chip { width: 92px; left: calc(50% - 46px); top: calc(50% - 72px); }
  .tx-chip__top { height: 118px; }
  .tx-cell { font-size: 1.375rem; }
}

/* --- Shared tool layouts ------------------------------------------------ */

.tl-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}
.tl-stack { display: flex; flex-direction: column; gap: var(--sp-s); min-width: 0; }
.tl-stack--l { gap: 2.25rem; }
.tl-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 1rem; }
.tl-row--center { align-items: center; }
.tl-buttons { display: flex; flex-wrap: wrap; gap: 0.625rem; }

/* --- 01 Compress & Convert ---------------------------------------------- */

.cc-presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
.cc-preset {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 1.25rem 1.375rem;
  border: 1px solid var(--rule);
  background: var(--tl-card);
  color: var(--ink);
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition: border-color var(--t-quick) var(--ease), transform var(--t-quick) var(--ease), box-shadow var(--t-quick) var(--ease);
}
.cc-preset:hover { border-color: var(--kumkumam); transform: translateY(-3px); box-shadow: 0 12px 24px rgba(36,28,24,.08); }
.cc-preset__pair { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.15; }
.cc-preset__arrow { color: var(--kumkumam); }
.cc-preset__why { font-size: 0.9375rem; color: var(--ink-muted); }

.cc-compare { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface); }
.cc-compare img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: contain; }
.cc-compare__after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--wipe, 50%)); }
.cc-compare__line { position: absolute; top: 0; bottom: 0; left: var(--wipe, 50%); width: 2px; margin-left: -1px; background: var(--paper); pointer-events: none; box-shadow: 0 0 0 1px rgba(36,28,24,.12); }
.cc-compare__handle { position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--paper); display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(36,28,24,.25); }
.cc-compare__tag { position: absolute; top: 1rem; padding: 0.45rem 0.625rem; font-size: 0.75rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--paper); }
.cc-compare__tag--before { left: 1rem; background: rgba(36,28,24,.82); }
.cc-compare__tag--after { right: 1rem; background: var(--kumkumam); }
.cc-compare__range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none; background: transparent; }
.cc-compare:focus-within .cc-compare__handle { outline: 2px solid var(--kumkumam); outline-offset: 3px; }
.cc-compare__empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 2rem; text-align: center; color: var(--ink-muted); }

.cc-weigh { display: flex; flex-direction: column; gap: 1.125rem; padding: 2rem 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.cc-weigh__big { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 1rem; }
.cc-weigh__num { font-family: var(--font-display); font-size: clamp(3.75rem, 7vw, 6rem); line-height: 0.9; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.cc-weigh__from { font-size: 1.125rem; color: var(--ink-muted); }
.cc-track { position: relative; height: 12px; background: var(--ink); }
.cc-fill { position: absolute; left: 0; top: 0; bottom: 0; width: var(--fill, 50%); background: var(--kumkumam); transform-origin: left; transition: width var(--t-quick) var(--ease), background-color var(--t-quick) var(--ease); }
.cc-weigh.is-heavier .cc-fill { background: var(--ink-muted); }
.cc-ticks { display: flex; justify-content: space-between; align-items: flex-start; height: 12px; }
.cc-ticks span { width: 1px; height: 6px; background: var(--ink); opacity: 0.3; }
.cc-ticks span:nth-child(6n + 1) { height: 12px; opacity: 0.7; }
.cc-change { font-weight: 600; color: var(--kumkumam); }
.cc-weigh.is-heavier .cc-change { color: var(--ink); }

.cc-files { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.cc-files li { margin: 0; border-bottom: 1px solid var(--rule); }
.cc-file { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.25rem 1rem; width: 100%; min-height: 44px; padding: 0.75rem 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: 0.9375rem; text-align: start; cursor: pointer; }
.cc-file[aria-pressed="true"] .cc-file__name { color: var(--kumkumam); }
.cc-file__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-file__sizes { color: var(--ink-muted); font-variant-numeric: tabular-nums; }

/* --- 02 Palette Extractor ----------------------------------------------- */

/* The swatch book's column takes about 60%, and never less than 42rem: a
   little over the 41rem five chips need at 120px each, so it never lands
   exactly on the cut-off. The photo, a reference, takes the rest. Two
   columns only from 70rem, where the photo still gets about 265px (409 at
   1280, 464 from 1440); narrower, one column, the five chips under the
   full-width photo. */
.pe-stage { display: grid; grid-template-columns: minmax(0, 2fr) minmax(42rem, 3fr); gap: 3.5rem; align-items: start; }
.pe-photo { position: relative; overflow: hidden; background: var(--surface); }
.pe-photo img { display: block; width: 100%; height: auto; max-width: none; }
.pe-dot {
  position: absolute;
  width: 28px; height: 28px;
  margin: -14px 0 0 -14px;
  padding: 0; border: 0; background: none;
  cursor: pointer;
  /* The entrance only fills backwards, so once it ends the dot's own
     transform rules again (a held fill would freeze it). */
  animation: pe-lift calc(var(--t-base) * 0.6) var(--ease) backwards;
  animation-delay: calc(var(--i) * 90ms);
}
/* A finger-sized target round the small dot. */
.pe-dot::before { content: ""; position: absolute; inset: -8px; border-radius: 50%; }
.pe-dot__in {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 2.5px solid var(--tl-card);
  box-shadow: 0 2px 8px rgba(36,28,24,.35);
  font-size: 0.75rem; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums;
  transition: transform var(--t-quick) var(--ease), opacity var(--t-quick) var(--ease), box-shadow var(--t-quick) var(--ease);
}
/* Linked to its chip: the matching dot grows a little with a ring, the
   others dim. */
.pe-photo.has-hot .pe-dot__in { opacity: 0.4; }
.pe-photo.has-hot .pe-dot.is-hot .pe-dot__in { opacity: 1; transform: scale(1.25); box-shadow: 0 0 0 2px var(--ink), 0 2px 10px rgba(36,28,24,.4); }
.pe-dot:focus-visible { outline: none; }
.pe-dot:focus-visible .pe-dot__in { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }
.pe-doc { display: flex; flex-direction: column; gap: 1.5rem; padding: 2rem; border: 1px solid var(--rule); background: var(--tl-card); }
.pe-doc__name { font-family: var(--font-display); font-size: 1.625rem; overflow-wrap: anywhere; }
.pe-font { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.25rem 1rem; padding: 1rem 0; border-top: 1px solid var(--rule); }
.pe-font__name { font-size: 1.125rem; overflow-wrap: anywhere; }
.pe-font__where { font-size: 0.8125rem; color: var(--ink-muted); }
/* A PDF's pages (November 2026): one page in the photo, turned by the
   arrows, a sideways swipe (an up-and-down one still scrolls) or the arrow
   keys while the page has focus. */
.pe-photo.is-page { touch-action: pan-y; }
.pe-photo.is-page:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.pe-pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.pe-pager__btn { min-width: 3rem; padding-left: 0.875rem; padding-right: 0.875rem; font-size: 1.125rem; }
.pe-pager__count { font-size: 0.9375rem; font-weight: 500; }
.pe-font.is-here .pe-font__name { color: var(--ink); }
.pe-font__here { display: inline-block; margin-left: 0.625rem; padding: 0.125rem 0.5rem; font-size: 0.75rem; font-weight: 500; color: var(--paper); background: var(--ink); }
.pe-back { min-height: 2.75rem; }

/* The swatch book decides its own layout by its own width (a size
   container), not the screen's: five chips while each can have about 120px,
   a list of rows when they can't. */
.pe-book-box { container: pe-book / inline-size; }
.pe-book { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.875rem; padding-top: 0.875rem; }
@keyframes pe-lift { 0% { opacity: 0; transform: translateY(40px) rotate(-6deg) scale(0.9); } 100% { opacity: 1; transform: none; } }
.pe-chip {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 0;
  background: var(--tl-card);
  color: var(--ink);
  font: inherit;
  text-align: start;
  cursor: pointer;
  box-shadow: var(--tl-shadow);
  animation: pe-lift calc(var(--t-base) * 0.9) var(--ease) backwards;
  animation-delay: calc(var(--i) * 90ms);
  transition: transform var(--t-quick) var(--ease), box-shadow var(--t-quick) var(--ease);
}
.pe-chip:hover, .pe-chip.is-hot { transform: translateY(-6px); }
.pe-chip.is-hot { box-shadow: 0 0 0 2px var(--ink), var(--tl-shadow); }
.pe-chip[aria-pressed="true"] { transform: translateY(-14px); box-shadow: 0 1px 0 rgba(36,28,24,.06), 0 22px 40px rgba(36,28,24,.2); }
.pe-chip[aria-pressed="true"].is-hot { box-shadow: 0 0 0 2px var(--ink), 0 22px 40px rgba(36,28,24,.2); }
.pe-chip__color { display: block; width: 100%; aspect-ratio: 3 / 4; }
/* A swatch that would vanish on the paper (under 1.5:1 against it) gets a
   hairline edge. */
.pe-chip__color.is-light { box-shadow: inset 0 0 0 1px var(--rule); }
.pe-chip__words { display: flex; flex-direction: column; gap: 3px; padding: 0.75rem 0.75rem 0.875rem; min-width: 0; }
.pe-chip__n { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; color: var(--kumkumam); font-variant-numeric: tabular-nums; }
/* Names never break inside a word. */
.pe-chip__name { font-family: var(--font-display); font-size: 1.125rem; line-height: 1.15; overflow-wrap: normal; word-break: normal; hyphens: manual; }
.pe-chip__hex { font-size: 0.75rem; letter-spacing: 0.08em; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.pe-chip__share { font-size: 0.75rem; color: var(--ink-muted); }

/* Too narrow for five chips at about 120px each (5 x 120 + 4 gaps): a list,
   one row per color, a 56px swatch beside its words. The selected row gets
   the lift and the outline. Same text sizes. */
@container pe-book (max-width: 41rem) {
  .pe-book { grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }
  .pe-chip { flex-direction: row; align-items: center; gap: 1rem; padding: 0.5rem 1rem 0.5rem 0.5rem; }
  .pe-chip__color { width: 56px; height: 56px; aspect-ratio: auto; flex: none; }
  .pe-chip__words { padding: 0; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.875rem; }
  .pe-chip__n { flex: none; }
  .pe-chip__name { flex: 1 1 auto; }
  .pe-chip:hover, .pe-chip.is-hot { transform: translateY(-2px); }
  .pe-chip[aria-pressed="true"] { transform: translateY(-3px); box-shadow: 0 0 0 2px var(--kumkumam), 0 10px 22px rgba(36,28,24,.16); }
  .pe-chip[aria-pressed="true"].is-hot { box-shadow: 0 0 0 2px var(--ink), 0 10px 22px rgba(36,28,24,.16); }
}

.pe-goes { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; font-family: var(--font-display); font-size: 1.625rem; }
.pe-goes__sw { display: inline-block; width: 22px; height: 22px; box-shadow: inset 0 0 0 1px rgba(36,28,24,.15); }
.pe-tabs { display: flex; flex-wrap: wrap; gap: 0.375rem 1.625rem; }
.pe-tab { min-height: 44px; padding: 0.625rem 0; border: 0; border-bottom: 1.5px solid transparent; background: transparent; color: var(--ink-muted); cursor: pointer; transition: color var(--t-quick) var(--ease), border-color var(--t-quick) var(--ease); }
.pe-tab:hover { color: var(--ink); }
.pe-tab[aria-pressed="true"] { color: var(--kumkumam); border-color: var(--kumkumam); }
.pe-harmony { display: flex; flex-wrap: wrap; gap: 0.625rem; }
.pe-hchip { width: 6.5rem; background: var(--tl-card); box-shadow: 0 1px 0 rgba(36,28,24,.06), 0 8px 18px rgba(36,28,24,.08); animation: pe-lift calc(var(--t-base) * 0.7) var(--ease) backwards; animation-delay: calc(var(--i) * 60ms); }
.pe-hchip.is-own { outline: 1.5px solid var(--ink); outline-offset: 3px; }
.pe-hchip__color { display: block; height: 6rem; }
.pe-hchip__hex { display: block; padding: 0.5rem 0.625rem; font-size: 0.75rem; letter-spacing: 0.06em; font-variant-numeric: tabular-nums; }

/* --- 03 Contrast Grid --------------------------------------------------- */

.cg-chips { display: flex; flex-wrap: wrap; gap: 0.625rem; }
.cg-chipx { display: flex; align-items: center; gap: 0.625rem; padding: 0.5rem 0.375rem 0.5rem 0.5rem; background: var(--tl-card); border: 1px solid var(--rule); animation: cg-in calc(var(--t-base) * 0.6) var(--ease) both; }
.cg-chipx__sw { display: block; width: 36px; height: 36px; flex: none; box-shadow: inset 0 0 0 1px rgba(36,28,24,.15); transition: background-color calc(var(--t-base) * 0.8) var(--ease); }
.cg-chipx__fields { display: flex; flex-direction: column; gap: 2px; }
.cg-chipx__name { font-size: 0.75rem; color: var(--ink-muted); }
.cg-hex { width: 5.75rem; padding: 4px 0; border: 0; border-bottom: 1px solid var(--rule); background: transparent; color: var(--ink); font: inherit; font-size: 0.875rem; letter-spacing: 0.06em; text-transform: uppercase; }
.cg-hex[aria-invalid="true"] { border-bottom-color: var(--kumkumam); }
.cg-x { width: 44px; height: 44px; border: 0; background: transparent; color: var(--ink-muted); font-size: 1.25rem; line-height: 1; cursor: pointer; }
.cg-x:hover { color: var(--kumkumam); }
.cg-x[disabled] { opacity: 0.3; cursor: default; }
.cg-add { min-height: 52px; padding: 0.875rem 1.125rem; border: 1px dashed var(--kumkumam); background: transparent; color: var(--kumkumam); font: inherit; font-size: 0.875rem; font-weight: 500; letter-spacing: 0.06em; cursor: pointer; }
.cg-add:hover { background: var(--tl-hover); }
.cg-add[disabled] { opacity: 0.35; cursor: default; }

.cg-stage { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: 3rem; align-items: start; }
.cg-stage.is-wide { grid-template-columns: minmax(0, 1fr); }
.cg-stage.is-wide .cg-close { position: static; max-width: 40rem; }
.cg-wrap { overflow-x: auto; padding: 12px 12px 14px; margin: -6px -12px 0; }
.cg-grid { display: grid; gap: 0.625rem; align-items: stretch; }
.cg-corner { align-self: end; padding-bottom: 4px; font-size: 0.75rem; line-height: 1.4; color: var(--ink-muted); }
.cg-head { display: flex; flex-direction: column; gap: 6px; padding-bottom: 4px; min-width: 0; }
.cg-rowhead { display: flex; align-items: center; gap: 0.625rem; min-width: 0; }
.cg-label { font-size: 0.8125rem; font-weight: 500; overflow-wrap: anywhere; }
.cg-sw { display: block; width: 22px; height: 22px; flex: none; box-shadow: inset 0 0 0 1px rgba(36,28,24,.15); transition: background-color calc(var(--t-base) * 0.8) var(--ease) var(--d, 0ms); }
@keyframes cg-in { 0% { opacity: 0; transform: translateY(14px) scale(0.96); } 100% { opacity: 1; transform: none; } }
@keyframes cg-stamp { 0% { opacity: 0; transform: scale(1.9) rotate(-14deg); } 60% { opacity: 1; transform: scale(0.92) rotate(-4deg); } 100% { opacity: 1; transform: scale(1) rotate(-4deg); } }
.cg-cell {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: start;
  cursor: pointer;
  /* The cell's width, not the screen's, decides whether the ratio and the
     stamp share a line (below). */
  container-type: inline-size;
  container-name: cg-cell;
  animation: cg-in calc(var(--t-base) * 0.7) var(--ease) both;
  animation-delay: var(--d, 0ms);
  transition: transform var(--t-quick) var(--ease);
}
/* The card itself, and what dims: the cell's animation never touches it. */
.cg-cell__in {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  background: var(--tl-card);
  box-shadow: 0 1px 0 rgba(36,28,24,.06), 0 6px 16px rgba(36,28,24,.06);
  transition: opacity calc(var(--t-base) * 0.3) var(--ease), box-shadow var(--t-quick) var(--ease);
}
.cg-cell:hover { transform: translateY(-3px); }
.cg-cell:hover .cg-cell__in { box-shadow: 0 1px 0 rgba(36,28,24,.06), 0 14px 26px rgba(36,28,24,.12); }
.cg-cell[aria-pressed="true"], .cg-cell[aria-pressed="true"]:hover { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--kumkumam); }
.cg-grid.is-dimming .cg-cell.is-fail .cg-cell__in { opacity: 0.18; }
.cg-aa { display: flex; align-items: center; justify-content: center; height: 5.25rem; font-family: var(--font-display); font-size: 1.875rem; box-shadow: inset 0 0 0 1px rgba(36,28,24,.08); transition: background-color calc(var(--t-base) * 0.8) var(--ease) var(--d, 0ms), color calc(var(--t-base) * 0.8) var(--ease) var(--d, 0ms); }
.cg-meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px; padding: 0.5625rem 0.625rem; }
/* Too narrow for the ratio and the stamp side by side: the ratio on top, the
   stamp under it. Same text, same size. The widest pair ("14.48"
   and "AA Large") needs 139px with the padding and the tilt (measured); the
   stamp alone 82px, which the column's minimum (6.75rem) holds. */
@container cg-cell (max-width: 8.75rem) {
  .cg-meta { flex-direction: column; align-items: flex-start; gap: 6px; }
}
.cg-ratio { font-size: 0.875rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.cg-stamp { display: inline-block; padding: 3px 7px; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; transform: rotate(-4deg); }
.cg-grid .cg-stamp { animation: cg-stamp calc(var(--t-base) * 0.55) cubic-bezier(.34, 1.56, .64, 1) both; animation-delay: var(--sd, 380ms); }
.cg-grid.is-restamp .cg-stamp { animation-name: none; }
.cg-stamp--aaa { background: var(--kumkumam); color: var(--paper); border: 1.5px solid var(--kumkumam); }
.cg-stamp--aa { color: var(--kumkumam); border: 1.5px solid var(--kumkumam); }
.cg-stamp--large { color: var(--ink-muted); border: 1.5px solid var(--ink-muted); }
.cg-stamp--fail, .cg-stamp--same { color: var(--ink-muted); border: 1.5px dashed var(--tl-drop-line); }
.cg-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.875rem 2rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.cg-legend > div { display: flex; align-items: baseline; gap: 0.75rem; padding-top: 0.75rem; }
.cg-legend .cg-stamp { animation: none; }

.cg-close { position: sticky; top: calc(var(--masthead-h) + 1.5rem); display: flex; flex-direction: column; gap: 1.5rem; }
.cg-preview { display: flex; flex-direction: column; gap: 0.875rem; padding: 2rem 1.875rem; box-shadow: inset 0 0 0 1px rgba(36,28,24,.12); transition: background-color calc(var(--t-base) * 0.8) var(--ease) 120ms, color calc(var(--t-base) * 0.8) var(--ease) 120ms; }
.cg-preview__head { margin: 0; font-family: var(--font-display); font-size: 2.125rem; line-height: 1.1; }
.cg-preview__body { margin: 0; font-size: 1.0625rem; line-height: 1.55; }
.cg-big { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 0.875rem; }
.cg-big__num { font-family: var(--font-display); font-size: clamp(3.5rem, 6vw, 5.5rem); line-height: 0.9; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.cg-checks { list-style: none; margin: 0; padding: 0; }
.cg-check { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin: 0; padding: 0.8125rem 0; border-top: 1px solid var(--rule); }
.cg-check__what { display: flex; flex-direction: column; gap: 2px; }
.cg-check__label { font-size: 0.9375rem; font-weight: 500; }
.cg-check__need { font-size: 0.8125rem; color: var(--ink-muted); }
.cg-check__mark { font-size: 0.875rem; font-weight: 600; white-space: nowrap; }
.cg-check__mark.is-pass { color: var(--kumkumam); }
.cg-check__mark.is-fail { color: var(--ink-muted); }

/* --- 04 Crop Previewer -------------------------------------------------- */

.cp-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.25rem, 1fr)); gap: 0.75rem; }
@keyframes cp-lift { 0% { opacity: 0; transform: translateY(24px); } 100% { opacity: 1; transform: none; } }
.cp-tile {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 0;
  background: var(--tl-card);
  color: var(--ink);
  font: inherit;
  text-align: start;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(36,28,24,.06), 0 8px 20px rgba(36,28,24,.07);
  animation: cp-lift calc(var(--t-base) * 0.8) var(--ease) both;
  animation-delay: var(--d, 0ms);
  transition: transform var(--t-quick) var(--ease), box-shadow var(--t-quick) var(--ease);
}
.cp-tile:hover { transform: translateY(-4px); box-shadow: 0 1px 0 rgba(36,28,24,.06), 0 16px 30px rgba(36,28,24,.12); }
.cp-tile[aria-pressed="true"], .cp-tile[aria-pressed="true"]:hover { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--kumkumam); }
.cp-tile__well { height: 7rem; display: flex; align-items: center; justify-content: center; padding: 0.75rem; background: var(--paper-deep); }
.cp-tile__words { display: flex; flex-direction: column; gap: 3px; padding: 0.75rem 0.75rem 0.875rem; }
.cp-tile__name { font-family: var(--font-display); font-size: 1.0625rem; line-height: 1.15; }
.cp-tile__label { font-size: 0.75rem; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.cp-box { position: relative; overflow: hidden; display: block; max-width: 100%; max-height: 100%; box-shadow: 0 6px 18px rgba(36,28,24,.14); }
.cp-box__img { position: absolute; max-width: none; height: auto; transition: left var(--t-quick) var(--ease), top var(--t-quick) var(--ease), width var(--t-quick) var(--ease); }
.cp-dragging .cp-box__img, .cp-dragging .cp-frame { transition: none !important; }
.cp-box__dash { position: absolute; inset: 6px; border: 1.5px dashed var(--paper); }

.cp-stage { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 3rem; align-items: start; }
.cp-table { position: relative; overflow: hidden; width: 100%; margin-inline: auto; background: var(--surface); touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.cp-table.cp-dragging { cursor: grabbing; }
.cp-table img { display: block; width: 100%; height: 100%; max-width: none; pointer-events: none; }
.cp-frame { position: absolute; box-shadow: 0 0 0 2000px rgba(36,28,24,.55); outline: 1.5px solid rgba(244,238,226,.9); pointer-events: none; transition: left .75s cubic-bezier(.34,1.3,.64,1), top .75s cubic-bezier(.34,1.3,.64,1), width .75s cubic-bezier(.34,1.3,.64,1), height .75s cubic-bezier(.34,1.3,.64,1); }
.cp-mark { position: absolute; width: 18px; height: 18px; border: 0 solid var(--paper); }
.cp-mark--tl { left: -2px; top: -2px; border-left-width: 3px; border-top-width: 3px; }
.cp-mark--tr { right: -2px; top: -2px; border-right-width: 3px; border-top-width: 3px; }
.cp-mark--bl { left: -2px; bottom: -2px; border-left-width: 3px; border-bottom-width: 3px; }
.cp-mark--br { right: -2px; bottom: -2px; border-right-width: 3px; border-bottom-width: 3px; }
.cp-chip { display: inline-block; padding: 4px 8px; background: var(--ink); color: var(--paper); font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.08em; white-space: nowrap; }
.cp-frame .cp-chip { position: absolute; left: 10px; top: 10px; max-width: calc(100% - 20px); overflow: hidden; text-overflow: ellipsis; }
.cp-handle { position: absolute; right: -11px; bottom: -11px; width: 22px; height: 22px; background: var(--paper); border: 2px solid var(--kumkumam); box-sizing: border-box; }
.cp-table:focus-visible { outline: 2px solid var(--kumkumam); outline-offset: 3px; }

.cp-preview { position: sticky; top: calc(var(--masthead-h) + 1.5rem); display: flex; flex-direction: column; gap: 1.125rem; }
.cp-preview__well { height: 26.25rem; display: flex; align-items: center; justify-content: center; padding: 1rem; background: var(--paper-deep); }
.cp-ov { position: absolute; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.cp-ov--shade { background: rgba(36,28,24,.5); }
.cp-ov--grid { top: 0; bottom: 0; left: 3.125%; right: 3.125%; border-left: 1.5px dashed var(--paper); border-right: 1.5px dashed var(--paper); align-items: flex-end; padding-bottom: 12px; }
.cp-ov--avatar { border-radius: 50%; background: var(--paper); box-shadow: 0 0 0 4px var(--tl-card); align-items: flex-start; }
.cp-download { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem; padding: 1.5rem 1.625rem; background: var(--tl-card); border: 1px solid var(--rule); }

/* --- Narrow screens ----------------------------------------------------- */

@media (max-width: 64rem) {
  .cg-stage, .cp-stage { grid-template-columns: minmax(0, 1fr); }
  .cg-close, .cp-preview { position: static; }
}
@media (max-width: 70rem) {
  .pe-stage { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 56rem) {
  .tl-stage { grid-template-columns: minmax(0, 1fr); }
  .cc-presets { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 40rem) {
  .cg-legend { grid-template-columns: minmax(0, 1fr); }
  .tl-drop { padding: 1.125rem 1rem; }
  .tl-drop .tl-btn { width: 100%; }
  .cp-preview__well { height: 20rem; }
  .tl-step b { font-size: 2.125rem; }
  .tl-step span { font-size: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .tl *, .tl *::before, .tl *::after { animation: none !important; transition-duration: 1ms !important; transition-delay: 0ms !important; }
  html { scroll-behavior: auto; }
}

.tx-how { display: flex; flex-direction: column; gap: 1rem; padding-bottom: var(--sp-l); }
.tx-how h2 { margin: 0; }
/* Focus stays ink and sits outside a pressed tile's red ring. */
.cp-tile:focus-visible, .cg-cell:focus-visible, .pe-chip:focus-visible { outline: 2px solid var(--ink); outline-offset: 8px; }

/* Good to know: each tool's facts as plain text (formats, limits, privacy),
   so a reader, and Kuri, can find them on the page. */
.tl-facts { max-width: 62ch; margin-top: var(--sp-xl); padding-top: var(--sp-m); border-top: 1px solid var(--rule); }
.tl-facts h2 { margin: 0 0 1rem; }
.tl-facts ul { margin: 0; padding-left: 1.1em; }
.tl-facts li { margin: 0 0 0.6rem; font-size: 1rem; line-height: 1.55; color: var(--ink-muted); text-wrap: pretty; }

/* --- The conch loader (js/tools/loader.js, CLAUDE.md §18) ----------------
   In place of the result area: the area keeps its size, its own content is
   hidden while the loader shows, so nothing moves. */
.tl-loading { position: relative; }
.tl-loading > :not(.tl-loader) { visibility: hidden; }
.tl-loader {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 9rem;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-quick) var(--ease);
}
.tl-loader[hidden] { display: none; }
.tl-loader.is-on { opacity: 1; }
.tl-loader__conch { width: 4.25rem; height: auto; overflow: visible; transform-origin: 50% 55%; transition: transform var(--t-quick) var(--ease); }
.tl-loader__art { fill: var(--kumkumam); }
.tl-loader__ghost { fill: var(--kumkumam); opacity: 0.12; }
.tl-loader__mask {
  fill: none;
  stroke: #fff;                    /* mask luminance: white reveals */
  stroke-width: 32;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1000 1000;     /* the spine's pathLength is 1000 */
  stroke-dashoffset: -1002;        /* hidden: the dash waits past the tail */
  transition: stroke-dashoffset var(--t-quick) var(--ease);
}
/* No measurable progress: a slow draw to about two-thirds, then a gentle
   breath until the step ends. */
.tl-loader.is-waiting .tl-loader__mask { transition: stroke-dashoffset calc(var(--t-draw) * 1.6) cubic-bezier(0.2, 0.6, 0.3, 1); }
.tl-loader.is-waiting .tl-loader__conch { animation: tl-breathe calc(var(--t-base) * 2.4) ease-in-out infinite; }
@keyframes tl-breathe { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.965); opacity: 0.8; } }
/* Finished: the curl completes and settles. */
.tl-loader.is-done .tl-loader__conch { transform: scale(1.03); }
.tl-loader__status { margin: 0; max-width: 30ch; font-size: 0.875rem; line-height: 1.45; color: var(--ink-muted); text-align: center; text-wrap: balance; }
.tl-loader__pct { display: none; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) {
  .tl-loader__mask { stroke-dashoffset: 0 !important; transition: none !important; }
  .tl-loader__conch, .tl-loader.is-waiting .tl-loader__conch { animation: none !important; transform: none !important; }
  .tl-loader__pct { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
  .pe-photo.has-hot .pe-dot.is-hot .pe-dot__in, .pe-chip.is-hot, .pe-chip:hover { transform: none; }
}

/* ===== css/masthead.css ===== */
/* ==========================================================================
   MASTHEAD — site-wide, minimal.

   Built once because project pages need navigation, and navigation that only
   exists on some pages is worse than navigation that is quietly consistent.

   Present from the top of the page. An earlier version slid in only after the
   hero had scrolled past, which left the first screen with no way to navigate
   at all — fine as an effect, wrong as a site.

   COLOUR IS STATED PER CONTROL, NOT PER ELEMENT TYPE. <summary> is not an
   <a>, so a rule written for links skips it and it falls back to the UA's
   default. Every rule below names all three — mark, link and summary — in
   both the resting and inverted states.
   ========================================================================== */

.masthead {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: var(--z-nav);

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-m);
  /* From the token, not a literal: --masthead-h is derived from this value so
     the hero can reserve exactly the height the bar occupies. Changing the
     padding here without changing the token would put the two out of step. */
  padding: var(--masthead-pad) var(--gutter);

  /* OPAQUE, NO BLUR (October 2026). It was 88% paper over a 10px
     backdrop blur, which the GPU re-blurs from the page under it on every
     frame of a scroll, and the progress line rides on it. */
  background: var(--paper);
  border-block-end: 1px solid var(--rule);

  transition: background-color var(--t-quick) var(--ease),
              border-color var(--t-quick) var(--ease),
              color var(--t-quick) var(--ease);
}


/* --- Scroll progress ------------------------------------------------------
   A kumkumam bar on the masthead's bottom edge that fills across the width of
   the page as the document scrolls. It sits ON the rule rather than under it,
   so the bar is not a second horizontal line — it is the rule, being drawn.

   masthead.js writes the fill's transform from the scroll offset, on every
   browser (no CSS scroll timeline: on an iPhone it glitched at every touch).
   Without the script the resting state is an empty track rather than a full
   one.

   Kept under prefers-reduced-motion. It is not motion for its own sake: it
   reports where you are, and it only ever moves because you moved the page. */

.masthead__progress {
  position: absolute;
  inset-inline: 0;
  /* Over the border, not above it. */
  inset-block-end: -1px;
  height: 3px;
  overflow: hidden;
  pointer-events: none;
}

/* TRANSFORM ONLY, ON ITS OWN LAYER. Full width, scaled from the left;
   masthead.js writes this element's transform and nothing else. */
.masthead__progress-fill {
  display: block;
  height: 100%;
  background: var(--kumkumam);
  transform-origin: left center;
  transform: scaleX(0);
  will-change: transform;
}

/* On the inverted field a kumkumam bar on a kumkumam ground has no edge, so
   the fill takes paper there and the track keeps the border's own tint. */
.masthead.is-over-invert .masthead__progress-fill { background: var(--paper); }


/* --- Mark ----------------------------------------------------------------- */

.masthead__mark {
  display: inline-flex;
  /* CENTRE, NOT BASELINE. With the conch in the box, baseline alignment sized
     the line box off the artwork and left the wordmark's optical centre 4.5px
     above WORK and ABOUT — measured, not guessed. The nav items are centred in
     the bar, so the name has to be centred in the mark to meet them. */
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  text-decoration: none;
}

/* Sized off the wordmark's own cap height rather than a fixed px, so the two
   stay in proportion as the name scales. */
.masthead__conch {
  width: auto;
  height: 2.1em;
  aspect-ratio: 666 / 908;
  fill: var(--kumkumam);
  flex: none;
}

.masthead.is-over-invert .masthead__conch { fill: var(--paper); }

.masthead__mark-name {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1.55vw, 1.5rem);
  letter-spacing: -0.01em;
}


/* --- Nav ------------------------------------------------------------------ */

.masthead__nav {
  display: flex;
  align-items: center;
  gap: clamp(var(--sp-s), 2.5vw, var(--sp-l));
}

.masthead__link,
.menu__summary {
  color: var(--kumkumam);
  font-size: var(--type-micro);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  text-decoration: none;
  padding-block: 0.35rem;
  border-block-end: 1px solid transparent;
  transition: color var(--t-quick) var(--ease),
              border-color var(--t-quick) var(--ease);
}

.masthead__link:hover,
.menu__summary:hover {
  color: var(--kumkumam-lit);
  border-block-end-color: var(--kumkumam-lit);
}

.masthead__mark:focus-visible,
.masthead__link:focus-visible,
.menu__summary:focus-visible {
  outline: 2px solid var(--kumkumam);
  outline-offset: 4px;
}


/* --- The Work menu -------------------------------------------------------
   Six projects would crowd the bar, so they live one level down. <details>
   gives open/close, keyboard operation and a correct expanded state with no
   script at all, and degrades to a labelled list of links if CSS fails. */

.menu { position: relative; }

.menu__summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.menu__summary::-webkit-details-marker { display: none; }

/* Caret drawn in CSS rather than set as a glyph, so it inherits colour and
   rotates with the open state. */
.menu__summary::after {
  content: '';
  width: 0.36em;
  height: 0.36em;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg) translateY(-0.1em);
  transition: transform var(--t-menu-out) var(--ease);
}

.menu[open]:not(.is-closing) .menu__summary::after {
  transform: rotate(-135deg) translateY(-0.1em);
  transition-duration: var(--t-menu-in);
}

/* OPEN AND CLOSE ARE ANIMATED (November 2026): the panel fades in and drops
   a few pixels into place, and closes in reverse, a little quicker. Transform
   and opacity only. masthead.js drives it: a reader's open starts from
   .is-from, and a close plays .is-closing before <details> really shuts, so a
   reopen mid-close just drops the class and reverses from where it is. An
   open by anything else (the menu morph's reverse) has no .is-from and shows
   at once, since an element that was display: none has nothing to
   transition from. */
.menu {
  --t-menu-in: calc(var(--t-base) * 0.25);
  --t-menu-out: calc(var(--t-base) * 0.18);
}

/* Absolutely positioned content escapes the hiding a browser applies to a
   closed <details>, so it has to be hidden explicitly — without this the
   panel rendered over the hero while the menu was shut. */
.menu:not([open]) .menu__list { display: none; }

.menu__list {
  position: absolute;
  inset-inline-end: 0;
  inset-block-start: calc(100% + 0.7rem);
  /* ABOVE THE PROGRESS BAR. Both are absolutely positioned inside the
     masthead with no z-index of their own, so paint order fell to DOM order
     and the bar — which comes later — drew its kumkumam rule straight across
     the top of the open panel. One local step is enough: .masthead is a
     stacking context, so this cannot escape the bar. */
  z-index: 1;
  min-width: 15rem;
  margin: 0;
  padding: var(--sp-xs) 0;
  list-style: none;
  background: var(--paper);
  border: 1px solid var(--rule);
  box-shadow: 0 12px 30px -18px rgba(36, 28, 24, 0.4);
  transition: opacity var(--t-menu-in) var(--ease), transform var(--t-menu-in) var(--ease);
}

.menu.is-from .menu__list {
  opacity: 0;
  transform: translateY(-6px);
  transition: none;
}

.menu.is-closing .menu__list {
  opacity: 0;
  transform: translateY(-6px);
  transition-duration: var(--t-menu-out);
  pointer-events: none;
}

.menu__list li { margin: 0; }

.menu__list a {
  display: block;
  padding: 0.5rem var(--sp-s);
  color: var(--ink);
  font-size: var(--type-micro);
  letter-spacing: 0.1em;
  text-decoration: none;
  white-space: nowrap;
}

.menu__list a:hover {
  background: var(--kumkumam);
  color: var(--paper);
}

.menu__list a:focus-visible {
  outline: 2px solid var(--kumkumam);
  outline-offset: -2px;
}

/* The panel used to end with an "All work" row, ruled off from the six
   projects. It has gone: the panel already IS all the work, so the row
   restated its own contents, and the summary above it is the same anchor. */


/* --- Over the inverted field ---------------------------------------------
   A cream stripe across the inversion would cut it in half, so the bar takes
   the field's colours while it is over it. The panel keeps paper ground —
   a kumkumam panel on a kumkumam field would have no edge. */

.masthead.is-over-invert {
  background: var(--kumkumam);
  border-block-end-color: color-mix(in srgb, var(--paper) 28%, var(--kumkumam));
}

.masthead.is-over-invert .masthead__mark,
.masthead.is-over-invert .masthead__link,
.masthead.is-over-invert .menu__summary {
  color: var(--paper);
}

.masthead.is-over-invert .masthead__link:hover,
.masthead.is-over-invert .menu__summary:hover {
  color: var(--paper);
  border-block-end-color: var(--paper);
}

.masthead.is-over-invert .masthead__mark:focus-visible,
.masthead.is-over-invert .masthead__link:focus-visible,
.masthead.is-over-invert .menu__summary:focus-visible {
  outline-color: var(--paper);
}


@media (max-width: 46rem) {
  .menu__list {
    min-width: min(17rem, calc(100vw - 2 * var(--gutter)));
  }
}

/* ON THE NARROWEST PHONES the panel hangs from the bar, not from Work
   (November 2026). Right-aligned to Work, its 17rem ran past the screen's
   left edge below about 370px (43px at 320), cutting off the first letters
   of every item. The bar is position: fixed, so with .menu static the panel
   is placed in the bar: its right edge on the gutter, under the bar. */
@media (max-width: 26.99rem) {
  .menu { position: static; }
  .menu__list { inset-inline-end: var(--gutter); }
}

/* --- Tools (November 2026) -----------------------------------------------
   A plain link after About (Work, About, Tools, Ask Kuri: Prateek's order,
   November 19 2026; it sat between Work and About, as in the tools mockup).
   The bar holds the wordmark, Work, About and Tools from 24rem (384px; it
   needs about 377). Below that, Tools is the first row of the Work menu,
   above Ask Kuri, and the bar keeps Work and About. */
.menu__tools { display: none; }
@media (max-width: 23.99rem) {
  .masthead__link--tools { display: none; }
  .menu__tools { display: block; }
  .menu__tools a { color: var(--kumkumam); }
  /* Ask Kuri's row, under it, carries the divider; without Kuri, Tools does. */
  .masthead:not(.has-kuri) .menu__tools { border-block-end: 1px solid var(--rule); margin-block-end: 0.35rem; }
}
.masthead__link[aria-current] { border-block-end-color: currentColor; }

@media (prefers-reduced-motion: reduce) {
  .masthead,
  .masthead__link,
  .menu__summary,
  .menu__summary::after,
  .menu__list { transition: none; }
}

/* ===== css/footer.css ===== */
/* ==========================================================================
   SITE FOOTER — shared by the homepage and every project page.

   Built because the project pages needed a consistent ending and because
   CLAUDE.md §9's footer byline had never actually been placed anywhere. One
   component now does both jobs, so the two cannot drift.

   WHAT IT DOES NOT CONTAIN: contact links. On the homepage they already sit
   in the About field directly above this, and repeating them one block later
   would read as a stutter rather than as a second chance. On a project page
   they are one click away through the About link in the masthead. The footer
   is the end of the page, not a second navigation.

   The back-to-top conch lives here rather than inside About, so there is
   exactly one of it on the homepage and the same one on every other page. It
   is the same mark, same valampiri flip, same paper-on-whatever treatment —
   only the ground changes, which is the point.
   ========================================================================== */

.site-footer {
  padding-block: clamp(var(--sp-xl), 10vh, var(--sp-2xl));
  padding-inline: var(--gutter);
  text-align: center;
}

/* On the homepage the footer follows the inverted About field, so it takes
   that field's colours and reads as its last line rather than as a cream
   strip cutting the arrival in half. */
/* Read off the footer that is actually on the page, rather than set per page
   in the markup. A page that switches footer variant later takes the right
   overscroll tail with it and cannot be forgotten. Browsers without :has()
   keep the --paper default, which is the behaviour that shipped before. */
:root:has(.site-footer--inverted) { --overscroll-tail: var(--kumkumam); }

/* No 100vw bleed: the footer is a child of <body>, which is already the full
   viewport width, so 100vw only overhung it by the scrollbar's width (see
   about.css). As a plain block it is exactly full width. */
.site-footer--inverted {
  background: var(--kumkumam);
  color: var(--paper);
  /* The field above already carries the top of this block; without pulling
     up, the two would show a seam where their paddings meet. */
  margin-block-start: 0;
  padding-block-start: 0;
}


/* --- Back to top ---------------------------------------------------------
   A real link with a real accessible name, not a scripted click target: it
   takes keyboard focus in order and works with no JavaScript. The SVG stays
   aria-hidden, because the name belongs to the anchor — an anchor whose only
   content is decorative artwork announces as an unlabelled link. */

.site-footer__top {
  display: block;
  width: max-content;
  margin-inline: auto;
  /* The anchor carries the hit area, the SVG only the artwork. A bare 64px
     stroke is a thin thing to ask a thumb to find. */
  padding: var(--sp-xs);
  -webkit-tap-highlight-color: transparent;
}

.site-footer__conch {
  display: block;
  width: clamp(64px, min(9vh, 8vw), 104px);
  aspect-ratio: 666 / 908;
  height: auto;
  max-width: none;
  /* Paper on the inverted ground, kumkumam on paper. Set per context below
     rather than here, so the same markup serves both. */
  opacity: 0.62;
  transition: opacity var(--t-quick) var(--ease),
              transform var(--t-slow) var(--ease);
}

.site-footer--inverted .site-footer__conch { fill: var(--paper); }
.site-footer:not(.site-footer--inverted) .site-footer__conch { fill: var(--kumkumam); }

/* Coming up to full strength is the whole hover state. It must not go to
   --kumkumam-lit on the inverted ground: that is a near-neighbour of the
   field and would make the mark disappear rather than respond. */
.site-footer__top:hover .site-footer__conch,
.site-footer__top:focus-visible .site-footer__conch {
  opacity: 1;
  transform: translateY(-3px);
}

.site-footer--inverted .site-footer__top:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: 2px;
}

.site-footer:not(.site-footer--inverted) .site-footer__top:focus-visible {
  outline: 2px solid var(--kumkumam);
  outline-offset: 2px;
}


/* --- Byline --------------------------------------------------------------
   §9, verbatim. Quiet: it is a signature, not a statement. */

.site-footer__byline {
  margin: var(--sp-l) auto 0;
  max-width: none;
  font-size: var(--type-small);
  letter-spacing: 0.06em;
  line-height: var(--lh-snug);
}

.site-footer--inverted .site-footer__byline { color: var(--paper); opacity: 0.82; }
.site-footer:not(.site-footer--inverted) .site-footer__byline { color: var(--ink-muted); }


@media (prefers-reduced-motion: reduce) {
  .site-footer__conch { transition: none; }
  .site-footer__top:hover .site-footer__conch,
  .site-footer__top:focus-visible .site-footer__conch { transform: none; }
}


/* --- The draw ------------------------------------------------------------
   The same masked reveal as the hero: conch-stroke swept along the spine by
   stroke-dashoffset, uncovering the tapered outline underneath. The taper is
   the artwork, not something CSS reconstructs.

   RESOLVED BY DEFAULT — offset 0, fully drawn. js/footer-conch.js adds
   .is-armed to wind it back and .is-drawing to release it, so every failure
   path (no script, no IntersectionObserver, reduced motion) lands on a
   finished conch rather than an empty frame.

   Stroke properties are set on the <use>, not the referenced path: they are
   inherited properties, so they reach the cloned geometry inside. Width 32
   clears the outline's measured 21-unit waist with margin, exactly as in the
   hero — a narrower mask clips the artwork at its widest point. */

.site-footer__mask {
  fill: none;
  stroke: #fff;                 /* mask luminance: white reveals */
  stroke-width: 32;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1000 1000;  /* pathLength is normalised to 1000 */
  stroke-dashoffset: 0;
}

.site-footer.is-armed .site-footer__mask { stroke-dashoffset: 1000; }

/* Faster than the hero's draw, deliberately. --t-draw is ~2.7s, which is
   right for the opening moment of the site but too slow for a mark you meet
   at the bottom of a page you are already leaving. --t-slow is ~1.3s. */
.site-footer.is-drawing .site-footer__mask {
  animation: footer-conch-draw var(--t-slow) linear forwards;
}

@keyframes footer-conch-draw {
  from { stroke-dashoffset: 1000; }
  to   { stroke-dashoffset: 0; }
}

/* Belt and braces: the script already refuses to arm under the preference,
   but if the class arrived by any other route the sequence is neutralised
   here rather than merely sped up. */
@media (prefers-reduced-motion: reduce) {
  .site-footer.is-armed .site-footer__mask,
  .site-footer.is-drawing .site-footer__mask {
    animation: none;
    stroke-dashoffset: 0;
  }
}

/* ===== css/cursor.css ===== */
/* ==========================================================================
   CUSTOM CURSOR — CLAUDE.md §5 (audited and rebuilt in Phase 5).

   The mark is conch-outline.svg's own tapered artwork (js/cursor.js builds
   it). At rest, the small spiral: the outline from the eye out to 0.6 of the
   spine. On structural UI it twirls one turn about the eye while the rest of
   the line comes in, piece by piece along the spine. Opacity and transform
   only: nothing is stroked, masked or resized.

   POINTER-EVENTS: NONE IS LOAD-BEARING. A full-viewport fixed layer that
   accepts pointer events swallows every click on the page. It would have
   silently re-broken click-to-zoom, the nav, and the video facades. It is
   declared on the host and never overridden.

   DESKTOP ONLY, gated in script on (hover: hover) and (pointer: fine) — the
   element is not created at all on touch, so there is nothing to interfere
   with a tap. The native cursor is only hidden once the custom one exists.
   ========================================================================== */

/* Hiding the native cursor is done by a class the script adds, so a page
   where the script never ran keeps its ordinary pointer rather than losing
   the cursor entirely. */
.has-conch-cursor,
.has-conch-cursor a,
.has-conch-cursor button,
.has-conch-cursor summary,
.has-conch-cursor .is-zoomable,
.has-conch-cursor label,
.has-conch-cursor .spine__handle { cursor: none; }

/* BODY TEXT KEEPS THE TEXT CURSOR, and the mark steps aside there (the
   script hides it over the same blocks). Not in the nav, the masthead or a
   card, which are structural throughout. */
.has-conch-cursor :is(p, li, figcaption, blockquote, dt, dd, td, th, .about__lead):not(nav *, .masthead *, .card__link *, a *, button *, summary *, label *) {
  cursor: text;
}
/* Inline links in case-study copy keep the native pointer: the mark never
   twirls on them (§5). */
.has-conch-cursor :is(.pj-body, .brand__note) a { cursor: pointer; }

/* WHERE THE MARK STANDS DOWN ([data-native-cursor]: the film players, the
   Metis wipe) the native cursor comes back. They used to inherit none from
   <html>, so over a player there was no cursor at all. Zero specificity, so
   a control's own cursor (the wipe's ew-resize) still wins. */
:where(.has-conch-cursor) :where([data-native-cursor], [data-native-cursor] *) { cursor: auto; }

.cursor {
  position: fixed;
  inset-block-start: 0;
  inset-inline-start: 0;
  z-index: var(--z-cursor);
  pointer-events: none;          /* see the note above — never change this */
  /* The box is the whole conch; the resting spiral is 0.77 of its width,
     about 26px here. */
  width: 34px;
  aspect-ratio: 626 / 867;
  color: var(--kumkumam);
  /* The script writes the follow here, with the eye on the pointer. */
  transform: translate3d(-100px, -100px, 0);
  will-change: transform;
  opacity: 0;
  transition: opacity var(--t-quick) var(--ease);
  /* Home: the long version. */
  --cur-in: var(--t-slow);
  --cur-out: var(--t-quick);
  --cur-fade: calc(var(--t-quick) * 0.1);
  --e0: 0;
}
.cursor.is-visible { opacity: 1; }
/* Over body text the I-beam shows instead. */
.cursor.is-visible.is-text { opacity: 0; }

.cursor__art {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: currentColor;
  /* The twirl turns about the eye, where the spine starts: the hotspot. */
  transform-origin: 42.92% 31.45%;
  transition: transform var(--cur-out) var(--ease);
}
.cursor.is-over .cursor__art {
  transform: rotate(-360deg);
  transition: transform var(--cur-in) var(--ease);
}

/* The line beyond the spiral, piece by piece. --d is a piece's place along
   it (0 to 1), --e0 how far the line had got when the hover changed, so it
   carries on, or winds back, from there. */
.cursor__ext path {
  opacity: 0;
  transition: opacity var(--cur-fade) linear calc((var(--e0) - var(--d)) * var(--cur-out));
}
.cursor.is-over .cursor__ext path {
  opacity: 1;
  transition: opacity var(--cur-fade) linear calc((var(--d) - var(--e0)) * var(--cur-in));
}

/* OVER RED AND DARK GROUNDS the mark goes cream. --kumkumam on the About
   field, the inverted footer, a hovered card's wash or the CTA button is
   kumkumam on kumkumam — 1:1, invisible. The case-study blocks are dark for a
   different reason and need the same treatment. The switch is immediate. */
.cursor.is-inverted { color: var(--paper); }

/* QUIETER ON PROJECT PAGES (§5: "shorter, quicker version of the same
   effect"). Smaller, and the line extends only to 0.82 of the spine (the
   script leaves out the rest), over --t-quick. */
.pj-cursor .cursor {
  width: 26px;
  --cur-in: var(--t-quick);
  --cur-out: calc(var(--t-quick) * 0.6);
}

/* REDUCED MOTION — the mark still tracks the pointer, which is what makes it
   a cursor, but nothing animates: no twirl, no extension (the script builds
   no pieces), no fade, no smoothing. The small spiral is what shows. */
@media (prefers-reduced-motion: reduce) {
  .cursor,
  .cursor__art { transition: none; }
  .cursor.is-over .cursor__art { transform: none; }
}

/* ===== css/kuri.css ===== */
/* ==========================================================================
   KURI + CITED SPOTS (CLAUDE.md §17)

   Loaded on every page. Two parts:
   1. .cite-mark: the outline a deep link's target gets on landing (js/cite.js),
      on every page, whether or not Kuri is on.
   2. Kuri's masthead control, About's line and the dialog. All of it stays
      hidden (the [hidden] attribute) until js/kuri.js turns it on.

   The site's own system: tokens, General Sans, Gambetta for the name, kumkumam
   for what's live, square corners. Nothing here borrows a case study's
   palette.
   ========================================================================== */

/* --- 1. The landing outline ---------------------------------------------- */

.cite-mark,
.cite-mark--still {
  outline: 2px solid var(--kumkumam);
  outline-offset: 10px;
}
.cite-mark { animation: cite-mark calc(var(--t-slow) * 2.4) var(--ease) both; }

@keyframes cite-mark {
  0%   { outline-color: color-mix(in srgb, var(--kumkumam) 0%, transparent); }
  22%  { outline-color: var(--kumkumam); }
  62%  { outline-color: var(--kumkumam); }
  100% { outline-color: color-mix(in srgb, var(--kumkumam) 0%, transparent); }
}

/* On the inverted About field the outline is paper, as everything is there. */
.about .cite-mark,
.about .cite-mark--still { outline-color: var(--paper); }
.about .cite-mark { animation-name: cite-mark-paper; }
@keyframes cite-mark-paper {
  0%   { outline-color: color-mix(in srgb, var(--paper) 0%, transparent); }
  22%  { outline-color: var(--paper); }
  62%  { outline-color: var(--paper); }
  100% { outline-color: color-mix(in srgb, var(--paper) 0%, transparent); }
}

@media (prefers-reduced-motion: reduce) {
  .cite-mark { animation: none; }
}

/* The quoted words themselves (js/cite.js, the CSS Custom Highlight API):
   a kumkumam underline on a faint kumkumam tint. Ink on the tint is about
   11.7:1. It fades in once the page is where it's going (--kuri-cite-a, a
   registered number the highlight's colors scale by); reduced motion: there
   at once. On the inverted About field, paper. */
@property --kuri-cite-a {
  syntax: '<number>';
  inherits: true;
  initial-value: 0;
}
html.kuri-cite-shown {
  --kuri-cite-a: 1;
  transition: --kuri-cite-a var(--t-slow) var(--ease);
}
::highlight(kuri-cite) {
  background-color: color-mix(in srgb, var(--kumkumam) calc(var(--kuri-cite-a) * 14%), transparent);
  text-decoration: underline 2px color-mix(in srgb, var(--kumkumam) calc(var(--kuri-cite-a) * 100%), transparent);
  text-underline-offset: 0.22em;
}
.about *::highlight(kuri-cite) {
  background-color: color-mix(in srgb, var(--paper) calc(var(--kuri-cite-a) * 18%), transparent);
  text-decoration-color: color-mix(in srgb, var(--paper) calc(var(--kuri-cite-a) * 100%), transparent);
}
@media (prefers-reduced-motion: reduce) {
  html.kuri-cite-shown { transition: none; }
}


/* --- 2. Ask Kuri in the masthead ----------------------------------------- */

.masthead__kuri {
  position: relative;
  background: none;
  border: 0;
  border-block-end: 1px solid transparent;
  font: inherit;
  font-size: var(--type-micro);
  cursor: pointer;
  border-radius: 0;
  white-space: nowrap;
}

/* WHERE IT SITS, by the bar's measured room (November 2026, Prateek's call:
   the wordmark always stays). With "Prateek Nair", Work, About and Tools,
   the bar needs about 486px for "Ask Kuri" and 446px for "Kuri" (measured
   when Tools joined the bar, November 18 2026; it was 465 and 427). So:
   30.5rem (488px) and up, "Ask Kuri"; from 28rem (448px), "Kuri" (the button
   keeps the name "Ask Kuri"); below that, Ask Kuri is in the Work menu, after
   Tools, and the glow and dot go on the menu's button. */
.masthead__kuri { display: none; }
.masthead.has-kuri .masthead__kuri { display: inline-block; }
@media (max-width: 30.49rem) {
  .masthead__kuri-ask { display: none; }
}
@media (max-width: 27.99rem) {
  .masthead.has-kuri .masthead__kuri { display: none; }
}

.menu__kuri { display: none; }
@media (max-width: 27.99rem) {
  .masthead.has-kuri .menu__kuri { display: block; border-block-end: 1px solid var(--rule); margin-block-end: 0.35rem; }
}
.menu__kuri-btn {
  display: block;
  width: 100%;
  text-align: start;
  padding: 0.5rem var(--sp-s);
  background: none;
  border: 0;
  border-radius: 0;
  font: inherit;
  font-size: var(--type-micro);
  letter-spacing: 0.1em;
  color: var(--kumkumam);
  cursor: pointer;
  white-space: nowrap;
}
.menu__kuri-btn:hover { background: var(--kumkumam); color: var(--paper); }
/* What Kuri is, for anyone who doesn't know the name (Prateek's call). */
.menu__kuri-note {
  margin-inline-start: 0.55em;
  color: color-mix(in srgb, var(--ink) 68%, var(--paper));
  letter-spacing: 0.06em;
}
.menu__kuri-btn:hover .menu__kuri-note { color: var(--paper); }
.menu__kuri-btn:focus-visible { outline: 2px solid var(--kumkumam); outline-offset: -2px; }

/* The dot: a small kumkumam mark beside the bar's Ask Kuri until Kuri is
   first opened, from 448px up. On phones there is no dot at all (Prateek's
   call): the red Ask Kuri row at the top of the Work menu, with its divider,
   is the highlight there, and Work keeps only the one-time glow. */
.masthead__kuri.kuri-dot { position: relative; }
.masthead__kuri.kuri-dot::before {
  content: "";
  position: absolute;
  inset-block-start: 0.15rem;
  inset-inline-end: -0.55rem;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: var(--kumkumam);
}
.masthead.is-over-invert .masthead__kuri.kuri-dot::before { background: var(--paper); }

/* The glow: once, on a session's first page, then the dot. */
.kuri-glowing { animation: kuri-glow calc(var(--t-slow) * 2) var(--ease) both; }
@keyframes kuri-glow {
  0%   { text-shadow: 0 0 0 transparent; color: var(--kumkumam); }
  35%  { text-shadow: 0 0 0.9em color-mix(in srgb, var(--kumkumam-lit) 70%, transparent); color: var(--kumkumam-lit); }
  100% { text-shadow: 0 0 0 transparent; color: var(--kumkumam); }
}
.masthead.is-over-invert .kuri-glowing { animation-name: kuri-glow-paper; }
@keyframes kuri-glow-paper {
  0%, 100% { text-shadow: 0 0 0 transparent; }
  35%      { text-shadow: 0 0 0.9em color-mix(in srgb, var(--paper) 80%, transparent); }
}

/* About's last line: "Or ask Kuri. It knows the site." */
.about__kuri {
  margin-block-start: var(--sp-m);
  /* Centred under the contact links it follows (they're a centred stack;
     About's own copy is set left). Its box keeps the paragraphs' measure,
     so it's centred in the column too. */
  margin-inline: auto;
  text-align: center;
}
.about__kuri-open {
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  cursor: pointer;
}
.about__kuri-open:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .kuri-glowing { animation: none; }
}

/* The panel's own styles are in css/kuri-panel.css, loaded with js/kuri-panel.js
   the first time someone opens Kuri: nothing of the panel loads with a page. */
