/* IndTrace project site. Palette: traveler-card stock, graphite ink, machine blue-grey, inspection-tag yellow. */
:root {
    --stock: #f6f7f4;
    --stock-2: #eceee8;
    --ink: #1e2428;
    --ink-2: #4a545a;
    --steel: #3d5663;
    --rule: #cfd4cc;
    --tag: #f0b92b;
    --tag-ink: #2a2206;
    --pass: #2f7d4f;
    --reject: #b8392b;
    --frame: #2b3236;
    --focus: #1f6fd1;

    --display: "Barlow Condensed", "Arial Narrow", sans-serif;
    --body: "Barlow", "Segoe UI", system-ui, sans-serif;
    --barcode: "Libre Barcode 128 Text", var(--body);

    --measure: 68ch;
    --gutter: clamp(16px, 4vw, 48px);
    --wide: 1180px;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --stock: #1b2023;
        --stock-2: #232a2e;
        --ink: #e9ece6;
        --ink-2: #aab3b0;
        --steel: #9db6c2;
        --rule: #3a4448;
        --tag: #f2c246;
        --pass: #5fbf86;
        --reject: #ef7a6a;
        --frame: #0f1315;
        --focus: #7fb2ff;
    }
}

:root[data-theme="dark"] {
    --stock: #1b2023;
    --stock-2: #232a2e;
    --ink: #e9ece6;
    --ink-2: #aab3b0;
    --steel: #9db6c2;
    --rule: #3a4448;
    --tag: #f2c246;
    --pass: #5fbf86;
    --reject: #ef7a6a;
    --frame: #0f1315;
    --focus: #7fb2ff;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--stock);
    color: var(--ink);
    font-family: var(--body);
    font-size: 1.125rem;
    line-height: 1.55;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration-color: var(--tag); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--gutter); top: 8px; background: var(--tag); color: var(--tag-ink); padding: 6px 10px; z-index: 10; }

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- header ---------- */
.site-head { border-bottom: 1px solid var(--rule); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { font-family: var(--display); font-weight: 700; font-size: 1.6rem; letter-spacing: 0.01em; text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { width: 22px; height: 22px; }
.head-nav { display: flex; gap: 20px; align-items: center; font-size: 1rem; flex-wrap: wrap; }
.head-nav a { text-decoration: none; color: var(--ink-2); }
.head-nav a:hover { color: var(--ink); }
.theme-toggle { background: none; border: 1px solid var(--rule); color: var(--ink); border-radius: 6px; padding: 4px 10px; font: inherit; font-size: 0.95rem; cursor: pointer; }

/* ---------- hero ---------- */
.hero { padding: clamp(40px, 7vw, 88px) 0 0; }
.hero h1 {
    font-family: var(--display);
    font-weight: 700;
    font-size: clamp(2.6rem, 7vw, 5.6rem);
    line-height: 0.98;
    letter-spacing: -0.01em;
    margin: 0 0 24px;
    max-width: 17ch;
}
.lead { font-size: clamp(1.15rem, 2vw, 1.35rem); color: var(--ink-2); max-width: 58ch; margin: 0 0 32px; }
.ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: clamp(40px, 6vw, 64px); }
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 20px; border-radius: 6px; font-weight: 600; text-decoration: none;
    border: 2px solid var(--ink); font-size: 1.05rem;
}
.btn-primary { background: var(--ink); color: var(--stock); }
.btn-primary:hover { background: var(--steel); border-color: var(--steel); }
.btn-plain:hover { background: var(--stock-2); }

/* The line: a part travels station to station; each arrival is checked against its routing. */
.line {
    border-top: 2px solid var(--ink);
    border-bottom: 2px solid var(--ink);
    background: var(--stock-2);
    padding: 28px 0 20px;
}
.line-caption { font-size: 0.98rem; color: var(--ink-2); margin: 16px 0 0; max-width: 70ch; }
.stations { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; position: relative; }
.stations::before { content: ""; position: absolute; left: 0; right: 0; top: 13px; height: 4px; background: repeating-linear-gradient(90deg, var(--ink) 0 18px, transparent 18px 26px); opacity: 0.35; }
.station { position: relative; padding: 0 10px; min-height: 172px; }
.station-id { font-family: var(--display); font-weight: 700; font-size: 1.5rem; display: block; }
.station-name { font-size: 0.95rem; color: var(--ink-2); display: block; }
.station-post { display: block; width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--ink); background: var(--stock); position: relative; margin: 4px 0 14px; z-index: 1; transition: background-color 300ms, border-color 300ms; }
.station.is-done .station-post { background: var(--pass); border-color: var(--pass); }
.station.is-reject .station-post { background: var(--reject); border-color: var(--reject); }
.verdict { font-size: 0.9rem; font-weight: 600; min-height: 2.6em; display: block; }
.verdict.ok { color: var(--pass); }
.verdict.bad { color: var(--reject); }

