/* Klade — kladeai.com styles.
   The site is set like an engagement letter: cover, contents, numbered
   sections in a left rail. One serif/sans pairing (system stacks, zero font
   requests), one accent, 4-pt spacing scale. */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.waitlist-form {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s3);
    margin-top: var(--s6);
    max-width: 34rem;
}

.waitlist-form input[type="email"] {
    flex: 1 1 16rem;
    padding: var(--s3) var(--s4);
    border: 1px solid var(--rule);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
}

.waitlist-form input[type="email"]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.waitlist-form .cta {
    border: 0;
    cursor: pointer;
    font: inherit;
}

.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.waitlist-status {
    margin-top: var(--s3);
    color: var(--ink-muted);
}

:root {
    /* Palette */
    --surface: #fdfdfc;
    --surface-raised: #f5f5f2;
    --ink: #17181a;
    --ink-muted: #565a60;
    --accent: #1e3a5f;
    --rule: #e3e2dd;
    --ink-inv-muted: #a9adb4;
    --rule-inv: #3a3d42;
    --waste: #b42318;

    /* Type */
    --serif: "Charter", "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    /* 4-pt spacing scale */
    --s1: 0.25rem;   /*  4px */
    --s2: 0.5rem;    /*  8px */
    --s3: 0.75rem;   /* 12px */
    --s4: 1rem;      /* 16px */
    --s6: 1.5rem;    /* 24px */
    --s8: 2rem;      /* 32px */
    --s12: 3rem;     /* 48px */
    --s16: 4rem;     /* 64px */
    --s20: 5rem;     /* 80px */
    --s24: 6rem;     /* 96px */
    --s32: 8rem;     /* 128px */

    --measure: 42rem;
    --page: 72rem;
    --rail: 9rem;
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    background: var(--surface);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 1.0625rem;
    line-height: 1.65;
    font-feature-settings: "kern";
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin: 0 0 var(--s4);
}

p {
    margin: 0 0 var(--s4);
    max-width: var(--measure);
}

a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

a:hover {
    text-decoration-thickness: 2px;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: var(--ink);
    color: var(--surface);
    padding: var(--s2) var(--s4);
}

.skip-link:focus {
    left: 0;
    z-index: 10;
}

.wrap {
    max-width: var(--page);
    margin: 0 auto;
    padding: 0 var(--s6);
}

/* Masthead */

.masthead {
    border-top: 3px solid var(--ink);
    border-bottom: 1px solid var(--rule);
}

.masthead .wrap {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--s6);
    flex-wrap: wrap;
    padding-top: var(--s6);
    padding-bottom: var(--s6);
}

.wordmark {
    font-family: var(--serif);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--ink);
    text-decoration: none;
}

.masthead nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: var(--s6);
    flex-wrap: wrap;
}

.masthead nav a {
    color: var(--ink-muted);
    text-decoration: none;
    font-size: 0.9375rem;
}

.masthead nav a:hover,
.masthead nav a[aria-current="page"] {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.masthead nav a.nav-cta {
    color: var(--accent);
    font-weight: 650;
}

/* Cover */

.cover {
    background: var(--ink);
    color: var(--surface);
    padding: var(--s20) 0;
}

.cover .wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--s12);
    align-items: center;
}

.cover h1 {
    font-family: var(--serif);
    font-size: clamp(2.375rem, 4.5vw, 3.875rem);
    line-height: 1.06;
    font-weight: 700;
    letter-spacing: -0.015em;
    max-width: 18ch;
}

.cover .sub {
    font-size: 1.1875rem;
    line-height: 1.6;
    color: var(--ink-inv-muted);
    max-width: 50ch;
    margin: var(--s6) 0 0;
}

.cover .cta {
    background: var(--surface);
    color: var(--ink);
}

.cover .cta:hover {
    background: #e8e8e4;
}

.cover .cta-secondary {
    color: var(--surface);
    border-color: var(--ink-inv-muted);
}

