/* GENERATED by tools/build-css.py. Do not edit: edit the files in
   css/ and run the script. This bundle is, in order:
     css/fonts.css
     css/tokens.css
     css/base.css
*/

/* ===== css/fonts.css ===== */
/* ==========================================================================
   FONTS, SELF-HOSTED
   Gambetta and General Sans, from Fontshare's own download packages, as
   shipped: the woff2 files are unmodified (no subsetting, no conversion; the
   license forbids both). License: assets/fonts/FFL.txt, the ITF Free Font
   License, which permits self-hosting for this site and forbids public
   redistribution — so this repository must stay private (CLAUDE.md §2).

   WHY NOT THE FONTSHARE API. On October 15, 2026 its combined CSS request
   (?f[]=gambetta@400&f[]=general-sans@400,500) began returning Gambetta only,
   so General Sans never loaded and every page fell back to the system font.
   Serving the files ourselves removes the dependency.

   ONLY THE CUTS THE CSS ACTUALLY USES, measured on every page: Gambetta 400;
   General Sans 400, 400 italic (em), 500 (section heads), 600 (labels) and
   700 (strong). Before this file the italic, 600 and 700 were never loaded and
   the browser faked them. Add a face here only when the CSS starts using it.

   Gambetta 400 and General Sans 400 are preloaded on every page: the name or
   title and the subtitle above the fold use them.
   ========================================================================== */

