/* QuotaBar — an instrument panel, not a landing page.
   Palette is the app's own, so the site and the product read as one thing.
   Everything is monospaced on purpose: this is a measurement tool. */

:root {
    --bg: #14161c;
    --rail: #181b23;
    --card: #1b1e26;
    --line: #262a33;
    --fg: #eceef2;
    --sub: #8b8f99;
    /* The app's semantic tokens, kept in step with Palette.swift. */
    --accent: #3cc5ab;
    --track: #262931;
    --ok: #37b992;
    --amber: #e2a13d;
    --red: #e35d55;

    --mono: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono", Menlo,
            Consolas, monospace;

    --gutter: clamp(1.25rem, 5vw, 3rem);
    --measure: 1120px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--mono);
    font-size: 15px;
    line-height: 1.65;
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Atmosphere: a cool glow bleeding from the top edge, and a fine grain so the
   flat dark never looks like an empty div. */
body::before {
    content: "";
    position: fixed;
    inset: -20% -10% auto -10%;
    height: 70vh;
    background:
        radial-gradient(60% 60% at 72% 0%, rgba(53, 196, 168, 0.14), transparent 70%),
        radial-gradient(50% 50% at 20% 0%, rgba(59, 130, 246, 0.10), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.028;
    z-index: 1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

.shell {
    position: relative;
    z-index: 2;
    max-width: var(--measure);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--fg); }

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

/* Instrument labels: small, wide, and in the app's accent so each section
   announces itself the way a panel legend does. */
.label {
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 0.9rem;
}

/* ---------- header ---------- */

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.6rem 0;
    flex-wrap: wrap;
}

.wordmark {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--fg);
    text-decoration: none;
}

.wordmark img { width: 26px; height: 26px; border-radius: 6px; display: block; }

nav { display: flex; gap: 1.4rem; align-items: center; font-size: 13px; flex-wrap: wrap; }
nav a { color: var(--sub); text-decoration: none; }
nav a:hover { color: var(--fg); }

