/* ON PROMOTION into site/: change the two asset paths below — 'fonts/' -> 'fonts/' (@font-face src)
   and 'img/' -> 'img/' (only used from index.html, plus 'privacy.html|terms.html|favicon.svg' -> bare filenames).

   Never Hidden — landing page, Direction A "The Loop".
   Self-contained. No frameworks, no CDNs, no external requests. Light mode only.
   Palette and type ported from the app's design tokens (resources/css/relay.css). */

@font-face {
    font-family: 'Instrument Sans';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('fonts/instrument-sans-latin.woff2') format('woff2');
}
@font-face {
    font-family: 'Geist Mono';
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url('fonts/geist-mono-latin.woff2') format('woff2');
}

:root {
    --bg: #F6F5F2;
    --surface: #FFFFFF;
    --surface2: #F0EEE9;
    --border: #E5E2DB;
    --border2: #D6D2C9;
    --text: #1D1C19;
    --text2: #5F5C55;
    --text3: #6E6B63;      /* muted text — darkened from the app token #98948B to clear AA on --bg */
    --accent: #0E7A72;
    --on-accent: #FFFFFF;
    --accent-soft: #EAF2F1;
    --green-soft: #EAF4EE;
    --green-ink: #146138;  /* chip text — AA on --green-soft */
    --amber-soft: #FAF0DD;
    --amber-ink: #8F4D08;  /* chip text — AA on --amber-soft */
    --shadow: 0 1px 2px rgba(30, 27, 21, .05), 0 6px 20px rgba(30, 27, 21, .06);

    --sans: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;

    --maxw: 1080px;
    --maxw-wide: 1180px;
    --gut: 32px;

    /* half of one 1fr column in the 7-node loop track (3fr + 1.6fr + 3fr = 7.6fr) */
    --loop-inset: 6.58%;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

h1, h2, h3 { text-wrap: balance; }

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.wrap {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 var(--gut);
}
.wrap--wide { max-width: var(--maxw-wide); }

/* ---------- glyph + wordmark ---------- */

.glyph {
    width: 32px;
    height: 32px;
    flex: none;
    border-radius: 9px;
    background: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.glyph svg { display: block; }

.lockup { display: inline-flex; align-items: center; gap: 11px; }
.lockup:hover { text-decoration: none; }
.wordmark {
    font-weight: 700;
    letter-spacing: -0.015em;
    font-size: 18.5px;
    color: var(--text);
    white-space: nowrap;
}

/* ---------- header ---------- */

.site-head { background: var(--bg); }
.site-head .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 78px;
    max-width: var(--maxw-wide);
}
.site-head nav {
    display: flex;
    align-items: center;
    gap: 24px;
    font-size: 14.5px;
}
.site-head nav a { color: var(--text2); white-space: nowrap; }
.site-head nav a:hover { color: var(--text); }

/* ---------- hero ---------- */

.hero { padding: 96px 0 96px; }

.hero-kicker {
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text3);
    margin: 0 0 30px;
}

.hero h1 {
    font-size: 60px;
    line-height: 1.06;
    letter-spacing: -0.03em;
    font-weight: 700;
    margin: 0;
    max-width: 16ch;
    text-wrap: pretty;
}

.lede {
    font-size: 20px;
    line-height: 1.55;
    color: var(--text2);
    max-width: 58ch;
    margin: 26px 0 0;
}

.cta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px 22px;
    margin: 38px 0 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    background: var(--accent);
    color: var(--on-accent);
    border-radius: 9px;
    padding: 13px 24px;
    font-size: 15.5px;
    font-weight: 600;
    letter-spacing: -0.005em;
    border: 1px solid var(--accent);
}
.btn:hover { text-decoration: none; filter: brightness(1.1); }

.quiet { font-size: 14.5px; color: var(--text3); }

/* ---------- generic section ---------- */

.section {
    padding: 82px 0;
    border-top: 1px solid var(--border);
}
.eyebrow {
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 22px;
}
.section h2 {
    font-size: 28px;
    line-height: 1.25;
    letter-spacing: -0.02em;
    font-weight: 700;
    margin: 0 0 40px;
    max-width: 32ch;
}

.note {
    margin: 34px 0 0;
    font-size: 15.5px;
    line-height: 1.62;
    color: var(--text2);
    border-left: 2px solid var(--accent);
    padding-left: 16px;
    max-width: 64ch;
}