.part-tag {
    display: inline-block;
    background: var(--tag); color: var(--tag-ink);
    padding: 4px 10px 2px; border-radius: 3px 3px 3px 3px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
    position: relative; margin-top: 4px;
    transform-origin: left center;
}
.part-tag::before { content: ""; position: absolute; left: -7px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--stock-2); box-shadow: inset 0 0 0 2px var(--tag); }
.part-tag .bars { font-family: var(--barcode); font-size: 2.1rem; line-height: 1; display: block; }
.part-tag.moving { animation: tag-in 380ms ease-out; }
@keyframes tag-in { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }

@media (max-width: 760px) {
    .stations { grid-template-columns: 1fr; }
    .stations::before { left: 9px; right: auto; top: 0; bottom: 0; width: 4px; height: auto; background: repeating-linear-gradient(180deg, var(--ink) 0 18px, transparent 18px 26px); }
    .station { min-height: 0; display: grid; grid-template-columns: 34px 1fr; column-gap: 8px; padding: 0 0 18px; }
    .station-post { grid-row: 1 / span 4; margin: 6px 0 0; }
    .verdict { min-height: 0; }
}

/* ---------- sections ---------- */
section { padding: clamp(56px, 8vw, 104px) 0 0; }
h2 {
    font-family: var(--display); font-weight: 700;
    font-size: clamp(2rem, 4.4vw, 3.1rem); line-height: 1.02; margin: 0 0 18px; max-width: 22ch;
}
h3 { font-family: var(--display); font-weight: 600; font-size: 1.55rem; line-height: 1.1; margin: 0 0 8px; }
.prose { max-width: var(--measure); }
.prose p { margin: 0 0 16px; }

/* Tracks, doesn't control */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-top: 32px; border: 2px solid var(--ink); }
.split > div { padding: 28px; }
.split > div + div { border-left: 2px solid var(--ink); background: var(--stock-2); }
.split ul { margin: 12px 0 0; padding-left: 20px; }
.split li { margin-bottom: 8px; }
.split .note { margin: 16px 0 0; font-size: 1rem; color: var(--ink-2); }
@media (max-width: 760px) {
    .split { grid-template-columns: 1fr; }
    .split > div + div { border-left: 0; border-top: 2px solid var(--ink); }
}

/* Route card: what IndTrace does, as operations on a traveler. */
.route-card { margin-top: 32px; border: 2px solid var(--ink); background: var(--stock); }
.route-card-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 2px solid var(--ink); font-family: var(--display); font-size: 1.15rem; font-weight: 600; }
.route-card table { width: 100%; border-collapse: collapse; }
.route-card th, .route-card td { text-align: left; vertical-align: top; padding: 14px 20px; border-bottom: 1px solid var(--rule); }
.route-card tr:last-child td { border-bottom: 0; }
.route-card th { font-weight: 600; font-size: 0.95rem; color: var(--ink-2); background: var(--stock-2); }
.route-card td.op { font-family: var(--display); font-weight: 700; font-size: 1.35rem; width: 76px; }
.route-card td.what strong { display: block; font-size: 1.1rem; }
.route-card td.where { color: var(--ink-2); font-size: 1rem; white-space: nowrap; }
@media (max-width: 760px) {
    .route-card thead { display: none; }
    .route-card tr { display: grid; grid-template-columns: 56px 1fr; border-bottom: 1px solid var(--rule); }
    .route-card td { border-bottom: 0; padding: 12px 14px; }
    .route-card td.where { grid-column: 2; padding-top: 0; white-space: normal; }
}

