/* ==========================================================================
   Quantum Edge — "Growth has a shape"
   System: 13-column grid · type scale ×√φ (1.272) · 8px baseline
   Colour: paper / ink / rule, and one semantic signal reserved for data.
   ========================================================================== */

:root {
    /* colour — semantic roles, not decoration */
    --paper: #F3F1EA;
    --ink: #121210;
    --ink-2: #4F4D46;      /* secondary text, ~8:1 on paper */
    --ink-3: #6F6C63;      /* meta / captions, ~4.9:1 on paper */
    --rule: #D6D2C5;
    --signal: #C8401E;     /* only ever marks the datum that matters */

    /* type */
    --serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;
    --sans: 'Geist', -apple-system, 'Segoe UI', sans-serif;
    --mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;

    /* scale ×1.272 (√φ) */
    --t-1: 0.75rem;
    --t0: 1rem;
    --t1: 1.272rem;
    --t2: 1.618rem;
    --t3: 2.058rem;
    --t4: 2.618rem;
    --t5: 3.33rem;
    --t6: 4.236rem;

    /* space — 8px baseline */
    --u: 0.5rem;
    --gutter: 1.5rem;
    --margin: clamp(1rem, 4vw, 3rem);
    --section: clamp(6rem, 13vw, 10.5rem);

    /* motion: one vocabulary for every transition on the page.
       out  = things arriving (decisive, no bounce)
       io   = things travelling (sweeps, wipes, rules)
       Durations pair with them: fast for pointer feedback, mid for state, slow for arrivals. */
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-io: cubic-bezier(0.62, 0, 0.2, 1);
    --t-fast: 0.22s;
    --t-mid: 0.45s;
    --t-slow: 0.9s;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    background: var(--paper);
    color: var(--ink);
    font: 400 var(--t0)/1.55 var(--sans);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

a { color: inherit; }
ul, ol { list-style: none; }

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

:focus-visible { outline: 2px solid var(--signal); outline-offset: 4px; }

/* --------------------------------------------------------------------------
   Grid
   -------------------------------------------------------------------------- */
.wrap {
    width: 100%;
    max-width: 1360px;
    margin-inline: auto;
    padding-inline: var(--margin);
}

.grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    column-gap: var(--gutter);
}
@media (min-width: 900px) {
    .grid { grid-template-columns: repeat(13, minmax(0, 1fr)); }
}

/* "G" toggles the column overlay — the grid is structural, so it may be inspected */
.grid-overlay {
    position: fixed; inset: 0; z-index: 200;
    pointer-events: none; opacity: 0; transition: opacity 0.3s;
}
.grid-overlay .grid { height: 100%; }
.grid-overlay i { background: rgba(200, 64, 30, 0.06); border-inline: 1px solid rgba(200, 64, 30, 0.2); }
body.show-grid .grid-overlay { opacity: 1; }
@media (max-width: 899px) { .grid-overlay i:not(:first-child) { display: none; } }

/* --------------------------------------------------------------------------
   Shared typographic roles
   -------------------------------------------------------------------------- */
.meta-row, .section-no, .row-no, .deliverables, .running-head,
figcaption, .foot-h, label, .ticks, .ledger dt {
    font-family: var(--mono);
    font-size: var(--t-1);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-variant-numeric: tabular-nums;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 300; }

h2 {
    font-size: clamp(var(--t3), 4.2vw, var(--t5));
    line-height: 1.05;
    letter-spacing: -0.02em;
    max-width: 16ch;
    text-wrap: balance;
}

.section-no { color: var(--ink-3); line-height: 1.6; margin-bottom: calc(var(--u) * 4); }

