/* DX Analytics site
   Ink background, paper text, and the red dot from the logo.
   No gradients, no shadows. Every colour comes from the tokens below. */

/* Fonts, self-hosted in assets/fonts (SIL Open Font License, see the OFL files there).
   Hanken Grotesk is one variable file per subset, covering weights 400 to 600. */
@font-face {
    font-family: "Hanken Grotesk";
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url("../assets/fonts/hanken-grotesk-var-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Hanken Grotesk";
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url("../assets/fonts/hanken-grotesk-var-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "IBM Plex Mono";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../assets/fonts/ibm-plex-mono-400-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "IBM Plex Mono";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../assets/fonts/ibm-plex-mono-400-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "IBM Plex Mono";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../assets/fonts/ibm-plex-mono-500-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "IBM Plex Mono";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../assets/fonts/ibm-plex-mono-500-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    color-scheme: dark;
    --paper: #121211;       /* page background */
    --surface: #1B1B19;     /* panels */
    --ink: #EDEBE4;         /* primary text */
    --ink-2: #BEBCB5;       /* secondary text, 10.6:1 on paper */
    --ink-3: #9A988F;       /* tertiary text,   6.4:1 on paper */
    --rule: #2E2D2A;
    --rule-strong: #6A6862;
    --red: #FF3B30;         /* marks and fills only */
    --red-text: #FF6B60;    /* red text, 6.7:1 on paper */

    --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

    --gutter: 16px;
    --radius: 3px;
}

@media (min-width: 720px) {
    :root { --gutter: 32px; }
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.55;
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, dl, dd, ol, ul, figure, blockquote { margin: 0; }
h1, h2, h3, p { text-wrap: pretty; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

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

.wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* ---------- Buttons & links ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 16px;
    text-decoration: none;
    transition: background-color .15s, color .15s;
}

.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: #fff; }

.btn-ghost { border: 1px solid var(--ink); color: var(--ink); min-height: 40px; padding: 0 14px; }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }

.link-arrow {
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid var(--rule-strong);
    padding-bottom: 2px;
}
.link-arrow::after { content: " \2193"; }
.link-arrow:hover { border-color: var(--ink); }

/* ---------- Header ---------- */

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 20px;
    padding-bottom: 20px;
}

.brand img { height: 40px; width: auto; }

nav { display: flex; align-items: center; gap: 32px; }

.nav-links { display: none; gap: 28px; }
.nav-links a { text-decoration: none; color: var(--ink-2); font-size: 16px; }
.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--ink); }

@media (min-width: 720px) {
    .nav-links { display: flex; }
}

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

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
    padding-top: 48px;
    padding-bottom: 88px;
}

@media (min-width: 980px) {
    .hero {
        grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
        align-items: center;
        gap: 64px;
        padding-top: 72px;
        padding-bottom: 96px;
    }
}

h1 {
    font-size: clamp(2.4rem, 5.2vw, 4rem);
    line-height: 1.02;
    font-weight: 600;
    letter-spacing: -0.03em;
    max-width: 13ch;
}

.lede {
    margin-top: 24px;
    font-size: 19px;
    color: var(--ink-2);
    max-width: 42ch;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 24px;
    margin-top: 32px;
}

/* ---------- Panel: a working example on sample data ---------- */

.panel {
    background: var(--surface);
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius);
    font-size: 14px;
    min-width: 0;
}

.panel-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--rule);
    font-family: var(--mono);
    font-size: 13px;
}
.panel-bar .file { display: inline-flex; align-items: center; gap: 8px; }
.panel-bar .meta { color: var(--ink-3); white-space: nowrap; }

.dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--red);
    flex: none;
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--rule);
    overflow-x: auto;
}
.tabs button {
    appearance: none;
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    padding: 12px 16px;
    font: inherit;
    font-weight: 500;
    color: var(--ink-3);
    cursor: pointer;
    white-space: nowrap;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] {
    color: var(--ink);
    border-bottom-color: var(--ink);
}

