/* ==========================================================================
   Ricky Munoz — one-page site
   STYLE LIBRARY. Every colour, text style, space and radius is named once here;
   rules below only read these names.
     1. Colour   2. Text   3. Spacing   4. Shape   5. Motion
   ========================================================================== */

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-var-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  /* ---- 1. Colour ----
     Rules read roles, never swatches. A theme (themes.css) redefines the roles; these defaults
     are the original bold palette ("Signal"). */
  --white: #ffffff;
  --black: #0d0d0d;
  --blue: #1f3bff;              /* white on it: 6.7:1 */
  --lime: #d7ff3d;
  --lime-deep: #c4ee22;
  --orange: #ff5b1f;            /* black on it: 6.2:1 */
  --orange-deep: #f04c10;

  /* page */
  --ground: var(--white);
  --ink: var(--black);
  --ink-soft: #595959;          /* 7:1 on white */
  --surface: #f2f2f0;           /* one tone step off the ground */
  --accent: var(--blue);        /* open project, focus ring, the 4 of 4 */
  --hint: var(--accent);        /* the finger that shows how a control works, on the ground */
  --hint-paper: var(--accent);  /* the same finger on the light toolkit field (Noir deepens it) */
  --x-ink: #e5322b;             /* the red X drawn over "slop." */
  --o-ink: #12a150;             /* the green circle drawn around "Ricky" */
  --mark-tick: var(--o-ink);    /* the tick in the switch card: the ring's colour unless a theme floods the card in it */
  --fc-o: #064d24;   /* the ring on the contact field: green can't hold 3:1 on orange, so it goes deep green */
  --fc-mark-a: 0.42;   /* the contact field's quiet marks, the X on "slop" and the location ring: its ink, mostly see-through */
  --btn-bg: var(--black);   --btn-ink: var(--white);
  --btn-hover-bg: var(--blue); --btn-hover-ink: var(--white);
  /* deep surfaces: the code diagram, floating button */
  --deep: var(--black);  --on-deep: var(--white);  --on-deep-soft: rgba(255, 255, 255, 0.72);
  --hi: var(--lime);     --on-hi: var(--black);    /* highlight on deep surfaces */
  --float-bg: var(--deep); --float-ink: var(--hi);   /* the floating call to action */
  /* field A: why, menu */
  --fa-bg: var(--blue);  --fa-ink: var(--white);
  /* the slop test panel */
  --panel-bg: var(--white); --panel-ink: var(--black); --panel-soft: #595959; --panel-track: #f2f2f0;
  --panel-on-bg: var(--lime); --panel-on-ink: var(--black);
  --panel-dim: 0.62; --panel-on-dim: 0.62;   /* how far a quiet label on the card is dimmed, off and switched on: still 4.5:1 */
  --mark-good: var(--black); --mark-good-ink: var(--lime);
  --count-on: var(--blue);
  /* field B: skills */
  --fb-bg: var(--lime);  --fb-ink: var(--black);  --fb-soft: #3d4012;   /* 9:1 on lime */
  --fb-head: var(--blue);
  --fb-hover-bg: var(--black); --fb-hover-ink: var(--lime); --fb-hover-soft: var(--white);
  --fb-surface: color-mix(in srgb, var(--fb-ink) 7%, var(--fb-bg));   /* one tone step inside the field: a toolkit card */
  /* the drawn underline: a hand-drawn stroke, like the ring and the X, that the background stretches along each
     line of a toolkit phrase and under the hero's cue. Toolkit: one plain line, thin and quiet at rest, heavier in ink once picked or hovered.
     An SVG file can't read a role, so each theme sets its own four (assets/img/marks/; the CSP's img-src 'self' allows files, never data: URIs) (toolkit rest and pick, cue rest and pick) */
  --under-quiet: url("../img/marks/under-quiet-signal.svg"); --under-pick: url("../img/marks/under-pick-signal.svg"); --under-ink: url("../img/marks/under-ink-signal.svg"); --under-cue-pick: url("../img/marks/under-cue-pick-signal.svg");
  --mark-hl: url("../img/marks/mark-hl-signal.svg");   /* the highlighter behind the picked phrase: one clean band, straight edges and soft corners, the same shape in every theme; the band in Signal's orange, ink on it 6.3:1 */
  --mark-under-h: 0.32em; --mark-hl-h: 1.04em; --mark-hl-y: 0.14em;   /* the toolkit marks: underline height, the band's height and its lift, so it covers the full height of the letters */
  --mark-run: 0.14em;   /* how far the band runs past each end of a phrase; the phrase gives it back in margin, so the words never move */
  /* field C: contact */
  --fc-bg: var(--orange); --fc-alt: var(--orange-deep); --fc-ink: var(--black);
  --fc-hover-bg: var(--black); --fc-hover-ink: var(--orange);
  /* field S: the statement band after the hero: the page's ink, with the hero's green ring */
  --fs-bg: var(--deep); --fs-ink: var(--on-deep); --fs-soft: var(--on-deep-soft); --fs-o: var(--o-ink);
  /* footer */
  --footer-bg: var(--black); --footer-ink: var(--white); --footer-soft: rgba(255, 255, 255, 0.72); --footer-mark: var(--lime);
  --hairline: color-mix(in srgb, currentColor 30%, transparent);   /* a divider inside a panel, drawn from whatever ink the panel uses: about 2:1, plainly visible but quieter than text */

  /* experience: one colour per kind of entry, 4.5:1 or more on the ground (themes redefine them) */
  --kind-role: var(--accent); --kind-project: #d63c0a; --kind-business: #0e7a3e;

  --text-heading: var(--ink);
  --text-body: var(--ink);
  --text-secondary: var(--ink-soft);

  /* ---- 2. Text: five sizes; a display face over a text face (themes set both) ---- */
  --font: "Inter", "Helvetica Neue", Arial, system-ui, sans-serif;   /* text face */
  --font-display: var(--font);                                         /* display face */
  --w-display: 800; --w-head: 800; --w-lead: 600; --w-strong: 600; --w-label: 600; --w-name: 800;
  --lh-display: 0.86; --lh-head: 0.92; --lh-lead: 1.18;
  /* the hero is sized to its widest line: "Stop choosing" (wide) and "choosing" (phone), in em of the display face */
  --fit-wide: 6.2; --fit-phone: 3.95;
  --fit-contact: 12.95;  /* the contact line's width in title-size ems at its phone proportions, so it stays on one line */
  --step-small: 0.875rem;                                  /* 14 */
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem); /* 17–19 */
  --step-lead: clamp(1.375rem, 1.15rem + 0.9vw, 2.125rem); /* 22–34 */
  --step-head: clamp(2.5rem, 1.2rem + 5.6vw, 7rem);        /* 40–112 */
  --step-statement: var(--step-lead);                      /* statements stay at or under 36px (24 on phones) */
  /* hero only: "Stop choosing" is 6.05em wide in Inter 800, so this runs it margin to margin */
  /* on phones the headline stacks "Stop / choosing / slop." and "choosing" (3.75em) sets the width */
  --step-display: calc((100vw - 2 * var(--gutter)) / var(--fit-phone));

  --track-display: -0.06em; --track-head: -0.05em; --track-lead: -0.025em; --track-name: -0.04em;
  --track-body: -0.005em; --track-strong: -0.01em; --track-small: 0; --track-label: -0.01em;
  --track-caps: 0.14em;   /* the one run of capitals: the experience spine's word */
  --type-display: var(--w-display) var(--step-display)/var(--lh-display) var(--font-display);
  --type-head:    var(--w-head) var(--step-head)/var(--lh-head) var(--font-display);
  --type-lead:    var(--w-lead) var(--step-lead)/var(--lh-lead) var(--font-display);
  --type-statement: var(--w-lead) var(--step-statement)/var(--lh-lead) var(--font-display);
  --type-body:    400 var(--step-body)/1.55 var(--font);
  --type-strong:  var(--w-strong) var(--step-body)/1.4 var(--font);
  --type-small:   500 var(--step-small)/1.45 var(--font);
  --type-label:   var(--w-label) var(--step-body)/1 var(--font);
  /* the statement band: the equation at poster size, between a statement and a heading, with the leading of a
     short paragraph rather than a title, since its lines sit one under another and the result may wrap */
  --step-say: clamp(2rem, 1.1rem + 3.9vw, 4.75rem);   /* 32–76: the result */
  --step-say-term: calc(var(--step-say) * 0.78);       /* 25–59: the closing line, a step under the claim */
  --step-say-part: clamp(2.6rem, 1rem + 7vw, 7.5rem);  /* 42–120: the three parts the band builds from, at poster size */
  --step-say-claim: clamp(2.25rem, 0.9rem + 5.2vw, 6.25rem);   /* 36–100: what they combine into, the band's claim */
  --type-say:     var(--w-head) var(--step-say)/1.04 var(--font-display);

  /* ---- 3. Spacing (8-point scale, stepped by breakpoint) ---- */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;
  --space-9: 96px; --space-10: 128px; --space-11: 192px;

  --gutter: var(--space-4);
  --pad-l: var(--space-5);
  --pad-m: var(--space-4);
  --pad-s: var(--space-3);
  --gap-tight: var(--space-2);
  --gap: var(--space-4);
  --gap-action: var(--space-5);
  --gap-group: var(--space-6);
  --gap-inline: var(--space-4);
  --section-gap: var(--space-9);

  /* ---- 4. Shape ---- */
  --radius-btn: var(--round);    /* every button and chip is a full pill */
  --round: 999px;                /* only for the switch and round arrow */
  --tap: 48px;
  --btn-h: 60px;
  --shell: 1440px;
  --mark: 4px;       /* filled bars: a card's kind bar, diagram links, bullet dashes */
  --dot: 12px;       /* a stage in a diagram, a kind dot */
  --hint-size: 40px; /* the hint finger's width (its height is 5/4 of it) */
  --area-dot: calc(var(--dot) / 2.4);   /* the small dot that marks each toolkit area */
  --loop: 220px;     /* the test-loop drawing */
  --peek: 72%;       /* a card's share of the strip on phones: neighbours always show */
  --font-code: ui-monospace, "SF Mono", Menlo, Consolas, monospace;   /* real code only: the toolkit test */ /* taste-skill-ignore */

  /* ---- 5. Motion ---- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 180ms;
  --dur-base: 420ms;
  --dur-slow: 900ms;
}

@media (min-width: 720px) {
  :root {
    --gutter: var(--space-6);
    --pad-l: var(--space-6); --pad-m: var(--space-5); --pad-s: var(--space-4);
    --gap-group: var(--space-7);
    --section-gap: var(--space-10);
  }
}
@media (min-width: 1024px) {
  :root {
    --gutter: var(--space-7);
    --pad-l: var(--space-7); --pad-m: var(--space-6); --pad-s: var(--space-5);
    --section-gap: var(--space-11);
    --btn-h: 68px;
  }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--space-5); }
body { margin: 0; background: var(--footer-bg); color: var(--text-body); font: var(--type-body); letter-spacing: var(--track-body); font-optical-sizing: auto; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--hi); color: var(--on-hi); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.field--blue :focus-visible, .footer :focus-visible { outline-color: var(--hi); }
.field--orange :focus-visible { outline-color: var(--fc-ink); }
.field--lime :focus-visible { outline-color: var(--fb-ink); }
.field--ink :focus-visible { outline-color: var(--fs-o); }

.skip { position: absolute; left: var(--gutter); top: -100px; z-index: 50; background: var(--btn-bg); color: var(--btn-ink); padding: var(--pad-s) var(--pad-m); font: var(--type-label); text-decoration: none; }
.skip:focus { top: var(--space-4); }

/* ---------- Text styles applied ---------- */
.hero__title           { font: var(--type-display); letter-spacing: var(--track-display); color: var(--text-heading); }
.h-head                { font: var(--type-head); letter-spacing: var(--track-head); text-wrap: balance; }
.h-lead, .crow, .menu__list a, .dg__fig b, .test__line
                       { font: var(--type-lead); letter-spacing: var(--track-lead); }
