/* AllTech · Hyperion
   Flat colour, one accent, left-aligned, 4px spacing grid.
   Every margin, padding, gap and line-height below is a multiple of 4px. */

:root {
    --paper: #f6f5f1;
    --ink: #18181a;
    --ink-2: #55555b;
    --rule: #d9d7cf;
    --accent: #b8500f;        /* Hyperion orange, darkened to pass AA with white text */
    --accent-dark: #96400a;
    --night: #1d1d1f;
    --night-ink: #f2f1ed;
    --night-ink-2: #b4b2ab;
    --night-rule: #3a3a3d;
    --spec-line: #ea7a2e;

    --sans: 'IBM Plex Sans', 'Noto Sans SC', -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --serif: 'Source Serif 4', 'Noto Serif SC', Georgia, 'Songti SC', serif;

    --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px;
    --s8: 32px; --s10: 40px; --s12: 48px; --s16: 64px; --s20: 80px;
    --header: 64px;
}

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

html {
    scroll-padding-top: calc(var(--header) + var(--s6));
}

body {
    font-family: var(--sans);
    font-size: 16px;
    line-height: 24px;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
}

html[lang="zh-CN"] body { line-height: 28px; }

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; }

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

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

/* Type ------------------------------------------------------------------ */
h1, h2 {
    font-family: var(--serif);
    font-weight: 600;
    letter-spacing: -0.01em;
}

h1 {
    font-size: 44px;
    line-height: 52px;
    max-width: 22ch;
}

h2 {
    font-size: 28px;
    line-height: 36px;
}

h3 {
    font-size: 20px;
    line-height: 28px;
    font-weight: 600;
    margin: var(--s12) 0 var(--s4);
}

html[lang="zh-CN"] h1 { max-width: 20em; letter-spacing: 0; }

.lede {
    font-size: 20px;
    line-height: 32px;
    color: var(--ink-2);
    max-width: 36em;
    margin: var(--s6) 0 var(--s8);
}

.body-lg {
    font-size: 18px;
    line-height: 28px;
    max-width: 40em;
    margin-bottom: var(--s8);
}

.prose p {
    font-size: 18px;
    line-height: 28px;
    max-width: 40em;
}

.prose p + p { margin-top: var(--s4); }

.note {
    font-size: 14px;
    line-height: 20px;
    color: var(--ink-2);
    margin-top: var(--s6);
}

.text-link {
    color: var(--accent);
    text-underline-offset: 4px;
    font-weight: 500;
}

.text-link:hover { color: var(--accent-dark); }

.button {
    display: inline-block;
    padding: var(--s3) var(--s5);
    background: var(--accent);
    color: #fff;
    font-size: 16px;
    line-height: 24px;
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--s1);
}

.button:hover { background: var(--accent-dark); }

/* Header ---------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
}

.nav {
    height: var(--header);
    display: flex;
    align-items: center;
    gap: var(--s8);
}

.logo {
    font-family: var(--serif);
    font-size: 20px;
    line-height: 28px;
    font-weight: 600;
    text-decoration: none;
    margin-right: auto;
}

.nav-links {
    display: flex;
    gap: var(--s6);
    list-style: none;
}

.nav-links a,
.mobile-nav a {
    text-decoration: none;
    color: var(--ink-2);
    font-size: 15px;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 8px;
    text-decoration-thickness: 1px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--s4);
}

.lang-toggle,
.menu-button {
    font: inherit;
    font-size: 15px;
    color: var(--ink-2);
    background: none;
    border: 0;
    padding: var(--s2) 0;
    cursor: pointer;
}

.lang-toggle [data-lang].is-current {
    color: var(--ink);
    font-weight: 600;
}

.menu-button { display: none; }

.mobile-nav { display: none; }

/* Sections -------------------------------------------------------------- */
.section {
    padding: var(--s20) 0;
    border-top: 1px solid var(--rule);
}

.split {
    display: grid;
    grid-template-columns: 288px minmax(0, 1fr);
    gap: var(--s12);
    align-items: start;
}

/* Definition lists used as clean tables */
.specs > div,
.rows > div {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: var(--s6);
    padding: var(--s3) 0;
    border-top: 1px solid var(--rule);
}

.specs > div:last-child,
.rows > div:last-child {
    border-bottom: 1px solid var(--rule);
}

.specs dt { color: var(--ink-2); }

.specs dd { font-weight: 500; }

.rows > div { padding: var(--s4) 0; }

.rows dt { font-weight: 600; }

.rows dd { color: var(--ink-2); }

.rows-compact > div {
    grid-template-columns: 200px minmax(0, 1fr);
    padding: var(--s3) 0;
}

.role {
    display: block;
    font-weight: 400;
    color: var(--ink-2);
}

.table-scroll { overflow-x: auto; }

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

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

.table th {
    font-weight: 600;
    border-top: 1px solid var(--rule);
}

.table td:first-child { font-weight: 500; white-space: nowrap; }

.table td:nth-child(2) { color: var(--ink-2); }

/* Home hero ------------------------------------------------------------- */
.home-hero { padding: var(--s16) 0 var(--s20); }

.home-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: var(--s12);
    align-items: center;
}

.home-hero-photo img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: 60% 30%;
    border-radius: var(--s1);
}

/* Hyperion hero --------------------------------------------------------- */
.hy-hero {
    background: var(--night);
    color: var(--night-ink);
}

.hy-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--s12);
    align-items: stretch;
}

.hy-hero-text {
    padding: var(--s20) 0;
    align-self: center;
}