@font-face {
  font-family: 'Gambetta';
  src: url('/assets/fonts/Gambetta-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'General Sans';
  src: url('/assets/fonts/GeneralSans-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'General Sans';
  src: url('/assets/fonts/GeneralSans-Italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'General Sans';
  src: url('/assets/fonts/GeneralSans-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'General Sans';
  src: url('/assets/fonts/GeneralSans-Semibold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'General Sans';
  src: url('/assets/fonts/GeneralSans-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ===== css/tokens.css ===== */
/* ==========================================================================
   TOKENS — prateeknair.design
   Every value the rest of the system reads. Nothing here is decorative;
   if a number appears twice in the site, it belongs in this file.
   ========================================================================== */

:root {

  /* --- Palette (locked, CLAUDE.md §2 — do not change) ------------------- */
  --paper:        #F4EEE2;   /* base background */
  --paper-deep:   #E9E0CE;   /* alternating sections */
  --kumkumam:     #9E2B25;   /* primary accent */
  --kumkumam-lit: #C1352E;   /* hover/active only */
  --ink:          #241C18;   /* body text */
  --surface:      #E4DED3;   /* backing tone behind flat/product shots */

  /* Derived ink tints. Opacity on --ink rather than new hex values, so a
     change to --ink carries through every muted state. */
  /* 70%, not 62%. Every element that uses this renders as NORMAL text —
     .card__sub at 23.7px/400 and .hero__tagline at 20.5px/400 are both under
     the 24px large-text bar and neither is bold — so all of them need 4.5:1,
     not 3:1. At 62% it measured 4.48 against bare paper and 3.84 against the
     grain composite at its darkest, i.e. it was already failing before the
     grain went up. 67.5% is the arithmetic minimum that clears 4.5 against
     the all-black bound; 70% takes it with headroom. */
  --ink-muted:    color-mix(in srgb, var(--ink) 70%, var(--paper));

  /* --ink-faint IS RETIRED. It was 34% ink — 2.07:1 against bare paper, which
     fails the 4.5 bar and the 3.0 one, on 12px text. A contrast below the
     legibility floor is not a way to make something recede; it is a way to
     make it unreadable. The year now takes --ink-muted and recedes through
     TYPE instead: half the subtitle's size, much wider tracking, and more
     space around it. The tonal ramp keeps three steps — ink, muted, and
     muted-set-small — without an illegal one. */
  --rule:         color-mix(in srgb, var(--ink) 16%, var(--paper));

  /* No gold. Anywhere in the shell. Studio Eikira's gold is scoped inside
     that case study's own contained frame — see CLAUDE.md §7. */

  --radius: 0px;             /* square corners, everywhere, no exceptions */

  /* THE ONE EXCEPTION, AND IT IS SCOPED TO CONTROLS.
     Frames, cards and images stay square: §6 asks the frame to present the
     work without editing it, and a radius on a frame shaves the corners off
     UI screenshots whose content runs to the edge. The About copy also says
     out loud that everything but the spiral runs straight, so rounding the
     page would contradict a sentence the visitor reads.

     A button is not the page — it is a control, and there a curve reads as an
     affordance rather than as styling. Applied only to the three controls
     that have a real box: the CTA, the zoom bar's buttons and the skip link.
     The video play button is already a circle, and the Spotify pills own
     their own shape under §7. */
  --radius-control: 14px;


  /* --- Type families ---------------------------------------------------- */
  --font-display: 'Gambetta', Georgia, 'Times New Roman', serif;
  --font-body:    'General Sans', system-ui, -apple-system, sans-serif;
  --font-mal:     'Manjari', 'Noto Sans Malayalam', sans-serif;


  /* --- Type scale -------------------------------------------------------
     Fluid between a 360px phone and a 1600px desktop. The display sizes are
     deliberately extreme at the top end — CLAUDE.md §1 asks the shell to be
     absurd in scale, and a timid hero is the failure mode to avoid. */

  /* MEASURED, not estimated: "Prateek" in Gambetta sets about 3.06x the font
     size wide. An earlier note here claimed 4.7x and concluded 19vw put the
     name across ~90% of the viewport — that was measuring the h1's block box,
     which is full-width by definition, rather than the glyphs. The real span
     at 19vw is ~58%, which was never the reason the hero collided.

     So 19vw stands, and the drop to 13vw was an over-correction chasing a
     bad number. The collision came from where the conch was placed, not from
     the type being too large.

     REVISED, and this time the constraint is vertical. Once the hero became a
     centred stack the binding limit stopped being how wide the glyphs run and
     became how tall the column is: at 19vw the two lines alone were 393px, so
     on a 779px laptop the hero measured 943px and overflowed by 164 — which
     pushed the conch up behind the fixed masthead. It was rendering the whole
     time; it was simply above the fold of its own section.

     So the size now takes the smaller of a width term and a height term. vh
     is what actually governs a stack, and vw keeps the name from running to
     the margins on a wide, short window.

     The two terms do different jobs. On a phone the column is tall and the
     height term never binds, so vw is what sets the name — 17vw keeps the
     glyphs at ~51% of the screen there. On a laptop the height term binds
     first and holds the whole stack inside one viewport. */
  /* HERO NAME MARK, SIZED TO SET ON ONE LINE.
     Measured off the glyphs, not guessed — §3 records that mistake being made
     once already: "Prateek Nair" in Gambetta at --ls-mega sets 5.027x the font
     size wide, against 3.056x for "Prateek" alone. So the whole name needs
     about 1.6x the room one word did, and the old 17vw/15.5vh was scaled for
     the word.
     7vw keeps it near 35% of the viewport on a desktop and the 3.25rem floor
     holds it at about 70% on a phone, which is 261px inside a 280px column at
     320 — the narrowest case, and it still clears. The vh term stops a short
     window blowing it up; it can be higher than it was because one line asks
     for half the height two did. */
  --type-mega:    clamp(3.25rem, min(7vw, 17vh), 9.5rem); /* hero name mark */
  --type-display: clamp(3rem, 11vw, 9rem);         /* section statements */
  --type-title:   clamp(2.25rem, 6vw, 4.5rem);     /* project titles */
  --type-head:    clamp(1.5rem, 3vw, 2.25rem);     /* section headers */
  --type-lead:    clamp(1.125rem, 1.6vw, 1.5rem);  /* opening paragraphs */
  --type-body:    clamp(1rem, 1.05vw, 1.125rem);   /* body copy */
  --type-small:   0.9375rem;                       /* captions, meta */
  --type-micro:   0.75rem;                         /* labels, eyebrows */

  --lh-tight:  0.92;   /* display only — set solid, never for body */
  --lh-snug:   1.14;
  --lh-normal: 1.6;    /* body copy */

  --ls-mega:   -0.035em;
  --ls-display:-0.025em;
  --ls-normal:  0em;
  --ls-wide:    0.18em;  /* eyebrows, small caps-ish labels */

  --measure: 62ch;       /* max line length for body copy */
  --measure-narrow: 46ch;


  /* --- Spacing -----------------------------------------------------------
     Ratio-based, not a linear 8px grid. Aggressive negative space is a
     stated goal, so the top of the scale is large on purpose. */

  --sp-3xs: 0.25rem;
  --sp-2xs: 0.5rem;
  --sp-xs:  0.75rem;
  --sp-s:   1.25rem;
  --sp-m:   2rem;
  --sp-l:   3.25rem;
  --sp-xl:  5.25rem;
  --sp-2xl: 8.5rem;
  --sp-3xl: 13.75rem;

  /* Section rhythm — fluid, so phones don't inherit desktop voids. */
  --sp-section: clamp(var(--sp-xl), 14vh, var(--sp-3xl));


  /* --- Layout ------------------------------------------------------------ */
  --gutter:      clamp(1.25rem, 5vw, 4rem);
  --w-full:      100%;
  --w-wide:      120rem;   /* near-full-bleed image runs */
  --w-content:   76rem;    /* default container */
  --w-text:      42rem;    /* copy blocks */

  /* The masthead is fixed, so nothing below it can learn its height from
     layout. Both numbers live here so the bar's real height and the space
     other sections reserve for it come from one place: masthead.css sets its
     padding from --masthead-pad, and --masthead-h is that padding plus the
     2rem the controls occupy. */
  --masthead-pad: clamp(0.7rem, 1.4vw, 1.15rem);
  --masthead-h:   calc(var(--masthead-pad) * 2 + 2rem);


  /* --- Image ratio buckets ----------------------------------------------
     Three buckets only (CLAUDE.md §6), set from the real files rather than
     chosen. Images are centered inside these frames, never stretched or
     cropped, so the frame absorbs odd source shapes and mixed exports stop
     showing. Measured across the 32 placed images (excludes _reference/
     and _cut-not-used/):

       TALL   n=8   0.46 x1  0.51 x2  0.56 x4  0.76 x1
       SQUARE n=10  1.00 x6  1.03 x2  1.17 x1  1.22 x1
       WIDE   n=14  1.34 x1  1.40 x2  1.41 x4  1.60 x4  1.90 x2  2.41 x1

     Because images are contained rather than cropped, the cost of a bucket
     is the letterbox it leaves. Where a bucket serves two clusters, the
     geometric mean equalises that cost proportionally across both.

     --ratio-wide 1.5 — the wide set has two real clusters, 1.40/1.41 (6
       files: Spotify desktop, Eikira hero, booth renders) and 1.60 (4
       files: the Mailchimp pairs). sqrt(1.406 x 1.60) = 1.4999, so 3:2
       leaves each cluster an even ~6% letterbox instead of fitting one
       perfectly and penalising the other at 12%.

     --ratio-square 1 — 1.00 is 6 of 10 outright. The 1.03 pair loses 2.8%,
       which is invisible. 1.17 and 1.22 are the packaging renders, and they
       run at native size in .row--native rather than in a frame.

     --ratio-tall 0.5625 — 9:16, matching the 4-file Spotify mobile cluster
       exactly. Chosen over the 0.535 geometric mean because the tall
       bucket's hardest job is the 4-up mobile row, where any letterbox is
       multiplied across four frames side by side. The Eikira pair at 0.508
       takes ~10% side padding, absorbed by the mat — which is the frame
       doing its job.

     TWO IMAGES ARE EXEMPT, both deliberately. Use .frame--solo:
       0.76  booths show-floor hero    — 26% letterbox in the tall frame
       2.41  POS production hero       — 61% letterbox in the wide frame

     Both are solo heroes with no neighbour to match, and both are named in
     §10 as among the strongest images on the site. A bucket costs them
     letterbox and buys nothing, so they size to their own ratio and are
     capped by viewport height instead. This is an exemption, not a fourth
     bucket — the three buckets still govern everything that shares a row
     or a section. */

  --ratio-tall:   0.5625;   /* 9:16 */
  --ratio-square: 1;        /* 1:1  */
  --ratio-wide:   1.5;      /* 3:2  */


  /* --- Motion ------------------------------------------------------------
     Every duration derives from --t-base so timing tunes from one number.
     980ms is locked (CLAUDE.md §2) — chosen on a live tuner. */

  --t-base:  980ms;
  --t-quick: calc(var(--t-base) * 0.6);
  --t-slow:  calc(var(--t-base) * 1.3);
  --t-draw:  calc(var(--t-base) * 2.8);
  --t-track: calc(var(--t-base) * 0.14);   /* a follower's lag: the hero lamp */
  --ease:    cubic-bezier(0.16, 1, 0.30, 1);
  /* For movement only (CLAUDE.md §2): a soft spring, sampled from a damped
     spring (damping 0.75). It starts from rest, goes about 3% past and
     settles by the end. Fades and reveals stay on --ease. */
  --ease-move: linear(0, 0.0353, 0.122, 0.2363, 0.3611, 0.4846, 0.599, 0.7, 0.7855, 0.8554,
                      0.9105, 0.9523, 0.9826, 1.0035, 1.0169, 1.0245, 1.0279, 1.0282, 1.0266,
                      1.0238, 1.0204, 1.0168, 1.0134, 1.0103, 1.0075, 1.0053, 1.0035, 1.0021, 1);


  /* --- Grain -------------------------------------------------------------
     Palm-leaf fibre. Procedural SVG turbulence, never a raster tile — the
     filter itself lives in base.css. Anisotropic: coarse along x, fine along
     y, which elongates the noise into parallel horizontal fibre rather than
     uniform static. The only pattern in the system besides the conch curve
     vocabulary.

     --grain-opacity is the one dial. 0.070 was picked off a four-way
     comparison at 1:1 (0.045 / 0.070 / 0.095 / 0.120): 0.045 read flat in
     the open stretches, 0.095 was clearly textured and 0.120 started to read
     as a repeating pattern rather than as stock. The note below describes the
     old 0.045 and is kept for the reasoning, not the number. 0.045 was near the
     threshold of visibility: it should register as paper stock, not as an
     effect anyone notices. */

  --grain-opacity: 0.07;
  --grain-scale:   260px;

  /* Dark-ground grain. multiply can only darken, so the paper grain is
     inherently a no-op on the dark containers in §7 and §10 — not something
     opacity tuning can reach. Those grounds get a second layer in screen
     instead, which can only lighten. Lower value because lifting a near-black
     reads far more strongly than darkening cream. */
  --grain-opacity-dark: 0.028;


  /* --- Layers ------------------------------------------------------------ */
  --z-grain:  1;
  --z-content: 2;
  --z-nav:    50;
  --z-cursor: 9999;
}


/* Motion tokens collapse to zero rather than being overridden at each call
   site. One rule here means no animation anywhere can outlive it. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --t-base:  1ms;
    --t-quick: 1ms;
    --t-slow:  1ms;
    --t-draw:  1ms;
    --t-track: 1ms;
  }
}

/* --- Contrast notes (measured, WCAG 2.1 relative luminance) --------------
   ink on paper 14.49   ink on paper-deep 12.77   ink on surface 12.51
   kumkumam on paper 6.43   on paper-deep 5.67   on surface 5.55
   kumkumam-lit on paper 4.76

   ONE EXCEPTION: --kumkumam-lit on --paper-deep is 4.20 — below the 4.5
   needed for normal text, above the 3.0 for large text. Since kumkumam-lit
   is a hover/active token only, restrict it on paper-deep sections to
   large text and UI affordances. For a body-size link inside a
   .section--deep, hover to --kumkumam rather than --kumkumam-lit. */

/* ===== css/base.css ===== */
/* ==========================================================================
   BASE — reset, typography, grain, focus
   ========================================================================== */

/* --- Reset ---------------------------------------------------------------
   Minimal, not a full normalize. Only what this site actually needs. */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;

  /* THE PAGE IS LIGHT, AND THE BROWSER HAS TO BE TOLD.
     The root background and overscroll-behavior below govern what THIS PAGE
     paints. They do not govern the UA's own backdrop — the surface a browser
     shows in the rubber-band area and behind the toolbars — and with
     color-scheme undeclared a phone in dark mode gives that surface its dark
     default. That is the grey seen when pulling past the footer: not the
     site's cream failing to reach, the browser's own dark ground showing
     where the site never painted. One keyword moves it to the light default. */
  color-scheme: light;

  /* EVERY IN-PAGE JUMP CLEARS THE FIXED MASTHEAD.
     The bar is position: fixed, so it does not participate in layout and an
     anchor jump happily parks its target underneath it — back-to-top landed
     with the project title hidden behind the bar, and #main, #work and
     #about all had the same fault.

     scroll-padding-top on the scroller fixes all of them at once and is
     inherited by the smooth scroll above, rather than needing a
     scroll-margin-top on each target that a new anchor would forget. The
     value is the masthead's own token, so the two cannot drift. */
  scroll-padding-top: calc(var(--masthead-h) + var(--sp-s));

  /* NO SIDEWAYS SCROLL. Full-bleed blocks sized with width: 100vw and pulled
     out of their container with margin-inline: calc(50% - 50vw) overhang the
     content width by exactly the scrollbar's width, because 100vw includes
     it. .about and the inverted footer no longer do this (October 2026: their
     parents were already full width, so the bleed was removed at the source
     and the homepage measures zero overflow without this rule). It stays for
     .brand and the project pages' other 100vw bleeds, which sit inside
     max-width containers and genuinely need them.

     CLIP, NOT HIDDEN, and the distinction is the reason this is safe here.
     `hidden` makes the element a scroll container, which would move the
     document's scrollport and put every scroll-driven animation on the site —
     the spine's line, its stops, each card's coil — onto a different
     timeline. `clip` explicitly does not create one; it only stops the paint
     escaping. Verified before and after against a nine-point sample of the
     spine's coil offsets across the whole work section at 1280 and 375:
     identical to the tenth of a pixel.

     The bleeds whose parent was already full-width were fixed at the source;
     this rule covers the ones that cannot be. */
  overflow-x: clip;

  /* THE BOUNCE PAST THE BOTTOM LANDS ON THE FOOTER'S OWN GROUND.
     There is no dead space under the footer — the document ends at its
     bottom edge to within a rounding error. What a phone shows below it is
     rubber-band overscroll: the browser drags past the end of the document
     and paints the canvas, which until now was --paper propagated up from
     body. On the homepage that put a cream strip under a red footer, which
     is exactly what a gap looks like.

     Fixing it here rather than with overscroll-behavior keeps the native
     bounce and only corrects its colour. The construction:

       - background-color is --paper, so it fills the canvas ABOVE the
         document, where every page is cream.
       - the image is a hard 50% stop sized to 200% of the root box, so its
         upper half covers the document exactly and its lower half carries
         the tail colour for one full document height below it. Body is at
         least 100svh, so that is always more than a bounce can travel.
       - no-repeat is required, not stylistic: the root's background is
         painted across the whole canvas, and a repeating gradient would
         tile the tail back up above the page.

     --overscroll-tail defaults to --paper, so a page whose footer is cream
     is unchanged. footer.css raises it where the footer is inverted.

     THIS ALONE IS NOT ENOUGH, and shipping it proved why. Deployed and
     verified live — the served base.css matches this file byte for byte —
     a real phone still showed grey below the footer. WebKit paints only the
     root's background-COLOR into the rubber-band area; the background-image
     does not extend past the document, so the red never reached it and the
     cream background-color did. It read as grey rather than cream because
     body::before is fixed, gradient-free grain in multiply, and multiply has
     no backdrop to darken out there — the canvas is not part of the root's
     blending group — so it lays its own neutral noise straight over the top.
     Confirmed the desaturation locally against an isolated cream canvas.

     The gradient stays: it is correct wherever a browser honours it, and it
     costs nothing where one does not. What it is NOT is the fix. */
  --overscroll-tail: var(--paper);
  background-color: var(--paper);
  background-image: linear-gradient(var(--paper) 50%, var(--overscroll-tail) 50%);
  background-repeat: no-repeat;
  background-size: 100% 200%;

  /* NO BOUNCE PAST THE ENDS OF THE DOCUMENT.
     Removes the gesture rather than colouring what it reveals, so there is
     nothing to drag into at either end. Declared on both html and body: the
     viewport takes its value from html, but engines have historically
     propagated it from body, and the pair costs one line.

     Scoped to the y axis on purpose. overscroll-behavior: none would also
     stop scroll CHAINING sideways, and .pj-embed, .row--native and every
     zoom stage rely on their own horizontal scrollers behaving normally.
     .zoom__stage sets overscroll-behavior: contain for itself and is
     unaffected by either value here.

     Does not touch ordinary scrolling, anchor jumps, or scroll-behavior:
     smooth above — it governs only what happens at a boundary. */
  overscroll-behavior-y: none;
}

body { overscroll-behavior-y: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd {
  margin: 0;
}

ul[role='list'],
ol[role='list'] {
  list-style: none;
  margin: 0;
  padding: 0;
}

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

input, button, textarea, select { font: inherit; color: inherit; }

/* Square corners, everywhere, no exceptions (CLAUDE.md §2). */
* { border-radius: var(--radius); }


/* --- Document ------------------------------------------------------------ */

body {
  min-height: 100svh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--type-body);
  line-height: var(--lh-normal);
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


/* --- Palm-leaf grain -----------------------------------------------------
   Procedural, not a raster tile: feTurbulence is evaluated by the browser,
   so there is no image asset, no network request and nothing to keep in
   sync. Inlined as an SVG data URI.

   Anisotropic on purpose. baseFrequency is '0.035 0.9' — low along x, high
   along y — so the noise varies slowly left-to-right and rapidly
   top-to-bottom. That elongates every feature horizontally, giving fine
   parallel horizontal fibre rather than uniform static.

   (Swapping those two numbers rotates the grain 90deg. It was the wrong way
   round initially, which read as vertical streaks.)

   stitchTiles='stitch' makes the 260px tile seamless, so tiling the data
   URI does not produce a visible repeat.

   Fixed to the viewport so it reads as a property of the paper rather than
   something that scrolls with the content.

   NO BLEND MODE (October 2026). It was grey noise laid on with
   mix-blend-mode: multiply, and a fixed layer with a blend mode over a
   scrolling page makes WebKit re-blend it against the page on every frame of
   a scroll: a steady cost on an iPhone. Multiplying by a grey g is exactly
   laying black over the ground at an alpha of (1 - g), so the tile now
   carries that alpha itself: the noise's own alpha times one minus its
   luminance (feComposite arithmetic), the luminance taken back to sRGB by a
   gamma of 1/2.2 as the old output was, and black everywhere. Composited
   normally at the same opacity it matches the old grain over paper to
   within 1/255 on every pixel (mean 236.17 against 236.11), and it is now an
   ordinary fixed layer the compositor just moves. */

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.035 0.9' numOctaves='3' stitchTiles='stitch' result='n'/%3E%3CfeColorMatrix in='n' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0' result='a'/%3E%3CfeColorMatrix in='n' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .2126 .7152 .0722 0 0' result='l'/%3E%3CfeComponentTransfer in='l' result='b'%3E%3CfeFuncA type='gamma' amplitude='1' exponent='0.4545' offset='0'/%3E%3C/feComponentTransfer%3E%3CfeComposite in='a' in2='b' operator='arithmetic' k1='-1' k2='1' k3='0' k4='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  background-size: var(--grain-scale) var(--grain-scale);
}

/* The grain is texture, not information. Users who reduce motion often also
   reduce visual noise; halve it rather than removing it, so the paper does
   not go flat. */
@media (prefers-reduced-motion: reduce) {
  body::before { opacity: calc(var(--grain-opacity) * 0.5); }
}


/* --- Typography ---------------------------------------------------------- */

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

h1 { font-size: var(--type-display); }
h2 { font-size: var(--type-title); }
h3 {
  font-family: var(--font-body);
  font-size: var(--type-head);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-normal);
  color: var(--kumkumam);
}

p {
  max-width: var(--measure);
  text-wrap: pretty;
}

/* --- Line breaks: the base layer (CLAUDE.md §12) --------------------------
   Headings, card titles and subtitles balance their lines; running text,
   captions, list items and role rows avoid short last lines with pretty.
   Hyphenation is never automatic, so no hyphen is ever inserted. A
   hyphenated compound in the copy that would split across lines is wrapped
   in .nowrap rather than written with U+2011, which these faces may not
   carry (a missing glyph falls back to another font). */
html { -webkit-hyphens: manual; hyphens: manual; }
h1, h2, h3, h4, h5, h6,
.card__title, .card__sub, .pj-head__sub { text-wrap: balance; }
li, figcaption, dd, blockquote { text-wrap: pretty; }
.nowrap { white-space: nowrap; }
/* Opt-out: plain greedy wrapping where balance or pretty moves a break onto
   a stranded word. Used once, on the Mailchimp card's subtitle, where
   balance gave "A Homecoming to / Where It All Started" at six of the nine
   device widths. */
.wrap-plain { text-wrap: wrap; }

/* Eyebrow / meta label. Used for years, roles, section numbers. */
.eyebrow {
  font-size: var(--type-micro);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--kumkumam);
}

.lead { font-size: var(--type-lead); }

.caption {
  font-size: var(--type-small);
  line-height: var(--lh-snug);
  color: var(--ink-muted);
  max-width: var(--measure-narrow);
}

/* The Malayalam name mark. Used once, on the hero. */
.mal {
  font-family: var(--font-mal);
  font-weight: 400;
  letter-spacing: var(--ls-normal);
}


/* --- Links ----------------------------------------------------------------
   Underline offset well clear of descenders. Colour shift on hover only —
   --kumkumam-lit is a hover/active token and never a resting state. */

a {
  color: var(--kumkumam);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: color var(--t-quick) var(--ease);
}

a:hover { color: var(--kumkumam-lit); }


/* --- Focus ---------------------------------------------------------------
   Keyboard navigable with visible focus states (CLAUDE.md §12). Square,
   like everything else, and offset so it never crowds the glyphs. */

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

:focus:not(:focus-visible) { outline: none; }

.skip-link {
  border-radius: var(--radius-control);
  position: absolute;
  left: var(--gutter);
  top: 0;
  z-index: var(--z-nav);
  padding: var(--sp-2xs) var(--sp-s);
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-120%);
  transition: transform var(--t-quick) var(--ease);
}

.skip-link:focus { transform: translateY(0); }

/* The colour is restated because `a:hover` above is (0,1,1) and beats
   .skip-link's (0,1,0) `color: var(--paper)`. Without this, hovering the
   focused skip link turned it kumkumam-lit on --ink — 3.04:1, below the AA
   floor §12 sets, on the one control that exists purely for accessibility. */
.skip-link:hover,
.skip-link:focus { color: var(--paper); }


/* --- Selection ------------------------------------------------------------ */

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


/* --- Dark-ground grain ---------------------------------------------------
   The body grain above uses multiply, which can only darken. On the dark
   containers in §7 (Studio Eikira's gold, quarantined) and §10 (the Flexx
   assets, black edge to edge) it therefore does nothing at all — a near-black
   multiplied by ~0.97 is the same near-black. That is inherent to the blend
   mode, not a value that wants tuning.

   Those grounds get their own layer in screen, which can only lighten. Same
   procedural turbulence, same tile, same horizontal fibre — so the two
   surfaces read as the same stock, one lit from the paper side and one from
   the ink side.

   Scoped strictly to the dark containers. It must never apply to paper, where
   screen would wash the ground out.

   .has-dark-grain is the grain WITHOUT the ink ground. A case study's own
   container is dark but is not --ink — Mailchimp's is Heritage Brown — so it
   needs the texture while setting its own background. Adding .contained-dark
   there would overwrite the brand colour with ink, which is the opposite of
   what §7 asks for. */

.frame--dark,
.contained-dark,
.has-dark-grain {
  position: relative;
  isolation: isolate;      /* keep the blend inside the container */
}

.frame--dark::after,
.contained-dark::after,
.has-dark-grain::after {
  content: '';
  position: absolute;      /* out of grid flow — .frame is a grid */
  inset: 0;
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: screen;
  opacity: var(--grain-opacity-dark);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.035 0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  background-size: var(--grain-scale) var(--grain-scale);
}

@media (prefers-reduced-motion: reduce) {
  .frame--dark::after,
  .contained-dark::after,
  .has-dark-grain::after { opacity: calc(var(--grain-opacity-dark) * 0.5); }
}


/* --- The conch motif, site-wide ------------------------------------------
   VALAMPIRI SHANKHU IS RIGHT-COILING. Both source files in assets/conch/ are
   drawn left-coiling, which is the wrong shell — not a stylistic variant. The
   motif is mirrored at render time instead of by rewriting path data, so the
   two files stay byte-identical to what was exported and cannot drift apart.

   Apply .conch-flip to a group wrapping BOTH the visible artwork and, where
   one exists, the mask that reveals it. A mask with maskUnits="userSpaceOnUse"
   resolves in the user space of the element referencing it, so a single
   wrapper flips both together and registration is structurally guaranteed
   rather than maintained by hand.

   Both conch files use the same 1000x1000 viewBox, so the translate is always
   1000. transform-box and transform-origin are set explicitly because the
   default for SVG elements has changed across spec revisions, and an
   unqualified scaleX(-1) would mirror about the wrong axis in some engines.

   EVERY conch instance takes this class — hero, scroll progress spiral,
   section dividers, cursor. One motif, one orientation. The favicon is a
   standalone file and cannot take a CSS class; it needs the same
   translate(1000,0) scale(-1,1) applied as a group wrapper inside the file
   itself when it is built. */

.conch-flip {
  transform: translate(1000px, 0) scaleX(-1);
  transform-box: view-box;
  transform-origin: 0 0;
}


/* --- Utility -------------------------------------------------------------- */

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


/* --- Card ⇄ project morph (CLAUDE.md §15d, js/morph.js) --------------------
   About 0.67s (--t-morph). Transform and opacity only.

   THE VEIL, NOT A RED FIELD (October 2026: the full-screen kumkumam flash
   between pages was hard on the eyes). --paper printed with the hero's name
   pattern in ink at the hero's own faint strength, calm, no flash: the tile
   (assets/pattern/name-tile-ink.webp) is പ്രതീക് in Manjari Thin, ink at 7%
   on transparent, brickwork rows, made from the hero's own pattern tile, so
   it can never set in a fallback face; sized like the hero's (--hp-size):
   the cell is 3.5167 by 3 ems. Its one accent is a thin kumkumam line, the
   spine's own stroke (--pn-line), on its leading edge: the veil sweeps off
   across the screen behind the line, and the new page is revealed just
   behind it, left to right forward, right to left on the way back. The
   moving cover and title keep their own colours throughout. */
:root {
  --pn-size: clamp(30px, 3.33vw, 56px);
  --t-morph: calc(var(--t-base) * 0.68);
  --pn-line: 7px;
}

.pn-pattern,
html.pn-flash-in::after {
  background-color: var(--paper);
  background-image: url('/assets/pattern/name-tile-ink.webp?v=20261101a');
  background-size: calc(var(--pn-size) * 3.5167) calc(var(--pn-size) * 3);
  background-position: var(--pn-veil-x, 50vw) 0;
}

/* The sweeping veil: a line's width wider than the screen, set back by it,
   so the line on its leading edge starts just off screen and ends just off
   the other side. (Two classes, to win over .pn-backdrop's box below.) */
.pn-backdrop.pn-veil,
html.pn-flash-in::after {
  left: calc(-1 * var(--pn-line));
  width: calc(100% + var(--pn-line));
  background-image: linear-gradient(var(--kumkumam), var(--kumkumam)),
                    url('/assets/pattern/name-tile-ink.webp?v=20261101a');
  background-size: var(--pn-line) 100%, calc(var(--pn-size) * 3.5167) calc(var(--pn-size) * 3);
  background-repeat: no-repeat, repeat;
  background-position: 0 0, calc(var(--pn-veil-x, 50vw) + var(--pn-line)) 0;
}
.pn-backdrop.pn-veil--back,
html.pn-flash-back.pn-flash-in::after {
  left: 0;
  background-position: 100% 0, var(--pn-veil-x, 50vw) 0;
}

/* The opt-in (@view-transition) is inline at the top of each page's head,
   not here: it has to be in place before anything waits on the network. */

::view-transition-group(*) {
  animation-duration: var(--t-morph);
  animation-timing-function: var(--ease);
}

/* Paper behind the pages while they fade, so nothing dark shows through. */
::view-transition { background-color: var(--paper); }

/* The page left fades and settles back; the page arrived on fades up
   under the veil. */
::view-transition-old(root) { animation: pn-settle calc(var(--t-morph) * 0.6) var(--ease) both; }
::view-transition-new(root) { animation: pn-fade-up calc(var(--t-morph) * 0.5) var(--ease) both; }

/* The veil: its own group, between the page and the cover, never over it.
   Its element fades in by itself (.pn-backdrop, by 32%), and its image
   sweeps off across the screen in the second half, on the spring, the line
   leading. */
::view-transition-group(pn-backdrop) { z-index: 1; animation: none; }
::view-transition-old(pn-backdrop) { animation: none; mix-blend-mode: normal; }
::view-transition-new(pn-backdrop) {
  mix-blend-mode: normal;
  animation: pn-veil-sweep calc(var(--t-morph) * 0.5) var(--ease-move) calc(var(--t-morph) * 0.5) both;
}
html.pn-veil-back::view-transition-new(pn-backdrop) { animation-name: pn-veil-sweep-back; }

.pn-backdrop {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: calc(var(--z-cursor) - 1);
  pointer-events: none;
  opacity: 0;
  animation: pn-veil-in var(--t-morph) linear both;
}

/* The cover travels on the spring (--ease-move), the one thing here that
   moves, filling its box. On the project page its box is an empty one in
   the middle of the header (.pn-lead): it dissolves into it while the veil
   is up (20 to 55%), so it never sits as a box round the header's type;
   coming back, the card's cover forms out of it from 25 to 70%. */
/* The card's text, named only so the cover beside it captures cleanly
   (morph.js): it stays where it is and fades and settles with the page. */
::view-transition-group(pn-text) { animation: none; }
::view-transition-old(pn-text) { animation: pn-settle calc(var(--t-morph) * 0.6) var(--ease) both; }

::view-transition-group(pn-cover) { z-index: 2; animation-timing-function: var(--ease-move); }
::view-transition-old(pn-cover),
::view-transition-new(pn-cover) { width: 100%; height: 100%; object-fit: cover; }
::view-transition-old(pn-cover) { animation: pn-cover-out var(--t-morph) linear both; }
::view-transition-new(pn-cover) { animation: pn-cover-in var(--t-morph) linear both; }

.pn-lead-host { position: relative; }
.pn-title-hidden { visibility: hidden; }
.pn-lead {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(60%, 26rem);
  aspect-ratio: 3 / 2;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* The arriving project page's first rows, its header first, rise in as the
   veil clears (from 60%), staggered, all done by the end: the text is only
   ever seen on the page. */
html.pn-arriving .pn-rise {
  animation: pn-rise calc(var(--t-morph) * 0.24) var(--ease) both;
  animation-delay: calc(var(--t-morph) * (0.6 + var(--pn-i, 0) * 0.04));
}

/* THE WORK MENU'S MORPH (morph.js). The tapped menu word glides and scales
   into the new page's title on the spring, above the veil (z 3), in its own
   ink. Forward: the word fades as its stand-in (a copy laid exactly over
   the new title) fades in by 30%, and the stand-in holds to the end, where
   the page's own title takes its place unseen. Back: the title holds, fades
   from 45%, and the menu word forms at the end. Both images keep their own
   shape while the box between them changes. */
::view-transition-group(pn-title) { z-index: 3; animation-timing-function: var(--ease-move); }
::view-transition-old(pn-title),
::view-transition-new(pn-title) { width: 100%; height: 100%; object-fit: contain; }
html.pn-menu-fwd::view-transition-old(pn-title) { animation: pn-word-out var(--t-morph) linear both; }
html.pn-menu-fwd::view-transition-new(pn-title) { animation: pn-stand-in var(--t-morph) linear both; }
html.pn-menu-back::view-transition-old(pn-title) { animation: pn-stand-out var(--t-morph) linear both; }
html.pn-menu-back::view-transition-new(pn-title) { animation: pn-word-in var(--t-morph) linear both; }

/* The page it returns to settles back in. */
html.pn-menu-back::view-transition-new(root) { animation: pn-settle-in calc(var(--t-morph) * 0.7) var(--ease) both; }

/* Without cross-document View Transitions, and for About from a project
   page: the veil fades in over the page left (.pn-flash), and on the next
   page (first paint) it sweeps off behind the line. */
.pn-flash {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-cursor) - 1);
  pointer-events: none;
  animation: pn-fade-up calc(var(--t-morph) * 0.4) var(--ease) both;
}
html.pn-flash-in::after {
  content: '';
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: calc(var(--z-cursor) - 1);
  pointer-events: none;
  animation: pn-veil-sweep calc(var(--t-morph) * 0.6) var(--ease-move) both;
}
html.pn-flash-back.pn-flash-in::after { animation-name: pn-veil-sweep-back; }

@keyframes pn-settle    { to { opacity: 0; transform: scale(0.97); } }
@keyframes pn-fade-up   { from { opacity: 0; } }
@keyframes pn-rise      { from { opacity: 0; transform: translateY(10px); } }
@keyframes pn-settle-in { from { opacity: 0; transform: scale(0.97); } }
@keyframes pn-veil-in {
  0%   { opacity: 0; animation-timing-function: cubic-bezier(0.3, 0, 0.2, 1); }
  32%, 100% { opacity: 1; }
}
@keyframes pn-veil-sweep      { to { transform: translateX(100%); } }
@keyframes pn-veil-sweep-back { to { transform: translateX(-100%); } }
@keyframes pn-word-out {
  0%   { opacity: 1; animation-timing-function: cubic-bezier(0.3, 0, 0.2, 1); }
  30%, 100% { opacity: 0; }
}
@keyframes pn-stand-in {
  0%   { opacity: 0; animation-timing-function: cubic-bezier(0.3, 0, 0.2, 1); }
  30%, 100% { opacity: 1; }
}
@keyframes pn-stand-out {
  0%, 45% { opacity: 1; animation-timing-function: cubic-bezier(0.45, 0, 0.25, 1); }
  80%, 100% { opacity: 0; }
}
@keyframes pn-word-in {
  0%, 60% { opacity: 0; animation-timing-function: cubic-bezier(0.3, 0, 0.2, 1); }
  100% { opacity: 1; }
}
@keyframes pn-cover-out {
  0%, 20% { opacity: 1; animation-timing-function: cubic-bezier(0.45, 0, 0.55, 1); }
  55%, 100% { opacity: 0; }
}
@keyframes pn-cover-in {
  0%, 25% { opacity: 0; animation-timing-function: cubic-bezier(0.45, 0, 0.55, 1); }
  70%, 100% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .pn-backdrop,
  .pn-flash,
  html.pn-flash-in::after { display: none; }
}