/* ---------- THE LOOP ---------- */

.section--loop h2 { margin-bottom: 58px; }

.loop { position: relative; }

.loop-track {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr) 1.6fr repeat(3, 1fr);
    gap: 0;
    position: relative;
}

/* one thin rail, first node centre to last node centre; the markers sit on top of it */
.loop-track::before {
    content: "";
    position: absolute;
    left: var(--loop-inset);
    right: var(--loop-inset);
    top: 54px;
    height: 1px;
    background: var(--border2);
    z-index: 0;
}

.loop-node {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 6px;
}

.loop-num {
    font-family: var(--mono);
    font-size: 11px;
    line-height: 16px;
    letter-spacing: 0.06em;
    color: var(--text3);
    margin-bottom: 10px;
}
.loop-num--gate { color: var(--accent); font-weight: 600; }

.loop-mark {
    position: relative;
    z-index: 1;
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
}
.loop-mark::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 13px;
    height: 13px;
    margin: -6.5px 0 0 -6.5px;
    border: 1px solid var(--border2);
    background: var(--surface);
    border-radius: 50%;
}

.loop-mark--gate {
    background: var(--accent);
    border-radius: 15px;
    box-shadow: 0 0 0 6px var(--accent-soft), 0 0 0 7px rgba(14, 122, 114, .13);
}
.loop-mark--gate::after { content: none; }
.loop-mark--gate svg { display: block; position: relative; z-index: 1; }

.loop-name {
    margin-top: 6px;
    font-size: 15.5px;
    font-weight: 600;
    letter-spacing: -0.008em;
    color: var(--text);
    white-space: nowrap;
}
.loop-node--gate .loop-name { font-size: 17px; }

.loop-actor {
    margin-top: 5px;
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: 0.02em;
    color: var(--text3);
    white-space: nowrap;
}
.loop-node--gate .loop-actor {
    color: var(--accent);
    font-weight: 600;
}

.loop-caption {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 16px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text2);
    text-wrap: pretty;
}

/* the return path: down from Collect, back along, up into Report */
.loop-return {
    position: relative;
    margin: 16px var(--loop-inset) 0;
    height: 116px;
    border: 1px solid var(--border2);
    border-top: 0;
    border-radius: 0 0 14px 14px;
    font: inherit;
}
.loop-return span {
    position: absolute;
    left: 22px;
    bottom: -9px;
    background: var(--bg);
    padding: 0 12px;
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: 0.02em;
    color: var(--text3);
    white-space: nowrap;
}

/* ---------- who does what ---------- */

.table-wrap { overflow-x: auto; }

.actors {
    width: 100%;
    border-collapse: collapse;
    min-width: 340px;
}
.actors th, .actors td {
    padding: 15px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}
.actors thead th {
    font-family: var(--mono);
    font-size: 11.5px;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text3);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border2);
    text-align: center;
    width: 15%;
}
.actors thead th.actors-row-head { text-align: left; width: 55%; }
.actors tbody th {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.008em;
}
.actors td { text-align: center; }
.actors tbody tr:last-child th,
.actors tbody tr:last-child td { border-bottom: 0; }

.mk {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--text);
    line-height: 1;
}
.mk--off { color: var(--text3); }
.mk--on { color: var(--accent); font-size: 16px; }

.row-gate th, .row-gate td { background: var(--accent-soft); }
.row-gate th { color: var(--accent); }
.row-gate th:first-child { border-radius: 8px 0 0 8px; }
.row-gate td:last-child { border-radius: 0 8px 8px 0; }

.actors .col-you { border-left: 1px solid var(--border); }
.actors thead th.col-you { border-left: 1px solid var(--border); }

/* ---------- how it works 01–04 ---------- */

.how {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: 64px;
    row-gap: 46px;
    align-items: start;
}
.how-step--1 { grid-column: 1; grid-row: 1; }
.how-step--2 { grid-column: 1; grid-row: 2; }
.how-step--3 { grid-column: 1; grid-row: 3; }
.how-step--4 { grid-column: 1; grid-row: 4; }
.shot        { grid-column: 2; grid-row: 2 / span 3; align-self: start; }