.cover .cta-secondary:hover {
    color: var(--ink-inv-muted);
}

/* Cover artifacts — the two deliverables as framed objects */

.cover-artifacts {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    gap: var(--s8) var(--s6);
    align-items: end;
}

.artifact {
    display: block;
    text-decoration: none;
    color: var(--surface);
}

.artifact-frame {
    display: block;
    background: var(--surface);
    color: var(--ink);
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px rgba(0, 0, 0, 0.45);
}

@media (prefers-reduced-motion: no-preference) {
    .artifact-frame {
        transition: transform 0.15s ease;
    }

    .artifact:hover .artifact-frame {
        transform: translateY(-2px);
    }
}

.artifact-plate {
    display: block;
    margin-top: var(--s3);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.artifact-plate strong {
    display: block;
    font-weight: 650;
    color: var(--surface);
}

.artifact-plate span {
    color: var(--ink-inv-muted);
}

.artifact:hover .artifact-plate strong {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* The memo cover, a letter page at reduced scale */

.memo-cover {
    position: relative;
    aspect-ratio: 17 / 22;
    padding: 9% 10%;
}

.memo-wordmark {
    display: inline-block;
    font-family: var(--serif);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-bottom: 2px solid var(--ink);
    padding-bottom: 0.25em;
}

.memo-block {
    display: block;
    margin-top: 34%;
}

.memo-title {
    display: block;
    font-family: var(--serif);
    font-size: clamp(0.875rem, 1.3vw, 1.125rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.1;
}

.memo-sub {
    display: block;
    font-family: var(--serif);
    font-size: 0.625rem;
    line-height: 1.45;
    margin-top: 0.75em;
}

.memo-notice {
    position: absolute;
    left: 10%;
    right: 10%;
    bottom: 7%;
    font-size: 0.5rem;
    font-style: italic;
    color: var(--ink-muted);
    line-height: 1.4;
}

/* The dashboard weekly-spend panel at reduced scale */

.panel-mini {
    padding: var(--s4) var(--s4) var(--s3);
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--s3);
    border-bottom: 1px solid var(--rule);
    padding-bottom: var(--s2);
}

.panel-title {
    font-size: 0.625rem;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.panel-meta {
    font-size: 0.5625rem;
    color: var(--ink-muted);
    white-space: nowrap;
}

.panel-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 84px;
    margin-top: var(--s4);
    border-bottom: 1px solid var(--ink);
    padding-bottom: 0;
}

.panel-bars i {
    position: relative;
    flex: 1;
    background: var(--accent);
    border-radius: 1px 1px 0 0;
    font-style: normal;
}

.panel-bars i.spike {
    background: var(--waste);
}

.panel-bars b {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 2px;
    font-size: 0.5625rem;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    color: var(--waste);
    white-space: nowrap;
}

.panel-note {
    display: block;
    margin-top: var(--s2);
    font-size: 0.5625rem;
    color: var(--ink-muted);
}

.panel-note::before {
    content: "";
    display: inline-block;
    width: 0.5em;
    height: 0.5em;
    background: var(--waste);
    margin-right: 0.5em;
}

.artifact-note {
    grid-column: 1 / -1;
    margin: 0;
    font-size: 0.8125rem;
    color: var(--ink-inv-muted);
    max-width: none;
}

.cta-row {
    margin-top: var(--s12);
    display: flex;
    align-items: center;
    gap: var(--s8);
    flex-wrap: wrap;
}

.cta {
    display: inline-block;
    background: var(--accent);
    color: var(--surface);
    text-decoration: none;
    font-weight: 650;
    font-size: 1rem;
    padding: var(--s3) var(--s8);
    border-radius: 2px;
}

.cta:hover {
    background: #162e4c;
    text-decoration: none;
}

.cta-secondary {
    color: var(--accent);
    text-decoration: none;
    font-weight: 650;
    font-size: 1rem;
    border-bottom: 1px solid var(--accent);
    padding-bottom: 1px;
}

.cta-secondary:hover {
    color: var(--ink);
    border-color: var(--ink);
    text-decoration: none;
}

.trust-line {
    margin-top: var(--s8);
    font-size: 0.875rem;
    color: var(--ink-inv-muted);
    max-width: 52em;
}

/* Contents */

.toc {
    padding: var(--s12) 0;
    border-bottom: 1px solid var(--rule);
}

.toc h2 {
    font-size: 0.8125rem;
    font-weight: 650;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin-bottom: var(--s6);
}

.toc ol {
    list-style: none;
    margin: 0;
    padding: 0;
    max-width: 44rem;
}

.toc li {
    display: flex;
    align-items: baseline;
    gap: var(--s3);
    padding: var(--s2) 0;
    font-size: 0.9844rem;
}

.toc .toc-num {
    font-family: var(--serif);
    font-variant-numeric: tabular-nums;
    color: var(--ink-muted);
    min-width: 1.75rem;
}

.toc a {
    color: var(--ink);
    text-decoration: none;
}

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

.toc .toc-leader {
    flex: 1;
    border-bottom: 1px dotted var(--ink-muted);
    opacity: 0.5;
    margin: 0 var(--s2) 0.3em;
}

.toc .toc-desc {
    color: var(--ink-muted);
    font-size: 0.875rem;
    white-space: nowrap;
}

/* Numbered sections with a left rail */

.sec {
    padding: var(--s20) 0;
    border-bottom: 1px solid var(--rule);
}

.sec:last-of-type {
    border-bottom: none;
}

.sec .wrap {
    display: grid;
    grid-template-columns: var(--rail) minmax(0, 1fr);
    gap: var(--s8) var(--s12);
    align-items: start;
}

.sec-label {
    position: sticky;
    top: var(--s6);
}

.sec-num {
    display: block;
    font-family: var(--serif);
    font-size: 2rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
    line-height: 1;
}

.sec-kicker {
    display: block;
    margin-top: var(--s2);
    font-size: 0.8125rem;
    font-weight: 650;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}

.sec-body h2 {
    font-family: var(--serif);
    font-size: clamp(1.625rem, 3vw, 2.125rem);
    font-weight: 700;
    max-width: 26ch;
    margin-bottom: var(--s6);
}

.note {
    font-size: 0.9375rem;
    color: var(--ink-muted);
    margin-top: var(--s8);
    margin-bottom: 0;
}

/* Stat row */

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s8);
    margin-top: var(--s8);
}

