/* =====================================================================
   Visuals — panels, traces and charts.

   Everything the site shows as "product" is drawn here: one chrome, one
   chart geometry, data in monospace. Built to read like a developer tool,
   not like an illustration.
   ===================================================================== */

:root {
    --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    --viz-bg: linear-gradient(180deg, #0f172a 0%, var(--panel-inset) 100%);
    --viz-line: var(--w07);
    --viz-line-soft: var(--w045);
}

/* ---------- Panel ---------- */
.viz {
    --viz-accent: #3b82f6;
    --viz-accent-2: #06b6d4;
    position: relative;
    border-radius: 18px;
    border: 1px solid var(--w09);
    background: var(--viz-bg);
    box-shadow:
        inset 0 1px 0 var(--w06),
        0 50px 90px -60px var(--k95),
        0 0 0 1px var(--k3);
    overflow: hidden;
    text-align: left;          /* a hero centres its text; a panel never does */
    font-feature-settings: "tnum" 1;
}
.viz::after {
    content: "";
    position: absolute;
    inset: -1px -1px auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--viz-accent-2), transparent);
    opacity: 0.55;
}
.viz--emerald { --viz-accent: #10b981; --viz-accent-2: #34d399; }
.viz--amber { --viz-accent: #f59e0b; --viz-accent-2: #fbbf24; }
.viz--violet { --viz-accent: #8b5cf6; --viz-accent-2: #a78bfa; }

.viz-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--viz-line);
    background: var(--w015);
}
.viz-name {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.viz-name b { color: var(--text-muted); font-weight: 400; }
.viz-head .viz-chip { margin-left: auto; }
.viz-body { padding: 18px 16px; }
.viz-foot {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 11px 16px;
    border-top: 1px solid var(--viz-line);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    background: var(--k2);
}
.viz-foot span { display: inline-flex; align-items: center; gap: 6px; }
.viz-foot b { color: var(--text-secondary); font-weight: 500; }
.viz-foot .viz-right { margin-left: auto; }

.viz-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.01em;
    white-space: nowrap;
    border: 1px solid rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
}
.viz-chip i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.viz-chip--run { border-color: rgba(59, 130, 246, 0.35); background: rgba(59, 130, 246, 0.12); color: #60a5fa; }
.viz-chip--warn { border-color: rgba(245, 158, 11, 0.35); background: rgba(245, 158, 11, 0.12); color: #fbbf24; }
.viz-chip--fail { border-color: rgba(239, 68, 68, 0.35); background: rgba(239, 68, 68, 0.12); color: #f87171; }
.viz-chip--mute { border-color: var(--viz-line); background: var(--w03); color: var(--text-muted); }

/* ---------- Trace: one row per step, bars on a shared time axis ---------- */
.trace { display: flex; flex-direction: column; }
.trace-row {
    display: grid;
    grid-template-columns: 18px 68px minmax(0, 1fr) 46% 52px;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    font-family: var(--font-mono);
    font-size: 12px;
    border-bottom: 1px solid var(--viz-line-soft);
}
.trace-row:last-of-type { border-bottom: 0; }
.trace-i { color: var(--text-muted); font-size: 11px; text-align: right; }
.trace-op { color: var(--viz-accent-2); font-weight: 500; }
.trace-target { color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trace-target em { font-style: normal; color: var(--text-secondary); }
.trace-bar { position: relative; height: 8px; border-radius: 3px; background: var(--w04); }
.trace-bar span {
    position: absolute;
    top: 0; bottom: 0;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--viz-accent), var(--viz-accent-2));
    box-shadow: 0 0 12px -2px var(--viz-accent-2);
}
.trace-row--fail .trace-bar span { background: linear-gradient(90deg, #b91c1c, #ef4444); box-shadow: 0 0 12px -2px #ef4444; }
.trace-row--fail .trace-op { color: #f87171; }
.trace-ms { color: var(--text-secondary); text-align: right; font-size: 11px; }
.trace-axis {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed var(--viz-line);
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
}
@media (max-width: 560px) {
    .trace-row { grid-template-columns: 16px 58px minmax(0, 1fr) 44px; }
    .trace-bar { display: none; }
}

/* ---------- Chart ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-gridline { stroke: var(--viz-line-soft); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-label { font-family: var(--font-mono); font-size: 9px; fill: #64748b; }
.chart-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart-p95 { fill: none; stroke-width: 1.25; stroke-dasharray: 3 4; opacity: 0.65; vector-effect: non-scaling-stroke; }
.chart-marker { stroke: #ef4444; stroke-width: 1; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }

/* thin availability ticks under a chart */
.ticks { display: flex; gap: 2px; align-items: stretch; height: 22px; margin-top: 14px; }
.ticks i { flex: 1; border-radius: 2px; background: linear-gradient(180deg, #10b981, #059669); opacity: 0.9; }
.ticks i.is-slow { background: linear-gradient(180deg, #f59e0b, #d97706); }
.ticks i.is-down { background: linear-gradient(180deg, #ef4444, #b91c1c); box-shadow: 0 0 12px -2px #ef4444; }
.ticks-axis { display: flex; justify-content: space-between; margin-top: 7px; font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); }

/* key/value strip under a chart */
.viz-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--viz-line); border-top: 1px solid var(--viz-line); }
.viz-kpis div { background: #0b1220; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.viz-kpis strong { font-family: var(--font-mono); font-size: 16px; font-weight: 600; color: var(--text-primary); letter-spacing: -0.02em; }
.viz-kpis span { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); letter-spacing: 0.02em; }
.viz-kpis .is-up strong { color: #34d399; }
@media (max-width: 560px) { .viz-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Timeline: what a night session did, in order ---------- */
.tl { position: relative; display: flex; flex-direction: column; gap: 2px; }
.tl-row {
    display: grid;
    grid-template-columns: 46px 22px minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    padding: 9px 0;
    font-size: 12px;
}
.tl-time { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); padding-top: 2px; }
.tl-mark { position: relative; display: flex; justify-content: center; }
.tl-mark i {
    width: 11px; height: 11px; border-radius: 50%;
    background: #0b1220;
    border: 2px solid var(--fg-emerald, #10b981);
    box-shadow: 0 0 10px -1px rgba(16, 185, 129, 0.8);
    margin-top: 3px;
    z-index: 1;
}
.tl-row--warn .tl-mark i { border-color: #f59e0b; box-shadow: 0 0 10px -1px rgba(245, 158, 11, 0.9); }
.tl-row--fail .tl-mark i { border-color: #ef4444; box-shadow: 0 0 10px -1px rgba(239, 68, 68, 0.9); }
.tl-row:not(:last-child) .tl-mark::after {
    content: "";
    position: absolute;
    top: 16px; bottom: -14px;
    width: 2px;
    background: linear-gradient(180deg, var(--tl-wire, rgba(16, 185, 129, 0.45)), rgba(16, 185, 129, 0.2));
}
.tl-row--warn:not(:last-child) .tl-mark::after { --tl-wire: rgba(245, 158, 11, 0.5); }
.tl-row--fail:not(:last-child) .tl-mark::after { --tl-wire: rgba(239, 68, 68, 0.5); }
.tl-body strong { display: block; font-size: 13px; font-weight: 500; color: var(--text-primary); margin-bottom: 2px; }
.tl-body span { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.tl-body code { font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); background: var(--w04); padding: 1px 5px; border-radius: 4px; }
.tl-body .tl-diff { color: #f87171; text-decoration: line-through; }
.tl-body .tl-diff-new { color: #34d399; }

/* ---------- Small versions for the bento tiles ---------- */
.viz--mini { border-radius: 14px; }
.viz--mini .viz-head { padding: 10px 13px; }
.viz--mini .viz-body { padding: 13px; }
.viz--mini .viz-name { font-size: 11px; }
.viz--mini .trace-row { grid-template-columns: 62px minmax(0, 1fr) 40px; gap: 8px; font-size: 11px; padding: 5px 0; }
.viz--mini .trace-bar { display: none; }
.viz--mini .tl-row { grid-template-columns: 40px 18px minmax(0, 1fr); padding: 6px 0; }
.viz--mini .tl-body strong { font-size: 12px; }

/* ---------- The panel a page hero shows ---------- */
.viz-hero { --viz-accent: #3b82f6; --viz-accent-2: #22d3ee; }
.viz-hero .viz-body { padding: 0; }
.viz-hero-chart { padding: 20px 18px 14px; }
.viz-hero-runs { border-top: 1px solid var(--viz-line); }
.run-row {
    display: grid;
    grid-template-columns: 18px minmax(0, 1.4fr) minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 11px 18px;
    border-bottom: 1px solid var(--viz-line-soft);
    font-family: var(--font-mono);
    font-size: 12px;
    transition: background 0.25s ease;
}
.run-row:last-child { border-bottom: 0; }
.run-row:hover { background: var(--w025); }
.run-state { width: 16px; height: 16px; border-radius: 5px; display: grid; place-items: center; background: rgba(16, 185, 129, 0.15); color: #34d399; }
.run-state--fail { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.run-name { color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-meta { color: var(--text-muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-time { color: var(--text-secondary); font-size: 11px; text-align: right; }
@media (max-width: 700px) { .run-row { grid-template-columns: 18px minmax(0, 1fr) auto; } .run-meta { display: none; } }

/* Data typography anywhere else */
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- The AI conversation and the code editor, in the same voice ---------- */
.ai-chat-mockup, .code-mockup {
    border-radius: 18px;
    border: 1px solid var(--w09);
    background: var(--viz-bg);
    box-shadow: inset 0 1px 0 var(--w06), 0 50px 90px -60px var(--k95);
    overflow: hidden;
}
.ai-chat-header, .code-mockup-header { border-bottom: 1px solid var(--viz-line); background: var(--w015); }
.ai-chat-header__title, .code-mockup-title { font-family: var(--font-mono); font-size: 12px; letter-spacing: -0.01em; }
.ai-chat-bubble { font-size: 13px; line-height: 1.55; }
.ai-chat-bubble--ai { border: 1px solid var(--viz-line); }
.ai-chat-step, .ai-chat-applied { font-family: var(--font-mono); font-size: 11px; }
.code-mockup-body, .code-mockup pre, .code-mockup code { font-family: var(--font-mono); font-size: 12px; line-height: 1.6; }

/* The visual stands on its own plinth; the old frame chrome goes */
.feature-frame-mockup .frame-content-mockup { background: transparent; padding: clamp(8px, 2vw, 24px); }
.platform-card { border-radius: 18px; background: var(--viz-bg); box-shadow: inset 0 1px 0 var(--w06), 0 50px 90px -60px var(--k95); }
.platform-card-head { font-family: var(--font-mono); font-size: 12px; font-weight: 500; }
.platform-code { font-family: var(--font-mono); background: var(--panel-deep); }
.platform-diff { font-family: var(--font-mono); }
.platform-card-foot { font-size: 12px; }

/* Numbers in the page's own tables and pricing read as data */
.comparison-table td, .price-amount, .price-currency, .price-period, .pricing-feature strong { font-variant-numeric: tabular-nums; }
.price-amount { font-family: var(--font-mono); letter-spacing: -0.04em; }
.floating-stat-value, .mini-kpi strong { font-family: var(--font-mono); }
.floating-stat { border-radius: 14px; background: linear-gradient(180deg, rgba(15, 23, 42, 0.97), rgba(10, 17, 32, 0.99)); border-color: var(--w09); }
.floating-stat-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: -0.01em; text-transform: none; }

/* Nothing may escape a chart's box */
.chart svg { overflow: hidden; }

/* ---------- Scan result ---------- */
.scan { display: flex; flex-direction: column; }
.scan-row {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr) 84px 36px;
    align-items: center;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--viz-line-soft);
}
.scan-row:last-child { border-bottom: 0; }
.scan-kind { font-family: var(--font-mono); font-size: 11px; color: var(--viz-accent-2); }
.scan-what { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.scan-what strong { font-size: 13px; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scan-what code { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scan-score { height: 5px; border-radius: 3px; background: var(--w05); overflow: hidden; }
.scan-score span { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--viz-accent), var(--viz-accent-2)); box-shadow: 0 0 10px -2px var(--viz-accent-2); }
.scan-num { font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); text-align: right; }
@media (max-width: 560px) { .scan-row { grid-template-columns: 62px minmax(0, 1fr) 34px; } .scan-score { display: none; } }

/* ---------- Bento: content top-aligned, the link pinned to the bottom ---------- */
.bento-art { margin-top: 0; }
.bento-link { margin-top: auto; padding-top: 4px; }
.bento-tile { gap: 16px; }

/* Trace: give the target room, the bar is the smaller half */
.trace-row { grid-template-columns: 16px 62px minmax(0, 1fr) 34% 52px; }
.ticks { gap: 2px; height: 18px; }
.ticks i { border-radius: 1.5px; }