.hy-hero .lede { color: var(--night-ink-2); }

.hy-hero-photo img {
    width: 100%;
    height: 100%;
    max-height: 720px;
    object-fit: cover;
    object-position: 50% 55%;
}

/* Spectrum (the one interactive piece) ---------------------------------- */
.spectrum-figure {
    margin-top: var(--s12);
    padding: var(--s8);
    background: var(--night);
    color: var(--night-ink);
    border-radius: var(--s1);
}

.spectrum-controls {
    display: inline-flex;
    border: 1px solid var(--night-rule);
    border-radius: var(--s1);
    margin-bottom: var(--s6);
}

.seg {
    font: inherit;
    font-size: 15px;
    color: var(--night-ink-2);
    background: none;
    border: 0;
    padding: var(--s2) var(--s4);
    cursor: pointer;
}

.seg + .seg { border-left: 1px solid var(--night-rule); }

.seg[aria-pressed="true"] {
    background: var(--night-ink);
    color: var(--night);
    font-weight: 500;
}

.spectrum {
    display: block;
    width: 100%;
    height: 400px;
    overflow: visible;
}

.spectrum text {
    font-family: var(--sans);
    font-size: 13px;
    fill: var(--night-ink-2);
}

.spectrum .band-label {
    fill: var(--night-ink);
    font-weight: 500;
}

.spectrum .axis { stroke: var(--night-rule); }
.spectrum .band { fill: rgba(234, 122, 46, 0.14); }
.spectrum .band-edge { stroke: rgba(234, 122, 46, 0.5); stroke-dasharray: 2 4; }
.spectrum .raw { fill: none; stroke: var(--night-ink-2); stroke-width: 1; stroke-dasharray: 4 4; }
.spectrum .removed { fill: url(#hatch); }
.spectrum .kept-area { fill: rgba(234, 122, 46, 0.16); }
.spectrum .kept { fill: none; stroke: var(--spec-line); stroke-width: 2.5; stroke-linejoin: round; }
.spectrum .hatch-line { stroke: rgba(242, 241, 237, 0.28); stroke-width: 1; }

.spectrum-figure figcaption {
    margin-top: var(--s6);
    max-width: 48em;
}

.spectrum-figure .note {
    display: block;
    color: var(--night-ink-2);
    margin-top: var(--s3);
}

/* Filter comparison ----------------------------------------------------- */
.compare-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s6);
    margin-bottom: var(--s12);
}

.compare-pair img {
    width: 100%;
    border-radius: var(--s1);
}

.compare-pair figcaption {
    margin-top: var(--s3);
    color: var(--ink-2);
}

.compare-pair strong {
    display: block;
    color: var(--ink);
    font-weight: 600;
}

/* Departments + photo --------------------------------------------------- */
.dept-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: var(--s8);
    align-items: start;
}

.dept-photo img { border-radius: var(--s1); }

/* Body areas ------------------------------------------------------------ */
.areas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s8) var(--s12);
}

.areas > div {
    padding-top: var(--s3);
    border-top: 1px solid var(--rule);
}

.areas dt {
    font-weight: 600;
    margin-bottom: var(--s1);
}

.areas dd { color: var(--ink-2); }

/* Footer ---------------------------------------------------------------- */
.site-footer {
    border-top: 1px solid var(--rule);
    padding: var(--s8) 0 var(--s12);
    font-size: 14px;
    line-height: 20px;
    color: var(--ink-2);
}

.footer-grid {
    display: grid;
    grid-template-columns: 288px minmax(0, 1fr);
    gap: var(--s12);
}

/* Responsive ------------------------------------------------------------ */
@media (max-width: 960px) {
    .nav-links { display: none; }
    .menu-button { display: block; }

    body.menu-open .mobile-nav { display: block; }

    .mobile-nav {
        border-top: 1px solid var(--rule);
        padding: var(--s2) 0 var(--s4);
    }

    .mobile-nav ul {
        list-style: none;
        max-width: 1152px;
        margin: 0 auto;
        padding: 0 var(--s6);
    }

    .mobile-nav a {
        display: block;
        padding: var(--s3) 0;
        font-size: 16px;
        color: var(--ink);
    }

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

    .home-hero-grid,
    .hy-hero-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--s8);
    }

    .home-hero-photo img { aspect-ratio: 4 / 3; max-height: 480px; }

    .hy-hero-text { padding: var(--s12) 0 0; }

    .hy-hero-photo { margin: 0 calc(var(--s6) * -1); }
    .hy-hero-photo img { height: 440px; }

    .dept-grid { grid-template-columns: minmax(0, 1fr); }
    .dept-photo { max-width: 320px; }
}

@media (max-width: 640px) {
    .wrap { padding: 0 var(--s4); }
    .mobile-nav ul { padding: 0 var(--s4); }
    .hy-hero-photo { margin: 0 calc(var(--s4) * -1); }

    h1 { font-size: 32px; line-height: 40px; }
    h2 { font-size: 24px; line-height: 32px; }
    .lede { font-size: 18px; line-height: 28px; }

    .section { padding: var(--s16) 0; }
    .home-hero { padding: var(--s10) 0 var(--s16); }

    .specs > div,
    .rows > div,
    .rows-compact > div {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--s1);
    }

    .compare-pair,
    .areas { grid-template-columns: minmax(0, 1fr); }

    .spectrum-figure { padding: var(--s4); margin-left: calc(var(--s4) * -1); margin-right: calc(var(--s4) * -1); border-radius: 0; }
    .spectrum { height: 280px; }
    .spectrum text { font-size: 11px; }
}
