/* ==========================================================================
   William McIlleron — redesign (v2)

   Changes from styles.css, and why:
     · Off the old cream (#f4f1ea) + terracotta (#b23c17) pairing, which has
       become the default output of AI design tools; a site whose pitch is
       craft can't wear it. Dark is now the default ground, with light as an
       explicit opt-in via the header toggle.
     · Two families, not three. Newsreader for display, Karla for everything
       else including the uppercase labels that used to need IBM Plex Mono.
       Body copy now has a voice instead of falling back to the system stack.
     · Accent belongs to actions, plus the one italic clause in the h1 that
       carries the whole proposition. Labels and decorative marks are muted.
     · Durations ranked by property — transform first, colour last — so a
       hover reads as one event. Nothing transitions `all`.
     · Radius is binary: pill for controls, square for surfaces.
     · Above-the-fold content is never gated behind JavaScript. Only
       below-fold sections carry `.reveal`.
   ========================================================================== */

/* --- Fonts -----------------------------------------------------------------
   Self-hosted and subsetted, not fetched from Google. That was 215KB for
   these faces; the identical glyphs are 74KB here. Almost none of the saving
   came from cutting characters — it came from cutting variable-font axes.
   A two-axis Newsreader carries delta data for every weight at every optical
   size, and this site uses three fixed combinations of them.

   So Newsreader is instanced: no axes, opsz baked at 48. It is a display face
   here — body copy is Karla — so it runs between 22px and 100px and the axis
   was buying subtlety at those sizes for 130KB. Karla stays variable but
   clipped to 400–600, which beats shipping three static cuts.

   Re-subsetting, if the character set ever changes:
     python -m fontTools.varLib.instancer SRC.ttf opsz=48 wght=400 -o tmp.ttf
     python -m fontTools.subset tmp.ttf --output-file=out.woff2 --flavor=woff2 \
       --unicodes="U+0020-007E,U+00A0-00FF,U+2013,U+2014,U+2018,U+2019,\
U+201C,U+201D,U+2026,U+2190,U+2192,U+2197" \
       --layout-features="kern,liga,calt,ccmp,mark,mkmk,rlig,locl" --no-hinting

   Both families are SIL OFL 1.1. Licences sit beside the files in /fonts/.   */

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

@font-face {
    font-family: 'Newsreader';
    src: url('/fonts/newsreader-500.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Newsreader';
    src: url('/fonts/newsreader-italic-400.woff2') format('woff2');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Karla';
    src: url('/fonts/karla-var.woff2') format('woff2');
    /* A range, not a value: this one file covers 400 through 600, which is
       every weight the sans is set at. */
    font-weight: 400 600;
    font-style: normal;
    font-display: swap;
}

/* --- Tokens --------------------------------------------------------------- */

/* Dark is the default. Light is opt-in via the toggle, which writes
   data-theme="light" — so a visitor who never touches it always gets dark,
   regardless of their OS setting. Every value below is measured: the lowest
   text ratio in either theme is 5.46:1 against a 4.5:1 requirement, and the
   two border tokens are split so field edges clear 3:1 for WCAG 1.4.11. */
:root {
    /* Without this the native select popups, scrollbar, autofill and
       spellcheck underlines all render in the light OS palette on a dark page. */
    color-scheme: dark;

    --paper:        #14171a;
    --surface:      #1b1f22;
    --sunken:       #22272a;

    --ink:          #e8ebe8;
    --muted:        #9aa39c;

    /* Two border weights: decorative hairlines, and UI edges that must
       clear 3:1. The old sheet used one value for both, which put form
       fields at 1.28:1. */
    --rule:         #2b3134;
    --line:         #6d7671;

    --accent:       #5fbf95;
    --accent-hover: #7ad3ab;
    --accent-ink:   #0e1113;
    --accent-wash:  rgba(95, 191, 149, 0.10);
    --invalid:      #ff8a6b;

    --display: 'Newsreader', Georgia, 'Times New Roman', serif;
    --body:    'Karla', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

    /* One value. Every uppercase label left on the page is a dense inline one
       — stack lines, field labels, dates — and they all want the tight
       setting. The loose variant existed for section eyebrows, and those are
       gone. */
    --track-tight: 0.1em;

    --wrap:     72rem;
    --gutter:   clamp(1.25rem, 5vw, 4rem);
    --header-h: 4.5rem;

    --ease:  cubic-bezier(0.25, 1, 0.5, 1);
    --t-move:  0.14s;   /* transform  — lands first */
    --t-paint: 0.18s;   /* border, background */
    --t-fade:  0.2s;    /* colour, opacity */
}

/* Light, on explicit request only. Warm stone rather than cream — cream plus
   a serif plus terracotta is the AI-default signature the audit flagged. */
:root[data-theme='light'] {
    color-scheme: light;

    --paper:        #f0efec;
    --surface:      #f8f7f5;
    --sunken:       #e6e5e1;

    --ink:          #191b19;
    --muted:        #585b57;

    /* Darker than the dark theme's equivalent on purpose: on a light ground a
       raised surface is only 1.07:1 against the page, so the hairline has to
       carry the structure by itself. */
    --rule:         #c4c2bb;
    --line:         #8a8a83;

    --accent:       #1e5340;
    --accent-hover: #17402f;
    --accent-ink:   #ffffff;
    --accent-wash:  rgba(30, 83, 64, 0.06);
    --invalid:      #9a3412;
}

/* --- Base ----------------------------------------------------------------- */

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 1.5rem);
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--body);
    font-size: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
    line-height: 1.62;
    -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }

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

