/*
 * HADAL's landing page (index.html). Load tokens.css first: it carries the fonts, the Bell plates, the one
 * accent and the arrival motion (docs/design/hadal-ui.md). Nothing here is a screenshot; the desk is drawn.
 */

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

.mono,
.tnum {
    font-family: var(--mono);
}

.tnum {
    font-variant-numeric: tabular-nums;
}

.nowrap {
    white-space: nowrap;
}

/* A figure or a label in the etched voice: small, mono, steel teal. */
.cap,
.kicker {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--brand);
    margin: 0;
}

/* ── Top bar ─────────────────────────────────────────────── */

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 22px;
    height: 58px;
    margin-bottom: clamp(40px, 8vw, 92px);
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
}

.brand:hover {
    text-decoration: none;
}

.brand img {
    border-radius: var(--r-sm);
}

.brand span {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.topbar .links {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto;
}

.topbar .links a {
    color: var(--muted);
    font-size: 14px;
}

.topbar .links a:hover {
    color: var(--text);
    text-decoration: none;
}

.git {
    width: 15px;
    height: 15px;
}

/* ── Controls ────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 20px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r);
    background: transparent;
    color: var(--text);
    font: 500 15px var(--sans);
    white-space: nowrap;
}

.btn:hover {
    text-decoration: none;
    border-color: var(--body);
    background: var(--card);
}

.btn-primary {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--on-accent);
}

.btn-primary:hover {
    background: var(--accent);
    color: var(--on-accent);
    filter: brightness(1.08);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

/* ── Hero ────────────────────────────────────────────────── */

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(44px, 6vw, 76px);
    align-items: start;
}

.hero h1 {
    margin: 18px 0 0;
    font-size: clamp(40px, 6.1vw, 68px);
    line-height: 0.94;
    letter-spacing: -0.045em;
    font-weight: 600;
}

.hero h1 .thin {
    font-weight: 400;
    color: var(--body);
}

.lead {
    margin-top: 26px;
    max-width: 46ch;
    font-size: 19px;
    line-height: 1.55;
    color: var(--body);
}

.facts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 34px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
}

.facts span {
    display: flex;
    align-items: center;
    gap: 14px;
    white-space: nowrap;
}

.facts span::before {
    content: "";
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--line-strong);
}

.facts span:first-child::before {
    content: none;
}

/* ── The desk, drawn ─────────────────────────────────────── */

.desk {
    margin: 0;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--card);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.desk-rail,
.desk-tray {
    display: flex;
    align-items: center;
    gap: 0;
    overflow: hidden;
    background: var(--bg-2);
}

.desk-rail {
    height: 30px;
    border-bottom: 1px solid var(--line);
}

.desk-tray {
    height: 40px;
    gap: 6px;
    padding: 0 10px;
    border-top: 1px solid var(--line);
}

.seg {
    display: flex;
    flex: none;
    align-items: center;
    gap: 7px;
    height: 100%;
    min-width: 0;
    padding: 0 10px;
    border-right: 1px solid var(--line);
    white-space: nowrap;
}

.seg.push {
    flex: none;
    margin-left: auto;
    border-right: 0;
    border-left: 1px solid var(--line);
}

.seg .lab {
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    font-style: normal;
}

.seg b {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font: 500 11px/1.2 var(--mono);
    color: var(--text);
    font-weight: 500;
}

/* The live segment is the one that gives up width, so env and ctx never clip. It owns the slack, so the rail
   never shows an empty slot before the people count. */
.seg.live {
    flex: 1 1 auto;
    border-right: 0;
}

.seg.live b {
    color: var(--accent);
}

.meter {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    font-style: normal;
}

.meter i {
    width: 4px;
    height: 10px;
    background: var(--line-strong);
}

.meter i:nth-child(-n + 6) {
    background: var(--accent);
}

.led {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--muted);
    font-style: normal;
}

.led.ok {
    background: var(--ok);
}

.led.busy {
    background: var(--accent);
}