.statement, .lead, .tk-sentence
                       { font: var(--type-statement); letter-spacing: var(--track-lead); }
.eq__part, .eq__claim, .eq__tail { font: var(--type-say); letter-spacing: var(--track-head); }
.row__text, .xp-points, .tk-next__body
                       { font: var(--type-body); letter-spacing: var(--track-body); }
.row__topic, .footer__h, .test__score, .tk-next__k
                       { font: var(--type-strong); letter-spacing: var(--track-strong); }
.btn, .float-cta, .menu__close
                       { font: var(--type-label); letter-spacing: var(--track-label); }
.hero__links, .menu-btn, .test__label--slop, .test__note, .dg, .tk-skill__areas, .tk-used, .footer__legal, .footer__cols p
                       { font: var(--type-small); letter-spacing: var(--track-small); }

/* ---------- Frame ---------- */
.page { position: relative; z-index: 1; background: var(--ground); }
.shell { width: 100%; max-width: var(--shell); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-gap); }
.field { padding-block: var(--section-gap); }
.field--blue   { background: var(--fa-bg); color: var(--fa-ink); }
.field--lime   { background: var(--fb-bg); color: var(--fb-ink); }
.field--orange { background: var(--fc-bg); color: var(--fc-ink); }
.field--ink    { background: var(--fs-bg); color: var(--fs-ink); }
.field .h-head { color: inherit; }

.lead { max-width: 22em; text-wrap: pretty; }
.statement { max-width: 26em; text-wrap: pretty; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--gap-inline); min-height: var(--btn-h); padding-inline: calc(var(--pad-l) + var(--space-2)); border-radius: var(--radius-btn); text-decoration: none; white-space: nowrap; transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease, transform var(--dur-base) var(--ease-out); will-change: transform; }
.btn__arrow { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: square; transition: transform var(--dur-base) var(--ease-out); }
.btn:hover .btn__arrow, .btn:focus-visible .btn__arrow { transform: translateX(6px); }
.btn:active { transform: scale(0.97); }
.btn--ink  { background: var(--btn-bg); color: var(--btn-ink); }
.btn--ink:hover  { background: var(--btn-hover-bg); color: var(--btn-hover-ink); }

/* ==========================================================================
   HERO — two-line statement, full width
   ========================================================================== */
.hero { position: relative; min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto 1fr; background: var(--ground); overflow: clip; }
.hero__nav { display: flex; align-items: center; justify-content: space-between; padding-block: var(--space-5); }
/* the wordmark: "Choose" over "Ricky.com", the second line starting under the second "o", set like the hero */
.wordmark { display: grid; font-family: var(--font-display); font-weight: var(--w-display); font-size: clamp(1.125rem, 1rem + 0.4vw, 1.375rem); line-height: 0.9; letter-spacing: calc(var(--track-display) * 0.5); color: var(--ink); text-decoration: none; white-space: nowrap; transition: color var(--dur-fast) ease; }
.wm__ghost { visibility: hidden; }
.wordmark:hover, .wordmark:focus-visible { color: var(--accent); }
.hero__links { display: none; gap: var(--space-5); }
.hero__links a, .footer a { position: relative; text-decoration: none; padding-block: var(--space-1); }
.hero__links a::after, .footer a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform var(--dur-base) var(--ease-out); }
.hero__links a:hover::after, .hero__links a:focus-visible::after, .footer a:hover::after, .footer a:focus-visible::after { transform: scaleX(1); transform-origin: left; }
.menu-btn { min-height: var(--tap); padding-inline: var(--space-2); margin-right: calc(var(--space-2) * -1); }
/* theme switcher: a small outlined pill; each press steps to the next theme */
.wordmark { margin-right: auto; }
.theme-btn { min-height: 36px; margin-block: calc((var(--tap) - 36px) / 2); margin-right: var(--space-3); padding-inline: var(--space-3); border-radius: var(--radius-btn); font: var(--type-small); letter-spacing: var(--track-small); color: var(--ink); outline: var(--chip-line, 2px) solid currentColor; outline-offset: calc(var(--chip-line, 2px) * -1); white-space: nowrap; transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease, transform var(--dur-fast) ease; touch-action: manipulation; }
.theme-btn:hover { background: var(--surface); }
.theme-btn:active { transform: scale(0.96); }

.hero__body { align-self: start; padding-top: 8svh; }
.hero__title { display: grid; }
.hero__title .lines { display: grid; }
.hero__title .line { display: block; overflow: clip; padding-bottom: 0.2em; margin-bottom: -0.2em; }
.only-phone { display: inline; }
.hero__title [data-line] { display: block; white-space: nowrap; }
.line--b { text-align: left; }

/* the play on the headline: an X drawn over "slop.", then the answer with a circle drawn around "Ricky" */
/* "slop." is knocked slightly off its baseline: each letter has its own small height (--y) and tilt (--r),
   enough to look careless while every letter stays readable. Pure vector transforms, no filters, so it
   stays sharp at any size. The word, X included, sits a few pixels low; the line gets headroom. */
.hero .line--b { padding-top: 0.15em; margin-top: -0.15em; }
.cross { top: 3px; }
.slop-word { display: inline-block; }
.slop-word > span { display: inline-block; transform: translateY(var(--y, 0)) rotate(var(--r, 0deg)); transform-origin: 50% 70%; }
.cross, .ring { position: relative; display: inline-block; }
.mark { position: absolute; overflow: visible; pointer-events: none; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mark path { stroke-dasharray: 1; stroke-dashoffset: 0; }
.mark--x { inset: 0.12em -0.04em 0.04em -0.06em; width: calc(100% + 0.1em); height: calc(100% - 0.16em); }
.mark--x path { stroke: var(--x-ink); stroke-width: 8; }
/* the answer, a step under the headline */
.hero__base { padding-top: max(var(--space-8), 10svh); }   /* a gap between the headline and the answer */
.hero__answer { font: var(--type-head); font-size: min(calc(var(--step-head) * 1.2), 13svh); letter-spacing: var(--track-head); color: var(--text-heading); text-align: right; text-wrap: balance; }

/* scrolling away leaves only "Choose Ricky": the headline lines and "instead." drift out and fade at one
   pace (--sp, 0 to 1, is set on .hero by script); "Choose" holds still beside "Ricky", which grows a little */
.hero .line--a, .hero .line--b, .aw--3 { opacity: calc(1 - var(--sp, 0) * 0.8); }
.hero .line--a { transform: translateX(calc(var(--sp, 0) * -6vw)); }
.hero .line--b, .aw--3 { transform: translateX(calc(var(--sp, 0) * 6vw)); }
.aw { display: inline-block; }
.aw--2 { transform: scale(calc(1 + var(--sp, 0) * 0.18)); transform-origin: 0 60%; }   /* grows rightward, into the room "instead." leaves */
/* Where the browser can tie an animation to scrolling itself, the same drift runs there instead: on the
   graphics card, in step with the trackpad at any refresh rate, with no script per frame. The hero's exit
   from 0% to 62.5% is the script's --sp from 0 to 1 (it reached 1 at 1/1.6 of the hero's height) */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .hero { view-timeline: --hero block; }
    .hero .line--a, .hero .line--b, .aw--3, .aw--2 { animation-timing-function: linear; animation-fill-mode: both; animation-timeline: --hero; animation-range: exit 0% exit 62.5%; }
    .hero .line--a { animation-name: drift-left; }
    .hero .line--b, .aw--3 { animation-name: drift-right; }
    .aw--2 { animation-name: grow-ricky; }
  }
}
@keyframes drift-left { to { opacity: 0.2; transform: translateX(-6vw); } }
@keyframes drift-right { to { opacity: 0.2; transform: translateX(6vw); } }
@keyframes grow-ricky { to { transform: scale(1.18); } }