::selection { background: var(--accent); color: var(--accent-ink); }

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

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

.skip-link {
    position: absolute;
    left: 50%; top: 0;
    translate: -50% -150%;
    z-index: 200;
    padding: 0.75rem 1.25rem;
    background: var(--accent);
    color: var(--accent-ink);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: translate var(--t-move) var(--ease);
}

.skip-link:focus-visible { translate: -50% 0; }

/* --- Shared type ---------------------------------------------------------- */

/* --- Masthead ------------------------------------------------------------- */

.masthead {
    position: sticky;
    top: 0;
    z-index: 100;
    background: color-mix(in srgb, var(--paper) 90%, transparent);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color var(--t-paint) var(--ease);
}

.masthead.is-stuck { border-bottom-color: var(--rule); }

.masthead__inner {
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.wordmark {
    font-family: var(--display);
    font-size: 1.0625rem;
    font-weight: 500;
    letter-spacing: -0.015em;
    text-decoration: none;
    white-space: nowrap;
}

.nav__list {
    display: flex;
    gap: 1.75rem;
    list-style: none;
    padding: 0;
}

.nav__list a {
    position: relative;
    display: inline-block;
    padding: 0.25rem 0;
    font-size: 0.875rem;
    letter-spacing: 0.005em;
    color: var(--muted);
    text-decoration: none;
    transition: color var(--t-fade) var(--ease);
}

.nav__list a::after {
    content: '';
    position: absolute;
    left: 0; bottom: 0;
    width: 100%; height: 1px;
    background: currentColor;
    scale: 0 1;
    transform-origin: left;
    transition: scale var(--t-paint) var(--ease);
}

.nav__list a:hover,
.nav__list a[aria-current='true'] { color: var(--ink); }

.nav__list a:hover::after,
.nav__list a[aria-current='true']::after { scale: 1 1; }

.masthead__actions {
    display: flex;
    align-items: center;
    /* Was 0.35rem, which put two identical 36px circles close enough that
       reaching for the menu caught the theme toggle instead. */
    gap: 0.75rem;
}

.icon-btn,
.nav-toggle {
    display: grid;
    place-items: center;
    width: 2.75rem; height: 2.75rem;
    padding: 0;
    background: none;
    border: 1px solid transparent;
    border-radius: 100px;
    color: inherit;
    cursor: pointer;
    transition: background-color var(--t-paint) var(--ease),
                border-color var(--t-paint) var(--ease);
}

.icon-btn:hover,
.nav-toggle:hover { background: var(--accent-wash); border-color: var(--rule); }

.icon-btn svg {
    width: 1.05rem; height: 1.05rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Show the icon for the theme you'd switch *to*. Dark is the default, so the
   sun shows first. */
.icon-moon { display: none; }
:root[data-theme='light'] .icon-sun  { display: none; }
:root[data-theme='light'] .icon-moon { display: block; }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
}

.nav-toggle__bar {
    width: 18px; height: 1.5px;
    background: currentColor;
    transition: translate var(--t-move) var(--ease), rotate var(--t-move) var(--ease);
}

.nav-toggle[aria-expanded='true'] .nav-toggle__bar:first-child { translate: 0 3.25px; rotate: 45deg; }
.nav-toggle[aria-expanded='true'] .nav-toggle__bar:last-child  { translate: 0 -3.25px; rotate: -45deg; }

/* --- Buttons -------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.6rem;
    border: 1px solid var(--accent);
    border-radius: 100px;
    background: var(--accent);
    color: var(--accent-ink);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: transform var(--t-move) var(--ease),
                background-color var(--t-paint) var(--ease),
                border-color var(--t-paint) var(--ease);
}

.btn:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-2px);
}

.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Section-closing CTA. Both audiences need somewhere to go from the section
   they were routed into; the small-business path used to dead-end here. */
.cta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem 1.5rem;
    margin-top: 2.25rem;
}