.led.warn {
    background: var(--warn);
}

.desk-body {
    display: grid;
    grid-template-columns: 152px minmax(0, 1fr);
}

.desk-nav {
    padding: 10px 0 12px;
    border-right: 1px solid var(--line);
}

.desk-nav .cap {
    padding: 0 12px 8px;
}

.en {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 26px;
    padding: 0 12px;
    font-size: 13px;
    color: var(--body);
    border-left: 2px solid transparent;
}

.en b {
    font-weight: 500;
    color: var(--text);
}

.en span {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
}

.en.on {
    background: var(--card-2);
    border-left-color: var(--accent);
}

.sub {
    margin: 2px 0 4px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.sr {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 23px;
    padding: 0 12px 0 22px;
    font-size: 12.5px;
    color: var(--muted);
}

.sr.on {
    color: var(--text);
    background: var(--sunken, var(--bg-2));
}

.sr span {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 10.5px;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
}

.desk-log {
    padding: 6px 0;
    min-width: 0;
}

.lrow {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    height: 27px;
    padding: 0 12px;
    border-bottom: 1px solid var(--line);
}

.lrow .kind {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--brand);
}

.lrow .arg {
    font-size: 12.5px;
    color: var(--body);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lrow .out {
    font-family: var(--mono);
    font-size: 11.5px;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

.lrow .out.ok {
    color: var(--ok);
}

.lrow .out.wait {
    color: var(--warn);
}

.turn {
    padding: 10px 14px 4px;
}

.turn .who {
    margin: 0 0 5px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand);
}

.turn p {
    font-size: 13px;
    line-height: 1.5;
    color: var(--body);
}

.turn p + p {
    margin-top: 6px;
}

.knob {
    display: flex;
    align-items: center;
    height: 24px;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--card);
    font-family: var(--mono);
    font-size: 11px;
    color: var(--body);
    white-space: nowrap;
}

.knob.model {
    border-color: var(--accent-line);
    color: var(--text);
}

.desk-tray .send {
    margin-left: auto;
    display: flex;
    align-items: center;
    height: 24px;
    padding: 0 12px;
    border-radius: var(--r-sm);
    background: var(--accent);
    color: var(--on-accent);
    font: 500 11px var(--mono);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.desk figcaption {
    padding: 10px 14px;
    border-top: 1px solid var(--line);
    background: var(--bg-2);
    font-size: 10.5px;
    letter-spacing: 0.06em;
    color: var(--muted);
}

/* ── Bands ───────────────────────────────────────────────── */

.band {
    margin-top: clamp(72px, 11vw, 132px);
    padding-top: clamp(40px, 6vw, 64px);
    border-top: 1px solid var(--line);
}

.band-head {
    max-width: 66ch;
}

.band-head h2 {
    margin: 14px 0 0;
    font-size: clamp(24px, 3.4vw, 34px);
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.body {
    margin-top: 18px;
    max-width: 62ch;
    font-size: 16.5px;
    line-height: 1.62;
    color: var(--body);
}

.body.small {
    margin-top: 14px;
    font-size: 15px;
    color: var(--muted);
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(28px, 4vw, 48px);
    margin-top: 36px;
    align-items: start;
}

/* A folder listing, drawn as an etched plate. */
.fold {
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--card);
    overflow: hidden;
}

.fold .cap {
    padding: 11px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--bg-2);
    color: var(--text);
    letter-spacing: 0.08em;
}

.frow {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: baseline;
    gap: 14px;
    padding: 9px 16px;
    border-bottom: 1px solid var(--line);
}

.frow:last-child {
    border-bottom: 0;
}

.frow .dir {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--text);
}

.frow.git .dir {
    color: var(--brand);
}

.frow .cm {
    font-size: 14px;
    color: var(--muted);
}

.notes {
    margin: 0;
    padding: 0 0 0 20px;
    list-style: none;
    border-left: 1px solid var(--line);
}

.notes li {
    position: relative;
    margin-bottom: 20px;
    font-size: 15.5px;
    line-height: 1.6;
    color: var(--body);
}