.how-num {
    display: block;
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.06em;
    color: var(--text3);
    margin-bottom: 10px;
}
.how-step h3 {
    font-size: 19px;
    line-height: 1.3;
    letter-spacing: -0.014em;
    font-weight: 700;
    margin: 0 0 10px;
}
.how-step p {
    margin: 0;
    font-size: 15.5px;
    line-height: 1.62;
    color: var(--text2);
    max-width: 46ch;
}

.shot { margin: 0; }
/* the source image is the full two-pane screen; the frame crops to the decision pane
   (source x 1028..2420, y 0..1330 of a 2420x1912 png) so it stays legible at page scale */
.shot-frame {
    overflow: hidden;
    border: 1px solid var(--border2);
    border-radius: 12px;
    box-shadow: var(--shadow);
    background: var(--surface);
    line-height: 0;
}
.shot-frame img {
    display: block;
    width: 100%;
    height: auto;
}
.shot figcaption {
    margin-top: 12px;
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: 0.02em;
    color: var(--text3);
}

/* ---------- pillars band ---------- */

.pillars {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    border-top: 1px solid var(--border2);
}
.pillar {
    padding: 34px 32px 6px 0;
    border-right: 1px solid var(--border);
}
.pillar + .pillar { padding-left: 32px; }
.pillar:last-child { border-right: 0; padding-right: 0; }
.pillar h3 {
    font-size: 18px;
    line-height: 1.32;
    letter-spacing: -0.014em;
    font-weight: 700;
    margin: 0 0 12px;
    min-height: 2.64em;
}
.pillar p {
    margin: 0;
    font-size: 15.5px;
    line-height: 1.65;
    color: var(--text2);
}

.chip {
    display: inline-block;
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 1.5;
    padding: 1px 7px;
    border-radius: 5px;
    white-space: nowrap;
}
.chip--green { background: var(--green-soft); color: var(--green-ink); }
.chip--amber { background: var(--amber-soft); color: var(--amber-ink); }

/* ---------- closing ---------- */

.section--close h2 { max-width: 26ch; margin-bottom: 20px; }
.lede--close { font-size: 18px; max-width: 62ch; }

/* ---------- footer ---------- */

.site-foot {
    border-top: 1px solid var(--border);
    padding: 32px 0 52px;
}
.site-foot .wrap {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 14px;
    color: var(--text3);
    max-width: var(--maxw-wide);
}
.site-foot a { color: var(--text2); }
.site-foot .sep { color: var(--border2); }
.site-foot .eu { margin-left: auto; }

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
    .hero h1 { font-size: 52px; }
    .loop-name { font-size: 14.5px; }
    .loop-node--gate .loop-name { font-size: 15.5px; }
    .loop-actor { font-size: 11px; }
    .loop-num { font-size: 10.5px; }
}

@media (max-width: 900px) {
    .how {
        grid-template-columns: 1fr;
        row-gap: 40px;
    }
    .how-step--1, .how-step--2, .how-step--3, .how-step--4, .shot {
        grid-column: auto;
        grid-row: auto;
    }
    .how-step p { max-width: 62ch; }
    .pillars { grid-template-columns: 1fr; border-top: 0; }
    .pillar {
        border-right: 0;
        border-top: 1px solid var(--border);
        padding: 26px 0 22px;
    }
    .pillar + .pillar { padding-left: 0; }
    .pillar h3 { min-height: 0; }
    .pillar p { max-width: 66ch; }
}

/* the loop turns vertical */
@media (max-width: 820px) {
    .loop-track {
        grid-template-columns: 1fr;
        gap: 26px;
    }
    .loop-track::before {
        left: 27px;
        right: auto;
        top: 28px;
        bottom: 28px;
        width: 1px;
        height: auto;
    }
    .loop-node {
        display: grid;
        grid-template-columns: 56px minmax(0, 1fr);
        grid-template-areas:
            "mark num"
            "mark name"
            "mark actor"
            ".    cap";
        column-gap: 18px;
        align-items: start;
        text-align: left;
        padding: 0;
    }
    .loop-mark { grid-area: mark; align-self: start; }
    .loop-num { grid-area: num; margin-bottom: 2px; }
    .loop-name { grid-area: name; margin-top: 0; font-size: 17px; }
    .loop-actor { grid-area: actor; margin-top: 3px; }
    .loop-node--gate .loop-name { font-size: 18px; }
    .loop-caption {
        grid-area: cap;
        position: static;
        margin: 8px 0 0;
        max-width: 42ch;
    }
    .loop-return {
        margin: 26px 0 0 27px;
        height: auto;
        border: 0;
        border-left: 1px solid var(--border2);
        border-radius: 0;
        padding: 4px 0 4px 27px;
    }
    .loop-return span {
        position: static;
        display: inline-block;
        padding: 0;
        background: none;
        white-space: normal;
    }
}