/* the scroll cue at the foot of the first screen: dotted-underlined words over a bobbing arrow */
/* the cue sits low, one row: an arrow either side of the words, so the centred link stays balanced */
.hero__cue { align-self: end; justify-self: center; display: inline-flex; align-items: center; gap: var(--space-3); min-height: var(--tap); padding: var(--space-2) var(--space-4) max(var(--space-3), env(safe-area-inset-bottom)); color: var(--ink); text-decoration: none; transition: color var(--dur-fast) ease, opacity var(--dur-base) ease; }
.hero__cue-text { position: relative; font: var(--type-label); letter-spacing: var(--track-label); padding-bottom: var(--space-2); }
.hero__cue-text::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 0.3em; background: var(--under-ink) 0 100% / 100% 100% no-repeat; transform-origin: left center; }   /* the drawn underline, as on the toolkit phrases */
.hero__cue-arrow { width: 0.6em; height: 0.9em; margin-bottom: var(--space-2); fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }   /* sized to the words; lifted to sit level with them above the underline */
.hero__cue:hover, .hero__cue:focus-visible { color: var(--o-ink); }
.hero__cue:hover .hero__cue-text::after, .hero__cue:focus-visible .hero__cue-text::after { background-image: var(--under-cue-pick); }
.hero__cue.is-gone { opacity: 0; pointer-events: none; }
@media (max-height: 760px) { .hero .hero__cue { padding-bottom: max(var(--space-2), env(safe-area-inset-bottom)); } .hero .hero__nav { padding-block: var(--space-4); } }
.mark--o { inset: -0.14em -0.3em -0.1em -0.3em; width: calc(100% + 0.6em); height: calc(100% + 0.24em); }
.mark--o path { stroke: var(--o-ink); stroke-width: 7; }



@media (min-width: 720px) {
  /* never so tall that the answer and the scroll cue leave the first screen */
  :root { --step-display: min(calc((min(100vw, var(--shell)) - 2 * var(--gutter)) / var(--fit-wide)), 27svh); }
  .only-phone { display: none; }
  .hero__links { display: flex; }
  .theme-btn { margin-left: var(--space-5); margin-right: 0; }
  .menu-btn { display: none; }
  .line--b { text-align: right; }
  .hero__body { padding-top: 5svh; }
  .hero__base { padding-top: clamp(var(--space-7), 11svh, 140px); }
  .hero__cue { padding-bottom: var(--space-4); }
}

/* Mobile menu (full screen, square, no glass) */
.menu { position: fixed; inset: 0; z-index: 40; background: var(--fa-bg); color: var(--fa-ink); display: grid; grid-template-rows: 1fr auto; padding: var(--space-9) var(--gutter) var(--space-6); }
.menu[hidden] { display: none; }
.menu__list { display: grid; align-content: start; gap: var(--space-2); }
.menu__list a { display: block; font-family: var(--font-display); font-size: 2.5rem; font-weight: var(--w-head); letter-spacing: var(--track-head); line-height: 1.1; text-decoration: none; padding-block: var(--space-1); }
.menu__close { justify-self: start; min-height: var(--tap); border-radius: var(--radius-btn); background: var(--fa-ink); color: var(--fa-bg); padding-inline: var(--pad-l); }
.menu.is-open .menu__list li { animation: rise var(--dur-base) var(--ease-out) both; animation-delay: calc(var(--n, 0) * 50ms); }

/* ==========================================================================
   STATEMENT — what the work is made of, on a band of the page's ink straight after the hero. A held build:
   with motion, the band holds while the visitor scrolls; "Cognitive Sciences.", "UI/UX." and "Code." arrive at
   poster size from three sides and stay, then the claim appears in the middle and pushes them apart as they
   fade, and its closing line follows. The accent phrase takes the band's mark colour with a hand-drawn
   underline under every line of it. The structure is the pinned story found across the gallery sites; the
   scroll is its clock. Without motion it reads, still and complete, in the same order.
   ========================================================================== */
/* the phrase reads in order: the three parts, then what they combine into, centred, then how. Still and
   complete like this with script off or reduced motion; with motion the band holds while it builds (below) */
.eq__stage { display: grid; row-gap: var(--space-2); color: var(--fs-ink); }
.eq__part { margin: 0; font-size: var(--step-say-part); }
.eq__part--2 { justify-self: end; }
.eq__mid { display: grid; justify-items: center; row-gap: var(--space-4); margin-top: var(--space-6); text-align: center; }
.eq__claim { position: relative; margin: 0; max-width: 14ch; font-size: var(--step-say-claim); text-wrap: balance; }
.eq__k { color: var(--fs-o); }
.eq__tail { margin: 0; font-size: var(--step-say-term); color: var(--fs-soft); }
/* the underline under the whole accent phrase: one hand-drawn stroke per line it wraps to (main.js draws them) */
.eq__mark { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; overflow: visible; pointer-events: none; }
.eq__mark path { fill: none; stroke: var(--fs-o); stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }

/* ==========================================================================
   WHY — differentiation, with the slop test
   ========================================================================== */
.why__head { display: grid; gap: var(--gap-group); }
.why .statement { color: var(--fa-ink); }
/* the statement under the title: one step lighter than a full statement, with a little more air between lines */
.why__statement { max-width: 24em; font-size: calc(var(--step-statement) * 0.88); line-height: 1.28; }
/* "matters." jolts when the title scrolls into view, the way "slop." is knocked about in the hero */
.shake-word { display: inline-block; white-space: nowrap; }
.shake-word > span { display: inline-block; transform-origin: 50% 70%; }
@media (min-width: 1024px) {
  .why__head { grid-template-columns: 5fr 6fr; align-items: end; }
  /* desktop: the heading sits closer to its test than one section does to the next */
  .why .test { margin-top: var(--gap-group); }
}

.test { margin-top: var(--section-gap); background: var(--panel-bg); color: var(--panel-ink); padding: var(--pad-l); display: grid; gap: var(--gap-group); transition: background-color var(--dur-base) ease; }
.test__bar { display: grid; row-gap: var(--space-2); }
/* the card's note is empty for now (its site-editor field is kept): an empty note takes no room; written in the
   editor, it shows small and centred under the switch */
.test__note { margin: 0; text-align: center; color: var(--panel-soft); text-wrap: pretty; }
.test__note:empty { display: none; }
.test[data-state="ricky"] .test__note { color: var(--panel-on-ink); }
/* the switch as a sentence, centred in the card: "Flip the switch with [toggle] Rick.", in the card's lead type.
   "Rick." carries the same type as the words before it; "Others", the switch's other side, is small and dimmed
   (still 4.5:1) so it draws little attention. At every width the line takes two rows like a stair: the words
   end where the toggle ends, so nothing sits above "Rick." and it reads as running off the end of the phrase */
.test__line { margin: 0; display: grid; grid-template-columns: auto auto; grid-template-areas: "lead ." "pair rick"; align-items: center; justify-content: center; column-gap: var(--space-3); row-gap: var(--space-2); }
.test__lead { grid-area: lead; justify-self: end; }
.test__pair { grid-area: pair; justify-self: end; display: inline-flex; align-items: center; gap: var(--space-3); }   /* "Others" and its toggle, the same gap as "Rick." on the other side */
.test__label { cursor: pointer; transition: color var(--dur-fast) ease, opacity var(--dur-fast) ease; }
.test__label--slop { opacity: var(--panel-dim); }
.test[data-state="ricky"] .test__label--slop { opacity: var(--panel-on-dim); }
.test__label--ricky { grid-area: rick; }
.test__rick { white-space: nowrap; }
.test__rick > span { display: inline-block; transform-origin: 50% 70%; }

.switch { position: relative; width: 104px; height: 56px; border-radius: var(--round); background: var(--panel-track); flex: none; transition: background-color var(--dur-base) var(--ease-out); }
.switch__thumb { position: absolute; top: 6px; left: 6px; width: 44px; height: 44px; border-radius: var(--round); background: var(--panel-ink); transition: transform var(--dur-base) var(--ease-out), background-color var(--dur-base) ease; }
.switch:hover .switch__thumb { transform: scale(0.92); }
.switch[aria-checked="true"] { background: var(--mark-good); }
.switch[aria-checked="true"] .switch__thumb { transform: translateX(48px); background: var(--mark-good-ink); }
.switch[aria-checked="true"]:hover .switch__thumb { transform: translateX(48px) scale(0.92); }

/* the hint finger: shows how the toolkit and Experience work, each time one scrolls into view, until the
   visitor uses it (main.js adds it; never with reduced motion). Solid, in the theme's accent, cut out from
   what it sits on by a thin edge in that surface's colour; a tap is just the finger pressing. (The switch
   needs no finger: its thumb glides across and back on its own) */
.skills .shell  { --hint-ink: var(--hint-paper); --hint-edge: var(--fb-bg); }
@media (max-width: 1023px) { .skills .shell { --hint-ink: var(--hint); } }   /* phones and tablets: the finger swipes over the dark current card, so the bright accent */
.fo             { --hint-ink: var(--hint);       --hint-edge: var(--ground); }
.hint-host { position: relative; }
.hint { position: absolute; top: 0; left: 0; z-index: 8; opacity: 0; pointer-events: none; }
.hint svg { position: absolute; top: calc(var(--hint-size) * -0.1); left: calc(var(--hint-size) * -0.35); width: var(--hint-size); height: calc(var(--hint-size) * 1.25); max-width: none; overflow: visible; }   /* the fingertip sits on the point it shows */
.hint path { fill: var(--hint-ink); stroke: var(--hint-edge); stroke-width: 2.2; stroke-linejoin: round; }
.tk-phrase.is-hinted .tk-mark { background-image: var(--under-pick), none; }   /* the tapped phrase shows its hover underline */

.test__rows { display: grid; gap: var(--space-1); grid-auto-rows: 1fr; }   /* each row holds both states' text in one cell, so flipping the switch never moves the card; every row takes the tallest row's height, so the topics and marks sit at one even interval whether or not a row's text wraps */
.row { display: grid; grid-template-columns: 1fr 40px; column-gap: var(--space-4); row-gap: var(--space-1); align-items: start; align-content: start; padding-block: var(--space-3); transition: transform 520ms var(--ease-out); transition-delay: calc(var(--r) * 90ms); }
.row__mark { grid-column: 2; grid-row: 1 / span 2; width: 40px; height: 40px; display: grid; place-items: center; }
.row__mark svg { width: 30px; height: 30px; fill: none; stroke: var(--x-ink); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }   /* the X in the hero's red, the tick in its green: drawn marks, not tiles */
.row__mark .v { stroke: var(--mark-tick); }
.row__mark .v { stroke-dasharray: 26; stroke-dashoffset: 26; transition: stroke-dashoffset var(--dur-base) var(--ease-out); transition-delay: calc(var(--r) * 90ms + 120ms); }
.row__mark .x { transition: opacity var(--dur-fast) ease; transition-delay: calc(var(--r) * 90ms); }
.row__topic { grid-column: 1; }
.row__text { display: grid; grid-column: 1; }
.row__slop, .row__ricky { grid-area: 1 / 1; text-wrap: pretty; transition: opacity var(--dur-base) ease, transform var(--dur-base) var(--ease-out), visibility var(--dur-base); transition-delay: calc(var(--r) * 90ms); }
.row__ricky { opacity: 0; transform: translateY(10px); visibility: hidden; }

