/* web/brand.css -- Rutken shared design system (2026-10).
 *
 * The single source of visual truth for the marketing + docs + blog site:
 * tokens, base elements, and the shared components (nav, buttons, cards,
 * hero, sections, footer). index.html / login.html / docs.html / blog.html
 * all include THIS file first, then only page-specific styles on top. Do not
 * fork the palette or the type scale per page -- extend here.
 *
 * Brand: orange accent carried over from the GUI (crates/gui) --
 * ACCENT #e0843a, ACCENT_BRIGHT #ec9d55, ACCENT_SOFT #f5be8a -- on a deep,
 * technical dark surface. Serious, fast, offensive-and-defensive security
 * tooling; the design should read confident and engineered, never playful.
 *
 * Shared components (all additive -- nothing here is renamed/removed, so the
 * home / login / docs / blog pages keep working byte-for-byte):
 *   .container .btn .card .surface .grid .badge .eyebrow        (layout kit)
 *   .site-header .site-footer .brand                            (chrome)
 *   .terminal (+ .term-*, .chip high|medium|low)               (NEW: console hero)
 *   .stat-strip / .stat                                        (NEW: perf band)
 */

:root {
  /* Brand (from the GUI) */
  --accent: #e0843a;
  --accent-bright: #ec9d55;
  --accent-soft: #f5be8a;
  --accent-ink: #1a1206; /* text on an orange fill */

  /* Dark technical surface */
  --bg: #0b0c0f;
  --bg-elev: #14161b;
  --bg-elev-2: #1b1e25;
  --line: #262a32;
  --line-soft: #1e222a;

  /* Text */
  --text: #eef0f4;
  --text-dim: #aab0ba;
  --text-faint: #767c88;

  /* Status */
  --ok: #6fcf97;
  --warn: #e0b341;
  --danger: #e06a5a;
  /* lightened status inks that clear 4.5:1 on the dark elevated surfaces,
     for chips / terminal output text */
  --ok-ink: #8bdcac;
  --warn-ink: #ecc66a;
  --danger-ink: #f0a08f;

  /* Type */
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;

  /* Scale / rhythm */
  --maxw: 1140px;
  --gutter: 24px;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 0 rgba(255,255,255,0.03) inset, 0 12px 40px -18px rgba(0,0,0,0.8);
  --speed: 160ms;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background-color: var(--bg);
  /* A very-low-opacity fine grid texture under everything -- the Linear/
     Vercel "engineered surface" cue, decorative only. (The warm orange
     corner glow was removed on request.) */
  background-image:
    linear-gradient(rgba(255,255,255,0.016) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.016) 1px, transparent 1px);
  background-size: 46px 46px, 46px 46px;
  background-position: 0 0, 0 0;
  background-repeat: repeat, repeat;
  background-attachment: fixed, fixed;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { line-height: 1.08; letter-spacing: -0.025em; margin: 0 0 0.5em; font-weight: 680; color: var(--text); }
h1 { font-size: clamp(2.4rem, 5.6vw, 4rem); font-weight: 760; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 720; }
h3 { font-size: 1.22rem; font-weight: 660; }
p { margin: 0 0 1rem; color: var(--text-dim); }
a { color: var(--accent-soft); text-decoration: none; transition: color var(--speed); }
a:hover { color: var(--accent-bright); }
code, kbd, pre { font-family: var(--font-mono); }
code { background: var(--bg-elev-2); border: 1px solid var(--line); border-radius: 6px; padding: 0.12em 0.4em; font-size: 0.88em; color: var(--accent-soft); }
pre { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; overflow: auto; }
pre code { background: none; border: 0; padding: 0; color: var(--text); }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.74rem; font-weight: 700; color: var(--accent); }
.muted { color: var(--text-faint); }
.center { text-align: center; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  font: inherit; font-weight: 600; cursor: pointer;
  padding: 0.7rem 1.15rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--bg-elev-2); color: var(--text);
  transition: transform var(--speed), background var(--speed), border-color var(--speed), box-shadow var(--speed), opacity var(--speed);
}
.btn:hover { transform: translateY(-1px); border-color: #3a434f; color: var(--text); }
.btn.primary {
  background: linear-gradient(180deg, var(--accent-bright), var(--accent)); border-color: transparent; color: var(--accent-ink);
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 10px 26px -14px rgba(224,132,58,0.9);
}
.btn.primary:hover { filter: brightness(1.05); color: var(--accent-ink); box-shadow: 0 1px 0 rgba(255,255,255,0.22) inset, 0 14px 32px -12px rgba(224,132,58,0.95); }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; filter: none; }