.tabpanel {
    padding: 20px 16px 16px;
    min-height: 360px;
}
@media (min-width: 720px) {
    .tabpanel { padding: 24px 24px 16px; }
}

.panel-note {
    margin-top: 10px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--red-text);
}

.panel-caption {
    padding: 10px 16px;
    border-top: 1px solid var(--rule);
    font-size: 12px;
    color: var(--ink-3);
}

/* Explore */
.scroll {
    max-height: 336px;
    overflow: auto;
    overscroll-behavior: contain;
}
.profile { width: 100%; border-collapse: collapse; }
.profile th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface);
    text-align: left;
    font-weight: 500;
    font-size: 12px;
    color: var(--ink-3);
    padding: 0 0 8px;
    border-bottom: 1px solid var(--rule);
}
.profile td {
    padding: 6px 0;
    border-bottom: 1px solid var(--rule);
    font-family: var(--mono);
    font-size: 13px;
}
.profile td:first-child {
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 12px;
}
.profile td:nth-child(2) { color: var(--ink-3); }
.profile td:nth-child(3) { white-space: nowrap; }
.profile .num { text-align: right; }
.profile td.num { color: var(--ink-3); }
.profile .bar {
    display: inline-block;
    vertical-align: middle;
    width: 64px;
    height: 6px;
    margin-right: 10px;
    background: linear-gradient(var(--ink), var(--ink)) no-repeat left / calc(var(--v) * 1%) 100%, var(--rule);
}
.profile .low .bar { background: linear-gradient(var(--red), var(--red)) no-repeat left / calc(var(--v) * 1%) 100%, var(--rule); }
.profile .low td:nth-child(3) { color: var(--red-text); }

@media (max-width: 420px) {
    .profile th:nth-child(2), .profile td:nth-child(2) { display: none; }
    .profile .bar { width: 40px; }
}

/* Prototype */
.proto-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--ink-3);
}
.proto-head select {
    font: inherit;
    font-family: var(--mono);
    font-size: 13px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius);
    padding: 5px 8px;
    max-width: 240px;
}

.chart { width: 100%; height: auto; display: block; }
.chart .grid-line { stroke: var(--rule); stroke-width: 1; }
.chart .series { fill: none; stroke: var(--ink); stroke-width: 1.25; }
.chart .flag-a { fill: none; stroke: var(--ink-3); stroke-width: 1; }
.chart .flag-b { fill: var(--red); }
.chart text { font-family: var(--mono); font-size: 10px; fill: var(--ink-3); }

.compare {
    display: grid;
    gap: 6px;
    margin-top: 12px;
    font-size: 13px;
}
.compare b { font-weight: 600; margin-left: 6px; }
.key { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; }
.key-a { border: 1px solid var(--ink-3); }
.key-b { background: var(--red); }

/* Share */
.share-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 10px 12px;
    font-family: var(--mono);
    font-size: 13px;
    color: var(--ink-3);
}
.share-link .copy { font-size: 12px; }

.access { margin-top: 16px; }
.access li {
    position: relative;
    padding: 10px 0 10px 28px;
    border-bottom: 1px solid var(--rule);
    color: var(--ink-2);
}
.access li::before {
    content: "";
    position: absolute;
    left: 2px; top: 50%;
    width: 12px; height: 12px;
    margin-top: -6px;
    border: 1px solid var(--ink-3);
    border-radius: 50%;
}
.access li.on { color: var(--ink); font-weight: 500; }
.access li.on::before { border-color: var(--ink); background: radial-gradient(circle, var(--red) 0 3px, transparent 3.5px); }

.toggles { margin-top: 16px; }
.toggle { display: flex; align-items: center; gap: 10px; padding: 6px 0; color: var(--ink-2); }
.switch {
    position: relative;
    flex: none;
    width: 30px; height: 16px;
    border-radius: 8px;
    background: var(--rule-strong);
}
.switch::after {
    content: "";
    position: absolute;
    top: 2px; left: 2px;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--paper);
}
.switch.on { background: var(--ink); }
.switch.on::after { left: auto; right: 2px; }