/* Slop state: rows sit crooked, off the grid */
.test[data-state="slop"] .row:nth-child(1) { transform: rotate(-1.2deg) translateX(-6px); }
.test[data-state="slop"] .row:nth-child(2) { transform: rotate(0.9deg) translateX(10px); }
.test[data-state="slop"] .row:nth-child(3) { transform: rotate(-0.6deg) translateX(-12px); }
.test[data-state="slop"] .row:nth-child(4) { transform: rotate(1.4deg) translateX(4px); }
.test[data-state="slop"] .row__slop { color: var(--panel-soft); }

/* Ricky state: everything snaps square */
.test[data-state="ricky"] { background: var(--panel-on-bg); color: var(--panel-on-ink); }
.test[data-state="ricky"] .row { transform: none; }
.test[data-state="ricky"] .row__mark .x { opacity: 0; }
.test[data-state="ricky"] .row__mark .v { stroke-dashoffset: 0; }
.test[data-state="ricky"] .row__slop { opacity: 0; transform: translateY(-10px); visibility: hidden; }
.test[data-state="ricky"] .row__ricky { opacity: 1; transform: none; visibility: visible; }

.test__score { display: flex; align-items: baseline; gap: var(--space-2); }
/* the switch card in three parts at every width: a hairline under the title and switch, and another above
   the score, drawn from the card's own ink so it reads on the white and the switched-on card in every theme.
   The visible space either side of each line is equal (--split: 24px on phones and tablets, 32px on
   desktop): the rows' own 12px padding is taken off the space next to them, and the score figure is
   trimmed to its cap height, so in any theme's typeface the space ends where its ink begins */
.test { --split: var(--space-5); row-gap: var(--split); }
.test__rows, .test__score { border-top: 1px solid var(--hairline); }
.test__rows { padding-top: calc(var(--split) - var(--space-3)); margin-bottom: calc(var(--space-3) * -1); }
.test__score { padding-top: var(--split); }
.test__count { text-box: trim-both cap alphabetic; }
.test__count { display: inline-block; font: var(--type-head); letter-spacing: var(--track-head); font-variant-numeric: lining-nums tabular-nums; min-width: 0.7em; transition: color var(--dur-base) ease; }
.test[data-state="ricky"] .test__count { color: var(--count-on); }
.test__count.is-tick { animation: tick 260ms var(--ease-out); }

@media (min-width: 720px) {
  .row__text { grid-column: 2; grid-row: 1; }
  .row { grid-template-columns: 9em 1fr 40px; align-items: center; align-content: center; column-gap: var(--space-5); }
  .row__text { font: var(--type-lead); letter-spacing: var(--track-lead); }
  .row__mark { grid-column: 3; grid-row: 1; }
}
@media (min-width: 1024px) {
  .test__rows { gap: var(--space-3); }
  /* desktop: the score stands beside the rows as the card's last column, not in a band under them, so the
     rows and their tally are read at one glance. The hairline under the switch runs on over the score, and
     a second hairline divides it from the rows; the space either side of it is the same --split */
  .test { grid-template-columns: minmax(0, 1fr) auto; column-gap: 0; }
  .test__bar { grid-column: 1 / -1; }
  .test__rows { grid-column: 1; padding-right: var(--split); }
  .test__score { grid-column: 2; grid-row: 2; flex-direction: column; justify-content: center; align-items: flex-start; gap: var(--space-4); padding: var(--split) 0 0 var(--split); border-left: 1px solid var(--hairline); }
}

/* ==========================================================================
   PROFILE — who you're choosing: a centred title, a ringed circle portrait with the name in italics
   and the status under it, then the facts on a tone panel
   ========================================================================== */
:root { --tint: var(--accent); }
.profile__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap-group); align-items: start; }
.profile__grid > * { min-width: 0; }
.profile__title { text-align: center; }

/* the portrait: toned in the theme accent, full colour on hover or tap, drifts with the pointer */
.bio__photo { position: relative; justify-self: center; width: min(66vw, 250px); padding: 5px; border: 3px solid var(--accent); border-radius: 50%; }
.ph { position: relative; width: 100%; overflow: clip; aspect-ratio: 1; border-radius: 50%; background: var(--surface); }
.ph img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; filter: grayscale(1) contrast(1.06); transform: scale(1.06) translate(calc(var(--mx, 0) * -10px), calc(var(--my, 0) * -10px)); transition: filter 700ms var(--ease-out), transform 240ms var(--ease-out); }
.ph::after { content: ""; position: absolute; inset: 0; background: var(--tint); mix-blend-mode: color; transition: opacity 700ms var(--ease-out); pointer-events: none; }
.bio__photo:hover .ph img, .bio__photo.is-lit .ph img { filter: none; }
.bio__photo:hover .ph::after, .bio__photo.is-lit .ph::after { opacity: 0; }
/* or no tint at all: full colour always (data-tint="off", set from the editor) */
.bio__photo[data-tint="off"] .ph img { filter: none; }
.bio__photo[data-tint="off"] .ph::after { content: none; }

.bio__id { display: grid; gap: var(--gap-tight); justify-self: center; justify-items: center; text-align: center; }
.bio__name { font-size: calc(var(--step-lead) * 1.3); color: var(--ink); }
.bio__status { display: inline-flex; align-items: center; gap: var(--space-2); font: var(--type-small); letter-spacing: var(--track-small); color: var(--ink); opacity: 0.72; }   /* present, never louder than the name */
.bio__status::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }

/* facts: label over value. Phones stack them as one centred column under the centred photo and name,
   a hairline between each; tablets set three centred columns; desktop three left-aligned columns */
.bio__facts { --fact-rule: color-mix(in srgb, var(--ink) 14%, var(--surface)); display: grid; grid-template-columns: minmax(0, 1fr); padding: 0 var(--pad-m); background: var(--surface); text-align: center; }
.bio__facts > div { display: grid; align-content: start; row-gap: var(--space-1); padding-block: var(--space-4); transition: transform var(--dur-base) var(--ease-out); }
.bio__facts > div + div { border-top: 1px solid var(--fact-rule); }
.bio__facts dt { font: var(--type-small); letter-spacing: var(--track-small); color: var(--text-secondary); }
.bio__facts dd { font: var(--type-strong); letter-spacing: var(--track-strong); text-wrap: balance; }
@media (min-width: 720px) {
  /* tablets: three centred columns, the middle one (the focus, the longest value) a little wider so it
     settles on two lines like the degree beside it */
  .bio__facts { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr); padding: var(--space-2) 0; }
  .bio__facts > div { padding: var(--space-3) var(--space-4); }
  .bio__facts > div + div { border-top: 0; border-left: 1px solid var(--fact-rule); }
}

@media (min-width: 1024px) {
  .bio__photo { width: 300px; }
  /* desktop: the facts as one row under the centred title, photo and name, the panel only as wide as
     its words (it never stretches to the page edges on a wide screen). The two outer columns are always
     the same width, so the middle fact, the focus (the longest value, on one line), is centred on the
     name above it, with the degree and the location one line each side. The dividers sit midway in
     the gap between neighbours; a value takes the accent on hover */
  .bio__facts { --fact-gap: var(--space-8); display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); justify-self: center; width: fit-content; max-width: 100%; padding: var(--space-3) var(--space-5); }
  .bio__facts > div { min-width: 0; padding: var(--space-4) calc(var(--fact-gap) / 2); }
  .bio__facts dd { transition: color var(--dur-fast) ease; }
  /* until the row has room for every value on one line, the focus takes two balanced lines rather
     than squeezing the degree and the location beside it */
  @media (max-width: 1439px) { .bio__facts > div:nth-child(2) dd { max-width: 12em; margin-inline: auto; } }
  .bio__facts > div:hover dd { color: var(--accent); }
}

/* ==========================================================================
   EXPERIENCE — a cabinet of folders. Every tab sits in one row with its title; the open tab rises,
   takes its folder's tint and joins it. Each page opens with its dates and "@place", then its
   diagram or its Responsibilities, alternating. A spine down the folder's left edge names its kind. On phones the row stays pinned with the next tab peeking in, a dot
   per entry marks where you are, and swiping the tabs, the folder or the dot marker turns to another
   entry. Tints are the kind colour mixed into the ground, so every theme carries.
   ========================================================================== */
.work { background: var(--ground); }
.xp { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap-action); }   /* the title sits as close to the cabinet as the toolkit's title does to its sentence */
.xp__head { display: grid; gap: var(--gap); }

/* kind: its colour plus its word, never colour alone */
.kind-role     { --kind: var(--kind-role);     --kind-word: "Role"; }
.kind-project  { --kind: var(--kind-project);  --kind-word: "Project"; }
.kind-business { --kind: var(--kind-business); --kind-word: "Business"; }
.fo :is(.kind-role, .kind-project, .kind-business) { --tint: color-mix(in srgb, var(--kind) 16%, var(--ground)); --tint-soft: color-mix(in srgb, var(--kind) 7%, var(--ground)); }

.fo { --spine: 28px; --spine-top: 152px; --spine-size: 0.75rem; display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; }   /* the spine's width, and where its word rides: just under the pinned dots and tabs */

/* the dots: one per entry in its kind colour, the open one stretched into a pill (shape, not colour
   alone). Phones only; they ride pinned just above the tabs with a few words on what to do */
.fo__dots { display: none; }
.fo__hint { min-width: 0; font: var(--type-small); color: var(--text-secondary); }
.fo__dotrow { flex: none; display: flex; align-items: center; gap: 2px; cursor: grab; user-select: none; -webkit-user-select: none; }
.fo__dotrow.is-dragging { cursor: grabbing; }
.fo__dot { width: 26px; height: 32px; display: grid; place-items: center; touch-action: pan-y; }
.fo__dot::before { content: ""; width: 8px; height: 8px; border-radius: var(--round); background: var(--kind); opacity: 0.45; transition: width var(--dur-base) var(--ease-out), opacity var(--dur-fast) ease; }
.fo__dot.is-on::before { width: 22px; opacity: 1; }
.fo__dot.is-target::before { width: 14px; opacity: 1; }
.fo__dotrow.is-dragging .fo__dot.is-on::before { width: 26px; }
.fo__dot.is-pop::before { animation: dot-pop 420ms var(--ease-out); }   /* a swipe landed */
@media (hover: hover) { .fo__dot:hover::before { opacity: 0.8; } }