.stat {
    border-top: 2px solid var(--ink);
    padding-top: var(--s4);
}

.stat-value {
    font-family: var(--serif);
    font-size: 3rem;
    line-height: 1;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
    margin-bottom: var(--s3);
}

.stat-label {
    font-size: 0.9375rem;
    margin-bottom: var(--s3);
}

.stat-source {
    font-size: 0.8125rem;
    color: var(--ink-muted);
    margin-bottom: 0;
}

/* Engagement timeline */

.timeline {
    list-style: none;
    margin: var(--s8) 0 var(--s8);
    padding: 0;
}

.timeline li {
    display: grid;
    grid-template-columns: var(--rail) minmax(0, 1fr);
    gap: var(--s2) var(--s12);
    padding: var(--s6) 0;
    border-top: 1px solid var(--rule);
    position: relative;
}

.timeline li:first-child {
    border-top: 2px solid var(--ink);
}

.tl-when {
    grid-row: 1 / span 3;
    font-family: var(--serif);
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
    line-height: 1.4;
}

.timeline h3 {
    grid-column: 2;
    font-size: 1.0625rem;
    font-weight: 650;
    margin: 0;
    line-height: 1.4;
}

.timeline li > p:not(.tl-when) {
    grid-column: 2;
    font-size: 0.9844rem;
    color: var(--ink-muted);
    margin: 0;
    max-width: 38em;
}