.cta-row p { font-size: 0.875rem; color: var(--muted); }

/* --- Hero ----------------------------------------------------------------- */

.hero {
    position: relative;
    padding-block: clamp(3.5rem, 11vh, 6.5rem) clamp(2.5rem, 6vh, 4rem);
}

/* Ambient field. A dot lattice, faded out before it reaches any text, so it
   reads as paper texture rather than as a pattern. Two gradients and no DOM
   node — the whole effect is ~200 bytes. */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(circle at center,
        color-mix(in srgb, var(--ink) 22%, transparent) 1px, transparent 1.2px);
    background-size: 22px 22px;
    opacity: 0.5;
    mask-image: radial-gradient(120% 90% at 78% 18%, #000 0%, transparent 68%);
    -webkit-mask-image: radial-gradient(120% 90% at 78% 18%, #000 0%, transparent 68%);
}

.hero > .wrap { position: relative; z-index: 1; }

.hero__title {
    font-family: var(--display);
    /* Pushed hard. The page had no scale event between the h1 and the section
       titles, which is most of why it read as flat. */
    font-size: clamp(2.75rem, 1.1rem + 6.6vw, 6.25rem);
    font-weight: 400;
    line-height: 0.98;
    letter-spacing: -0.035em;
    text-wrap: balance;
    max-width: 15ch;
}

.hero__title em {
    font-style: italic;
    color: var(--accent);
}

.hero__lede {
    margin-top: 1.75rem;
    max-width: 54ch;
    font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.1875rem);
    color: var(--muted);
    text-wrap: pretty;
}

@media (max-width: 46rem) {
    .hero { padding-block: 2rem 2.25rem; }
    .hero__lede { margin-top: 1.25rem; }
    .status { margin-top: 1.75rem; }
}

/* --- Availability --------------------------------------------------------- */

.status {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 2.25rem;
    font-size: 0.9375rem;
    color: var(--muted);
}

.status__dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    /* 3.7s, not a rounded 3s — an ambient loop on a round number reads as a
       designer's timer. It also holds at the top of the cycle rather than
       easing continuously, so it registers as a heartbeat, not a throb. */
    animation: available 3.7s var(--ease) infinite;
}

@keyframes available {
    0%, 8%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); }
    55%, 100% { box-shadow: 0 0 0 7px transparent; }
}

/* --- Instrumentation -------------------------------------------------------
   The page's central claim is that it loads fast on a bad connection. That
   claim used to sit in 15px grey body copy. Here it is measured, live, from
   the Performance API — real transfer size, real first paint. Borrowed from
   yinger.dev's live readouts, except his shows FPS because he does realtime
   3D, and this shows weight because that is what is actually being sold.
   Rendered entirely by JS, so with JS off nothing empty is left behind.     */

.readout {
    position: absolute;
    top: 0;
    right: var(--gutter);
    display: grid;
    gap: 0.55rem;
    padding-top: 0.25rem;
    text-align: right;
    z-index: 2;
}

.readout dl { display: grid; gap: 0.2rem; margin: 0; }

.readout dt {
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: var(--track-tight);
    text-transform: uppercase;
    color: var(--muted);
}

.readout dd {
    margin: 0;
    font-family: var(--display);
    font-size: 1.375rem;
    line-height: 1;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.readout dd span { font-size: 0.75rem; color: var(--muted); }

.readout__live {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    justify-content: flex-end;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: var(--track-tight);
    text-transform: uppercase;
    color: var(--muted);
}

.readout__live i {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--accent);
}

@media (max-width: 64rem) {
    /* Flex rather than a column grid: the first-paint row is only added once
       the browser reports the entry, so the number of items varies. Wrapping
       fits whatever turns up instead of pushing a fixed row off a 320px
       screen. */
    .readout {
        position: static;
        right: auto;
        text-align: left;
        display: flex;
        flex-wrap: wrap;
        gap: 1rem 2rem;
        margin-top: 2.5rem;
        padding-top: 1.25rem;
        border-top: 1px solid var(--rule);
    }

    .readout__live { justify-content: flex-start; }
    .readout dd { font-size: 1.125rem; }
}

@media (max-width: 30rem) {
    .readout { gap: 0.9rem 1.25rem; font-size: 0.9em; }
    .readout dd { font-size: 1rem; }
}

/* --- Scroll progress ------------------------------------------------------- */

.progress {
    position: fixed;
    top: 0; left: 0;
    height: 2px;
    width: 100%;
    transform-origin: left;
    transform: scaleX(0);
    background: var(--accent);
    z-index: 300;
    pointer-events: none;
}