/* Nav */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.site-header .container { display: flex; align-items: center; gap: 1.5rem; height: 62px; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; font-weight: 750; letter-spacing: -0.02em; color: var(--text); font-size: 1.12rem; }
/* The Rutken mark: the brand-orange "T" logo (web/rutken-logo.png, color-
 * corrected to --accent). url() is relative to THIS stylesheet, so every
 * page (incl. blog/*) gets the right asset with no per-page path. The
 * literal letter in the markup (<span class="mark">R</span>) is hidden via
 * font-size:0 so no markup change is needed across pages. */
.brand .mark { width: 24px; height: 24px; background: url(rutken-logo.png) center/contain no-repeat; font-size: 0; color: transparent; filter: drop-shadow(0 2px 8px rgba(224,132,58,0.45)); }
.site-header nav { margin-left: auto; display: flex; align-items: center; gap: 1.25rem; }
.site-header nav a { position: relative; color: var(--text-dim); font-weight: 500; font-size: 0.95rem; }
.site-header nav a:hover { color: var(--text); }
.site-header nav a[aria-current="page"] { color: var(--text); }
/* The nav underline (hover-grow + current-page indicator) lives in the
 * MOTION LAYER section at the end of this file. */

/* Cards / surfaces */
.card {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow);
  transition: border-color var(--speed), transform var(--speed), background var(--speed);
}
.card:hover { border-color: #353d49; transform: translateY(-2px); }
.surface { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); }

/* Sections */
section { padding: clamp(84px, 10vw, 132px) 0; }
.section-head { max-width: 680px; margin-bottom: 3rem; }
.section-head p { font-size: 1.08rem; }

/* Grids */
.grid { display: grid; gap: 20px; }
@media (min-width: 720px) { .grid.cols-2 { grid-template-columns: repeat(2, 1fr); } .grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }

/* Footer */
.site-footer { border-top: 1px solid var(--line-soft); padding: 40px 0; color: var(--text-faint); font-size: 0.9rem; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; }
.site-footer a { color: var(--text-dim); }
.site-footer nav { margin-left: auto; display: flex; gap: 1.25rem; flex-wrap: wrap; }

