/* Shared page template for every page except the home reveal.
   One rhythm throughout: dark hero, paper body, dark closing band.
   Legal pages use the same parts with the glow and closing band omitted.
   Tokens come from ergodic-landing.css; chrome from ergodic-site.css. */

html,
body {
    overflow: auto;
}

:root {
    --paper: #f2f4f6;
    --paper-raised: #ffffff;
    --ink: #1c2b3a;
    --ink-soft: #4c5b6b;
    --hairline: #d9dee4;
}

body {
    background: var(--paper) !important;
    color: var(--ink) !important;
}

/* The footer sits inside this column, so min-height covers the whole page
   rather than reserving a viewport before the footer even begins. */
.pg-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.pg-page > .site-footer {
    margin-top: 0;
}

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

.pg-hero {
    padding: 84px 32px 80px;
    background: var(--bg-navy);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26'%3E%3Crect x='0' y='0' width='6' height='6' fill='%230099ff' fill-opacity='0.05'/%3E%3C/svg%3E");
}

/* Legal pages: same shape, no spotlight. */
.pg-hero--plain {
    padding: 60px 32px 56px;
    background-image: none;
}

/* Every page uses this one measure — hero, body and closing all align to it. */
.pg-hero-inner,
.pg-section,
.pg-product,
.pg-prose,
.pg-closing-inner {
    width: 100%;
    max-width: 940px;
    margin: 0 auto;
}

.pg-hero .eyebrow {
    margin-bottom: 0;
}

.pg-hero h1 {
    margin-top: 26px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(30px, 4.4vw, 46px);
    line-height: 1.18;
    color: var(--white);
    letter-spacing: -0.005em;
}

.pg-hero--plain h1 {
    font-weight: 600;
    font-size: clamp(26px, 3.4vw, 34px);
}

.pg-lede {
    margin: 24px 0 0;
    max-width: 580px;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 1.75;
    color: var(--text-muted);
}

.pg-hero--plain .pg-lede {
    max-width: 640px;
    font-size: 14.5px;
}

.pg-meta {
    margin-top: 14px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--text-faint);
}

/* ---------- Body ---------- */

.pg-body {
    flex: 1;
    padding-bottom: 84px;
}

.pg-section {
    padding: 76px 32px 0;
}

.pg-section-head {
    max-width: 620px;
    margin: 0 0 34px;
}

    .pg-section-head .eyebrow {
        margin-bottom: 0;
        color: var(--ink-soft);
    }

    .pg-section-head h2 {
        margin-top: 14px;
        font-family: 'Space Grotesk', sans-serif;
        font-weight: 600;
        font-size: clamp(23px, 2.8vw, 29px);
        color: var(--ink);
    }

/* ---------- Two directions ---------- */

.pg-directions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    background: var(--paper-raised);
    border: 1px solid var(--hairline);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 20px 50px -30px rgba(11,18,32,.25);
}

.pg-direction {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 38px 36px 34px;
    border-left: 1px solid var(--hairline);
}

    .pg-direction:first-child {
        border-left: none;
    }

.pg-direction-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--accent);
}

.pg-direction h3 {
    margin: 14px 0 0;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 20px;
    line-height: 1.35;
    color: var(--ink);
}

.pg-direction p {
    margin-top: 14px;
    font-size: 14.5px;
    line-height: 1.75;
    color: var(--ink-soft);
}

.pg-direction-live {
    margin-top: auto;
    padding-top: 24px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10.5px;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

    .pg-direction-live a {
        color: var(--accent);
        text-decoration: none;
        border-bottom: 1px solid transparent;
        transition: border-color .25s var(--ease);
    }

        .pg-direction-live a:hover {
            border-bottom-color: var(--accent);
        }

/* ---------- Principles ---------- */

.pg-principles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    background: var(--paper-raised);
    border: 1px solid var(--hairline);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 20px 50px -30px rgba(11,18,32,.25);
}

.pg-principle {
    padding: 32px 26px;
    border-left: 1px solid var(--hairline);
}

    .pg-principle:first-child {
        border-left: none;
    }

    .pg-principle h3 {
        margin: 0;
        font-family: 'IBM Plex Mono', monospace;
        font-size: 11.5px;
        font-weight: 600;
        letter-spacing: .1em;
        text-transform: uppercase;
        color: var(--accent);
    }

    .pg-principle p {
        margin-top: 13px;
        font-size: 14px;
        line-height: 1.7;
        color: var(--ink-soft);
    }

/* ---------- Product ---------- */

.pg-product {
    padding: 76px 32px 0;
}

.pg-product-card {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    background: var(--paper-raised);
    border: 1px solid var(--hairline);
    border-left: 2px solid var(--accent);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 20px 50px -30px rgba(11,18,32,.22);
}