/* --- Syzygy band -----------------------------------------------------------
   The one element that breaks the 72rem measure, now that the marquee is
   gone. Full-bleed and sunken so it reads as a different surface rather than
   as a fourth card: it is a door out of the page, not another project on it.
                                                                            */

.band {
    background: var(--sunken);
    border-block: 1px solid var(--rule);
    padding-block: clamp(2.25rem, 5vw, 3rem);
}

.band__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem 2.5rem;
}

.band__text {
    max-width: 52ch;
    font-family: var(--display);
    font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
    line-height: 1.45;
    text-wrap: pretty;
}

/* --- Section scaffold ----------------------------------------------------- */

.section {
    padding-block: clamp(3.5rem, 9vh, 6rem);
    border-top: 1px solid var(--rule);
}

.section__head {
    display: grid;
    gap: 0.85rem;
    max-width: 60ch;
    margin-bottom: 2.75rem;
}

.section__title {
    font-family: var(--display);
    font-size: clamp(1.75rem, 1.3rem + 1.9vw, 2.625rem);
    font-weight: 400;
    line-height: 1.12;
    letter-spacing: -0.022em;
    text-wrap: balance;
}

.section__intro {
    font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
    color: var(--muted);
    text-wrap: pretty;
}

/* --- Proof ---------------------------------------------------------------- */

.proof { display: grid; gap: 1rem; }

.proof__rest {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr));
    gap: 1rem;
}

.proof__item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.5rem 1.5rem 1.65rem;
    background: var(--surface);
    border: 1px solid var(--rule);
    text-decoration: none;
    transition: transform var(--t-move) var(--ease),
                border-color var(--t-paint) var(--ease);
}

a.proof__item:hover,
a.proof__item:focus-visible {
    transform: translateY(-3px);
    border-color: var(--accent);
}


.proof__kind {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: var(--track-tight);
    text-transform: uppercase;
    color: var(--muted);
}

.proof__title {
    font-family: var(--display);
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.25;
}

.proof__desc { font-size: 0.9375rem; color: var(--muted); }

.proof__stack {
    margin-top: auto;
    padding-top: 0.6rem;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: var(--track-tight);
    text-transform: uppercase;
    color: var(--muted);
}

/* --- Work page -------------------------------------------------------------
   /work/ is a reading page rather than a card grid. Every entry gets room for
   a paragraph or two, because what it is and what happened to it is the whole
   payload — a thumbnail wall would say less than the homepage already does.

   Shares every token with the rest of the site and introduces no colour,
   radius or shadow of its own.                                             */

.work-list {
    display: grid;
    gap: 1rem;
}

.work-item {
    padding: 1.6rem 1.75rem 1.75rem;
    background: var(--surface);
    border: 1px solid var(--rule);
}

.work-item__kind {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: var(--track-tight);
    text-transform: uppercase;
    color: var(--muted);
}

.work-item__title {
    margin-top: 0.4rem;
    font-family: var(--display);
    font-size: 1.375rem;
    font-weight: 400;
    line-height: 1.2;
}

.work-item p {
    margin-top: 0.7rem;
    max-width: 68ch;
    font-size: 0.9375rem;
    color: var(--muted);
}

.work-item__stack {
    display: block;
    margin-top: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: var(--track-tight);
    text-transform: uppercase;
    color: var(--muted);
}

/* A row rather than a list, because two or three links on one line read as
   "here are the ways in" and a stacked list reads as navigation. */
.work-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.5rem;
    margin-top: 1.1rem;
}

/* --- The client quote -----------------------------------------------------
   One quote, and it lives inside the project it refers to rather than in a
   testimonials band. The live site and the monthly are the evidence; the quote
   corroborates them. Standing on its own it would read as decoration on a site
   that publishes its own failures two sections further down. Same
   line-not-accent treatment as the quotes in /writing/, so it reads as someone
   else's words instead of a callout competing with the links beneath it.    */

.work-quote {
    margin-top: 1.2rem;
    padding-left: 1.25rem;
    border-left: 2px solid var(--line);
}

/* Beats `.work-item p`, which is muted body copy. This is the client speaking,
   so it takes the display face and full-contrast ink. */
.work-item .work-quote p {
    margin-top: 0;
    font-family: var(--display);
    font-size: 1.0625rem;
    font-style: italic;
    line-height: 1.45;
    color: var(--ink);
}

/* Homepage copy of the MVS quote, under the three proof cards. */
.home-quote { margin-top: 2rem; max-width: 46rem; }
.home-quote p {
    font-family: var(--display);
    font-size: 1.1875rem;
    font-style: italic;
    line-height: 1.45;
    color: var(--ink);
}