/* The ink fill is a layer that wipes away on hover, rather than a colour that blinks */
.btn {
    position: relative; z-index: 0; isolation: isolate;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.95rem 1.4rem;
    background: transparent; color: var(--paper);
    border: 1px solid var(--ink);
    font: 500 0.875rem/1 var(--sans);
    text-decoration: none; cursor: pointer;
    transition: color var(--t-mid) var(--ease);
}
.btn::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: var(--ink);
    transform: scaleX(1); transform-origin: 0 50%;
    transition: transform var(--t-mid) var(--ease-io);
}
.btn:hover { color: var(--ink); }
.btn:hover::before { transform: scaleX(0); transform-origin: 100% 50%; }
.btn:active { transform: translateY(1px); }

.link-arrow {
    font: 500 0.875rem/1 var(--sans);
    text-decoration: none;
    background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
    padding-bottom: 5px;
    transition: background-size 0.4s var(--ease);
}
.link-arrow:hover { background-size: 30% 1px; }

/* --------------------------------------------------------------------------
   Navigation — with a running head, as in a book
   -------------------------------------------------------------------------- */
.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: color-mix(in srgb, var(--paper) 90%, transparent);
    backdrop-filter: saturate(1.2) blur(10px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.4s;
}
.nav.scrolled { border-bottom-color: var(--rule); }

.nav-inner {
    height: 64px;
    display: flex; align-items: center; justify-content: space-between; gap: 2rem;
}

.brand { display: flex; align-items: center; gap: 0.65rem; text-decoration: none; }
/* logo.jpeg carries mark + wordmark; crop to the nautilus and multiply out its white */
.brand-mark {
    width: 30px; height: 30px; flex: none;
    background: url(logo.jpeg) 54% 0 / 131% auto no-repeat;
    mix-blend-mode: multiply;
}
.brand-word { font: 500 0.95rem/1 var(--sans); letter-spacing: -0.01em; }

.running-head { color: var(--ink-3); margin-right: auto; padding-left: 2.5rem; display: none; overflow: hidden; }
.running-head span { display: inline-block; }
@media (min-width: 1100px) { .running-head { display: block; } }

.nav-links { display: flex; align-items: center; gap: 2rem; font-size: 0.875rem; }
/* Underline wipes in from the left, out to the right: the same gesture as the button fill */
.nav-links a { position: relative; text-decoration: none; color: var(--ink-2); transition: color var(--t-fast) var(--ease); }
.nav-links a:not(.nav-cta)::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px;
    background: currentColor;
    transform: scaleX(0); transform-origin: 100% 50%;
    transition: transform var(--t-mid) var(--ease-io);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:not(.nav-cta):hover::after { transform: scaleX(1); transform-origin: 0 50%; }
.nav-links .nav-cta { color: var(--ink); border-bottom: 1px solid var(--ink); padding-bottom: 2px; }
@media (max-width: 720px) { .nav-links a:not(.nav-cta) { display: none; } }

.progress {
    position: absolute; left: 0; bottom: -1px; height: 1px; width: 100%;
    background: var(--ink); transform-origin: 0 50%; transform: scaleX(0);
}

/* --------------------------------------------------------------------------
   § 00 Hero
   -------------------------------------------------------------------------- */
.hero { padding-top: 64px; min-height: 100svh; display: flex; flex-direction: column; }
.hero > .wrap { flex: 1; display: flex; flex-direction: column; }

.meta-row {
    display: flex; justify-content: space-between; gap: 1rem;
    color: var(--ink-3);
    padding: calc(var(--u) * 3) 0;
    border-bottom: 1px solid var(--rule);
}

.hero-grid { flex: 1; align-content: space-between; row-gap: calc(var(--u) * 6); padding: calc(var(--u) * 6) 0; }

.hero-title {
    font-size: clamp(3.33rem, 10.2vw, 8.72rem);
    line-height: 0.92;
    letter-spacing: -0.035em;
    font-variation-settings: "opsz" 72;
}
/* line-height 0.92 is shorter than the glyph ascent; pad the mask and cancel it with margins so caps/descenders aren't clipped */
.hero-title .line { display: block; overflow: hidden; padding: 0.14em 0.04em 0.12em 0; margin: -0.14em -0.04em -0.12em 0; }
.hero-title .line > span { display: inline-block; }