.pg-product-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 38px 40px;
    min-width: 0;
}

.pg-product-eyebrow {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.pg-product-text h3 {
    margin: 12px 0 0;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 25px;
    color: var(--ink);
}

.pg-product-text p {
    margin: 14px 0 0;
    font-size: 14.5px;
    line-height: 1.75;
    color: var(--ink-soft);
}

.pg-product-thumb {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    min-width: 0;
    border-left: 1px solid var(--hairline);
    text-decoration: none;
    overflow: hidden;
}

    .pg-product-thumb img {
        display: block;
        width: 100%;
        height: 100%;
        min-height: 0;
        object-fit: cover;
        object-position: top left;
        filter: saturate(.85);
        transition: filter .25s var(--ease);
    }

    .pg-product-thumb:hover img {
        filter: saturate(1);
    }

.pg-product-caption {
    padding: 12px 14px;
    border-top: 1px solid var(--hairline);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10.5px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--accent);
    white-space: nowrap;
    transition: background .25s var(--ease);
}

.pg-product-thumb:hover .pg-product-caption {
    background: rgba(0,153,255,.07);
}

.pg-product-thumb:focus-visible {
    outline: 1.5px solid var(--accent);
    outline-offset: -2px;
}

/* ---------- Prose (about, legal) ---------- */

.pg-prose {
    padding: 72px 32px 0;
}

    .pg-prose > * {
        max-width: 680px;
    }

    .pg-prose h2 {
        margin-top: 44px;
        font-family: 'Space Grotesk', sans-serif;
        font-weight: 600;
        font-size: 19px;
        color: var(--ink);
    }

    .pg-prose p,
    .pg-prose li {
        margin-top: 15px;
        font-family: 'Inter', sans-serif;
        font-size: 15.5px;
        line-height: 1.8;
        color: var(--ink-soft);
    }

    .pg-prose ul {
        margin-top: 4px;
        padding-left: 20px;
    }

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

    .pg-prose a {
        color: var(--accent);
        text-decoration: none;
        border-bottom: 1px solid transparent;
        transition: border-color .25s var(--ease);
    }

        .pg-prose a:hover {
            border-bottom-color: var(--accent);
        }

.pg-note {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--hairline);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    letter-spacing: .04em;
    color: var(--ink-soft);
}

    .pg-note a {
        color: var(--accent);
        text-decoration: none;
        border-bottom: 1px solid transparent;
    }

        .pg-note a:hover {
            border-bottom-color: var(--accent);
        }

/* ---------- Closing band ---------- */

.pg-closing {
    margin-top: 0;
    padding: 76px 32px 72px;
    background: var(--bg-navy);
}

    .pg-closing .eyebrow {
        margin-bottom: 0;
    }

    .pg-closing h2 {
        margin: 16px 0 0;
        max-width: 640px;
        font-family: 'Space Grotesk', sans-serif;
        font-weight: 600;
        font-size: clamp(21px, 2.6vw, 27px);
        line-height: 1.4;
        color: var(--white);
    }

.pg-closing-contact {
    display: inline-block;
    margin-top: 28px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    letter-spacing: .06em;
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color .25s var(--ease);
}

    .pg-closing-contact:hover {
        border-bottom-color: var(--accent);
    }

/* ---------- Trailing space before the footer ---------- */

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

@media (max-width: 900px) {
    .pg-principles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pg-principle {
        border-left: none;
        border-top: 1px solid var(--hairline);
    }

        .pg-principle:nth-child(1),
        .pg-principle:nth-child(2) {
            border-top: none;
        }

    .pg-directions,
    .pg-product-card {
        grid-template-columns: 1fr;
    }

    .pg-direction {
        border-left: none;
        border-top: 1px solid var(--hairline);
    }

        .pg-direction:first-child {
            border-top: none;
        }

    .pg-product-thumb {
        border-left: none;
        border-top: 1px solid var(--hairline);
    }

        .pg-product-thumb img {
            height: auto;
            aspect-ratio: 16 / 9;
        }
}

@media (max-width: 640px) {
    .pg-hero {
        padding: 62px 20px 66px;
    }

    .pg-hero--plain {
        padding: 46px 20px 44px;
    }

    .pg-section,
    .pg-product {
        padding: 58px 20px 0;
    }

    .pg-prose {
        padding: 54px 20px 0;
    }

    .pg-principles {
        grid-template-columns: 1fr;
    }

    .pg-principle {
        border-left: none;
        border-top: 1px solid var(--hairline);
    }

        .pg-principle:first-child {
            border-top: none;
        }

    .pg-direction,
    .pg-product-text {
        padding: 30px 26px;
    }

    .pg-closing {
        margin-top: 78px;
        padding: 64px 20px 58px;
    }
}