.work-quote cite {
    display: block;
    margin-top: 0.7rem;
    font-family: var(--body);
    font-size: 0.8125rem;
    font-style: normal;
    color: var(--muted);
}

/* --- The syzygy strip ------------------------------------------------------
   Not a card, deliberately. It is a door out of the page, so it gets the
   accent wash and the full measure instead of sitting in the grid with the
   projects it is a view of.                                                */

.work-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem 2rem;
    margin-bottom: 2rem;
    padding: 1.35rem 1.6rem;
    background: var(--accent-wash);
    border: 1px solid var(--rule);
    text-decoration: none;
    transition: border-color var(--t-paint) var(--ease);
}

.work-strip:hover,
.work-strip:focus-visible { border-color: var(--accent); }

.work-strip__text {
    max-width: 62ch;
    font-size: 0.9375rem;
    color: var(--ink);
}

.work-strip__go {
    flex-shrink: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: var(--track-tight);
    text-transform: uppercase;
    color: var(--accent);
}

.work-strip__go span { transition: translate var(--t-move) var(--ease); }
.work-strip:hover .work-strip__go span,
.work-strip:focus-visible .work-strip__go span { translate: 3px 0; }

/* --- Screenshot figure -----------------------------------------------------
   Used on the trade pages to show a real page rather than describe one. The
   sunken background matters while the image is still loading: a bordered box
   the right shape holds its place, so nothing below it jumps.               */

.shot {
    margin: 0;
    max-width: 62rem;
}

.shot img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--rule);
    background: var(--sunken);
}

.shot figcaption {
    margin-top: 0.9rem;
    max-width: 40rem;
    font-size: 0.9375rem;
    color: var(--muted);
}

/* --- How I work ----------------------------------------------------------- */

.steps {
    list-style: none;
    padding: 0;
    counter-reset: step;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr));
    gap: 1.75rem 2.5rem;
}

.steps li {
    counter-increment: step;
    padding-top: 1.1rem;
    border-top: 2px solid var(--line);
}

.steps li::before {
    content: counter(step, decimal-leading-zero);
    display: block;
    margin-bottom: 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: var(--track-tight);
    color: var(--accent);
}

.steps h3 {
    font-family: var(--display);
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.25;
    margin-bottom: 0.4rem;
}

.steps p { font-size: 0.9375rem; color: var(--muted); }

/* No accent side-tab. The 3px-accent-left-bar callout is one of the most
   recognisable generated-design tells; a heavier top rule sets this apart as
   an aside without borrowing it. */
.pricing-note {
    margin-top: 2.75rem;
    padding: 1.4rem 0 0;
    border-top: 2px solid var(--line);
    max-width: 60ch;
}

.pricing-note p + p { margin-top: 0.65rem; }
.pricing-note p { font-size: 0.9375rem; color: var(--muted); }
.pricing-note strong { color: var(--ink); font-weight: 600; }

/* skincare/'s #shop repeats the .pricing-note pattern right after the base
   page price, which reads as more of the same list rather than a genuinely
   optional add-on. A tinted, padded box marks it as its own decision. */
#shop .pricing-note {
    padding: 1.75rem 1.75rem 1.9rem;
    background: var(--surface);
    border-top: 2px solid var(--line);
    max-width: none;
}

/* --- About ---------------------------------------------------------------- */

.about {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 14rem;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: start;
}

.about__portrait {
    width: 100%;
    /* height:auto is load-bearing. The height attribute on the <img> lands as a
       presentational hint, and with no author height to beat it the box is
       forced to 448px tall and aspect-ratio never gets a say. */
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    border: 1px solid var(--rule);
}

.about__caption {
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    color: var(--muted);
}

.prose {
    max-width: 58ch;
    font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
    color: var(--muted);
    text-wrap: pretty;
}

.prose p + p { margin-top: 1.15rem; }
.prose strong { color: var(--ink); font-weight: 600; }

.prose a {
    color: var(--ink);
    text-decoration-color: var(--line);
    text-underline-offset: 3px;
    transition: color var(--t-fade) var(--ease), text-decoration-color var(--t-fade) var(--ease);
}

.prose a:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* Its own rule, not shared with .prose a: .prose's own text is --muted, so an
   --ink link brightens against it. .post__body text is --ink already, so the
   same rule would make a link identical in colour to the paragraph around it. */
.post__body a {
    color: var(--accent);
    text-decoration-color: var(--accent);
    text-underline-offset: 3px;
    transition: color var(--t-fade) var(--ease);
}

.post__body a:hover { color: var(--accent-hover); }

.eyebrow {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: var(--track-tight);
    text-transform: uppercase;
    color: var(--muted);
}