.nav-cta {
    color: var(--accent);
    border: 1px solid rgba(60, 197, 171, 0.45);
    border-radius: 8px;
    padding: 0.4rem 1rem;
    transition: background 0.18s ease, color 0.18s ease;
}
.nav-cta:hover { background: var(--accent); color: #10151a; }

/* ---------- hero ---------- */

/* Copy on the left, the app itself on the right — the screenshot is the
   product demo, so it gets equal billing rather than a slot further down. */
.hero {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: clamp(2rem, 5vw, 3.5rem);
    align-items: center;
    padding: clamp(2.5rem, 8vw, 5rem) 0 0;
}

.hero-shot { position: relative; }

.hero-shot::before {
    content: "";
    position: absolute;
    inset: -30px;
    background: radial-gradient(60% 60% at 50% 40%, rgba(60, 197, 171, 0.12), transparent 70%);
    pointer-events: none;
}

.hero-shot img {
    position: relative;
    display: block;
    width: 100%;
    max-width: 400px;
    height: auto;
    margin: 0 auto;
    border-radius: 18px;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

h1 {
    /* Monospace is wide: this ceiling is what keeps the headline to two lines
       in the hero's left column. */
    font-size: clamp(2rem, 4.2vw, 2.9rem);
    line-height: 1.02;
    letter-spacing: -0.035em;
    font-weight: 700;
    margin: 0 0 1.2rem;
    max-width: 20ch;
}

h1 em {
    font-style: normal;
    color: var(--accent);
}

.lead {
    color: var(--sub);
    font-size: clamp(0.95rem, 1.5vw, 1.08rem);
    max-width: 58ch;
    margin: 0 0 2rem;
}

.actions {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

/* The install command is the primary call to action for this audience —
   a button is secondary to something you can paste. */
.command {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.75rem 0.9rem 0.75rem 1rem;
    font-size: 13.5px;
    color: var(--fg);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.command:hover { border-color: var(--accent); background: #1e222b; }
.command .sigil { color: var(--accent); user-select: none; }
.command .copy { color: var(--sub); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }

.button {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    border: 1px solid var(--accent);
    background: transparent;
    color: var(--accent);
    font: inherit;
    font-size: 13.5px;
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease;
}

.button:hover { background: var(--accent); color: #10151a; }

.button.solid { background: var(--accent); color: #10151a; font-weight: 600; }
.button.solid:hover { background: #4ad6bc; }

.fineprint { color: var(--sub); font-size: 12.5px; margin: 0; }

/* Four numbers that answer the questions this audience asks first. */
.stats {
    display: flex;
    gap: clamp(1.2rem, 3vw, 1.8rem);
    flex-wrap: wrap;
    margin: 2.2rem 0 0;
    padding-top: 1.4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.stats dt { font-size: 20px; font-weight: 600; line-height: 1.2; }
.stats dd { margin: 0; color: var(--sub); font-size: 12px; }

/* ---------- gauge ---------- */

.readout {
    margin: clamp(2.5rem, 7vw, 4.5rem) 0 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(27, 30, 38, 0.9), rgba(20, 22, 28, 0.9));
    padding: clamp(1.1rem, 3vw, 1.8rem);
}

.readout-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.1rem;
}

.readout-head .who { font-size: 13px; color: var(--sub); letter-spacing: 0.08em; }
.readout-head .who b { color: var(--fg); font-weight: 700; letter-spacing: 0; }
.readout-head .caret { color: var(--accent); font-style: normal; animation: blink 1.2s steps(1) infinite; }

@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0.25; } }

.pct {
    font-size: clamp(2.6rem, 8vw, 4rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1;
}
.pct span { font-size: 0.4em; color: var(--sub); margin-left: 0.15em; }

/* One bar, one colour, chosen by zone — the same shape the app draws. The
   ghost sits under the fill from the same left edge, so it reads as the
   fill's future extension rather than a second bar. */
.bar {
    position: relative;
    height: 26px;
    margin-bottom: 0.5rem;
}

/* The zone colour and the two widths. These were style attributes until
   style-src 'self' — which does not allow inline style attributes — silently
   dropped them, leaving the bar with no width and no colour. */
.bar.zone-red { --c: var(--red); }
.bar .ghost { --w: 100%; }
.bar .fill  { --w: 95%; }

.bar i {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 0;
    width: var(--w);
    border-radius: 3px;
}

.bar .track { width: 100%; background: var(--track); }
.bar .ghost { background: var(--c); opacity: 0.26; animation: ghost 7s ease-in-out infinite; }

/* The fill is already `width: var(--w)` from `.bar i`; the animation scales it
   from that width rather than animating width itself. A `var()` inside
   `@keyframes` does not resolve, so the old `width: var(--w)` frame was
   dropped and the bar sat at 0 forever. Scaling also stays off the layout
   path. */
.bar .fill  {
    background: var(--c);
    transform-origin: left center;
    animation: grow 7s cubic-bezier(0.2, 0.8, 0.2, 1) infinite,
               zone 7s linear infinite;
}

/* The window filling and resetting, on a loop — the bar is the product, so
   it should be doing something when you land on it. */
@keyframes grow {
    0%           { transform: scaleX(0); }
    18%, 80%     { transform: scaleX(1); }
    100%         { transform: scaleX(0); }
}

/* The zone flip, which is the point of the whole graphic: the window is
   healthy until it crosses the line the app promises to warn at, and red
   afterwards. The offsets are where the eased fill actually reaches the 85%
   marker — the fill spans 95% of the bar, so it crosses at scaleX 0.8947,
   which the easing puts at 6.93% of the loop on the way up and 80.52% on the
   way back down. The paired offsets a hundredth apart make each change a
   flip rather than a fade.

   The colours are literals rather than var(--ok) and var(--red): a var()
   inside @keyframes does not resolve, which is the bug that had this bar
   rendering empty in the first place. Keep them in step with :root. */
@keyframes zone {
    0%,      6.92%  { background-color: #37b992; }
    6.93%,  80.51%  { background-color: #e35d55; }
    80.52%, 100%    { background-color: #37b992; }
}

@keyframes ghost {
    0%, 18%      { opacity: 0; }
    30%, 80%     { opacity: 0.26; }
    100%         { opacity: 0; }
}

/* The alert threshold, spanning the full height as it does in the app. */
.bar::after {
    content: "";
    position: absolute;
    left: 85%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(255, 255, 255, 0.3);
}

.gauge-legend {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--sub);
    letter-spacing: 0.1em;
}

.verdict {
    margin-top: 1.2rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--line);
    font-size: 13.5px;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.verdict .warn { color: var(--amber); }
.verdict .dim { color: var(--sub); }
/* The recommendation is the answer, so it sits at the far end of the row. */
.verdict .route { color: var(--accent); margin-left: auto; }

/* ---------- sections ---------- */

section { padding: clamp(3.5rem, 10vw, 7rem) 0 0; }

h2 {
    font-size: clamp(1.4rem, 3.2vw, 2rem);
    letter-spacing: -0.025em;
    line-height: 1.15;
    margin: 0 0 1rem;
    max-width: 22ch;
}

.section-lead {
    color: var(--sub);
    max-width: 62ch;
    margin: 0 0 2rem;
    font-size: 14.5px;
}

/* Terminal transcript — the app's real output, not a mockup of one. */
.terminal {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #10131a;
    overflow: hidden;
}

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--line);
    background: var(--rail);
}
.terminal-bar u { width: 10px; height: 10px; border-radius: 50%; background: var(--line); display: block; }
.terminal-bar span { margin-left: 0.5rem; font-size: 11px; color: var(--sub); letter-spacing: 0.14em; text-transform: uppercase; }

.terminal pre {
    margin: 0;
    padding: 1.1rem 1.2rem;
    font-size: 13px;
    line-height: 1.85;
    overflow-x: auto;
    color: var(--fg);
}

.terminal .g { color: var(--accent); }
.terminal .a { color: var(--amber); }
.terminal .r { color: var(--red); }
.terminal .d { color: var(--sub); }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}

.cell { background: var(--bg); padding: 1.6rem; }
.cell h3 { margin: 0 0 0.5rem; font-size: 14.5px; letter-spacing: -0.01em; }
.cell p { margin: 0; color: var(--sub); font-size: 13.5px; }
.cell .n {
    margin: 0 0 0.6rem;
    color: var(--accent);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.cell .tick { color: var(--accent); }

/* ---------- handoff & subscriptions ---------- */

/* Two picture-led sections: a framed screenshot beside the argument for it,
   with the copy pinned while the shot scrolls past. */
.split {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: clamp(2rem, 4vw, 3.5rem);
    align-items: start;
}

.split.shot-first { grid-template-columns: 0.6fr 1fr; }
.split-copy { position: sticky; top: 2rem; }

.shot {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--card);
    padding: 0.85rem;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
}

.shot img { display: block; width: 100%; height: auto; border-radius: 8px; }

.points { display: grid; gap: 0.6rem; max-width: 52ch; }

.point {
    display: flex;
    gap: 0.8rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.9rem 1rem;
    background: var(--card);
}
.point .n { color: var(--accent); font-size: 13px; }
.point p { margin: 0; color: var(--sub); font-size: 13.5px; }
.point b { color: var(--fg); font-weight: 700; }

.rows { display: grid; gap: 0.6rem; font-size: 13.5px; }

.row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.8rem 1rem;
    background: var(--card);
}
.row .k { color: var(--sub); }
.row.flag {
    border-color: rgba(226, 161, 61, 0.4);
    background: rgba(226, 161, 61, 0.06);
    color: var(--amber);
}

/* ---------- trust ---------- */

.claims { display: grid; gap: 1px; background: var(--line); border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }

.claim {
    background: var(--bg);
    padding: 1.3rem 1.4rem;
    display: grid;
    grid-template-columns: 1.6rem 1fr;
    gap: 0.9rem;
    align-items: start;
}

.claim .n { color: var(--accent); font-size: 12px; padding-top: 0.2rem; }
.claim h3 { margin: 0 0 0.35rem; font-size: 14.5px; }
.claim p { margin: 0 0 0.6rem; color: var(--sub); font-size: 13.5px; }
.claim code {
    display: block;
    background: #10131a;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 0.55rem 0.7rem;
    font-size: 12.5px;
    color: var(--fg);
    overflow-x: auto;
    white-space: pre;
}

.caveat {
    margin-top: 1.5rem;
    border-left: 2px solid var(--amber);
    padding: 0.3rem 0 0.3rem 1rem;
    color: var(--sub);
    font-size: 13.5px;
    max-width: 66ch;
}
.caveat b { color: var(--fg); font-weight: 700; }
.caveat.accent { border-color: var(--accent); }

/* ---------- install ---------- */

.install-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.2rem;
}

.pane {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1.4rem;
    background: var(--card);
}
.pane h3 { margin: 0 0 0.8rem; font-size: 14px; letter-spacing: 0.02em; }
.pane p { color: var(--sub); font-size: 13px; margin: 0.8rem 0 0; }

/* Formerly style attributes, which style-src 'self' drops. */
.pane p.tight { margin-top: 0; }
.button.spaced { margin-top: 0.5rem; }

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

footer {
    margin-top: clamp(4rem, 10vw, 7rem);
    border-top: 1px solid var(--line);
    padding: 2rem 0 3.5rem;
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-size: 12.5px;
    color: var(--sub);
}

footer nav { gap: 1.2rem; flex-wrap: wrap; }

.no-track { max-width: 44ch; }

/* Below this the two-column layouts stop earning their keep: the screenshot
   goes under the copy it illustrates, and nothing sticks. */
@media (max-width: 880px) {
    .hero, .split, .split.shot-first { grid-template-columns: 1fr; }
    .split-copy { position: static; }
    .split.shot-first .shot { order: 2; }
    .hero-shot img { max-width: 340px; }
    .verdict .route { margin-left: 0; }
}

/* The transcript is the one thing that cannot reflow — shrink it rather than
   make a phone scroll sideways through the whole block. */
@media (max-width: 560px) {
    .terminal pre { font-size: 11px; line-height: 1.75; padding: 0.9rem; }
    .gauge i { height: 20px; }
    .claim { grid-template-columns: 1fr; gap: 0.4rem; }
    .claim .n { padding-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}
