/* ============================================================
   R1 HARDWARE ENGINE — instrument-panel design system
   graphite surfaces · signal amber · three verdict states

   Shared foundation for every page. Page-specific components
   (hero, fit matrix, ladder, terminals) stay inline on their page.
   ============================================================ */

:root {
    --void: #08090c;
    --panel: #0d0f14;
    --panel-2: #12151c;
    --rule: #1d212a;
    --rule-hi: #2e3542;

    --ink: #eceef2;
    --ink-2: #98a0af;
    --ink-3: #737b8a;

    --signal: #ffb020;
    --signal-2: #c98407;
    --signal-wash: rgba(255, 176, 32, .09);

    --allow: #4fd68a;
    --hold: #ffb020;
    --deny: #ff6a52;

    --sans: 'Archivo', system-ui, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, monospace;

    --pad: clamp(20px, 4vw, 32px);
    --shell: 1180px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--void);
    color: var(--ink-2);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* faint grain so the black reads as a surface, not a void */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 9;
    pointer-events: none;
    opacity: .035;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1,
h2,
h3,
h4 {
    color: var(--ink);
    font-weight: 800;
    letter-spacing: -.028em;
    line-height: 1.08;
    margin: 0;
}

p {
    margin: 0;
}

a {
    color: inherit;
}

strong {
    color: var(--ink);
    font-weight: 600;
}

ul,
ol {
    margin: 0;
}

code {
    font-family: var(--mono);
    font-size: .88em;
    background: var(--panel-2);
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 1px 6px;
    color: var(--ink);
}

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

.shell {
    max-width: var(--shell);
    margin: 0 auto;
    padding-left: var(--pad);
    padding-right: var(--pad);
}

.skip {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--signal);
    color: #12100a;
    padding: 10px 16px;
    font-weight: 700;
    z-index: 100;
}

.skip:focus {
    left: 12px;
    top: 12px;
}

/* the PCB canvas sits behind everything; opaque sections occlude it,
   which is what gives the pages their depth */
#board {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

main,
footer {
    position: relative;
    z-index: 1;
}

section.slab {
    padding: clamp(56px, 8vw, 96px) 0;
}

/* ---------- shared atoms ---------- */

.eyebrow {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.sect-tag {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 30px;
}

.sect-tag::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--rule);
}

.sect-tag .num {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .1em;
    color: var(--signal);
}

.sect-tag h2 {
    font-size: clamp(21px, 2.6vw, 27px);
}

.panel {
    background: var(--panel);
    border: 1px solid var(--rule);
    border-radius: 10px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 13px 22px;
    border-radius: 7px;
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.01em;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background .14s ease, border-color .14s ease, color .14s ease, transform .14s ease;
}

.btn-primary {
    background: var(--signal);
    color: #14110a;
}

.btn-primary:hover {
    background: #ffc14d;
    transform: translateY(-1px);
}

.btn-ghost {
    border-color: var(--rule-hi);
    color: var(--ink);
}

.btn-ghost:hover {
    border-color: var(--ink-3);
    background: rgba(255, 255, 255, .03);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .09em;
    text-transform: uppercase;
    padding: 5px 11px;
    border: 1px solid var(--rule);
    border-radius: 999px;
    color: var(--ink-3);
    white-space: nowrap;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex: none;
}

.v-allow {
    color: var(--allow);
}

.v-hold {
    color: var(--hold);
}

.v-deny {
    color: var(--deny);
}

/* ---------- masthead ---------- */

.masthead {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(8, 9, 12, .86);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--rule);
    transition: border-color .25s ease;
}

.masthead.stuck {
    border-bottom-color: var(--rule-hi);
}

.masthead .shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    height: 62px;
}

.wordmark {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--ink);
    font-weight: 700;
    letter-spacing: -.02em;
    font-size: 15px;
}

/* R1 mark — an R with a slab-footed 1 set beside it */
.wordmark .glyph {
    height: 25px;
    width: auto;
    flex: none;
    color: var(--signal);
}

.mast-nav {
    display: flex;
    align-items: center;
    gap: 26px;
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.mast-nav a {
    color: var(--ink-3);
    text-decoration: none;
    transition: color .14s ease;
}

.mast-nav a:hover {
    color: var(--ink);
}

.mast-nav a[aria-current="page"] {
    color: var(--ink);
}

.mast-nav .btn {
    padding: 8px 15px;
    font-size: 12px;
    font-family: var(--mono);
    letter-spacing: .05em;
}

@media (max-width:760px) {
    .mast-nav .hide-sm {
        display: none;
    }
}

/* ---------- footer ---------- */

footer {
    padding: 40px 0 52px;
}

footer .shell {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--ink-3);
}

footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
}

footer a {
    color: var(--ink-3);
    text-decoration: none;
}

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

/* ---------- reveal ---------- */

/* scoped to .js — without scripting the page must still render, not sit at
   opacity 0 waiting for an observer that will never run */
.js [data-reveal] {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .55s ease, transform .55s cubic-bezier(.2, .7, .3, 1);
}

.js [data-reveal].in {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion:reduce) {

    *,
    *::before,
    *::after {
        animation: none !important;
        transition-duration: .01ms !important;
    }

    html {
        scroll-behavior: auto;
    }

    .js [data-reveal] {
        opacity: 1;
        transform: none;
    }
}