.capabilities {
    margin-top: 2.5rem;
    display: grid;
    gap: 0;
    border-top: 1px solid var(--rule);
    max-width: 44rem;
}

.capability {
    display: grid;
    grid-template-columns: 8rem minmax(0, 1fr);
    gap: 1.5rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--rule);
}

.capability dt {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: var(--track-tight);
    text-transform: uppercase;
    color: var(--muted);
    padding-top: 0.15rem;
}

.capability dd { margin: 0; font-size: 0.9375rem; }

/* solar/ and skincare/ reuse .capability with an <h3>+<p> pair instead of
   <dt>+<dd>. The 8rem label column above is sized for a short dt term, not a
   full heading, so it wraps titles into a cramped strip. Stack them instead. */
.capability:has(h3) {
    grid-template-columns: 1fr;
    gap: 0.35rem;
}

.capability h3 {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--ink);
}

.capability p { margin: 0; font-size: 0.9375rem; color: var(--muted); }

/* --- Contact -------------------------------------------------------------- */

.contact {
    display: grid;
    grid-template-columns: minmax(0, 22rem) minmax(0, 1fr);
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: start;
}

.contact__aside .prose { font-size: 1rem; }

.contact-links {
    list-style: none;
    padding: 0;
    margin-top: 1.75rem;
    display: grid;
    gap: 0.75rem;
}

.contact-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--line);
    padding-bottom: 2px;
    justify-self: start;
    transition: color var(--t-fade) var(--ease),
                border-color var(--t-paint) var(--ease);
}

.contact-links a:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* Copy-to-clipboard on the email. Rendered by JS only — without it the
   address stays a plain mailto link, which is the important path anyway. */
.copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-left: 0.6rem;
    /* min-height clears the WCAG 2.5.8 24px floor; it was 19px tall. */
    min-height: 1.5rem;
    padding: 0.2rem 0.6rem;
    background: none;
    border: 1px solid var(--line);
    border-radius: 100px;
    color: var(--muted);
    font-family: inherit;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: var(--track-tight);
    text-transform: uppercase;
    cursor: pointer;
    transition: color var(--t-fade) var(--ease),
                border-color var(--t-paint) var(--ease);
}

.copy-btn:hover { color: var(--ink); border-color: var(--ink); }

.copy-btn[data-copied='true'] {
    color: var(--accent);
    border-color: var(--accent);
}

.reply-time {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--rule);
    font-size: 0.875rem;
    color: var(--muted);
}

/* --- Form ----------------------------------------------------------------- */

.form { display: grid; gap: 1.25rem; }

.field { display: grid; gap: 0.4rem; }

.field label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: var(--track-tight);
    text-transform: uppercase;
    color: var(--muted);
}

.field input,
.field textarea,
.field select {
    width: 100%;
    padding: 0.8rem 0.95rem;
    background: var(--surface);
    /* --line, not --rule: a field edge is a UI boundary and must clear 3:1. */
    border: 1px solid var(--line);
    border-radius: 0;
    color: var(--ink);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color var(--t-paint) var(--ease),
                box-shadow var(--t-paint) var(--ease);
}

.field textarea { resize: vertical; min-height: 7.5rem; }

.field select {
    appearance: none;
    cursor: pointer;
    padding-right: 2.75rem;
    background-image:
        linear-gradient(45deg, transparent 50%, currentColor 50%),
        linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position: calc(100% - 1.35rem) 55%, calc(100% - 1rem) 55%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.field select:invalid { color: var(--muted); }

.field input:hover,
.field textarea:hover,
.field select:hover { border-color: var(--ink); }

.field input:focus,
.field textarea:focus,
.field select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-wash);
}

/* aria-invalid, not :user-invalid. The browser pseudo-class fired on all five
   fields at once and colour was the only channel — a WCAG 1.4.1 failure. Now
   JS marks only the fields it actually reports, and each one gets text. */
.field [aria-invalid='true'] { border-color: var(--invalid); }

.field label span.optional {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    color: var(--muted);
}

.field__error {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8125rem;
    color: var(--invalid);
}

.field__error::before {
    content: '!';
    display: grid;
    place-items: center;
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: 0.6875rem;
    font-weight: 700;
}

.form__errors {
    padding: 0.85rem 1rem;
    border: 1px solid var(--invalid);
    color: var(--invalid);
    font-size: 0.875rem;
}

.form__errors:empty { display: none; }

/* Multi-choice group (project kind). A fieldset, so a screen reader hears the
   legend with each box. Rows are full-width tap targets, 44px tall at least. */
.field--choices { border: 0; padding: 0; margin: 0; min-width: 0; }

.field--choices legend {
    padding: 0;
    margin-bottom: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: var(--track-tight);
    text-transform: uppercase;
    color: var(--muted);
}