/* the tab row: pinned on the ground while the folder scrolls under it. Phones see three whole tabs, the
   open one in the middle with its neighbours either side; the row slides to keep it centred, so no
   title is ever cut. A sideways drag on the row turns entries */
.fo__tabs { --w-open: 40%; position: sticky; top: 0; z-index: 5; display: flex; align-items: stretch; gap: 3px; min-width: 0; margin-inline: calc(var(--gutter) * -1); padding: var(--space-3) var(--gutter) 0; background: var(--ground); overflow: hidden; overflow: clip; }   /* clip: never a scroll box, so focus can't nudge it off centre */

/* a tab: slanted like a folder's; the row sizes every tab to the tallest so the top edge stays straight,
   and the open one stands 10px above the rest */
.ft { position: relative; flex: none; width: calc((100% - var(--w-open)) / 2 - 3px); min-height: 52px; margin-top: 10px; display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; gap: 2px; padding: 6px calc(var(--space-1) + 12px) 6px var(--space-2); background: var(--tint-soft); color: var(--text-body); text-align: left; clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 100%, 0 100%); translate: calc(var(--shift, 0px) + var(--drag, 0px)) 0; transition: width var(--dur-base) var(--ease-out), opacity var(--dur-fast) ease calc(var(--dur-base) - var(--dur-fast)), background-color var(--dur-fast) ease, margin-top var(--dur-base) var(--ease-out); touch-action: manipulation; }
.ft__t { font: var(--type-small); font-size: 0.75rem; font-weight: var(--w-strong); line-height: 1.2; text-wrap: balance; }
.ft[aria-selected="true"] { width: var(--w-open); min-height: 62px; margin-top: 0; z-index: 2; background: var(--tint); color: var(--text-heading); }
.ft[aria-selected="true"] .ft__t { font-family: var(--font-display); font-weight: var(--w-head); font-size: 1.125rem; line-height: 1.05; letter-spacing: var(--track-head); }
:root:not([data-theme]) .ft[aria-selected="true"] .ft__t { font-size: 1rem; }   /* Signal's heavy grotesk keeps to two lines */
.ft.is-target:not([aria-selected="true"]) { background: var(--tint); }   /* where a swipe will land */
.ft.is-far, .fo__tabs.is-settling .ft.is-far { opacity: 0; pointer-events: none; transition-property: translate, width, opacity; transition-duration: var(--dur-base), var(--dur-base), 0s; transition-delay: 0s; }   /* two or more away: gone at once, off to the side; its name is still read aloud. A tab arriving fades in as its slide lands */
.fo__tabs.is-settling .ft { transition: translate var(--dur-base) var(--ease-out), width var(--dur-base) var(--ease-out), opacity var(--dur-fast) ease calc(var(--dur-base) - var(--dur-fast)), background-color var(--dur-fast) ease, margin-top var(--dur-base) var(--ease-out); }
@media (hover: hover) { .ft:not([aria-selected="true"]):hover { background: var(--tint); } }
.ft:focus-visible { outline-offset: -4px; z-index: 3; }

/* the folder: the open entry, with two more folders' edges showing beneath it. A dragged page slides
   inside it: the sides clip, the edges below stay */
.fo__folder { position: relative; display: grid; margin-bottom: 14px; padding: var(--pad-l); background: var(--tint); clip-path: inset(0 0 -16px 0); transition: background-color var(--dur-base) ease; }
.fo__folder::before, .fo__folder::after { content: ""; position: absolute; height: 6px; transition: background-color var(--dur-base) ease; }
.fo__folder::before { left: var(--space-3); right: var(--space-3); bottom: -7px; background: color-mix(in srgb, var(--kind) 10%, var(--ground)); }
.fo__folder::after { left: var(--space-5); right: var(--space-5); bottom: -14px; background: color-mix(in srgb, var(--kind) 6%, var(--ground)); }
.fo__page { display: grid; gap: var(--gap); scroll-margin-top: 152px; }
.fo__page[hidden] { display: none; }

/* the spine: the open folder's kind, named on a strip of its colour down the folder's left edge, the way a
   box file is labelled. A filled strip and a word, no line. The word reads top to bottom like a book's spine
   and rides along just under the pinned tabs while a long entry scrolls, so the kind stays in view. It
   changes colour with the folder and stays put; a dragged page slides under it, like a sheet into the file. Ground on every kind
   colour is 4.6:1 or better in every theme. The tab already names the kind to a screen reader, so the
   strip is hidden from it. Without script there's one folder and every page, so each page carries its own */
.fo__folder { padding-left: calc(var(--spine) + var(--pad-m)); }
.fo__spine { position: absolute; inset: 0 auto 0 0; z-index: 1; width: var(--spine); background: var(--kind); color: var(--ground); transition: background-color var(--dur-base) ease; }
.fo__spine-w { position: sticky; top: var(--spine-top); display: block; margin-block: var(--pad-l); }
.fo__spine-w::before, html:not(.js) .fo__page::before { content: var(--kind-word); writing-mode: vertical-rl; width: var(--spine); font: var(--w-strong) var(--spine-size)/var(--spine) var(--font); letter-spacing: var(--track-caps); text-transform: uppercase; white-space: nowrap; }
.fo__spine-w::before { display: block; }
html:not(.js) .fo__spine { display: none; }
html:not(.js) .fo__page { position: relative; }
html:not(.js) .fo__page::before { position: absolute; top: 0; bottom: 0; left: calc((var(--spine) + var(--pad-m)) * -1); padding-top: var(--space-1); background: var(--kind); color: var(--ground); }

/* the top of each page: its dates, then where it was, "@place" */
.fo__when { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); font: var(--type-small); color: var(--text-body); }
.fo__date { font-variant-numeric: tabular-nums; color: var(--text-secondary); white-space: nowrap; }
.js .fo__page-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }   /* the tab names it; without script the page names itself */
.fo__page-t { font: var(--type-lead); letter-spacing: var(--track-lead); color: var(--text-heading); }
.fo .dg { background: var(--ground); }
.xp-pane__body { display: grid; gap: var(--gap); }
.fo__duties { display: grid; gap: var(--space-3); align-content: start; }
.fo__duties-h { margin: 0; font: var(--type-strong); color: var(--text-heading); }
.xp-points { display: grid; gap: var(--space-3); max-width: 34em; color: var(--text-body); }
.xp-points li { display: grid; grid-template-columns: var(--dot) minmax(0, 1fr); gap: var(--space-3); }
.xp-points li::before { content: ""; width: var(--dot); height: var(--mark); margin-top: 0.7em; background: var(--kind); }
/* entries with a diagram alternate: one opens with it, the next with its Responsibilities */
.fo__page--dg-end .xp-pane__body > .dg { order: 2; }

/* without script: every page in full, one after another; no tabs or dots to work */
html:not(.js) :is(.fo__tabs, .fo__dots) { display: none; }
html:not(.js) .fo__folder { gap: var(--gap-group); }

@media (min-width: 720px) { .fo { --spine: 36px; } }
@media (min-width: 1024px) { .fo { --spine: 40px; --spine-top: 116px; --spine-size: var(--step-small); } }   /* 20px under the pinned tabs, as on phones */
@media (max-width: 719px) {
  .fo__tabs { --w-open: 38%; }
  .ft { min-height: 70px; padding-right: 12px; }   /* room for a four-line neighbour, so the row keeps its height whichever entry is open; the slant only reaches the text's last line */
  .ft[aria-selected="true"] .ft__t, :root:not([data-theme]) .ft[aria-selected="true"] .ft__t { font-size: 1rem; }
}
@media (max-width: 1023px) {
  .fo__dots { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-inline: calc(var(--gutter) * -1); padding: var(--space-2) var(--gutter) 0; background: var(--ground); }
  .fo__tabs { top: 40px; }   /* pinned just under the dots */
  .ft__t { hyphens: auto; overflow-wrap: break-word; }   /* only a word wider than its tab, on the narrowest screens, ever breaks */
}
@media (min-width: 1024px) {
  .fo__tabs { overflow: visible; }
  .ft, .ft.is-far { flex: 1 1 0; width: auto; min-width: 0; opacity: 1; pointer-events: auto; min-height: 60px; margin-top: 12px; padding: var(--space-2) calc(var(--space-4) + 14px) var(--space-2) var(--space-4); clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 100%, 0 100%); translate: none; }
  .ft__t { font-size: var(--step-small); line-height: 1.25; }
  .ft[aria-selected="true"] { width: auto; min-height: 72px; margin-top: 0; }
  .ft[aria-selected="true"] .ft__t, :root:not([data-theme]) .ft[aria-selected="true"] .ft__t { font-size: 1.375rem; }
  .fo__page .xp-pane__body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: var(--gap-group); }
  .fo__page .xp-pane__body > .dg { order: 0; }                     /* the diagram on the left... */
  .fo__page--dg-end .xp-pane__body > .dg { order: 2; }   /* ...then on the right, entry by entry */
  .fo__page .xp-pane__body--solo { grid-template-columns: minmax(0, 1fr); }   /* no diagram: the Responsibilities take the folder */
}
@media (min-width: 1024px) and (max-width: 1279px) {
  /* small laptops and half-screen windows: six tabs share a narrow row, so the open title steps down to its tablet
     size and its longest word ("Development") clears the slant whole, in every theme's face */
  .ft[aria-selected="true"] .ft__t, :root:not([data-theme]) .ft[aria-selected="true"] .ft__t { font-size: 1.125rem; }
}

/* ---------- Diagrams: one per entry, drawn from that job's own process.
   Each sits one padding tier down from the entry and adapts to its own box. ---------- */
.dg { container-type: inline-size; padding: var(--pad-s); background: var(--ground); color: var(--text-body); }