/* Badges / pills */
.badge { display: inline-flex; align-items: center; gap: 0.4em; font-size: 0.76rem; font-weight: 600; padding: 0.25em 0.6em; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-elev-2); color: var(--text-dim); }
.badge.accent { color: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* ---------------------------------------------------------------------------
 * Severity chips -- shared between the terminal hero, findings output, and
 * anywhere a HIGH/MEDIUM/LOW label is needed. Monospace, uppercase, status-
 * tinted. The ink colors (--*-ink) are the lightened status tones so the text
 * clears 4.5:1 on the dark elevated surfaces.
 * ------------------------------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 700;
  font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 5px; border: 1px solid var(--line);
  background: var(--bg-elev-2); color: var(--text-dim); white-space: nowrap;
}
.chip.high   { color: var(--danger-ink); border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); background: color-mix(in srgb, var(--danger) 16%, transparent); }
.chip.medium { color: var(--warn-ink);   border-color: color-mix(in srgb, var(--warn) 55%, var(--line));   background: color-mix(in srgb, var(--warn) 14%, transparent); }
.chip.low    { color: var(--accent-soft);border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* ---------------------------------------------------------------------------
 * Terminal / console panel -- the credibility centerpiece. Window chrome
 * (three dots + title), a monospace body, and color helpers for a realistic
 * `rutken` run. Static HTML; the only motion is the caret blink, which the
 * global reduced-motion rule below freezes.
 * ------------------------------------------------------------------------- */
.terminal {
  text-align: left; overflow: hidden;
  background: linear-gradient(180deg, #0f1115, #0c0e12);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow), 0 0 0 1px rgba(224,132,58,0.05), 0 48px 90px -50px rgba(224,132,58,0.28);
  font-family: var(--font-mono);
}
.term-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px; background: var(--bg-elev-2); border-bottom: 1px solid var(--line);
}
.term-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--line); flex: none; }
.term-dot.r { background: #e06a5a; }
.term-dot.y { background: #e0b341; }
.term-dot.g { background: #6fcf97; }
.term-title { margin-left: 8px; font-size: 0.74rem; color: var(--text-faint); letter-spacing: 0.02em; }
.term-body {
  padding: 18px 20px; overflow-x: auto;
  font-size: 0.86rem; line-height: 1.75; color: var(--text-dim);
}
.term-body .line { display: block; white-space: pre; }
.term-body .line.wrap { white-space: pre-wrap; }
.term-body .line + .line { margin-top: 1px; }
.term-body .gap { height: 0.7rem; }
/* color helpers */
.t-prompt { color: var(--accent); font-weight: 700; }
.t-cmd    { color: var(--text); font-weight: 600; }
.t-dim    { color: var(--text-faint); }
.t-ok     { color: var(--ok-ink); }
.t-accent { color: var(--accent-soft); }
.t-path   { color: var(--accent-soft); }
/* blinking caret (reduced-motion safe -- the global rule stops the animation) */
.term-caret {
  display: inline-block; width: 8px; height: 1.05em; vertical-align: -0.17em;
  margin-left: 3px; background: var(--accent); border-radius: 1px;
  animation: term-blink 1.1s steps(1) infinite;
}
@keyframes term-blink { 50% { opacity: 0; } }

/* ---------------------------------------------------------------------------
 * Perf / capability strip -- a tight, hairline-divided band of .stat cells
 * (NOT big cards). Reusable: give the container `.stat-strip cols-3|cols-4`.
 * ------------------------------------------------------------------------- */
.stat-strip {
  display: grid; grid-template-columns: 1fr; gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
@media (min-width: 560px) { .stat-strip.cols-4, .stat-strip.cols-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 880px) { .stat-strip.cols-3 { grid-template-columns: repeat(3, 1fr); } .stat-strip.cols-4 { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--bg-elev); padding: 18px 20px; display: flex; flex-direction: column; gap: 5px; }
.stat .stat-v { font-weight: 680; font-size: 1.02rem; letter-spacing: -0.015em; color: var(--text); }
.stat .stat-v .mono { font-family: var(--font-mono); font-size: 0.92em; color: var(--accent-soft); font-weight: 600; letter-spacing: 0; }
.stat .stat-d { font-size: 0.86rem; color: var(--text-dim); line-height: 1.45; }

/* Accessibility / motion */
:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* No horizontal scroll at phone width */
img, svg, video, canvas { max-width: 100%; height: auto; }

/* ===========================================================================
 * MOTION LAYER (2026-10) — scroll reveals, nav scroll state, hover polish.
 *
 * Progressive enhancement: motion.js adds `.motion` to <html> ONLY when the
 * viewer has NOT requested reduced motion. Every hide-then-reveal rule is
 * gated on BOTH `.motion` AND `prefers-reduced-motion: no-preference`, so with
 * JS disabled, motion.js missing/failed, or reduced motion requested, nothing
 * is ever hidden — each element renders in its final, visible state. We animate
 * only transform/opacity (GPU-friendly) and keep will-change scoped to the
 * reveal targets. The global `@media (prefers-reduced-motion: reduce)` rule
 * above additionally kills every transition/animation as a hard backstop.
 * ======================================================================== */

/* Smooth in-page scrolling (CSS-native; off under reduced motion). */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
/* Keep anchored sections clear of the sticky header. */
section[id], [id].section-head, .section-head[id] { scroll-margin-top: 84px; }

/* Nav: step up the opacity/blur and add a hairline shadow once scrolled. */
.site-header { transition: background var(--speed) ease, box-shadow var(--speed) ease, border-color var(--speed) ease; }
.site-header.scrolled {
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  box-shadow: 0 1px 0 var(--line-soft), 0 10px 30px -20px rgba(0,0,0,0.85);
}

/* Nav links: an underline that grows from the left on hover; the current
 * page stays lit. Under reduced motion the global rule drops the transition,
 * so the hover underline simply appears/disappears instantly and the
 * current-page indicator (a static scaleX(1) base state) is unaffected. */
.site-header nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -21px; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright)); border-radius: 2px;
  transform: scaleX(0); transform-origin: left center;
  transition: transform var(--speed) ease;
}
.site-header nav a:hover::after,
.site-header nav a[aria-current="page"]::after { transform: scaleX(1); }

/* Thin scroll-progress bar — the element is injected by motion.js, so it is
 * simply absent (no bar) when JS is off. */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60;
  transform: scaleX(0); transform-origin: left center;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright), var(--accent-soft));
  pointer-events: none;
}

/* Card hover: lift (already set above) + an orange border-glow. Hover is
 * user-driven, so this is safe to apply regardless of motion preference. */
.card:hover {
  box-shadow: var(--shadow),
    0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent),
    0 20px 54px -26px rgba(224,132,58,0.55);
}

/* Primary button: a one-shot orange "sheen" sweep on hover (no-preference
 * only). The existing orange box-shadow glow carries the hover cue otherwise. */
.btn.primary { position: relative; overflow: hidden; }
@media (prefers-reduced-motion: no-preference) {
  .btn.primary::after {
    content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,0.35), transparent);
    transform: skewX(-18deg); opacity: 0; pointer-events: none;
  }
  .btn.primary:hover::after { animation: btn-sheen 0.7s ease; }
  @keyframes btn-sheen {
    0%   { left: -60%; opacity: 0; }
    15%  { opacity: 1; }
    100% { left: 130%; opacity: 0; }
  }
}