.field--choices legend span.optional {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

.choices { display: grid; gap: 0.5rem; }

.field--choices .choice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 2.75rem;
    padding: 0.55rem 0.95rem;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink);
    font-size: 1rem;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    cursor: pointer;
    transition: border-color var(--t-paint) var(--ease),
                background-color var(--t-paint) var(--ease);
}

.choice:hover { border-color: var(--ink); }

.choice input {
    flex-shrink: 0;
    width: 1.125rem;
    height: 1.125rem;
    margin: 0;
    accent-color: var(--accent);
    cursor: pointer;
}

.choice:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-wash);
}

.choice:has(input:focus-visible) {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* JS marks the first box invalid when none are ticked; show it on the group. */
.field--choices:has([aria-invalid='true']) .choice { border-color: var(--invalid); }

.form .btn { justify-self: start; }

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

/* --- Writing -------------------------------------------------------------- */

.post-list {
    list-style: none;
    padding: 0;
    border-top: 1px solid var(--rule);
}

.post-list li { border-bottom: 1px solid var(--rule); }

.post-list a {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 0.5rem 2rem;
    padding: 1.4rem 0.75rem;
    text-decoration: none;
    transition: transform var(--t-move) var(--ease),
                background-color var(--t-paint) var(--ease);
}

.post-list a:hover,
.post-list a:focus-visible {
    background: var(--accent-wash);
    transform: translateX(6px);
}

/* h2 on /writing/, where the list sits directly under the page's own h1;
   h3 on the homepage, where it sits under that section's own h2. Same list,
   different heading depth depending on what owns the page. */
.post-list h2,
.post-list h3 {
    font-family: var(--display);
    font-size: 1.1875rem;
    font-weight: 400;
    line-height: 1.3;
    transition: color var(--t-fade) var(--ease);
}

.post-list a:hover h2,
.post-list a:focus-visible h2,
.post-list a:hover h3,
.post-list a:focus-visible h3 { color: var(--accent); }

.post-list p {
    grid-column: 1;
    margin-top: 0.3rem;
    font-size: 0.9375rem;
    color: var(--muted);
    max-width: 56ch;
}

.post-list time {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: var(--track-tight);
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}

/* --- Post (single article) ------------------------------------------------- */

.post {
    padding-block: clamp(3rem, 8vh, 5rem) clamp(4rem, 10vh, 7rem);
}

.post__back {
    display: inline-block;
    margin-bottom: 2.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    transition: color var(--t-fade) var(--ease);
}

.post__back:hover { color: var(--accent); }

.post__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin-bottom: 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: var(--track-tight);
    text-transform: uppercase;
    color: var(--muted);
}

.post__title {
    max-width: 20ch;
    font-family: var(--display);
    font-size: clamp(2rem, 1.3rem + 2.8vw, 3.5rem);
    font-weight: 400;
    line-height: 1.06;
    letter-spacing: -0.03em;
    text-wrap: balance;
}

.post__standfirst {
    margin-top: 1.5rem;
    max-width: 46ch;
    font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
    color: var(--muted);
    text-wrap: pretty;
}

.post__body {
    margin-top: 3rem;
    max-width: 62ch;
    font-size: clamp(1.0625rem, 1rem + 0.2vw, 1.1875rem);
    line-height: 1.7;
    text-wrap: pretty;
}

.post__body > * + * { margin-top: 1.5rem; }

.post__body h2 {
    margin-top: 3rem;
    font-family: var(--display);
    font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -0.015em;
}

.post__body ul,
.post__body ol { padding-left: 1.25rem; }

.post__body li + li { margin-top: 0.6rem; }

.post__body strong { color: var(--ink); font-weight: 600; }

/* No accent side-tab here either — line, not accent, so the quote reads as a
   quotation rather than a highlighted callout competing with real CTAs. */
.post__body blockquote {
    padding-left: 1.25rem;
    border-left: 2px solid var(--line);
    font-family: var(--display);
    font-size: 1.2em;
    font-style: italic;
    line-height: 1.4;
}

/* Marks a quote as someone else's words, not the author's own aside. Only
   the verbatim third-party quotes carry one — the distinction is the point. */
.post__body blockquote cite {
    display: block;
    margin-top: 0.6rem;
    font-family: var(--body);
    font-size: 0.8125rem;
    font-style: normal;
    color: var(--muted);
}

.post__body hr {
    margin-block: 2.5rem;
    border: 0;
    border-top: 1px solid var(--rule);
}

.post__foot {
    margin-top: 3.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--rule);
    max-width: 62ch;
    font-size: 0.9375rem;
    color: var(--muted);
}