@media (max-width: 700px) {
    .actors thead th { width: 16%; }
    .actors thead th.actors-row-head { width: 52%; }
    .actors th, .actors td { padding: 14px 8px; }
    .actors tbody th { font-size: 15px; }
}

@media (max-width: 620px) {
    :root { --gut: 20px; }
    body { font-size: 16px; }

    .site-head .wrap { height: 68px; }
    .site-head nav { gap: 18px; font-size: 14px; }
    /* the hero CTA and the footer both carry the contact link on small screens */
    .site-head nav a[href^="mailto:"] { display: none; }

    .hero { padding: 56px 0 60px; }
    .hero-kicker { margin-bottom: 24px; font-size: 11px; letter-spacing: 0.1em; }
    .hero h1 { font-size: 38px; letter-spacing: -0.024em; max-width: none; }
    .lede { font-size: 17.5px; }

    .section { padding: 56px 0; }
    .section h2 { font-size: 24px; margin-bottom: 32px; }
    .section--loop h2 { margin-bottom: 40px; }

    .btn { width: 100%; justify-content: center; }
    .quiet { width: 100%; }

    .loop-mark { width: 48px; height: 48px; }
    .loop-mark--gate { border-radius: 13px; box-shadow: 0 0 0 5px var(--accent-soft), 0 0 0 6px rgba(14, 122, 114, .13); }
    .loop-node { grid-template-columns: 48px minmax(0, 1fr); column-gap: 15px; }
    .loop-track::before { left: 23px; top: 24px; bottom: 24px; }
    .loop-name { font-size: 16.5px; }
    .loop-node--gate .loop-name { font-size: 17px; }
    .loop-return { margin-left: 23px; padding-left: 22px; }

    .how-step h3 { font-size: 18px; }
    .note { margin-top: 28px; }

    .site-foot { padding: 26px 0 40px; }
    .site-foot .eu { margin-left: 0; width: 100%; }
}

@media (max-width: 420px) {
    .actors tbody th { font-size: 14.5px; }
    .actors thead th { font-size: 10.5px; letter-spacing: 0.07em; }
    .actors th, .actors td { padding: 13px 6px; }
}

/* ── hero screenshot ─────────────────────────────────────────────────────
   Full workspace under the fold-line: the queue on the left, one decision
   open on the right. Cropped so it ends just below the lifecycle strip
   rather than in the empty tail of the detail pane. */
.hero-shot { margin: 64px 0 0; }
.hero-frame {
    overflow: hidden;
    aspect-ratio: 1440 / 745;
    border: 1px solid var(--border2);
    border-radius: 14px;
    box-shadow: var(--shadow-lg, 0 4px 12px rgba(30,27,21,.08), 0 20px 48px rgba(30,27,21,.10));
    background: var(--surface);
}
.hero-frame img { display: block; width: 100%; height: auto; }
.hero-shot figcaption {
    margin-top: 12px;
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: 0.02em;
    color: var(--text3);
    text-align: center;
}

/* ── the weekly email ────────────────────────────────────────────────── */
.email-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
    gap: 56px;
    align-items: center;
    margin-top: 40px;
}
.email-copy h2 { margin: 0 0 20px; }
.email-copy p { margin: 0 0 16px; max-width: 46ch; }
.email-copy p:last-child { margin-bottom: 0; }
.shot--email { margin: 0; }

@media (max-width: 900px) {
    .email-grid { grid-template-columns: 1fr; gap: 32px; }
    .hero-frame { aspect-ratio: 1008 / 1180; }
    .hero-frame img { width: 143%; max-width: none; margin-left: -3%; }
}
@media (max-width: 620px) {
    .hero-shot { margin-top: 44px; }
    .hero-frame { aspect-ratio: 760 / 1080; }
    .hero-frame img { width: 190%; margin-left: -4%; }
}