/* --- Scroll-reveal system (shared by index / docs / blog) ---------------
 * [data-reveal]           a single element that fades + rises on entry.
 * [data-reveal-stagger]   a container whose direct children reveal in
 *                         sequence; motion.js sets each child's
 *                         transition-delay when the group enters view.
 * Children are hidden purely in CSS (flash-free, since `.motion` is set in
 * <head> before paint). Containers populated asynchronously should use
 * [data-reveal] on the CONTAINER (not stagger on children), so late-rendered
 * children are never left hidden. */
@media (prefers-reduced-motion: no-preference) {
  .motion [data-reveal] {
    opacity: 0; transform: translateY(20px);
    transition: opacity 0.7s cubic-bezier(0.22, 0.72, 0.2, 1),
                transform 0.7s cubic-bezier(0.22, 0.72, 0.2, 1);
    will-change: opacity, transform;
  }
  .motion [data-reveal].in { opacity: 1; transform: none; }

  .motion [data-reveal-stagger] > * {
    opacity: 0; transform: translateY(18px);
    transition: opacity 0.6s cubic-bezier(0.22, 0.72, 0.2, 1),
                transform 0.6s cubic-bezier(0.22, 0.72, 0.2, 1);
  }
  .motion [data-reveal-stagger].in > * { opacity: 1; transform: none; }

  /* Calmer, shorter travel on phones. */
  @media (max-width: 560px) {
    .motion [data-reveal],
    .motion [data-reveal-stagger] > * { transform: translateY(12px); }
  }
}

/* Legal / policy pages (privacy.html, terms.html, security.html) */
.legal-prose { max-width: 760px; }
.legal-prose .updated { color: var(--text-faint); font-size: 0.85rem; margin: 0 0 2rem; }
.legal-prose h2 { font-size: 1.3rem; margin: 2.5rem 0 0.8rem; }
.legal-prose h3 { font-size: 1.04rem; margin: 1.6rem 0 0.5rem; color: var(--text); }
.legal-prose p, .legal-prose li { color: var(--text-dim); line-height: 1.7; font-size: 0.97rem; }
.legal-prose ul { margin: 0.5rem 0 1rem; padding-left: 1.3rem; }
.legal-prose li { margin: 0.35rem 0; }
.legal-prose a { color: var(--accent-soft); }
.legal-prose a:hover { color: var(--accent); }
.legal-prose strong { color: var(--text); }
.legal-prose code { font-family: var(--font-mono); font-size: 0.86rem; background: var(--bg-elev); padding: 1px 6px; border-radius: 5px; }

/* Platform cards: pin the status chip (Flagship / Actively building / Coming
   soon) to the top-right corner instead of stacking it above the title. */
.platforms .card { position: relative; }
.platforms .card .chip { position: absolute; top: 20px; right: 20px; margin: 0; }
.platforms .card h3 { margin-top: 0; padding-right: 7.5rem; }

/* Phase 73 -- in-app Billing section (account.html / billing.js). Built
   from existing tokens (--line, --text-dim, --accent, .card, .btn):
   Rutken's own look, not a copy of any other product's billing page. */
.billing-card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(22px, 4vw, 30px); box-shadow: var(--shadow); margin-top: 1.5rem; }
.billing-card h2 { margin-top: 0; font-size: 1.2rem; }
.billing-muted { color: var(--text-dim); font-size: 0.92rem; }
.billing-plan { padding: 16px 0; border-bottom: 1px solid var(--line); }
.billing-plan-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; justify-content: space-between; }
.billing-plan-name { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.billing-plan-price { font-size: 1.02rem; color: var(--accent-soft); font-weight: 600; }
.billing-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 1rem; }
.billing-picker-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 0.9rem; }
.billing-payment, .billing-section, .billing-cancel { padding: 16px 0; border-bottom: 1px solid var(--line); }
.billing-cancel { border-bottom: none; }
.billing-row-head { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); margin-bottom: 0.7rem; }
.billing-row-body { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; color: var(--text); }
.billing-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.billing-table th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); padding: 8px 10px 8px 0; }
.billing-table td { padding: 10px 10px 10px 0; border-top: 1px solid var(--line); vertical-align: middle; color: var(--text); }
.billing-table td:last-child { text-align: right; }

/* ---- Mobile / responsive pass (<=760px): shared chrome so every page
   inherits it. The header is sticky on desktop; on a phone we make it static
   so a wrapped nav scrolls away instead of permanently eating screen.
   `overflow-x: clip` guards any stray wide child without breaking sticky
   (unlike `hidden`, which would). ---- */
html { overflow-x: clip; }
@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .site-header { position: static; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .site-header .container { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; gap: 8px 1rem; }
  .site-header nav { margin-left: 0; width: 100%; flex-wrap: wrap; gap: 0.5rem 1.1rem; }
  .site-header nav a { font-size: 0.92rem; }
  .site-footer .container { flex-direction: column; align-items: flex-start; gap: 0.9rem; }
  .site-footer nav { margin-left: 0; flex-wrap: wrap; }
}