.share-note { margin-top: 14px; font-size: 13px; color: var(--ink-3); max-width: 48ch; }

/* ---------- Sections ---------- */

.section { padding: 64px 0; }
.section > .wrap {
    padding-top: 24px;
    background: linear-gradient(var(--rule-strong), var(--rule-strong)) no-repeat center top / calc(100% - 2 * var(--gutter)) 1px;
}

.grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
@media (min-width: 980px) {
    .grid { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 64px; }
}

.section-head {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.intro {
    font-size: clamp(1.25rem, 2.2vw, 1.6rem);
    line-height: 1.35;
    letter-spacing: -0.01em;
    max-width: 34ch;
}

.footnote {
    margin-top: 24px;
    color: var(--ink-3);
    font-size: 15px;
}

/* Toolbox rows */
.rows { margin-top: 40px; border-top: 1px solid var(--rule); }
.row {
    display: grid;
    gap: 4px;
    padding: 16px 0;
    border-bottom: 1px solid var(--rule);
}
@media (min-width: 640px) {
    .row { grid-template-columns: 160px 1fr; gap: 24px; }
}
.row dt { font-weight: 600; }
.row dd { color: var(--ink-2); }

/* ---------- Work: selected list on the landing page ---------- */

.work-intro { color: var(--ink-2); max-width: 52ch; margin-bottom: 8px; }

.work {
    display: grid;
    gap: 16px;
    padding: 24px 0;
    border-bottom: 1px solid var(--rule);
}
@media (min-width: 640px) {
    .work { grid-template-columns: 240px 1fr; gap: 32px; align-items: start; }
}
.work-thumb { display: block; }
.work img {
    aspect-ratio: 3 / 2;
    object-fit: cover;
    width: 100%;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    background: var(--surface);
}
.work-meta { font-size: 14px; color: var(--ink-3); }
.work h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; margin-top: 2px; }
.work h3 a { text-decoration: none; }
.work h3 a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }

/* Data / Built / Result rows, shared by the list and the case page */
.work-facts { margin-top: 12px; max-width: 56ch; }
.work-facts > div { display: grid; gap: 0 20px; padding: 3px 0; }
@media (min-width: 620px) { .work-facts > div { grid-template-columns: 64px minmax(0, 1fr); } }
.work-facts dt { font-family: var(--mono); font-size: 12px; color: var(--ink-3); padding-top: 5px; }
.work-facts dd { color: var(--ink-2); }
.todo { color: var(--red-text); font-family: var(--mono); font-size: 12px; }

.all-work { margin-top: 28px; }
.all-work a {
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid var(--rule-strong);
    padding-bottom: 3px;
}
.all-work a::after { content: "\2192"; }
.all-work a:hover { border-color: var(--ink); }
.all-work span { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }

/* ---------- Offers, quote, contact ---------- */

.offers { display: grid; gap: 0; }
@media (min-width: 720px) {
    .offers { grid-template-columns: repeat(3, 1fr); gap: 32px; }
}
.offers li {
    padding: 16px 0 20px;
    border-bottom: 1px solid var(--rule);
}
@media (min-width: 720px) {
    .offers li { border-bottom: 0; border-top: 1px solid var(--rule); }
}
.offers h3 { font-size: 18px; font-weight: 600; }
.offers p { margin-top: 8px; color: var(--ink-2); }

.quote p {
    font-size: clamp(1.25rem, 2.2vw, 1.6rem);
    line-height: 1.35;
    letter-spacing: -0.01em;
    max-width: 36ch;
}
.quote p::before { content: "\201C"; margin-left: -0.45em; }
.quote p::after { content: "\201D"; }
.quote footer { margin-top: 16px; color: var(--ink-3); font-size: 15px; }
.quote-note { display: block; font-size: 13px; }