.lede {
    font-size: var(--t1);
    line-height: 1.5;
    color: var(--ink-2);
    max-width: 30ch;
    text-wrap: pretty;
}
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.75rem; margin-top: calc(var(--u) * 5); }

.hero-figure { margin: 0; }
.figure-frame { position: relative; }
#spiral { display: block; width: 100%; height: auto; overflow: visible; cursor: crosshair; }
#construction rect { fill: none; stroke: var(--rule); stroke-width: 1; vector-effect: non-scaling-stroke; }
#spiral-path { fill: none; stroke: var(--ink); stroke-width: 1.25; vector-effect: non-scaling-stroke; }
#points circle { fill: var(--ink); }
#points circle.signal { fill: var(--signal); }
.probe { opacity: 0; transition: opacity 0.2s; pointer-events: none; }
.probe line { stroke: var(--signal); stroke-width: 1; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
#probe-dot { fill: none; stroke: var(--signal); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.probe-tip {
    position: absolute; pointer-events: none; opacity: 0;
    font: 400 var(--t-1)/1.45 var(--mono); font-variant-numeric: tabular-nums;
    background: var(--ink); color: var(--paper);
    padding: 0.45rem 0.6rem; white-space: nowrap;
    transition: opacity 0.2s;
}
.figure-frame.probing .probe, .figure-frame.probing .probe-tip { opacity: 1; }

figcaption {
    display: grid; grid-template-columns: auto 1fr; gap: 1.5rem;
    color: var(--ink-3);
    text-transform: none; letter-spacing: 0; line-height: 1.5;
    padding-top: calc(var(--u) * 2);
    margin-top: calc(var(--u) * 2);
    border-top: 1px solid var(--rule);
}
figcaption span:first-child { text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink); }

@media (min-width: 900px) {
    /* headline + lede on the left register; the figure answers them on the right, bottom-aligned */
    .hero-title  { grid-column: 1 / 10; grid-row: 1; position: relative; z-index: 1; }
    .hero-copy   { grid-column: 1 / 6;  grid-row: 2; align-self: end; }
    .hero-figure { grid-column: 8 / 14; grid-row: 1 / 3; align-self: end; }
}

/* --------------------------------------------------------------------------
   § 01 Premise
   -------------------------------------------------------------------------- */
.premise { padding: var(--section) 0; border-top: 1px solid var(--rule); }
.statement {
    font: 300 clamp(var(--t2), 3.4vw, var(--t4))/1.22 var(--serif);
    letter-spacing: -0.015em;
    text-wrap: pretty;
}
.statement .w { opacity: 0.16; }
@media (min-width: 900px) {
    .premise .section-no { grid-column: 1 / 4; }
    .statement { grid-column: 5 / 14; }
}

/* --------------------------------------------------------------------------
   § 02 Method
   -------------------------------------------------------------------------- */
.method { padding: 0 0 var(--section); }
.section-head { padding-bottom: calc(var(--u) * 8); }
@media (min-width: 900px) {
    .section-head .section-no { grid-column: 1 / 4; }
    .section-head h2 { grid-column: 5 / 14; }
}

.method-list { border-top: 1px solid var(--ink); }
.method-row {
    padding: calc(var(--u) * 5) 0;
    border-bottom: 1px solid var(--rule);
    row-gap: 1rem;
    align-items: start;
}
.row-no { color: var(--ink-3); padding-top: 0.6rem; transition: color var(--t-mid) var(--ease); }
.method-row h3 { font-size: clamp(var(--t3), 3.2vw, var(--t4)); line-height: 1; letter-spacing: -0.02em; transition: transform var(--t-mid) var(--ease); }
.row-body p { color: var(--ink-2); max-width: 38ch; padding-top: 0.35rem; }
.deliverables { margin-top: calc(var(--u) * 3); color: var(--ink); display: grid; gap: 0.35rem; }