/* stages in order (Our Spot Coffee) */
.dg--process ol { display: grid; gap: var(--gap); }
.dg__step { position: relative; display: grid; grid-template-columns: var(--dot) minmax(0, 1fr); gap: var(--space-3); align-items: center; }
.dg__step::before { content: ""; width: var(--dot); height: var(--dot); border-radius: var(--round); background: var(--kind); }
.dg__step:not(:last-child)::after { content: ""; position: absolute; left: calc((var(--dot) - var(--mark)) / 2); top: calc(50% + var(--dot) / 2); height: calc(100% + var(--gap) - var(--dot)); width: var(--mark); background: var(--kind); opacity: 0.35; }
.dg__step:last-child { font-weight: var(--w-strong); }
@container (min-width: 400px) {
  .dg--process ol { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-2); }
  .dg__step { grid-template-columns: none; justify-items: center; text-align: center; }
  .dg__step:not(:last-child)::after { left: calc(50% + var(--dot)); right: calc(-50% + var(--dot)); top: calc((var(--dot) - var(--mark)) / 2); width: auto; height: var(--mark); }
}

/* the test loop (Workout App) */
.dg--loop { display: grid; place-items: center; }
.dg__loop { position: relative; width: min(100%, var(--loop)); aspect-ratio: 1; }
.dg__loop svg { width: 100%; height: 100%; fill: none; }
.dg__ring { stroke: var(--surface); stroke-width: 14; }
.dg__arc { stroke: var(--kind); stroke-width: var(--mark); stroke-linecap: round; stroke-dasharray: 120 370; transform-origin: 50% 50%; }
.dg__node { position: absolute; transform: translate(-50%, -50%); padding: var(--space-1) var(--space-3); border-radius: var(--round); background: var(--btn-bg); color: var(--btn-ink); font-weight: var(--w-strong); white-space: nowrap; }
.dg__node:nth-of-type(1) { left: 50%; top: 9%; } .dg__node:nth-of-type(2) { left: 91%; top: 50%; }
.dg__node:nth-of-type(3) { left: 50%; top: 91%; } .dg__node:nth-of-type(4) { left: 9%; top: 50%; }

/* what the job covers (Student Supervisor) */
.dg--roles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.dg__tile { display: grid; gap: var(--space-1); padding: var(--pad-s); background: var(--surface); }
.dg__tile b { color: var(--kind); font-weight: var(--w-strong); }
.dg__tile span { color: var(--text-secondary); }

/* the shop's record (Ricky's Reptiles) */
.dg--shop { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.dg__fig { display: grid; gap: var(--gap-tight); }
.dg__fig b { color: var(--text-heading); font-variant-numeric: tabular-nums; }
.dg__fig span { color: var(--text-secondary); }
.dg__stars { display: inline-flex; gap: var(--space-1); margin-left: var(--space-2); vertical-align: middle; }
.dg__stars i { width: var(--dot); height: var(--dot); background: var(--kind); transform: rotate(45deg) scale(0.8); }

/* ==========================================================================
   SKILLS — the toolkit. One sentence reads as the product lifecycle; each phrase opens its card.
   Phones swipe one card at a time; from 1024px the cards sit side by side and the picked one turns dark.
   ========================================================================== */
.tk-skill__name { font: var(--type-strong); letter-spacing: var(--track-strong); }   /* emphasis by weight and marks, not by a size of its own */

.skills__head { margin-bottom: var(--gap-action); }
/* the sentence: each line is at least a full tap tall, so phrase targets never touch */
.tk-sentence { max-width: 22em; margin-bottom: var(--gap-action); color: var(--fb-ink); line-height: max(var(--tap), 1.2em); text-wrap: pretty; }
.tk-beat { white-space: nowrap; }   /* a phrase and its comma never part */
/* a conventional paragraph indent: the first line steps in by one em of its own type, so it scales with
   the sentence at every width; the lines after it start at the edge. Each phrase is its own button and
   would take the inherited indent too, so it resets it */
.tk-sentence { text-indent: 1em; }
.tk-sentence .tk-phrase { text-indent: 0; }
.tk-phrase { position: relative; display: inline; padding: 0; font: inherit; letter-spacing: inherit; color: inherit; text-align: left; text-decoration: none; background: none; isolation: isolate; transition: color var(--dur-fast) ease; touch-action: manipulation; }
.tk-punct { display: inline-block; }   /* inside the button so it never parts from its phrase; inline-block keeps the underline off it */
/* the marks under a phrase, in two layers that follow each line the phrase wraps onto: on top the drawn underline,
   under it the highlighter, a clean band the full height of the letters that runs a little past the words. Every
   phrase shows the thin underline, so each reads as something to press; hover and the picked phrase draw it in
   ink; the picked phrase also gets the highlighter, and both sweep in */
.tk-mark { padding: 0.08em var(--mark-run) 0.14em; margin-inline: calc(var(--mark-run) * -1); box-decoration-break: clone; -webkit-box-decoration-break: clone; background-image: var(--under-quiet), none; background-repeat: no-repeat; background-position: left 0 bottom 0, left 0 bottom var(--mark-hl-y); background-size: 100% var(--mark-under-h), 100% var(--mark-hl-h); }
@media (hover: hover) { .tk-phrase:hover .tk-mark { background-image: var(--under-pick), none; } }   /* a real pointer only: on a touch screen hover would stick after a tap */
.tk-phrase[aria-pressed="true"] .tk-mark { background-image: var(--under-pick), var(--mark-hl); }
@media (prefers-reduced-motion: no-preference) {
  .tk-phrase[aria-pressed="true"] .tk-mark { animation: mark-draw var(--dur-base) var(--ease-out) both; }
}
@keyframes mark-draw { from { background-size: 0 var(--mark-under-h), 0 var(--mark-hl-h); } to { background-size: 100% var(--mark-under-h), 100% var(--mark-hl-h); } }   /* both marks sweep in left to right, like a pen */

/* the strip: phones see one card with its neighbours peeking */
.tk-strip { display: grid; grid-auto-flow: column; grid-auto-columns: 84%; align-items: start; gap: var(--space-3); overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding-inline: calc(8% + var(--gutter)); }
.tk-strip::-webkit-scrollbar { display: none; }
.tk-strip:focus-visible { outline-offset: calc(var(--space-1) * -1); }
.tk-panel { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--pad-s); scroll-snap-align: center; background: var(--fb-surface); opacity: 0.5; transition: opacity var(--dur-base) ease, background-color var(--dur-base) ease, color var(--dur-base) ease; }
/* the live card goes dark, at every width: the same state the desktop row shows */
.tk-panel.is-current { opacity: 1; background: var(--fb-hover-bg); color: var(--fb-hover-ink); }
.tk-panel.is-current .tk-skill { background: color-mix(in srgb, var(--fb-hover-ink) 10%, var(--fb-hover-bg)); }
.tk-panel.is-current :is(.tk-skill__name, .tk-used__link) { color: var(--fb-hover-ink); }
.tk-panel.is-current :is(.tk-skill__areas, .tk-used) { color: var(--fb-hover-soft); }

/* a card: each skill in its own box, then one quiet "Used in" line */
.tk-skills { display: grid; gap: var(--space-2); }
.tk-skill { --area-gap: var(--space-3); display: grid; gap: var(--area-gap); min-width: 0; padding: var(--pad-s); background: var(--fb-bg); color: var(--fb-ink); transition: background-color var(--dur-base) ease, color var(--dur-base) ease; }
.tk-skill__areas { display: grid; gap: var(--space-1); color: var(--fb-soft); }
/* one area per line, a small dot before each; a wrapped line hangs clear of the dot */
.tk-skill__areas > span { display: grid; grid-template-columns: var(--area-dot) minmax(0, 1fr); column-gap: var(--space-2); overflow-wrap: break-word; text-wrap: balance; }
.tk-skill__areas > span::before { content: ""; width: var(--area-dot); height: var(--area-dot); margin-top: calc(0.725em - var(--area-dot) / 2); border-radius: var(--round); background: currentColor; opacity: 0.6; }
.tk-used { max-width: 30em; margin-inline: auto; padding-block: var(--space-2) var(--space-1); text-align: center; color: var(--fb-soft); text-wrap: balance; }
.tk-used__k { display: block; margin-bottom: var(--space-1); }
.tk-used__items { display: flex; flex-wrap: wrap; justify-content: center; column-gap: var(--space-4); }   /* no separators: the underlines and the gap keep projects apart */
.tk-used__link { display: inline-block; padding-block: calc((var(--tap) - 1.45em) / 2); margin-block: calc((var(--tap) - 1.45em) / -2); color: var(--fb-ink); white-space: nowrap; text-decoration: underline 1px; text-underline-offset: 0.2em; }   /* small text, full tap height, no extra space */
.tk-used__link:hover { color: var(--fb-head); }

/* where he's headed: the last card, set in ink so it never reads as one more skill */
.tk-panel--next { display: grid; align-content: start; padding: var(--pad-m); background: var(--fb-ink); color: var(--fb-bg); }
.tk-panel--next.is-current { background: var(--fb-ink); color: var(--fb-bg); }
.tk-next__body { opacity: 0.86; }
.tk-talk-wrap { line-height: var(--tap); }   /* the link wraps like text, each line a full tap tall */
.tk-talk { padding-block: calc((var(--tap) - 1em) / 2); color: var(--fb-bg); font-weight: var(--w-strong); text-decoration: underline 1.5px; text-underline-offset: 0.2em; }
.tk-talk svg { display: inline-block; vertical-align: -0.12em; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: square; transition: transform var(--dur-fast) var(--ease-out); }
.tk-talk:hover svg { transform: translateX(var(--space-1)); }

.tk-dots { display: flex; justify-content: center; margin-top: var(--space-2); }
/* each dot is its own marker: the picked one opens into a pill in place, so no separate shape travels
   across the row and none can be left behind */
.tk-dot { width: var(--tap); height: var(--tap); display: grid; place-items: center; touch-action: manipulation; }
.tk-dot::before { content: ""; width: calc(var(--dot) * 2.2); height: var(--dot); border-radius: var(--round); background: var(--fb-ink); opacity: 0.3; clip-path: inset(0 calc(var(--dot) * 0.6) round var(--round)); transition: clip-path var(--dur-base) var(--ease-out), opacity var(--dur-fast) ease; }
.tk-dot[aria-pressed="true"]::before { opacity: 1; clip-path: inset(0 round var(--round)); }