.notes li:last-child {
    margin-bottom: 0;
}

.notes li::before {
    content: "";
    position: absolute;
    top: 9px;
    left: -23px;
    width: 5px;
    height: 5px;
    background: var(--brand);
}

.notes b {
    color: var(--text);
    font-weight: 600;
}

/* A readout of figures, separated by hairlines rather than boxed in. */
.stat {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    margin-top: 40px;
    border-top: 1px solid var(--line);
}

.stat > div {
    padding: 22px 24px 22px 0;
    border-bottom: 1px solid var(--line);
}

.stat .fig {
    margin: 0;
    font-family: var(--mono);
    font-size: 21px;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.stat .cap {
    margin-top: 10px;
    font-family: var(--sans);
    font-size: 14.5px;
    line-height: 1.55;
    letter-spacing: 0;
    text-transform: none;
    color: var(--body);
}

/* A spec sheet, not a card grid. */
.spec {
    width: 100%;
    margin-top: 32px;
    border-collapse: collapse;
}

.spec th,
.spec td {
    padding: 15px 18px 15px 0;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.spec th {
    width: 128px;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--brand);
    padding-top: 17px;
}

.spec td {
    font-size: 15.5px;
    line-height: 1.6;
    color: var(--body);
}

.spec tr:first-child th,
.spec tr:first-child td {
    border-top: 1px solid var(--line);
}

.cmd {
    margin: 0;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--code-bg);
    overflow-x: auto;
}

.cmd code {
    display: block;
    padding: 0;
    border-radius: 0;
    background: none;
    font-size: 13.5px;
    line-height: 1.8;
    white-space: pre;
}

.keys {
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--card);
    overflow: hidden;
}

.keys .cap {
    padding: 11px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--bg-2);
}

.krow {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 9px 16px;
    border-bottom: 1px solid var(--line);
    font-size: 14.5px;
    color: var(--body);
}

.krow:last-child {
    border-bottom: 0;
}

.guides {
    margin-top: 46px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 12.5px;
    color: var(--muted);
}

.guides a {
    margin-left: 20px;
    color: var(--brand);
    text-decoration: underline;
    text-decoration-color: var(--accent-line);
    text-underline-offset: 3px;
}

.guides a:hover {
    color: var(--text);
}

/* ── Footer ──────────────────────────────────────────────── */

.footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-top: clamp(72px, 11vw, 132px);
    padding: 26px 0 40px;
    border-top: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
}

.footer .links {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-left: auto;
}

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

.footer a:hover {
    color: var(--text);
    text-decoration: none;
}

/* ── Wider screens ───────────────────────────────────────── */

@media (min-width: 620px) {
    .stat {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stat > div {
        padding-right: 28px;
    }

    .stat > div:nth-child(odd) {
        border-right: 1px solid var(--line);
    }

    .stat > div:nth-child(odd) {
        padding-left: 0;
    }

    .stat > div:nth-child(even) {
        padding-left: 28px;
    }
}

@media (min-width: 980px) {
    .hero {
        grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
        align-items: center;
    }

    .split {
        grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    }

    .stat {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .stat > div {
        border-bottom: 0;
        border-right: 1px solid var(--line);
        padding: 24px 24px 4px 0;
    }

    .stat > div:nth-child(even) {
        padding-left: 24px;
    }

    .stat > div:last-child {
        border-right: 0;
        padding-right: 0;
    }
}

@media (max-width: 619px) {
    .wrap {
        padding: 0 18px;
    }

    .topbar .links a:not(:last-child) {
        display: none;
    }

    .topbar .links {
        gap: 12px;
    }

    .desk-body {
        grid-template-columns: minmax(0, 1fr);
    }

    .desk-nav {
        display: none;
    }

    .desk-tray .knob:not(.model) {
        display: none;
    }

    .spec th {
        width: auto;
        padding-bottom: 2px;
    }

    .spec td {
        padding-top: 0;
    }
}