.post__foot a {
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--line);
    padding-bottom: 1px;
    transition: color var(--t-fade) var(--ease), border-color var(--t-paint) var(--ease);
}

.post__foot a:hover { color: var(--accent); border-color: var(--accent); }

/* --- Message page (404, thanks) --------------------------------------------
   No masthead, no footer — a single centred screen with one way back. The
   wordmark stays, muted, so the page still says whose site this is; a full
   masthead would compete with the one thing the screen needs to say. */

.message-page {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
    padding-block: 4rem;
}

.message-page .wordmark { color: var(--muted); margin-bottom: 0.5rem; }
.message-page .section__title { margin-top: 0.35rem; max-width: 20ch; }
.message-page .prose { margin-top: 0.5rem; }
.message-page__actions { margin-top: 1.5rem; }

.text-link {
    display: inline-block;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--line);
    padding-bottom: 2px;
    transition: color var(--t-fade) var(--ease),
                border-color var(--t-paint) var(--ease);
}

.text-link:hover { color: var(--accent); border-color: var(--accent); }

/* The standalone one at the end of a section, rather than mid-sentence. */
.text-link--standalone { margin-top: 1.75rem; }

/* --- Footer --------------------------------------------------------------- */

.footer {
    border-top: 1px solid var(--rule);
    padding-block: 2.5rem;
    color: var(--muted);
    font-size: 0.875rem;
}

.footer__inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem 2rem;
}

.footer a { color: var(--ink); }

.footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.5rem;
}

.footer__links a {
    text-decoration: none;
    border-bottom: 1px solid var(--line);
    padding-bottom: 1px;
    transition: color var(--t-fade) var(--ease),
                border-color var(--t-paint) var(--ease);
}

.footer__links a:hover { color: var(--accent); border-color: var(--accent); }

/* --- Scroll reveal -------------------------------------------------------- */

/* 8px of travel, not 20. Compositor-only, so it costs nothing and the page
   is readable the instant it paints. */
.js .reveal {
    opacity: 0;
    translate: 0 8px;
    transition: opacity var(--t-fade) var(--ease), translate var(--t-fade) var(--ease);
}

.js .reveal.is-visible { opacity: 1; translate: none; }

/* --- Responsive ----------------------------------------------------------- */

@media (max-width: 60rem) {
    .about { grid-template-columns: 1fr; }
    .about__portrait { width: 9rem; }
    .contact { grid-template-columns: 1fr; }
}

@media (max-width: 46rem) {
    /* The earlier 46rem block holds the hero. This one is the mobile nav. */
    .nav-toggle { display: flex; }

    .nav {
        position: absolute;
        inset: var(--header-h) 0 auto 0;
        background: var(--paper);
        border-bottom: 1px solid var(--line);
        display: grid;
        grid-template-rows: 0fr;
        visibility: hidden;
        transition: grid-template-rows var(--t-paint) var(--ease), visibility var(--t-paint);
    }

    .nav.is-open { grid-template-rows: 1fr; visibility: visible; }

    /* Scrim. Without it the panel's own ground sat straight on top of hero
       text with a 1.36:1 hairline between them, and the page scrolled
       underneath. The body scroll lock is in script.js.

       absolute, NOT fixed. .masthead carries backdrop-filter, and that makes it
       the containing block for fixed descendants — so `top: 100%` resolved
       against the 4.5rem masthead instead of the viewport and landed the scrim
       exactly where the nav panel starts. Being positioned, it then painted over
       the links: the whole menu came out washed and 2px blurred. Against .nav
       (itself absolute) 100% means "below the panel", which is what was meant. */
    .nav.is-open::after {
        content: '';
        position: absolute;
        inset: 100% 0 -100vh 0;
        background: color-mix(in srgb, var(--paper) 78%, transparent);
        backdrop-filter: blur(2px);
        pointer-events: none;
    }

    body.nav-open { overflow: hidden; }

    .nav__list {
        overflow: hidden;
        flex-direction: column;
        gap: 0;
        padding-inline: var(--gutter);
    }

    .nav__list li + li { border-top: 1px solid var(--rule); }

    .nav__list a { display: block; padding: 1rem 0; font-size: 1rem; }
    .nav__list a::after { display: none; }

    .capability { grid-template-columns: 1fr; gap: 0.2rem; }
    .footer__inner { flex-direction: column; }
    .post-list a { grid-template-columns: 1fr; }
    .post-list time { grid-row: 3; }
}

/* --- Motion & print ------------------------------------------------------- */

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

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .js .reveal { opacity: 1; translate: none; }

    .status__dot { animation: none !important; }
}

@media print {
    .masthead, .skip-link, .form { display: none; }
    body { background: #fff; color: #000; }
}
