/* Reflick's site: one page from a Renaissance notebook. Parchment, a faint graph-paper grid, sepia ink and red-chalk
   construction lines. Reflick orange appears only in the logo and the main button. */
:root {
  --paper: #efe6d5; --paper-deep: #e4d6bd; --ink: #2a1d14; --ink-soft: #5a4636; --sanguine: #a9472a;
  --orange: #ff5f1f; --action: #c8430c;
  --grid-minor: rgba(110, 72, 38, .09); --grid-major: rgba(110, 72, 38, .16);
  --display: 'IM Fell English', Georgia, serif; --sc: 'IM Fell English SC', 'Noto Sans Brahmi', Georgia, serif; --hand: 'La Belle Aurore', 'Noto Sans Brahmi', cursive; --sans: 'Geist', system-ui, sans-serif;
  --wrap: 1180px; --gutter: max(16px, calc((100vw - var(--wrap)) / 2));
}
* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); -webkit-font-smoothing: antialiased; }
body { margin: 0; font: 400 16px/1.6 var(--sans); }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; }
h1 { font-size: clamp(40px, 6vw, 78px); line-height: 1.02; letter-spacing: -0.015em; }
h1 em, h2 em { font-style: italic; color: var(--ink-soft); }
h2 { font-size: clamp(32px, 4vw, 48px); line-height: 1.08; letter-spacing: -0.01em; }

/* The page: a 24px grid with a heavier line every 120px, and a soft vignette over everything. */
.paper { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--grid-minor) 1px, transparent 1px), linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px),
    linear-gradient(var(--grid-major) 1px, transparent 1px), linear-gradient(90deg, var(--grid-major) 1px, transparent 1px);
  background-size: 24px 24px, 24px 24px, 120px 120px, 120px 120px; }
.vignette { position: fixed; inset: 0; z-index: 20; pointer-events: none; box-shadow: inset 0 0 160px rgba(120, 80, 40, .22); }

.label { font-family: var(--sc); font-size: 13px; letter-spacing: .14em; color: var(--sanguine); }
.note { font-family: var(--hand); font-size: 20px; color: var(--sanguine); line-height: 1.4; }
.lede { font-size: 18px; line-height: 1.6; color: var(--ink-soft); max-width: 52ch; }
.cap { font-family: var(--display); font-style: italic; color: var(--ink-soft); font-size: 17px; }

/* Buttons and the waitlist field: press feedback, never a jump. */
.pill { display: inline-flex; align-items: center; justify-content: center; height: 48px; padding: 0 24px; border-radius: 999px; font: 600 16px var(--sans);
  border: 1.5px solid var(--ink); color: var(--ink); background: transparent; cursor: pointer; transition: transform .16s cubic-bezier(.2, .9, .3, 1.2), background .2s, color .2s; }
.pill:active { transform: scale(.97); }
.pill:hover { background: var(--ink); color: var(--paper); }
.pill.action { background: var(--action); border-color: var(--action); color: #fff; height: 56px; padding: 0 28px; }
.pill.action:hover { background: #a9380a; border-color: #a9380a; }
.waitlist { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 36px; }
.waitlist input { height: 56px; flex: 1 1 220px; max-width: 320px; padding: 0 22px; border-radius: 999px; border: 1.5px solid rgba(42, 29, 20, .3); background: rgba(255, 252, 245, .55);
  font: 400 16px var(--sans); color: var(--ink); outline: none; transition: border-color .2s, box-shadow .2s; }
.waitlist input:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(169, 71, 42, .15); }
.waitlist-note { margin-top: 14px; }
/* a wrong email: the field's edge turns red chalk and the note gives a small shake */
.waitlist input[aria-invalid="true"] { border-color: var(--sanguine); box-shadow: 0 0 0 4px rgba(169, 71, 42, .15); }
/* the bots' trap: a field people never see; Cloudflare's check stays invisible unless it needs a click */
.waitlist .trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.waitlist .turnstile:empty { display: none; }
/* "Leave the waitlist", right in the note: a handwritten link, not a second button */
.note-action { padding: 0; border: 0; background: none; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.note-action:disabled { opacity: .5; cursor: default; }
.note-action:focus-visible { outline: 1.5px solid var(--sanguine); outline-offset: 3px; border-radius: 3px; }
.waitlist-note.shake { animation: shake .42s cubic-bezier(.36, .07, .19, .97); }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }

/* Nav */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; padding: 18px var(--gutter);
  background: rgba(239, 230, 213, .82); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color .3s; }