/* ---------- Failure pages ---------- */

.pg-notice {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    max-width: 940px;
    margin: 0 auto;
    padding: 110px 32px 120px;
}

.notice-code {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: .22em;
    color: var(--accent);
}

.pg-notice h1 {
    margin-top: 18px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: clamp(26px, 3.6vw, 36px);
    color: var(--ink);
    letter-spacing: -0.01em;
}

.pg-notice p {
    margin-top: 16px;
    max-width: 54ch;
    font-family: 'Inter', sans-serif;
    font-size: 15.5px;
    line-height: 1.8;
    color: var(--ink-soft);
}

.notice-actions {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
    margin-top: 32px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: .09em;
    text-transform: uppercase;
}

    .notice-actions a {
        color: var(--accent);
        text-decoration: none;
        border-bottom: 1px solid transparent;
        transition: border-color .25s var(--ease);
    }

        .notice-actions a:hover {
            border-bottom-color: var(--accent);
        }

.notice-detail {
    margin-top: 36px;
    padding-top: 20px;
    border-top: 1px solid var(--hairline);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--ink-soft);
    word-break: break-all;
}

/* ---------- People ---------- */

/* Names and one line of provenance each. No photos: with a founder and two
   advisors, portraits would imply a larger team than exists. */
.pg-people {
    margin-top: 44px;
    padding-top: 30px;
    border-top: 1px solid var(--hairline);
}

.pg-people-group + .pg-people-group {
    margin-top: 56px;
}

.pg-people-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 18px;
}

.pg-person {
    display: flex;
    align-items: flex-start;
    gap: 18px;
}

    .pg-person + .pg-person {
        margin-top: 22px;
    }

.pg-person-mark {
    flex: 0 0 auto;
    margin-top: 8px;
    display: grid;
    grid-template-columns: repeat(5, 9px);
    grid-template-rows: repeat(5, 9px);
    gap: 3px;
}

    .pg-person-mark span {
        background: transparent;
    }

        .pg-person-mark span.on {
            background: var(--ink);
            opacity: .16;
            transition: opacity .45s var(--ease);
        }

        .pg-person-mark span.accent {
            background: var(--accent);
            opacity: 1;
        }

.pg-person:hover .pg-person-mark span.on:not(.accent) {
    opacity: .34;
}

.pg-person-body {
    min-width: 0;
}

.pg-person-name {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 17px;
    color: var(--ink);
}

.pg-person-line {
    margin-top: 5px;
    max-width: 62ch;
    font-family: 'Inter', sans-serif;
    font-size: 14.5px;
    line-height: 1.7;
    color: var(--ink-soft);
}

/* ---------- Legal documents ---------- */

/* These are long, conventional documents. They need a readable hierarchy that
   the shorter pages did not: sub-headings, a contents list, and the summary
   lines counsel uses to open each section. */

.pg-prose h3 {
    margin-top: 30px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 15.5px;
    color: var(--ink);
}

.pg-summary {
    margin-top: 12px !important;
    padding-left: 14px;
    border-left: 2px solid var(--accent);
    font-style: italic;
    color: var(--ink-soft);
}

.pg-toc {
    margin-top: 16px;
    padding-left: 20px;
}

    .pg-toc li {
        margin-top: 8px;
        font-family: 'Inter', sans-serif;
        font-size: 14.5px;
        line-height: 1.6;
        color: var(--ink-soft);
    }

    .pg-toc a {
        color: var(--ink-soft);
        text-decoration: none;
        border-bottom: 1px solid transparent;
        transition: color .25s var(--ease), border-color .25s var(--ease);
    }

        .pg-toc a:hover {
            color: var(--accent);
            border-bottom-color: var(--accent);
        }

/* Numbered section headings pin beneath the topbar as you read, so a reader
   deep in a long document can always see which section they are in. Scoped to
   headings with an id, which only the legal pages have. */
.pg-prose h2[id] {
    position: sticky;
    top: 64px;
    z-index: 10;
    margin-top: 52px;
    padding: 14px 0 12px;
    background: var(--paper);
    border-bottom: 1px solid var(--hairline);
    scroll-margin-top: 64px;
}

/* Sub-headings sit below a pinned section heading, not on top of it. */
.pg-prose h3 {
    position: relative;
    z-index: 1;
}

@media (max-width: 640px) {
    /* The topbar stacks to two rows on narrow screens, so the offset grows. */
    .pg-prose h2[id] {
        top: 96px;
        scroll-margin-top: 96px;
    }
}

.pg-address {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13.5px;
    line-height: 1.8;
}