.timeline .tl-deliverable {
    font-size: 0.875rem;
    color: var(--ink);
    border-left: 2px solid var(--accent);
    padding-left: var(--s3);
    margin-top: var(--s2);
}

/* The CFO moment */

.cfo-moment {
    font-family: var(--serif);
    font-size: 1.3125rem;
    line-height: 1.5;
    max-width: 34em;
    margin-bottom: var(--s8);
}

/* Pull quote band */

.pull {
    border-bottom: 1px solid var(--rule);
    padding: var(--s24) 0;
    background: var(--surface-raised);
}

.pull p {
    font-family: var(--serif);
    font-size: clamp(1.625rem, 3.6vw, 2.5rem);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    max-width: 24ch;
    margin: 0 0 0 calc(var(--rail) + var(--s12));
}

@media (max-width: 56rem) {
    .pull p {
        margin-left: 0;
    }
}

/* Tables */

.table-scroll {
    overflow-x: auto;
    margin-top: var(--s8);
}

table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.9375rem;
    line-height: 1.5;
}

caption {
    text-align: left;
    font-size: 0.8125rem;
    color: var(--ink-muted);
    padding-bottom: var(--s3);
}

th, td {
    text-align: left;
    vertical-align: top;
    padding: var(--s4) var(--s6) var(--s4) 0;
    border-bottom: 1px solid var(--rule);
}

thead th {
    font-size: 0.8125rem;
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-muted);
    border-bottom: 2px solid var(--ink);
}

th[scope="row"] {
    white-space: nowrap;
    font-weight: 650;
}

td.num, th.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ratio-cell {
    font-family: var(--serif);
    font-size: 1.125rem;
    font-weight: 700;
}

.formula {
    font-family: var(--mono);
    font-size: 0.875rem;
    background: var(--surface-raised);
    border: 1px solid var(--rule);
    border-left: 2px solid var(--accent);
    padding: var(--s4) var(--s6);
    margin: var(--s8) 0 0;
    overflow-x: auto;
}

/* Refusals */

.refusals {
    list-style: none;
    margin: var(--s8) 0 0;
    padding: 0;
    border-top: 2px solid var(--ink);
}

.refusals li {
    display: grid;
    grid-template-columns: 16rem 1fr;
    gap: var(--s6);
    padding: var(--s6) 0;
    border-bottom: 1px solid var(--rule);
}

.refusals strong {
    font-weight: 650;
}

.refusals p {
    color: var(--ink-muted);
    font-size: 0.9844rem;
    margin-bottom: 0;
    max-width: 38em;
}

/* Client access */

.portal-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: var(--s12);
    margin-top: var(--s8);
    align-items: start;
}

.portal-card {
    border: 1px solid var(--rule);
    border-top: 2px solid var(--ink);
    background: var(--surface-raised);
    padding: var(--s8);
}

.portal-card h3 {
    font-family: var(--serif);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--s4);
}

.portal-card p {
    font-size: 0.9844rem;
    color: var(--ink-muted);
}

.portal-card .cta {
    margin-top: var(--s2);
}

.portal-card .fineprint {
    margin-top: var(--s4);
    font-size: 0.8125rem;
    color: var(--ink-muted);
    margin-bottom: 0;
}

.portal-list {
    list-style: none;
    margin: var(--s2) 0 0;
    padding: 0;
}

.portal-list li {
    padding: var(--s3) 0;
    border-bottom: 1px solid var(--rule);
    font-size: 0.9844rem;
}

.portal-list li strong {
    font-weight: 650;
}

.portal-list li span {
    color: var(--ink-muted);
}

/* Methodology link */

.method-link {
    font-size: 1.0625rem;
    font-weight: 650;
}

/* Footer */

.site-footer {
    border-top: 3px solid var(--ink);
    padding: var(--s8) 0 var(--s12);
}

.site-footer p {
    font-size: 0.875rem;
    color: var(--ink-muted);
    margin: 0;
}

.site-footer p + p {
    margin-top: var(--s2);
}

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

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

/* Methodology page */