.nav.scrolled { border-bottom-color: rgba(42, 29, 20, .14); }
.brand { display: inline-flex; align-items: center; gap: 12px; font-family: var(--display); font-size: 30px; letter-spacing: -0.01em; }
.brand img { height: 34px; width: auto; }
.nav nav { display: flex; align-items: center; gap: 28px; font-family: var(--display); font-size: 19px; color: var(--ink-soft); }
.nav .pill { font: 400 19px var(--display); }
.nav nav a:not(.pill):hover { color: var(--ink); }

section { position: relative; padding: 72px var(--gutter); }

/* Hero: words on the left, the mark measured on the right. */
.hero { min-height: 100vh; padding-top: 150px; display: grid; grid-template-columns: 1.15fr 1fr; gap: 48px; align-items: center; }
.hero .label { margin-bottom: 18px; }
.hero .lede { margin-top: 28px; }
.measure { position: relative; margin: 0; }
.measure svg { width: 100%; overflow: visible; translate: calc(var(--px, 0) * -4px) calc(var(--py, 0) * -4px); } /* depth: the mark drifts toward the pointer, its lines a little the other way */
.measure .geo * { fill: none; stroke: var(--sanguine); stroke-width: 1; stroke-opacity: .7; }
.measure .geo .faint { stroke-opacity: .35; }
.measure .ticks line { stroke: var(--ink); stroke-width: 1.4; }
/* centred by its box, not a transform: GSAP owns the transform (entrance, drift) and must never be able to undo the centring */
.mark { position: absolute; inset: 0 4% 4% 0; margin: auto; width: 46%; filter: drop-shadow(0 18px 30px rgba(255, 95, 31, .28)); }
.measure .note { position: absolute; top: -6px; right: 10%; }
.measure .cap { position: absolute; bottom: -18px; left: 4%; }