/* Hovering a row shifts its parts by different amounts: near things move more than far ones */
@media (hover: hover) and (min-width: 900px) {
    .method-row:hover .row-no { color: var(--signal); }
    .method-row:hover h3 { transform: translateX(6px); }
    .method-row .deliverables li { transition: transform var(--t-mid) var(--ease); }
    .method-row:hover .deliverables li { transform: translateX(3px); }
    .method-row:hover .deliverables li:nth-child(2) { transition-delay: 0.04s; }
    .method-row:hover .deliverables li:nth-child(3) { transition-delay: 0.08s; }
}
.deliverables li::before { content: "· "; color: var(--ink-3); }

.row-fig { width: 100%; max-width: 280px; height: auto; overflow: visible; }
.row-fig * { vector-effect: non-scaling-stroke; }
.row-fig .src rect, .row-fig .sink { fill: none; stroke: var(--ink); stroke-width: 1.25; }
.row-fig .flow { fill: none; stroke: var(--ink); stroke-width: 1.25; }
.row-fig .flow.flowing { stroke-dasharray: 3 5; }
.row-fig .axis { stroke: var(--ink); stroke-width: 1.25; }
.row-fig .band { fill: var(--ink); opacity: 0.07; }
.row-fig .observed { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.row-fig .forecast { fill: none; stroke: var(--ink); stroke-width: 1.25; }
.row-fig .forecast.dashed { stroke-dasharray: 4 4; }
.row-fig .now { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 2 3; }
.row-fig .bars rect { fill: var(--rule); transform-box: fill-box; transform-origin: 50% 100%; }
.row-fig .bars rect.hot { fill: var(--signal); }
.row-fig .bars rect { transition: fill 0.8s var(--ease); }
.row-fig .pulse-ring { fill: none; stroke: var(--signal); stroke-width: 1; opacity: 0; }
.row-fig .runner { fill: var(--ink); opacity: 0; }
.row-fig .trend { fill: none; stroke: var(--ink); stroke-width: 1; opacity: 0; }
.row-fig .bar-label { font: 500 10px var(--mono); fill: var(--signal); letter-spacing: 0.02em; opacity: 0; font-variant-numeric: tabular-nums; }
.accent-dot { fill: var(--signal); }

@media (min-width: 900px) {
    .row-no        { grid-column: 1 / 2; }
    .method-row h3 { grid-column: 2 / 5; }
    .row-body      { grid-column: 5 / 10; }
    .row-fig       { grid-column: 10 / 14; justify-self: end; }
}

/* --------------------------------------------------------------------------
   § 03 Practice — the one inverted ground: cadence light · light · dark · light
   -------------------------------------------------------------------------- */
.practice {
    --rule: #34332E;
    background: var(--ink); color: var(--paper);
    padding: var(--section) 0;
}
.practice .section-no, .practice .ticks, .gantt-label span { color: #A29E92; }

.gantt { border-top: 1px solid var(--paper); }
.gantt-row {
    display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.75rem;
    padding: calc(var(--u) * 3) 0;
    border-bottom: 1px solid var(--rule);
}
@media (min-width: 900px) {
    .gantt-row { grid-template-columns: repeat(13, minmax(0, 1fr)); column-gap: var(--gutter); align-items: center; }
    .gantt-row > :first-child { grid-column: 1 / 5; }
    .gantt-row > :last-child  { grid-column: 5 / 14; }
}
.gantt-axis { padding: calc(var(--u) * 2) 0; }
.ticks { display: flex; justify-content: space-between; }
.gantt-label b { display: block; font: 300 var(--t2)/1.1 var(--serif); letter-spacing: -0.01em; font-weight: 300; }
.gantt-label span { font-size: 0.875rem; }

.track {
    position: relative; height: 12px;
    background: repeating-linear-gradient(90deg, var(--rule) 0 1px, transparent 1px calc(100% / 6));
}
.bar {
    position: absolute; top: 0; bottom: 0;
    left: calc(var(--s) / 12 * 100%);
    width: calc((var(--e) - var(--s)) / 12 * 100%);
    background: var(--paper);
    transform-origin: 0 50%;
}
.bar.open { background: repeating-linear-gradient(135deg, var(--paper) 0 2px, transparent 2px 6px); }

/* --------------------------------------------------------------------------
   § 04 Standards — a ledger, not a brag wall
   -------------------------------------------------------------------------- */
.standards { padding: var(--section) 0; }
.ledger { border-top: 1px solid var(--ink); }
.ledger-row { padding: calc(var(--u) * 3.5) 0; border-bottom: 1px solid var(--rule); align-items: baseline; row-gap: 0.5rem; }
.ledger dt { color: var(--ink-3); }
.figure-val {
    font: 300 clamp(var(--t3), 4vw, var(--t5))/1 var(--serif);
    letter-spacing: -0.02em;
    font-variant-numeric: lining-nums tabular-nums;
}
.figure-val small { font: 400 var(--t-1)/1 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); margin-left: 0.6em; }
.ledger .note { color: var(--ink-2); max-width: 34ch; }
@media (min-width: 900px) {
    .ledger dt    { grid-column: 1 / 4; }
    .figure-val   { grid-column: 5 / 9; }
    .ledger .note { grid-column: 10 / 14; }
}

/* --------------------------------------------------------------------------
   § 05 Contact
   -------------------------------------------------------------------------- */
.contact { padding: var(--section) 0; border-top: 1px solid var(--rule); }
.contact h2 { font-size: clamp(var(--t4), 5.6vw, var(--t6)); max-width: 13ch; margin-bottom: calc(var(--u) * 7); }
.contact h2 em { font-style: italic; }

.contact-form label { display: block; color: var(--ink-3); margin-bottom: 0.75rem; }
.field { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; border-bottom: 1px solid var(--ink); padding-bottom: 1rem; transition: border-color 0.3s; }
.field input {
    flex: 1 1 16rem; min-width: 0;
    border: 0; background: transparent; color: var(--ink);
    font: 300 var(--t2)/1.2 var(--serif);
    padding: 0.4rem 0;
}
.field input::placeholder { color: #9C998F; }
.field input:focus { outline: none; }
.field:focus-within { border-bottom-color: var(--signal); }

.form-feedback { font: 400 0.875rem/1.4 var(--sans); padding: 0.9rem 1rem; margin-bottom: 1.5rem; border-left: 2px solid; }
.form-feedback.success { border-color: #2F6B45; background: #E7EEE6; }
.form-feedback.error   { border-color: var(--signal); background: #F6E4DC; }

.next-steps { display: grid; gap: 1.25rem; align-self: end; color: var(--ink-2); font-size: 0.925rem; margin-top: 3rem; }
.next-steps li { display: grid; grid-template-columns: 2.5rem 1fr; padding-top: 1.25rem; border-top: 1px solid var(--rule); }
.next-steps span { font: 400 var(--t-1)/1.7 var(--mono); color: var(--ink-3); }

@media (min-width: 900px) {
    .contact .section-no { grid-column: 1 / 4; }
    .contact-main { grid-column: 5 / 11; }
    .next-steps   { grid-column: 11 / 14; margin-top: 0; }
}

/* --------------------------------------------------------------------------
   Footer + colophon
   -------------------------------------------------------------------------- */
.footer { border-top: 1px solid var(--ink); padding: calc(var(--u) * 6) 0 calc(var(--u) * 8); font-size: 0.875rem; }
.footer .grid { row-gap: 2.5rem; }
.foot-brand { display: flex; gap: 0.75rem; align-items: flex-start; }
.foot-brand p { font-weight: 500; line-height: 1.4; }
.foot-brand p span { font-weight: 400; color: var(--ink-3); }
.foot-h { color: var(--ink-3); margin-bottom: 0.9rem; }
.foot-col a { display: block; text-decoration: none; color: var(--ink-2); margin-bottom: 0.4rem; }
.foot-col a:hover { color: var(--ink); }
.colophon p:last-child { color: var(--ink-2); max-width: 36ch; }
kbd { font: 400 var(--t-1) var(--mono); border: 1px solid var(--rule); padding: 0.05rem 0.35rem; }
@media (min-width: 900px) {
    .foot-brand { grid-column: 1 / 5; }
    .foot-col:nth-child(2) { grid-column: 5 / 7; }
    .foot-col:nth-child(3) { grid-column: 7 / 9; }
    .colophon   { grid-column: 10 / 14; }
}

/* --------------------------------------------------------------------------
   Reduced motion: final states, no transitions
   -------------------------------------------------------------------------- */
/* ==========================================================================
   Motion system
   One arrival gesture (mask + rise), one travelling gesture (wipe from the
   left), one ambient gesture (slow drift). Everything below is a variation
   on those three, so the page reads as one hand.
   ========================================================================== */

/* Hairlines are drawn, not switched on. The element keeps its border box for
   layout and the visible line is a layer scaled from the left. JS adds the
   data-rule attribute, so without JS the plain borders still show. */
[data-rule] { position: relative; }
[data-rule]::after {
    content: ""; position: absolute; left: 0; right: 0; height: 1px;
    background: var(--rule-c, var(--rule));
    transform: scaleX(var(--rx, 0)); transform-origin: 0 50%;
}
[data-rule="top"] { border-top-color: transparent; }
[data-rule="top"]::after { top: -1px; }
[data-rule="bottom"] { border-bottom-color: transparent; }
[data-rule="bottom"]::after { bottom: -1px; }
.method-list, .ledger { --rule-c: var(--ink); }
.gantt { --rule-c: var(--paper); }

.hero-figure { will-change: transform; }
.figure-frame { transform: translateZ(0); }

/* Form: the rule under the field is the status light */
.contact-form label { transition: color var(--t-mid) var(--ease), transform var(--t-mid) var(--ease); }
.contact-form:focus-within label { color: var(--ink); transform: translateY(-2px); }
.field { position: relative; }
.field::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
    background: var(--signal);
    transform: scaleX(0); transform-origin: 0 50%;
    transition: transform var(--t-slow) var(--ease-io);
}
.field:focus-within::after { transform: scaleX(1); }
.field.sending::after { animation: sweep 1.1s var(--ease-io) infinite; }
@keyframes sweep {
    0% { transform: scaleX(0); transform-origin: 0 50%; }
    50% { transform: scaleX(1); transform-origin: 0 50%; }
    51% { transform: scaleX(1); transform-origin: 100% 50%; }
    100% { transform: scaleX(0); transform-origin: 100% 50%; }
}

/* Practice: a playhead sweeps each track once as the phase is drawn */
.track .playhead {
    position: absolute; top: -6px; bottom: -6px; width: 1px;
    background: var(--signal); opacity: 0; pointer-events: none;
}

/* Footer and ledger links share the nav's underline wipe */
.foot-col a { position: relative; }
.foot-col a::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
    background: currentColor; transform: scaleX(0); transform-origin: 100% 50%;
    transition: transform var(--t-mid) var(--ease-io);
}
.foot-col a:hover::after { transform: scaleX(1); transform-origin: 0 50%; }

.link-arrow span { display: inline-block; transition: transform var(--t-mid) var(--ease); }
.link-arrow:hover span { transform: translateY(3px); }

.ledger-row .figure-val { transition: transform var(--t-mid) var(--ease); }
@media (hover: hover) and (min-width: 900px) {
    .ledger-row:hover .figure-val { transform: translateX(6px); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
    .statement .w { opacity: 1; }
    [data-rule]::after { transform: scaleX(1); }
}