/* Screens */
.shots { display: grid; grid-template-columns: repeat(6, 1fr); gap: 28px; margin-top: 32px; }
.shot { margin: 0; grid-column: span 3; }
.shot.wide { grid-column: span 6; }
.shot button { all: unset; cursor: zoom-in; display: block; width: 100%; }
.shot button:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.frame { background: var(--frame); border-radius: 8px; padding: 26px 8px 8px; position: relative; box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.6); }
.frame::before { content: ""; position: absolute; top: 10px; left: 12px; width: 8px; height: 8px; border-radius: 50%; background: #e2675a; box-shadow: 14px 0 0 #e6b84a, 28px 0 0 #6cbf6a; }
.frame img { border-radius: 3px; }
.shot figcaption { margin-top: 12px; font-size: 1rem; color: var(--ink-2); max-width: 60ch; }
.shot figcaption strong { color: var(--ink); }
@media (max-width: 760px) { .shot, .shot.wide { grid-column: span 6; } }

.lightbox { border: 0; padding: 0; background: transparent; max-width: min(96vw, 1600px); }
.lightbox::backdrop { background: rgba(10, 12, 14, 0.86); }
.lightbox img { max-height: 88vh; width: auto; margin: 0 auto; border-radius: 4px; }
.lightbox form { text-align: right; margin-bottom: 8px; }
.lightbox button { font: inherit; background: var(--stock); color: var(--ink); border: 0; border-radius: 6px; padding: 6px 14px; cursor: pointer; }

/* Videos (planned) */
.videos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 32px; }
.video { margin: 0; }
.video video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; border-radius: 8px; background: var(--frame); }
.video h3 { margin-top: 14px; font-size: 1.3rem; }
.video p { margin: 0; color: var(--ink-2); font-size: 1rem; }
@media (max-width: 900px) { .videos { grid-template-columns: 1fr; } }

/* Architecture */
.arch { margin-top: 32px; border: 2px solid var(--ink); background: var(--stock-2); padding: clamp(12px, 3vw, 28px); }
.arch { overflow-x: auto; }
.arch svg { width: 100%; min-width: 760px; height: auto; display: block; }
.arch svg .box { fill: var(--stock); stroke: var(--ink); stroke-width: 2; }
.arch svg .box-accent { fill: var(--tag); stroke: var(--ink); stroke-width: 2; }
.arch svg .seam { fill: none; stroke: var(--steel); stroke-width: 2; stroke-dasharray: 6 5; }
.arch svg .flow { stroke: var(--ink); stroke-width: 2.5; fill: none; marker-end: url(#arrow); }
.arch svg text { fill: var(--ink); font-family: var(--body); font-size: 15px; }
.arch svg .t-title { font-family: var(--display); font-weight: 700; font-size: 21px; }
.arch svg .t-dim { fill: var(--ink-2); font-size: 13.5px; }
.arch svg .on-tag { fill: var(--tag-ink); }
.arch svg #arrow path { fill: var(--ink); }
.arch-notes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 24px; }
.arch-notes p { margin: 4px 0 0; font-size: 1rem; color: var(--ink-2); }
@media (max-width: 760px) { .arch-notes { grid-template-columns: 1fr; } }

/* Quality */
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 32px; border-top: 2px solid var(--ink); }
.fact { padding: 18px 20px 0 0; }
.fact b { font-family: var(--display); font-size: 2.3rem; line-height: 1; display: block; }
.fact span { font-size: 1rem; color: var(--ink-2); display: block; margin-top: 6px; max-width: 26ch; }
@media (max-width: 760px) { .facts { grid-template-columns: 1fr 1fr; row-gap: 20px; } }

/* Get started */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 28px 0 0; max-width: 820px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 0 12px; margin-bottom: 22px; }
.steps li::before { content: counter(step); font-family: var(--display); font-weight: 700; font-size: 1.4rem; width: 36px; height: 36px; border: 2px solid var(--ink); border-radius: 50%; display: grid; place-items: center; }
.steps p { margin: 4px 0 8px; }
pre { margin: 0; background: var(--frame); color: #e8ece6; padding: 14px 16px; border-radius: 6px; overflow-x: auto; font-size: 0.92rem; line-height: 1.5; }
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }
p code, li code { background: var(--stock-2); padding: 1px 5px; border-radius: 3px; font-size: 0.92em; }
pre code, li pre code { background: none; padding: 0; border-radius: 0; font-size: inherit; color: inherit; }

/* Author */
.author { display: block; }
.author .links { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 8px; }

/* Footer */
.site-foot { margin-top: clamp(64px, 9vw, 112px); border-top: 2px solid var(--ink); padding: 28px 0 40px; font-size: 0.98rem; color: var(--ink-2); }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.site-foot p { margin: 0 0 6px; max-width: 64ch; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .part-tag.moving { animation: none; }
}