/* "this changed": a 3px wiggle on the phrase and its card */
.tk-panel.is-wiggle { animation: tk-wiggle 320ms var(--ease-out); }
.tk-phrase.is-wiggle { animation: tk-wiggle-inline 320ms var(--ease-out); }   /* stays inline: moves by offset, never becomes a block */
@keyframes tk-wiggle { 0%, 100% { translate: 0; } 25% { translate: -3px 0; } 50% { translate: 3px 0; } 75% { translate: -1px 0; } }
@keyframes tk-wiggle-inline { 0%, 100% { left: 0; } 25% { left: -3px; } 50% { left: 3px; } 75% { left: -1px; } }

@media (max-width: 419px) { .tk-beat { white-space: normal; } }   /* a long phrase may wrap on phones; its comma has no space before it, so they never part */
/* phones: wider cards, tighter padding; the direction card's text matches the areas */
@media (max-width: 719px) {
  /* the title, the sentence and its cards read as one unit: a little more air under the title, a
     little less under the sentence; the sentence a step smaller, its lines 40px apart (each phrase
     button is a line tall, so every one is a 40px tap target and none overlap) */
  .skills__head { margin-bottom: var(--space-6); text-align: center; }   /* centred over the centred sentence */
  .tk-sentence { margin-bottom: var(--space-5); font-size: calc(var(--step-lead) * 0.9); line-height: max(40px, 2em); }
  /* on phones the sentence is centred, keeping its 1em first-line indent, with its lines balanced so no
     phrase is left alone on the last one. The block centres too, for widths wider than its measure, and
     a phrase that wraps inside its button (under 420px) centres its own lines with the rest */
  .tk-sentence { margin-inline: auto; text-align: center; text-wrap: balance; }
  .tk-sentence .tk-phrase { text-align: inherit; }
  .tk-strip { grid-auto-columns: 88%; gap: var(--space-2); padding-inline: calc(6% + var(--gutter)); }
  .tk-panel { gap: var(--space-3); padding: var(--space-2); }
  .tk-skill { --area-gap: var(--space-2); padding: var(--pad-s); }
  .tk-next__body { font: var(--type-small); letter-spacing: var(--track-small); }
  .tk-dots { margin-top: 0; }
}
/* desktop: the cards side by side; "Used in" sits at each card's foot so the lines align across the row */
@media (min-width: 1024px) {
  .tk-strip { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-columns: auto; align-items: stretch; gap: var(--gap); overflow: visible; margin: 0; padding: 0; }
  .tk-panel { opacity: 1; }
  .tk-used { margin-top: auto; }
  /* the direction runs as a band under the four stages */
  .tk-strip .tk-panel--next { grid-column: 1 / -1; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: var(--gap-group); }
  .tk-dots { display: none; }
}
/* small laptops: still four across, so the whole lifecycle is seen at once; the card and its skill boxes
   step down to the phone padding (an area may wrap to two lines rather than the cards stacking two by two) */
@media (min-width: 1024px) and (max-width: 1279px) {
  .tk-strip { gap: var(--space-3); }
  .tk-panel { gap: var(--space-3); padding: var(--space-3); }
  .tk-skill { --area-gap: var(--space-2); padding: var(--space-4); }
}

/* ==========================================================================
   CONTACT — display rows
   ========================================================================== */
.contact { padding-bottom: 0; overflow-x: clip; }   /* the closing line slides in from beyond the screen edges without widening the page */
.contact__head { display: grid; justify-items: center; gap: var(--gap-group); margin-bottom: var(--space-8); container-type: inline-size; }   /* the location's ring reaches 0.6em above it */
/* the closing line answers the hero in its own voice: one sentence at one display size, centred, with the
   hero's X over "slop", quietened to the field's ink, and its ring around "Ricky". It fills the width it is given up to a touch
   under the other section titles, and shrinks with the screen on phones so it never breaks */
.contact__line { display: flex; justify-content: center; align-items: baseline; gap: 0.26em; max-width: 100%; white-space: nowrap;
  font: var(--type-head); font-size: min(calc(var(--step-head) * 0.85), calc(100cqi / var(--fit-contact))); letter-spacing: var(--track-head); color: var(--fc-ink); }
.contact__lead, .contact__choose { display: inline-block; }
.contact__line .cross { top: 0; }
.contact__line .mark { max-width: none; }   /* the marks reach past their word, as in the hero */
.contact__line .ring { margin-inline: 0.18em 0.14em; }   /* room for the ring, so it clears "Choose" and the full stop */
/* on the contact field the X is the field's own ink, mostly see-through, like the location ring: "slop"
   reads clearly through it. Opacity sits on the whole mark, so the strokes don't darken where they cross */
.contact__line .mark--x { opacity: var(--fc-mark-a); }
.contact__line .mark--x path { stroke: var(--fc-ink); stroke-width: 7; }
.contact__line .mark--o path { stroke: var(--fc-o); }
.contact__loc { position: relative; display: inline-block; margin-inline: 1.2em; font: var(--type-small); letter-spacing: 0.02em; white-space: nowrap; color: var(--fc-ink); cursor: default; transition: letter-spacing var(--dur-base) var(--ease-out); }
/* letter-spacing trails the last letter, so the same space leads the first: the words sit dead centre in
   their ring, under the line above, at rest and as they spread on hover */
.loc__text { display: inline-block; padding-inline-start: 0.02em; transition: padding var(--dur-base) var(--ease-out); }
.contact__loc:hover .loc__text { padding-inline-start: 0.14em; }
/* a hand-drawn ring around the location, like the one on "Ricky", in transparent black. Its path is drawn
   symmetric about the centre of its box, so the ring is centred on the words both ways */
.loc__ring { will-change: opacity; inset: -0.6em -1.2em; width: calc(100% + 2.4em); max-width: none; height: calc(100% + 1.2em); }
.loc__ring path { stroke: color-mix(in srgb, var(--fc-ink) calc(var(--fc-mark-a) * 100%), transparent); stroke-width: 5; }
.contact__loc:hover { letter-spacing: 0.14em; }
.loc__c { display: inline-block; }
/* text for screen readers only, e.g. a line that animates letter by letter */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.contact__rows { display: grid; }
.contact__rows.is-scrolling .crow { pointer-events: none; }   /* see main.js: no hover repaints while the page scrolls */
.contact__rows li:nth-child(even) .crow { background: var(--fc-alt); }
.crow { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 96px; padding: var(--space-4) var(--gutter); font-family: var(--font-display); font-size: clamp(2rem, 1rem + 5vw, 5.5rem); font-weight: var(--w-head); letter-spacing: var(--track-head); line-height: 1; text-decoration: none; text-align: left; position: relative; isolation: isolate; overflow: clip; }
.crow::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--fc-hover-bg); transform: translateY(101%); transition: transform var(--dur-base) var(--ease-out); }
a.crow:hover, button.crow:hover, a.crow:focus-visible, button.crow:focus-visible { color: var(--fc-hover-ink); }
a.crow:hover::before, button.crow:hover::before, a.crow:focus-visible::before, button.crow:focus-visible::before { transform: none; }
.crow__go { flex: none; width: 56px; height: 56px; border-radius: var(--round); background: var(--fc-ink); display: grid; place-items: center; transition: transform var(--dur-base) var(--ease-out), background-color var(--dur-fast) ease; }
.crow__go svg { width: 26px; height: 26px; fill: none; stroke: var(--fc-bg); stroke-width: 2.6; stroke-linecap: square; }
.crow:hover .crow__go, .crow:focus-visible .crow__go { background: var(--fc-hover-ink); transform: rotate(-45deg); }
.crow[target="_blank"]:hover .crow__go, .crow[target="_blank"]:focus-visible .crow__go { transform: translate(3px, -3px); }   /* the ↗ stays ↗, never turns into a back-to-top ↑ */
.crow:hover .crow__go svg, .crow:focus-visible .crow__go svg { stroke: var(--fc-hover-bg); }

@media (min-width: 1024px) {
  .crow { min-height: 152px; padding-block: var(--space-5); align-items: flex-end; }
  .crow__go { width: 80px; height: 80px; }
  .crow__go svg { width: 34px; height: 34px; }
}

/* ==========================================================================
   FOOTER — curtain: the page slides away to uncover it
   ========================================================================== */
.footer { position: sticky; bottom: 0; z-index: 0; min-height: 100svh; background: var(--footer-bg); color: var(--footer-ink); display: grid; grid-template-rows: auto 1fr auto; padding-top: var(--space-7); }
.footer__cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6) var(--space-5); }
.footer__cols > div { display: grid; gap: var(--space-1); align-content: start; }
.footer__cols p { color: var(--footer-soft); }
.footer__h { color: var(--footer-ink) !important; margin-bottom: var(--space-1); }
.footer__mark { grid-row: 3; display: grid; gap: var(--space-4); padding-bottom: var(--space-5); }
.footer__word { width: 100%; height: auto; overflow: visible; }
.footer__word text { font: var(--w-display) 112px var(--font-display); letter-spacing: var(--track-display); fill: var(--footer-mark); }   /* sized so every theme's face fills the width with a mild stretch (1.2–1.7×), the viewBox leaving room for the "y" */
.footer__legal { color: var(--footer-soft); }

@media (min-width: 1024px) {
  .footer__cols { grid-template-columns: repeat(4, 1fr); }
}

/* Floating call to action */
.float-cta { position: fixed; right: var(--gutter); bottom: var(--space-4); z-index: 30; display: inline-flex; align-items: center; min-height: 52px; padding-inline: calc(var(--pad-l) + var(--space-2)); border-radius: var(--radius-btn); background: var(--float-bg); color: var(--float-ink); text-decoration: none; transform: translateY(160%); transition: transform var(--dur-base) var(--ease-out), background-color var(--dur-fast) ease; }
.float-cta.is-on { transform: none; }
.float-cta:hover { background: var(--btn-hover-bg); color: var(--btn-hover-ink); }