/* Folio II: two journeys, side by side in time. */
.journeys .head { max-width: 760px; }
.journeys .head h2 { margin-top: 14px; }
.track { display: grid; grid-template-columns: 140px repeat(3, 1fr); gap: 0 28px; align-items: center; margin-top: 48px; }
.track + .track { margin-top: 12px; }
.track .who { font-family: var(--sc); letter-spacing: .14em; font-size: 13px; color: var(--sanguine); }
.track .who b { display: block; font-family: var(--display); font-style: italic; font-weight: 400; letter-spacing: 0; font-size: 24px; color: var(--ink); margin-top: 4px; }
.step { position: relative; }
.step + .step::before { content: ''; position: absolute; left: -26px; top: 64px; width: 24px; border-top: 1.2px dashed var(--sanguine); }
.step svg { width: 100%; max-width: 240px; height: auto; }
.step svg .ink { fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.step svg .chalk { fill: none; stroke: var(--sanguine); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.step svg .guide { fill: none; stroke: var(--sanguine); stroke-opacity: .45; stroke-width: .8; stroke-dasharray: 2 3; }
.step svg .star { fill: var(--orange); fill-opacity: .85; stroke: none; }
.step svg .faint { stroke-opacity: .38; }
.step svg .fig .ink, .step svg .fig .chalk { stroke-width: 1.05; }
.step svg .joint { fill: var(--paper); stroke: var(--sanguine); stroke-width: 1; }
.step svg .lbl { font: italic 11px var(--display); fill: var(--sanguine); }
.step h3 { font-size: 26px; margin-top: 6px; }
.step p { color: var(--ink-soft); font-size: 15px; max-width: 30ch; }
.step .sc { font-family: var(--sc); letter-spacing: .14em; font-size: 12px; color: var(--sanguine); }
.equals { margin-top: 56px; display: grid; grid-template-columns: 140px 1fr; gap: 28px; align-items: baseline; }
.equals p:last-child { font-family: var(--display); font-size: clamp(24px, 2.6vw, 34px); line-height: 1.25; }
.equals em { color: var(--ink-soft); }

/* Folio III: three studies, loose sheets pinned into the notebook, joined by one red-chalk thread. */
.sheets { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 56px; align-items: start; margin-top: 56px; }
.thread { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.thread path { fill: none; stroke: var(--sanguine); stroke-opacity: .7; stroke-width: 1.3; stroke-dasharray: 1 7; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.thread-v { display: none; }
.sheet { --sheet: #f6eedd; --tilt: -1.4deg; --tape: -4deg; position: relative; padding: 34px 28px 30px; transform: rotate(var(--tilt));
  background: radial-gradient(ellipse at 48% 38%, transparent 52%, rgba(150, 100, 50, .13)), url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .42 0 0 0 0 .3 0 0 0 0 .16 0 0 0 .07 0'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>"), var(--sheet);
  box-shadow: 0 1px 1px rgba(60, 30, 10, .12), 0 18px 30px -14px rgba(60, 30, 10, .35);
  transition: transform .55s cubic-bezier(.2, .8, .2, 1), box-shadow .55s cubic-bezier(.2, .8, .2, 1); }
.sheet:nth-of-type(2) { --tilt: 1deg; --tape: 3deg; margin-top: 72px; }
.sheet:nth-of-type(3) { --tilt: -.6deg; --tape: -2deg; margin-top: 24px; }
/* the plate mark an etching leaves pressed into the paper */
.sheet::after { content: ''; position: absolute; inset: 12px; border: 1px solid rgba(42, 29, 20, .14); box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .5); pointer-events: none; }
/* paper tape with torn ends */
.sheet::before { content: ''; position: absolute; z-index: 2; top: -14px; left: 50%; width: 104px; height: 30px; transform: translateX(-50%) rotate(var(--tape));
  background: rgba(233, 220, 190, .82); box-shadow: 0 1px 2px rgba(60, 30, 10, .12);
  clip-path: polygon(2% 0, 98% 0, 100% 16%, 97% 32%, 100% 50%, 97% 68%, 100% 84%, 98% 100%, 2% 100%, 0 84%, 3% 68%, 0 50%, 3% 32%, 0 16%); }
@media (hover: hover) { .sheet:hover { transform: translateY(-7px) rotate(var(--tilt)); box-shadow: 0 2px 2px rgba(60, 30, 10, .1), 0 30px 44px -18px rgba(60, 30, 10, .42); } }
/* a red wax seal carrying the study's Brāhmī numeral */
.wax { position: absolute; z-index: 3; top: -20px; right: 20px; display: grid; place-items: center; width: 58px; height: 56px; transform: rotate(-9deg);
  border-radius: 47% 53% 49% 51% / 52% 46% 54% 48%; background: radial-gradient(circle at 35% 30%, #c65a3c, #922c19 55%, #6a1b0e);
  color: #f2dcc4; font: 22px/1 'Noto Sans Brahmi', serif; text-shadow: 0 -1px 0 rgba(0, 0, 0, .4), 0 1px 0 rgba(255, 210, 190, .25);
  box-shadow: 0 2px 5px rgba(60, 20, 10, .35), inset 0 -3px 6px rgba(0, 0, 0, .25), inset 0 2px 3px rgba(255, 190, 160, .25); }
.wax::after { content: ''; position: absolute; inset: 8px; border-radius: 50%; border: 1px solid rgba(242, 220, 196, .35); }
.sheet .scene { width: 100%; height: auto; overflow: visible; }
.scene .ink { fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.scene .chalk { fill: none; stroke: var(--sanguine); stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }
.scene .guide { fill: none; stroke: var(--sanguine); stroke-opacity: .45; stroke-width: .8; stroke-dasharray: 2 3; }
.scene .faint { stroke-opacity: .38; }
.scene .fig .ink, .scene .fig .chalk { stroke-width: 1; }
.scene .joint, .scene .occlude { fill: var(--sheet); stroke: var(--sanguine); stroke-width: .9; }
.scene .occlude { stroke: none; }
.scene .glow { fill: var(--orange); fill-opacity: .22; stroke: none; }
/* the Sanskrit as a marginal note, its arrow pointing into the drawing */
.marg { display: flex; justify-content: flex-end; align-items: flex-start; gap: 4px; margin: -12px 0 10px; }
.marg .arrow { flex: none; width: 50px; height: 34px; fill: none; stroke: var(--sanguine); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.marg .note { font-size: 19px; text-align: right; }
.marg [lang="sa-Brah"] { white-space: nowrap; } /* the phrase stays whole; its English meaning may drop to the next line */
.sheet h3 { font-size: 32px; }
.sheet h3 + p { color: var(--ink-soft); margin-top: 6px; font-size: 15px; }
/* each scene moves once when its sheet is touched: the circles meet, the hammer strikes, the shared thing blooms */
.scene .act, .scene .act * { transform-box: view-box; }
.sheet.play .meet .l { animation: meet-left 1.3s cubic-bezier(.3, .7, .2, 1); }
.sheet.play .meet .r { animation: meet-right 1.3s cubic-bezier(.3, .7, .2, 1); }
.sheet.play .strike { animation: strike 1.1s cubic-bezier(.3, .7, .2, 1); }
.sheet.play .bloom { animation: bloom 1.4s cubic-bezier(.3, .7, .2, 1); }
@keyframes meet-left { 45% { transform: translateX(5px); } }
@keyframes meet-right { 45% { transform: translateX(-5px); } }
@keyframes strike { 30% { transform: rotate(-30deg); } 52% { transform: rotate(8deg); } 64% { transform: rotate(0); } }
@keyframes bloom { 45% { transform: scale(1.22); } }

/* Meet Agent R. */
.agent-r { display: grid; grid-template-columns: 1fr 1.25fr; gap: 56px; align-items: center; }
.agent-r .lede { margin-top: 22px; }
.agent-r ul { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; }
.agent-r li { padding-left: 30px; position: relative; }
.agent-r li::before { content: ''; position: absolute; left: 0; top: .8em; width: 16px; border-top: 1.2px solid var(--sanguine); }
/* Agent R's portrait study on a pinned sheet, with a photograph of the app pinned over its corner. */
.study-r { position: relative; margin: 0 0 130px; }
.study-r .sheet { max-width: 520px; }
.study-r .cap { display: block; margin-top: 4px; font-size: 15px; }
.wax.latin, .study-r .wax, .letter .wax, .medal-r .wax { font: italic 28px/1 var(--display); }
.scene .hand { font: 15px var(--hand); fill: var(--sanguine); }
.photo { position: absolute; right: 8px; bottom: -118px; width: 50%; padding: 10px 10px 34px; background: #fbf8f1; transform: rotate(3.5deg);
  box-shadow: 0 2px 3px rgba(60, 30, 10, .15), 0 22px 36px -16px rgba(60, 30, 10, .45); transition: transform .55s cubic-bezier(.2, .8, .2, 1); }
.photo img { filter: sepia(.25) saturate(.9) contrast(.96); }
.photo .note { position: absolute; left: 14px; bottom: 6px; font-size: 18px; }
.photo::before { content: ''; position: absolute; z-index: 2; top: -12px; left: 18px; width: 70px; height: 24px; transform: rotate(-20deg); background: rgba(233, 220, 190, .82);
  clip-path: polygon(2% 0, 98% 0, 100% 20%, 97% 40%, 100% 60%, 97% 80%, 98% 100%, 2% 100%, 0 80%, 3% 60%, 0 40%, 3% 20%); }
@media (hover: hover) { .photo:hover { transform: rotate(1.5deg) translateY(-6px) scale(1.03); } }

/* The room. */
.room .center { text-align: center; display: grid; justify-items: center; gap: 14px; }
.room .lede { text-align: center; }
.anatomy { position: relative; max-width: 1040px; margin: 40px auto 0; }
.film { position: relative; margin: 0; padding: 12px; border: 1px solid var(--ink); background: rgba(228, 214, 189, .5); }
.film::after { content: ''; position: absolute; inset: 5px; border: 1px solid rgba(42, 29, 20, .3); pointer-events: none; }
.screen { position: relative; }
.film video { width: 100%; aspect-ratio: 16 / 9; background: #1a120c; }
.film .cap { display: block; position: absolute; left: 12px; bottom: -30px; font-size: 15px; }
/* an anatomy plate: numbered pins on the parts, leader lines out to the legend */
.pin { position: absolute; z-index: 2; display: grid; place-items: center; width: 30px; height: 30px; transform: translate(-50%, -50%); border-radius: 50%;
  background: var(--paper); border: 1.5px solid var(--sanguine); color: var(--sanguine); font: italic 16px/1 var(--display); box-shadow: 0 0 0 4px rgba(239, 230, 213, .35);
  transition: transform .4s cubic-bezier(.2, .9, .3, 1.3), background .25s, color .25s, opacity .3s; }
.pin.lit, .legend li.lit .n { background: var(--sanguine); color: var(--paper); }
.pin.lit { transform: translate(-50%, -50%) scale(1.2); }
/* the plate is the still; the film plays on request, and the pins step aside while it runs */
.watch { position: absolute; right: 14px; bottom: 14px; z-index: 3; padding: 6px 18px; border: 0; border-radius: 999px; background: rgba(42, 29, 20, .78); color: #f6eedd;
  font: 400 19px var(--hand); cursor: pointer; transition: transform .16s cubic-bezier(.2, .9, .3, 1.2), background .2s; }
.watch:hover { background: rgba(42, 29, 20, .92); } .watch:active { transform: scale(.96); }
.watch:focus-visible { outline: 2px solid var(--sanguine); outline-offset: 3px; }
.anatomy.playing .pin, .anatomy.playing .leaders { opacity: 0; pointer-events: none; }
.leaders { transition: opacity .3s; }
.leaders { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.leaders path { fill: none; stroke: var(--sanguine); stroke-width: 1.1; stroke-dasharray: 2 4; stroke-linecap: round; opacity: .55; transition: opacity .25s; }
.leaders path.lit { opacity: 1; stroke-dasharray: none; }
.legend { list-style: none; padding: 0; margin: 64px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.legend li { display: grid; gap: 4px; align-content: start; cursor: default; }
.legend .n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--sanguine); font: italic 16px/1 var(--display); color: var(--sanguine); transition: background .25s, color .25s; }
.legend b { font: 400 22px var(--display); }
.legend span { color: var(--ink-soft); font-size: 15px; }

/* Agents: ink seals. */
/* Agents: a tray of engraved medallions; Agent R's is the red wax seal, and yours waits unfinished in chalk. */
.medals { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px; }
.medals li { position: relative; display: grid; justify-items: center; gap: 12px; text-align: center; }
.medals li:nth-child(odd) { transform: rotate(-4deg); } .medals li:nth-child(even) { transform: rotate(3deg) translateY(10px); }
.medals .medal, .medals .wax { width: 112px; height: 112px; transition: transform .6s cubic-bezier(.2, .9, .3, 1.2); }
.medals .medal .ink { fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-linecap: round; }
.medals .medal .chalk { fill: none; stroke: var(--sanguine); stroke-width: 1.1; stroke-linecap: round; }
.medals .medal .faint { stroke-opacity: .45; }
.medals .medal .guide { fill: none; stroke: var(--sanguine); stroke-width: 1.2; stroke-dasharray: 3 4; }
.medals i { position: absolute; top: 56px; left: 50%; transform: translate(-50%, -50%); font: italic 34px/1 var(--display); color: var(--ink); pointer-events: none; }
.medals .yours i { color: var(--sanguine); font-style: normal; }
.medals .wax { position: static; transform: rotate(-8deg); font-size: 44px; }
.medals b { font: 400 13px var(--sc); letter-spacing: .14em; color: var(--sanguine); }
@media (hover: hover) { .medals li:hover .medal, .medals li:hover .wax { transform: rotate(22deg) scale(1.06); } }

.small { font-size: 14px; color: var(--ink-soft); margin-top: 22px; }

/* Close. */
.close { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; }
.close h2 { font-size: clamp(32px, 3.8vw, 52px); }
/* The waitlist as a letter: a salutation, a line to sign with your email, and the seal. */
.letter { --tilt: 1.2deg; padding: 44px 40px 34px; }
.letter .salute { font: 400 30px var(--hand); color: var(--ink); }
.letter .hand-line { margin-top: 10px; font: italic 21px/1.45 var(--display); color: var(--ink-soft); }
.letter .waitlist { margin-top: 26px; align-items: flex-end; }
.letter .sign { display: flex; align-items: baseline; gap: 12px; flex: 1 1 260px; }
.letter .sign span { font: 400 24px var(--hand); color: var(--ink); }
.letter .waitlist input { flex: 1; min-width: 0; max-width: none; height: 44px; padding: 0 4px; border: 0; border-bottom: 1.5px solid var(--ink); border-radius: 0; background: transparent;
  font: italic 20px var(--display); }
.letter .waitlist input:focus, .letter .waitlist input[aria-invalid="true"] { border-bottom-color: var(--sanguine); box-shadow: 0 1.5px 0 var(--sanguine); }
.letter .waitlist-note { margin-top: 18px; font-size: 18px; }

.foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 28px var(--gutter) 36px; border-top: 1px solid rgba(42, 29, 20, .2); font-size: 14px; color: var(--ink-soft); }
.foot .brand { font-size: 20px; }
.foot .brand img { height: 22px; }
.foot .social { display: flex; gap: 6px; }
.foot .social a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--ink-soft); transition: color .2s, transform .16s cubic-bezier(.2, .9, .3, 1.2); }
.foot .social a:hover, .foot .social a:focus-visible { color: var(--sanguine); transform: translateY(-2px) rotate(-4deg); }
.foot .social a:active { transform: scale(.92); }
.foot .social svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.foot .social .dot { fill: currentColor; }
.foot { flex-wrap: wrap; }
.foot a { color: inherit; text-decoration: underline; text-decoration-color: rgba(42, 29, 20, .35); text-underline-offset: 3px; }
.foot a:hover { color: var(--ink); text-decoration-color: currentColor; }
/* The waitlist's count (main.js fills it from the service; hidden until it has a real number). */
.waitlist-count { margin-top: 10px; font-family: var(--display); font-size: 19px; color: var(--ink-soft); animation: count-in .5s ease both; }
.waitlist-count b { font-weight: 400; color: var(--ink); font-variant-numeric: tabular-nums; display: inline-block; text-align: right; }
.letter .waitlist-count { font-size: 18px; }
@keyframes count-in { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .waitlist-count { animation: none; } }
.fine { margin-top: 8px; font-size: 13px; color: var(--ink-soft); }
.fine a { color: inherit; text-underline-offset: 3px; }
.mirror { font-family: var(--hand); color: var(--sanguine); font-size: 20px; transform: scaleX(-1); display: inline-block; }

@media (max-width: 860px) {
  .hero, .agent-r, .close { grid-template-columns: 1fr; }
  .study-r { margin-bottom: 24px; }
  .photo { position: relative; right: auto; bottom: auto; width: 80%; margin: -10px 4px 0 auto; }
  .medals { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 36px; }
  .legend { margin-top: 48px; }
  .leaders { display: none; }
  .hero { padding-top: 120px; }
  .equals { grid-template-columns: 1fr; gap: 16px; }
  /* The two journeys stay side by side, each step level with its counterpart (fire with mathematics, and so on). */
  .tracks { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(4, auto); gap: 28px 16px; margin-top: 40px; }
  .track, .track + .track { grid-row: span 4; grid-template-columns: 1fr; grid-template-rows: subgrid; align-items: start; margin-top: 0; }
  .track .who b { font-size: 20px; }
  .step h3 { font-size: 20px; }
  .step p { font-size: 14px; }
  .step + .step::before { display: none; }
  .sheets { grid-template-columns: 1fr; gap: 72px; max-width: 520px; margin-inline: auto; }
  .sheet:nth-of-type(n) { margin-top: 0; }
  .thread-h { display: none; }
  .thread-v { display: inline; }
  .legend { grid-template-columns: 1fr 1fr; }
  .foot { flex-direction: column; }
}
@media (max-width: 600px) { section { padding-block: 56px; } .hero { padding-top: 120px; }
  .pin { width: 22px; height: 22px; font-size: 13px; box-shadow: 0 0 0 2px rgba(239, 230, 213, .35); }
  .watch { left: 6px; right: auto; bottom: 6px; padding: 2px 12px; font-size: 15px; } }

/* Sanskrit glosses: tap or hover a Brāhmī label and its meaning writes itself in beside it, left to right. */
[lang="sa-Brah"][role="button"] { cursor: pointer; text-decoration: underline dotted rgba(169, 71, 42, .55); text-underline-offset: 5px; border-radius: 3px; }
[lang="sa-Brah"][role="button"]:focus-visible { outline: 1.5px solid var(--sanguine); outline-offset: 3px; }
.gloss { display: inline-block; max-width: 0; overflow: hidden; white-space: nowrap; vertical-align: middle; padding: 4px 0; font: 400 17px/1.3 var(--hand); letter-spacing: 0; color: var(--sanguine);
  transition: max-width .7s cubic-bezier(.2, .8, .2, 1); }
.gloss::before { content: ''; display: inline-block; width: .6em; }
[aria-expanded="true"] + .gloss { max-width: 24em; }
.mirror .gloss { transform: scaleX(-1); }

/* The two journeys pair up: a red-chalk ring is drawn round the chosen step's sketch and its counterpart's, the way
   you would circle two things in a notebook; nothing else changes. */
.step h3 { transition: color .35s; }
.step.paired h3 { color: var(--sanguine); }
.ring { position: absolute; left: -12px; top: -10px; width: min(calc(100% + 24px), 264px); aspect-ratio: 264 / 200; overflow: visible; pointer-events: none; }
.ring path { fill: none; stroke: var(--sanguine); stroke-width: .6; stroke-linecap: round; /* scales with the box: Chrome mis-dashes pathLength with non-scaling strokes */
  stroke-dasharray: 1 1; stroke-dashoffset: 1; transition: stroke-dashoffset .45s cubic-bezier(.4, 0, .6, 1); }
.step.paired .ring path { stroke-dashoffset: 0; transition-duration: .8s; }

/* Phones: the section links fold into a parchment sheet under the bar. */
.links { display: contents; }
.menu-toggle { display: none; }
@media (max-width: 600px) {
  .nav nav { gap: 10px; }
  .menu-toggle { display: inline-grid; place-content: center; gap: 6px; width: 48px; height: 48px; padding: 0; border: 1.5px solid var(--ink); border-radius: 50%; background: transparent; cursor: pointer;
    transition: transform .16s cubic-bezier(.2, .9, .3, 1.2); }
  .menu-toggle:active { transform: scale(.94); }
  .menu-toggle i { display: block; width: 16px; height: 1.5px; background: var(--ink); transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
  .menu-toggle[aria-expanded="true"] i:first-child { transform: translateY(3.75px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] i:last-child { transform: translateY(-3.75px) rotate(-45deg); }
  .links { display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; padding: 4px var(--gutter) 18px; background: var(--paper); /* solid: under the bar's backdrop blur, a translucent sheet lets the page show through */
    border-bottom: 1px solid rgba(42, 29, 20, .14); box-shadow: 0 18px 30px rgba(60, 30, 10, .12);
    opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .25s, transform .3s cubic-bezier(.2, .8, .2, 1), visibility 0s .3s; }
  .nav.open .links { opacity: 1; visibility: visible; transform: none; transition: opacity .25s, transform .3s cubic-bezier(.2, .8, .2, 1); }
  .links a { padding: 12px 0; font-size: 24px; color: var(--ink); border-bottom: 1px solid rgba(42, 29, 20, .1); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* The intro, once a visit: the first page of the notebook. The same parchment and grid as the page, two hands in ink
   inside a measured red-chalk circle, a small spark, the R growing out of it and settling into the hero's R. The hands
   sit so the gap between the fingertips (666, 229 of 1400 x 430) is the centre of the screen, and are at least 110vw
   wide so both arms run off the edges. */
.intro { display: none; }
html.intro-on { overflow: hidden; }
.intro-on .hero .mark { visibility: hidden; } /* the intro's R lands on it, then hands over */
.intro-on .intro { display: block; position: fixed; inset: 0; z-index: 100; cursor: pointer;
  --sw: min(max(110vw, 120vh), 230vw); --sh: calc(var(--sw) * 430 / 1400); --r: min(24vmin, 230px); }
.intro-paper { position: absolute; inset: 0; background-color: var(--paper);
  background-image: linear-gradient(var(--grid-minor) 1px, transparent 1px), linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px),
    linear-gradient(var(--grid-major) 1px, transparent 1px), linear-gradient(90deg, var(--grid-major) 1px, transparent 1px);
  background-size: 24px 24px, 24px 24px, 120px 120px, 120px 120px; box-shadow: inset 0 0 160px rgba(120, 80, 40, .22); }
.intro-scene { position: absolute; width: var(--sw); height: var(--sh); left: calc(50vw - var(--sw) * 0.4757); top: calc(50vh - var(--sh) * 0.5326); }
.intro-hand { position: absolute; top: 0; height: 100%; max-width: none; opacity: 0;
  -webkit-mask-image: linear-gradient(var(--dir), #000 45%, transparent 55%); mask-image: linear-gradient(var(--dir), #000 45%, transparent 55%);
  -webkit-mask-size: 260% 100%; mask-size: 260% 100%; -webkit-mask-position: var(--reveal) 0; mask-position: var(--reveal) 0; }
.intro-hand.left { left: 0; width: 47.57%; --dir: to right; --reveal: 100%; }
.intro-hand.right { left: 47.57%; width: 52.43%; --dir: to left; --reveal: 0%; }
.intro-measure { position: absolute; left: calc(50% - var(--r) * 1.15); top: calc(50% - var(--r) * 1.15); width: calc(var(--r) * 2.3); overflow: visible; }
.intro-measure path { fill: none; stroke: var(--sanguine); stroke-width: .7; stroke-opacity: .65; stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.intro-measure .faint { stroke-opacity: .3; }
.intro-spark { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--orange); opacity: 0;
  box-shadow: 0 0 8px 2px rgba(255, 95, 31, .5), 0 0 28px 8px rgba(255, 95, 31, .18); }
/* centred by position, not translate: GSAP moves it in the hand-off, and GSAP clears translate */
.intro-mark { position: absolute; left: calc(50% - var(--r) / 2); top: calc(50% - var(--r) * 981 / 961 / 2); width: var(--r); aspect-ratio: 961 / 981; }
.intro-piece { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; opacity: 0; }
.intro-skip { position: absolute; right: 20px; bottom: 20px; padding: 4px 16px; border: 1px solid rgba(42, 29, 20, .25); border-radius: 999px; background: transparent;
  color: var(--ink-soft); font: 400 18px var(--hand); opacity: .75; cursor: pointer; transition: opacity .2s, transform .16s cubic-bezier(.2, .9, .3, 1.2); }
.intro-skip:hover, .intro-skip:focus-visible { opacity: 1; } .intro-skip:active { transform: scale(.96); }
.intro-skip:focus-visible { outline: 2px solid var(--sanguine); outline-offset: 3px; }