.doc {
    padding: var(--s16) 0;
}

.doc .wrap {
    max-width: 48rem;
}

.doc header.doc-head {
    margin-bottom: var(--s12);
}

.doc-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: var(--s6);
    margin: var(--s8) 0 0;
    border-top: 2px solid var(--ink);
    padding-top: var(--s4);
}

.doc-meta div {
    margin: 0;
}

.doc-meta dt {
    font-size: 0.75rem;
    font-weight: 650;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin-bottom: var(--s1);
}

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

.doc-toc {
    margin-top: var(--s8);
    border: 1px solid var(--rule);
    border-top: 2px solid var(--ink);
    background: var(--surface-raised);
    padding: var(--s6);
}

.doc .doc-toc h2 {
    font-family: var(--sans);
    font-size: 0.8125rem;
    font-weight: 650;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-muted);
    border-top: none;
    padding-top: 0;
    margin-bottom: var(--s3);
}

.doc-toc ol {
    margin: 0;
    padding: 0 0 0 1.25rem;
    columns: 2;
    column-gap: var(--s12);
    font-size: 0.9375rem;
}

.doc-toc li {
    margin-bottom: var(--s2);
}

.doc-toc a {
    text-decoration: none;
    color: var(--ink);
}

.doc-toc a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.doc h1 {
    font-family: var(--serif);
    font-size: clamp(2rem, 4.5vw, 2.75rem);
    max-width: none;
}

.doc .doc-note {
    border-left: 3px solid var(--accent);
    padding: var(--s3) var(--s6);
    margin: var(--s6) 0 0;
    max-width: var(--measure);
    color: var(--ink-muted);
}

.doc section {
    border-bottom: none;
    padding: var(--s8) 0;
}

.doc h2 {
    font-family: var(--serif);
    font-size: 1.5rem;
    border-top: 1px solid var(--ink);
    padding-top: var(--s6);
    max-width: none;
}

.doc h3 {
    font-size: 1.0625rem;
    font-weight: 650;
    margin: var(--s8) 0 var(--s3);
}

.doc ul, .doc ol {
    max-width: var(--measure);
    padding-left: 1.25rem;
    margin: 0 0 var(--s4);
}

.doc li {
    margin-bottom: var(--s3);
}

.doc li p {
    margin-bottom: var(--s2);
}

.limitations li {
    margin-bottom: var(--s4);
}

/* Responsive */

@media (max-width: 56rem) {
    .cover .wrap {
        grid-template-columns: 1fr;
        gap: var(--s12);
    }

    .sec .wrap {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--s6);
    }

    .sec-label {
        position: static;
        display: flex;
        align-items: baseline;
        gap: var(--s3);
    }

    .sec-num {
        font-size: 1.25rem;
    }

    .timeline li {
        grid-template-columns: 1fr;
    }

    .tl-when {
        grid-row: auto;
    }

    .timeline h3,
    .timeline li > p:not(.tl-when) {
        grid-column: 1;
    }

    .portal-grid {
        grid-template-columns: 1fr;
    }

    .refusals li {
        grid-template-columns: 1fr;
        gap: var(--s2);
    }

    .toc .toc-desc {
        display: none;
    }
}

@media (max-width: 40rem) {
    .sec {
        padding: var(--s16) 0;
    }

    .cover {
        padding: var(--s16) 0;
    }

    .cover-meta {
        grid-template-columns: 1fr;
        gap: var(--s6);
    }

    .stats {
        grid-template-columns: 1fr;
        gap: var(--s6);
    }

    .stat-value {
        font-size: 2.5rem;
    }

    .masthead .wrap {
        flex-direction: column;
        gap: var(--s3);
        align-items: flex-start;
    }

    .cover-artifacts {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .memo-cover {
        max-width: 17rem;
    }

    .pull {
        padding: var(--s16) 0;
    }

    .cfo-moment {
        font-size: 1.1875rem;
    }

    .doc-toc ol {
        columns: 1;
    }
}