/* the first quote leads; the others sit below it, side by side on wide screens */
.quotes { display: grid; gap: 40px 48px; }
.quotes .quote + .quote { padding-top: 24px; border-top: 1px solid var(--rule); }
.quotes .quote + .quote p { font-size: 1.05rem; line-height: 1.5; letter-spacing: 0; max-width: 46ch; color: var(--ink-2); }
@media (min-width: 900px) {
    .quotes { grid-template-columns: 1fr 1fr; }
    .quotes .quote:first-child { grid-column: 1 / -1; }
}

.partners {
    margin-top: 40px;
    padding-top: 16px;
    border-top: 1px solid var(--rule);
    font-weight: 500;
}
.partners .partners-label { color: var(--ink-3); font-weight: 400; margin-right: 12px; }

.contact h2 {
    font-size: clamp(2rem, 4.4vw, 3.25rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.05;
    max-width: 16ch;
}
.contact p { margin-top: 16px; color: var(--ink-2); max-width: 44ch; }
.contact .btn { margin-top: 28px; }
.contact .places { margin-top: 28px; font-size: 15px; color: var(--ink-3); }

/* ---------- Case-study page ---------- */

.case { padding-top: 48px; padding-bottom: 72px; }
.crumb { font-size: 14px; margin-bottom: 20px; }
.crumb a { color: var(--ink-3); text-decoration: none; }
.crumb a::before { content: "\2190  "; }
.crumb a:hover { color: var(--ink); }
.case h1 {
    margin-top: 6px;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.05;
    font-weight: 600;
    letter-spacing: -0.03em;
    max-width: 20ch;
}
.case-facts { margin-top: 28px; max-width: 62ch; }
.case-img {
    width: 100%;
    max-width: 760px;
    margin-top: 40px;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    aspect-ratio: 3 / 2;
    object-fit: cover;
}
.case-body { margin-top: 40px; max-width: 62ch; }
.case-body h2 { font-size: 20px; font-weight: 600; margin-top: 32px; letter-spacing: -0.01em; }
.case-body h2:first-child { margin-top: 0; }
.case-body p { margin-top: 12px; color: var(--ink-2); }

.case-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px 32px;
    margin-top: 56px;
    padding-top: 18px;
    border-top: 1px solid var(--rule);
    font-size: 15px;
}
.case-nav a { text-decoration: none; }
.case-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.case-next { text-align: right; max-width: 36ch; }
.case-next span {
    display: block;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--ink-3);
}

/* ---------- Gallery ---------- */

.gallery { padding-top: 48px; padding-bottom: 80px; }
.gallery h1 {
    font-size: clamp(2.2rem, 4.4vw, 3.4rem);
    max-width: none;
}
.gallery-intro { margin-top: 16px; color: var(--ink-2); max-width: 52ch; }

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 32px;
}
.filters[hidden] { display: none; }
.filters button {
    appearance: none;
    font: inherit;
    font-size: 14px;
    color: var(--ink-2);
    background: none;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 6px 12px;
    min-height: 36px;
    cursor: pointer;
}
.filters button span { font-family: var(--mono); font-size: 11px; color: var(--ink-3); margin-left: 4px; }
.filters button:hover { border-color: var(--ink-3); color: var(--ink); }
.filters button[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); }

.cards {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 40px 32px;
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--rule-strong);
}
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.card[hidden] { display: none; }
.card a { display: block; text-decoration: none; }
.card img {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    margin-bottom: 14px;
}
.card h2 {
    margin-top: 4px;
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
}
.card a:hover h2 { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.card-built { margin-top: 8px; font-size: 15px; color: var(--ink-2); }

.gallery-cta {
    margin-top: 64px;
    padding-top: 20px;
    border-top: 1px solid var(--rule);
    color: var(--ink-2);
}

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

.site-footer { padding: 0 0 40px; }
.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px 24px;
    padding-top: 20px;
    /* rule spans the content width, not the padded box */
    background: linear-gradient(var(--rule), var(--rule)) no-repeat center top / calc(100% - 2 * var(--gutter)) 1px;
    font-size: 14px;
    color: var(--ink-3);
}
.footer-inner ul { display: flex; gap: 20px; }
.footer-inner a { text-decoration: none; }
.footer-inner a:hover { color: var(--ink); text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; }
}
