/* ------------------------------------------------------------------
   Tokens: CAD model space. Colours are layers, and each one means something.
   ------------------------------------------------------------------ */
:root {
    --space: #000000;        /* model space, matches the 3D clear colour */
    --space-2: #13161b;      /* raised panels */
    --line: #e8ecf2;         /* walls, primary text */
    --line-2: #9aa3af;       /* secondary text */
    --line-3: #5b6470;       /* tertiary, annotations */
    --rule: rgba(232, 236, 242, 0.1);
    --rule-2: rgba(232, 236, 242, 0.18);
    --dim: #5cc8ff;          /* dimensions and measurements */
    --flag: #ffb547;         /* flagged */
    --graph: #8b7cff;        /* graph and selection */

    --sans: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

    --t-xs: 0.75rem;
    --t-sm: 0.875rem;
    --t-base: 1.0625rem;
    --t-lg: 1.25rem;
    --t-xl: clamp(1.4rem, 2vw, 1.75rem);
    --t-2xl: clamp(2rem, 3.6vw, 3rem);
    --t-3xl: clamp(2.8rem, 6.4vw, 6rem);

    --wrap: 1240px;
    --gutter: clamp(20px, 4vw, 56px);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--space); -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
body {
    margin: 0;
    background: var(--space);
    color: var(--line);
    font-family: var(--sans);
    font-size: var(--t-base);
    font-variation-settings: "wdth" 100;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}
h1, h2, h3, p, ul, ol, dl, dd, dt, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img, video, svg, canvas { display: block; max-width: 100%; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
code { font-family: var(--mono); font-size: 0.88em; }
::selection { background: var(--graph); color: #fff; }
:focus-visible { outline: 2px solid var(--dim); outline-offset: 3px; border-radius: 4px; }

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed; top: 10px; left: 10px; z-index: 200;
    padding: 10px 14px; background: var(--line); color: var(--space); font-weight: 600; border-radius: 6px;
    transform: translateY(-200%); transition: transform 0.3s var(--ease);
}
.skip-link:focus { transform: none; }

.wrap {
    width: 100%;
    max-width: calc(var(--wrap) + var(--gutter) * 2);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

/* ------------------------------------------------------------------
   Buttons and links
   ------------------------------------------------------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 600;
    font-variation-settings: "wdth" 108;
    letter-spacing: -0.005em;
    white-space: nowrap;
    transition: background-color 0.25s, border-color 0.25s, color 0.25s, box-shadow 0.3s;
}
.btn--solid { background: var(--line); color: var(--space); }
.btn--solid:hover { background: #fff; box-shadow: 0 0 0 4px rgba(92, 200, 255, 0.18); }
.btn--line { border-color: var(--rule-2); background: rgba(13, 15, 18, 0.6); }
.btn--line:hover { border-color: var(--dim); color: #fff; }
.btn--sm { padding: 8px 14px; font-size: var(--t-sm); }

.text-link {
    display: inline-block;
    color: var(--dim);
    border-bottom: 1px solid rgba(92, 200, 255, 0.35);
    transition: border-color 0.2s, color 0.2s;
}
.text-link:hover { color: #fff; border-color: #fff; }

.verdict {
    font-family: var(--mono);
    font-size: 0.8em;
    padding: 1px 7px;
    border-radius: 4px;
    white-space: nowrap;
}
.verdict--review { color: var(--flag); background: rgba(255, 181, 71, 0.1); border: 1px solid rgba(255, 181, 71, 0.35); }

/* ------------------------------------------------------------------
   Top bar
   ------------------------------------------------------------------ */
.bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 24px;
    height: 60px;
    padding: 0 var(--gutter);
    border-bottom: 1px solid var(--rule);
    background: rgba(13, 15, 18, 0.62);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
}
.bar-mark {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-variation-settings: "wdth" 112;
    letter-spacing: -0.01em;
}
.bar-mark svg { width: 18px; height: 18px; fill: none; stroke: var(--dim); stroke-width: 1.6; }
.bar nav { margin-left: auto; }
.bar-links { display: flex; gap: 2px; }
.bar-links a {
    display: block;
    padding: 6px 10px;
    border-radius: 6px;
    color: var(--line-2);
    font-size: var(--t-sm);
    transition: color 0.2s, background-color 0.2s;
}
.bar-links a:hover { color: var(--line); background: rgba(255, 255, 255, 0.05); }
.bar-links a[aria-current="page"] { color: var(--line); }
.bar-menu {
    display: none;
    padding: 7px 12px;
    border: 1px solid var(--rule-2);
    border-radius: 8px;
    background: transparent;
    font-size: var(--t-sm);
}
@media (max-width: 1080px) {
    .bar-menu { display: block; margin-left: auto; }
    .bar nav {
        position: absolute;
        top: 60px; left: 0; right: 0;
        margin: 0;
        padding: 8px var(--gutter) 16px;
        border-bottom: 1px solid var(--rule);
        /* Solid: a backdrop blur nested inside the bar's own blur doesn't render */
        background: var(--space);
        display: none;
    }
    .bar.is-open nav { display: block; }
    .bar-links { flex-direction: column; }
    .bar-links a { padding: 12px 0; font-size: var(--t-base); border-radius: 0; border-bottom: 1px solid var(--rule); }
    .bar-links a:hover { background: none; }
}
@media (max-width: 420px) {
    .bar > .btn { display: none; }
}

/* ------------------------------------------------------------------
   Shared bits
   ------------------------------------------------------------------ */
.tools { color: var(--line-3); font-size: var(--t-sm); }

.footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px 24px;
    margin-top: 120px;
    padding-top: 24px;
    padding-bottom: 8px;
    border-top: 1px solid var(--rule);
    color: var(--line-3);
    font-size: var(--t-sm);
}
.footer-tagline { color: var(--line-2); }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-links a { color: var(--line-2); transition: color 0.2s; }
.footer-links a:hover { color: var(--dim); }
.footer small { font-family: var(--mono); font-size: var(--t-xs); }