/* ==========================================================================
   MOTION
   ========================================================================== */
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes fo-next { from { opacity: 0; transform: translateX(28px); } }
@keyframes fo-prev { from { opacity: 0; transform: translateX(-28px); } }
@keyframes dot-pop { 40% { transform: scale(1.35); } }
@keyframes line-up { to { transform: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes redraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(var(--space-1)); } }
@keyframes underline { to { transform: scaleX(1); } }
@keyframes knock { to { transform: translateY(var(--y, 0)) rotate(var(--r, 0deg)); } }
@keyframes jolt {
  0%, 100% { transform: none; }
  20% { transform: translateY(-0.06em) rotate(-5deg); }
  40% { transform: translateY(0.04em) rotate(4deg); }
  60% { transform: translateY(-0.03em) rotate(-2.5deg); }
  80% { transform: translateY(0.015em) rotate(1deg); }
}
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes tick { 0% { transform: translateY(-30%); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: no-preference) {
  .js .hero__title [data-line] { transform: translateY(105%); animation: line-up var(--dur-slow) var(--ease-out) forwards; animation-delay: calc(var(--i) * 110ms + 150ms); }
  .js .mark--x path { stroke-dashoffset: 1; animation: draw 320ms var(--ease-io) forwards; }
  .js .mark--x path:first-child { animation-delay: 1150ms; }
  .js .mark--x path:last-child { animation-delay: 1430ms; }
  .js .hero__answer { opacity: 0; animation: rise 700ms var(--ease-out) 1600ms forwards; }
  .js .hero__cue { opacity: 0; animation: rise 600ms var(--ease-out) 3000ms forwards; }
  /* the location types itself in once the closing line has landed and been marked, then gets circled */
  .js .contact__loc .loc__c { opacity: 0; transform: translateY(0.4em); transition: opacity 260ms var(--ease-out), transform 260ms var(--ease-out); transition-delay: calc(var(--c) * 32ms + 2100ms); }
  .js .contact__loc.is-in .loc__c { opacity: 1; transform: none; }
  .js .loc__ring path { stroke-dashoffset: 1; }
  .js .contact__loc.is-in .loc__ring path { animation: draw 900ms var(--ease-io) 2900ms forwards; }
  .js .contact__loc.is-in .loc__ring { animation: breathe 2.6s var(--ease-io) 4000ms infinite; }
  .js .hero__cue-text::after { transform: scaleX(0); animation: underline 700ms var(--ease-io) 3300ms forwards; }
  .js .hero__cue-arrow { animation: bob 1.8s var(--ease-io) 3600ms infinite; }
  .js .hero__cue-arrow:last-child { animation-delay: 3750ms; }
  .js .mark--o path { stroke-dashoffset: 1; animation: draw 850ms var(--ease-io) 2150ms forwards; }
  .js .slop-word > span { transform: none; animation: knock 520ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
  .js .slop-word > span:nth-child(1) { animation-delay: 1780ms; }
  .js .slop-word > span:nth-child(2) { animation-delay: 1830ms; }
  .js .slop-word > span:nth-child(3) { animation-delay: 1880ms; }
  .js .slop-word > span:nth-child(4) { animation-delay: 1930ms; }
  .js .slop-word > span:nth-child(5) { animation-delay: 1980ms; }
  /* the equation band holds for about two and a half screens while main.js builds the phrase with the scroll;
     the parts and the claim start hidden and the script brings them in */
  .js .say.field { padding-block: 0; overflow: clip; }
  .js .eq { height: 280vh; }
  .js .eq__stage { position: sticky; top: 0; height: 100vh; height: 100svh; align-content: center; }
  .js .eq__mid { position: absolute; inset: 0; align-content: center; margin: 0; pointer-events: none; }
  .js .eq__part, .js .eq__claim, .js .eq__tail { opacity: 0; will-change: transform, opacity; }
  .shake-word.is-shaking > span { animation: jolt 620ms var(--ease-out) both; animation-delay: calc(var(--n, 0) * 40ms + 450ms); }
  /* "Rick." in the switch's sentence jolts the same way, the moment the gliding thumb lands on it (main.js) */
  .test__label--ricky.is-shaking .test__rick > span { animation: jolt 620ms var(--ease-out) both; animation-delay: calc(var(--n, 0) * 40ms); }
  .js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
  /* the closing line arrives from either side and meets, fading up as it comes: "Skip the slop," from the
     left, "Choose Ricky." from the right, together. As they settle, the X strikes "slop" in two strokes and
     the ring is drawn around "Ricky", as in the hero */
  .js .contact__head { --slide: clamp(var(--space-8), 16vw, 240px); }
  .js .contact__lead[data-reveal] { transform: translateX(calc(var(--slide) * -1)); }
  .js .contact__choose[data-reveal] { transform: translateX(var(--slide)); }
  .js .contact__head [data-reveal] { transition-duration: var(--dur-slow); }
  /* the halves travel further than other reveals, so they take longer and ease in gently, visibly gliding
     the whole way rather than snapping into place; the fade finishes a little before the glide */
  .js .contact__line [data-reveal] { transition: opacity 900ms var(--ease-out), transform 1200ms cubic-bezier(0.22, 1, 0.36, 1); }
  .js .contact__head [data-reveal].is-in { transform: none; }
  .js .contact__line .mark path { animation: none; stroke-dashoffset: 1; }
  .js .contact__line .is-in .mark path { stroke-dashoffset: 0; }
  .js .contact__line .is-in .mark--x path { transition: stroke-dashoffset 300ms var(--ease-io) 950ms; }
  .js .contact__line .is-in .mark--x path:last-child { transition-delay: 1210ms; }
  .js .contact__line .is-in .mark--o path { transition: stroke-dashoffset 850ms var(--ease-io) 1370ms; }
  /* under the pointer (or a tap), each mark is made again: the X re-strikes "slop", the ring redraws round
     "Ricky". Leaving shows the finished mark at once, so a quick pass never leaves one half drawn */
  .contact__line .cross:hover .mark--x path { animation: redraw 260ms var(--ease-io) both; }
  .contact__line .cross:hover .mark--x path:last-child { animation-delay: 140ms; }
  .contact__line .ring:hover .mark--o path { animation: redraw 620ms var(--ease-io) both; }
  .js .fo__page.from-next > * { animation: fo-next var(--dur-base) var(--ease-out) both; }
  .js .fo__page.from-prev > * { animation: fo-prev var(--dur-base) var(--ease-out) both; }
  .js .fo__page.is-in :is(.dg__step, .dg__tile) { animation: rise var(--dur-base) var(--ease-out) both; animation-delay: calc(var(--k, 0) * 70ms + 120ms); }
  .dg__arc { animation: spin 6s linear infinite; }
  /* the endless loops rest while off screen (main.js marks what is on screen with .is-live) */
  .js .dg:not(.is-live) .dg__arc, .js .hero__cue:not(.is-live) .hero__cue-arrow, .js .contact__loc:not(.is-live) .loc__ring { animation-play-state: paused; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; }
  .test[data-state="slop"] .row { transform: none !important; }
}

/* 404 page */
.nf { min-height: 100svh; display: grid; align-items: center; }
.nf__inner { display: grid; gap: var(--gap-group); justify-items: start; }

/* ==========================================================================
   PHONE TUNING (under 720px only). The middle sections, from the statement band to Experience,
   sit tighter so a screen holds more of each, while every section still runs past one screen and the
   next always shows a little below. The hero and the contact field are untouched. Only the space
   between parts steps down, each to the next step of the 8-point scale; text sizes and tap targets stay
   ========================================================================== */
@media (max-width: 719px) {
  /* section padding 96px to 64px: the change of ground or the title already marks a new section */
  .why.field, .say.field, .profile.section, .skills.field, .work.section { padding-block: var(--space-8); }
  /* Expertise: the switch card a group gap under its title (as on desktop), not a whole section away.
     Inside the card the title and the switch sit a step closer */
  .why .test { margin-top: var(--gap-group); }
  .why__head { gap: var(--space-5); }
  .test__bar { gap: var(--space-4); }
  /* the rows 8px apart rather than 12px; the hairline above keeps the same visible --split, since the
     rows' own padding is taken off it, as everywhere */
  .row { padding-block: var(--space-2); }
  .test__rows { padding-top: calc(var(--split) - var(--space-2)); margin-bottom: calc(var(--space-2) * -1); }
  /* Profile: the portrait a little smaller, so the name and the first fact show with it */
  .bio__photo { width: min(54vw, 210px); }
  .profile__grid { gap: var(--space-5); }
  .bio__facts > div { padding-block: var(--space-3); }
  /* Toolkit: the title a group gap's step closer to its sentence; the sentence keeps its 40px lines,
     so every phrase stays a full tap target */
  .skills__head { margin-bottom: var(--space-5); }
  .tk-sentence { margin-bottom: var(--space-4); }
  /* a skill's name a step nearer the body (1.25 of it rather than 1.4), still clearly over its areas */
  .tk-skill__name { font-size: calc(var(--step-body) * 1.25); }
  /* Experience: the stages of the process diagram a step closer */
  .dg--process ol { gap: var(--space-3); }
  .dg__step:not(:last-child)::after { height: calc(100% + var(--space-3) - var(--dot)); }
}

/* ==========================================================================
   DESKTOP TUNING (1024px and up only; phones and tablets are as above)
   ========================================================================== */
@media (min-width: 1024px) {
  /* hero: the free height splits above and below the headline and its answer (a little less above, so
     the block sits just over the middle), rather than all of it collecting above the scroll cue */
  .hero { grid-template-rows: auto minmax(var(--space-5), 2fr) auto auto minmax(var(--space-5), 3fr) auto; }
  .hero__nav { grid-row: 1; }
  .hero__body { grid-row: 3; padding-top: 0; }
  .hero__base { grid-row: 4; }
  .hero__cue { grid-row: 6; }
  /* the coloured fields, the equation band, "Expertise matters." and the toolkit, each fit close to one
     screen: half the section padding (the change of ground already marks where one ends) */
  .why.field, .skills.field, .say.field { padding-block: var(--space-9); }
  /* the toolkit's head set like "Expertise matters.": the title on the left, its sentence beside it, the
     title centred on the sentence; the cards run the full width under them, a group gap below, as every section
     title sits the same distance from what it introduces (the first-line indent is set for every width) */
  .skills > .shell { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--gap-group) var(--space-8); align-items: end; }
  .skills__head, .tk-sentence { margin: 0; }
  .skills__head { align-self: center; }   /* the title centred on the sentence's lines, not resting on its last one */
  .tk-sentence { max-width: 24em; justify-self: end; text-align: start; text-wrap: balance; }
  .tk { grid-column: 1 / -1; }
  .test { --split: var(--space-6); }
  /* the statement beside "Expertise matters." at full statement size, so it holds its own against the title */
  .why__statement { max-width: 22em; font-size: var(--step-statement); line-height: 1.24; }
  .xp { row-gap: var(--gap-group); }
}
