/* ============================================================================
   DEVTOOLS — "Instrument Panel" design system
   Three engineering tools presented as precision instruments on a drafting table.
   Display: Bricolage Grotesque · Mono: Space Mono · Body: Spline Sans
   ========================================================================== */

:root {
  /* ---- ink surfaces ---- */
  --ink-900: #090c11;
  --ink-850: #0c1016;
  --ink-800: #11161e;
  --ink-750: #151b25;
  --ink-700: #1a212c;
  --ink-600: #232c39;

  /* ---- hairlines ---- */
  --line: rgba(233, 240, 250, 0.08);
  --line-2: rgba(233, 240, 250, 0.14);
  --line-3: rgba(233, 240, 250, 0.22);

  /* ---- text ---- */
  --text-hi: #eef2f8;
  --text: #aab4c2;
  --text-dim: #8a95a3; /* WCAG AA (>=4.5:1 on --ink-900) for small UI text */
  --text-faint: #5a6573; /* decoration only (separators, arrows) */

  /* ---- signal accents (one per instrument) ---- */
  --amber: #f4a93c;          /* ContractCheck — verification lamp */
  --amber-bright: #ffc56b;
  --cyan: #3fd7d7;           /* DevBox — power / online */
  --cyan-bright: #82f0f0;
  --coral: #ff6c8a;          /* CodeScope — heat / scan */
  --coral-bright: #ff9bb0;
  --lime: #a6e22e;           /* semantic: pass / run / healthy */
  --red: #ff5d5d;            /* semantic: fail / violation */

  --brand: var(--amber);
  --brand-bright: var(--amber-bright);

  /* ---- type ---- */
  --font-display: "Bricolage Grotesque", "Spline Sans", system-ui, sans-serif;
  --font-body: "Spline Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "Space Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* ---- geometry ---- */
  --maxw: 1180px;
  --radius: 14px;
  --radius-sm: 9px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --grid: 28px;

  --shadow: 0 26px 60px -28px rgba(0, 0, 0, 0.85);
  --glow: 0 0 0 1px var(--line-2), 0 24px 50px -30px rgba(0, 0, 0, 0.9);
}

/* ============================ reset ============================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* keyboard focus visibility (was missing entirely) */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 3px; }

body {
  font-family: var(--font-body);
  background: var(--ink-900);
  color: var(--text);
  line-height: 1.65;
  font-size: 16.5px;
  font-weight: 350;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
}

/* blueprint grid + vignette + grain atmosphere */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    radial-gradient(1200px 700px at 78% -8%, rgba(244, 169, 60, 0.07), transparent 60%),
    radial-gradient(1000px 720px at 6% 18%, rgba(63, 215, 215, 0.055), transparent 60%);
  background-size: var(--grid) var(--grid), var(--grid) var(--grid), 100% 100%, 100% 100%;
  -webkit-mask-image: radial-gradient(125% 110% at 50% 0%, #000 38%, transparent 92%);
  mask-image: radial-gradient(125% 110% at 50% 0%, #000 38%, transparent 92%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.4;
  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='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* ============================ layout ============================ */
.wrap { width: min(100% - 44px, var(--maxw)); margin-inline: auto; }
section { padding: clamp(72px, 11vw, 148px) 0; position: relative; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 1px;
  background: linear-gradient(90deg, var(--brand), transparent);
}
h1, h2, h3 { font-family: var(--font-display); color: var(--text-hi); line-height: 1.02; letter-spacing: -0.025em; font-weight: 700; }
.section-head { max-width: 720px; margin-bottom: 56px; }
.section-head h2 { font-size: clamp(30px, 4.6vw, 50px); margin: 18px 0 16px; }
.section-head p { font-size: 17px; color: var(--text); max-width: 60ch; }

a { color: inherit; text-decoration: none; }
.mono { font-family: var(--font-mono); }

/* ============================ topbar ============================ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px clamp(18px, 4vw, 40px);
  backdrop-filter: blur(14px) saturate(140%);
  background: linear-gradient(180deg, rgba(9, 12, 17, 0.86), rgba(9, 12, 17, 0.34));
  border-bottom: 1px solid var(--line);
  transition: padding 0.4s var(--ease), background 0.4s var(--ease);
}
.topbar.shrink { padding-top: 11px; padding-bottom: 11px; background: rgba(9, 12, 17, 0.94); }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-mono); font-size: 14px; color: var(--text-hi); letter-spacing: -0.01em; }
.brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px rgba(244, 169, 60, 0.16); animation: pulse 3.4s var(--ease) infinite; }
.brand b { font-weight: 700; }
.brand .slash { color: var(--text-faint); }
.nav { display: flex; align-items: center; gap: 30px; font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.04em; }
.nav a { color: var(--text-dim); transition: color 0.2s; position: relative; }
.nav a:hover { color: var(--text-hi); }
.nav a::after { content: ""; position: absolute; left: 0; bottom: -6px; height: 1px; width: 0; background: var(--brand); transition: width 0.3s var(--ease); }
.nav a:hover::after { width: 100%; }
.nav .ghost { padding: 8px 16px; border: 1px solid var(--line-2); border-radius: 7px; color: var(--text-hi); transition: border-color 0.25s, color 0.25s, background 0.25s; }
.nav .ghost:hover { border-color: var(--brand); color: var(--brand); background: rgba(244, 169, 60, 0.07); }
@media (max-width: 720px) { .nav .nav-link { display: none; } }

/* ============================ hero ============================ */
.hero { padding-top: clamp(150px, 19vw, 220px); padding-bottom: clamp(60px, 8vw, 110px); }
.hero-grid { display: grid; grid-template-columns: 1.04fr 0.96fr; gap: clamp(34px, 5vw, 72px); align-items: center; }
@media (max-width: 940px) { .hero-grid { grid-template-columns: 1fr; gap: 44px; } }

.hero h1 { font-size: clamp(44px, 8.2vw, 96px); letter-spacing: -0.04em; margin: 22px 0; }
.hero h1 .line { display: block; overflow: hidden; }
.hero h1 .line > span { display: block; transform: translateY(105%); animation: rise 1s var(--ease) forwards; }
.hero h1 .line:nth-child(2) > span { animation-delay: 0.09s; }
.hero h1 .line:nth-child(3) > span { animation-delay: 0.18s; }
.hero h1 em { font-style: normal; color: transparent; -webkit-text-stroke: 1.2px var(--brand); }
.hero h1 mark { background: none; color: var(--brand); }
.hero-lede { font-size: clamp(16px, 2vw, 19px); color: var(--text); max-width: 50ch; opacity: 0; animation: fade 0.9s ease 0.5s forwards; }
.hero-lede b { color: var(--text-hi); font-weight: 500; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; opacity: 0; animation: fade 0.9s ease 0.66s forwards; }
.btn {
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.02em;
  padding: 13px 22px; border-radius: 9px; cursor: pointer; display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid transparent; transition: transform 0.25s var(--ease), background 0.25s, border-color 0.25s, color 0.25s;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); color: #1a1205; font-weight: 700; box-shadow: 0 14px 34px -16px rgba(244, 169, 60, 0.7); }
.btn-primary:hover { background: var(--brand-bright); transform: translateY(-2px); }
.btn-ghost { border-color: var(--line-2); color: var(--text-hi); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-2px); }

.hero-meta { display: flex; gap: 26px; margin-top: 42px; flex-wrap: wrap; opacity: 0; animation: fade 0.9s ease 0.8s forwards; }
.hero-meta .stat .n { font-family: var(--font-display); font-size: 30px; color: var(--text-hi); font-weight: 700; letter-spacing: -0.03em; }
.hero-meta .stat .l { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-dim); }

/* ============================ terminal ============================ */
.terminal {
  background: linear-gradient(180deg, var(--ink-800), var(--ink-850));
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
  opacity: 0; transform: translateY(20px);
  animation: fade-up 1s var(--ease) 0.4s forwards;
}
.terminal::after { /* corner crop marks */
  content: ""; position: absolute; inset: 9px; border: 1px solid transparent; border-radius: 8px; pointer-events: none;
  background:
    linear-gradient(var(--line-3), var(--line-3)) left 0 top 0 / 14px 1px no-repeat,
    linear-gradient(var(--line-3), var(--line-3)) left 0 top 0 / 1px 14px no-repeat,
    linear-gradient(var(--line-3), var(--line-3)) right 0 bottom 0 / 14px 1px no-repeat,
    linear-gradient(var(--line-3), var(--line-3)) right 0 bottom 0 / 1px 14px no-repeat;
}
.term-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.015); }
.term-bar .lights { display: flex; gap: 7px; }
.term-bar .lights i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.term-bar .lights i:nth-child(1) { background: #ff5f57; }
.term-bar .lights i:nth-child(2) { background: #febc2e; }
.term-bar .lights i:nth-child(3) { background: #28c840; }
.term-bar .title { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-dim); margin-left: 8px; }
.term-bar .tag { margin-left: auto; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); }
.term-body { padding: 20px 22px; font-family: var(--font-mono); font-size: 13px; line-height: 1.75; overflow-x: auto; }
.term-body .row { white-space: pre; }
.term-body .prompt { color: var(--brand); }
.term-body .cmd { color: var(--text-hi); }
.term-body .dim { color: var(--text-dim); }
.term-body .ok { color: var(--lime); }
.term-body .bad { color: var(--red); }
.term-body .warn { color: var(--amber); }
.term-body .cy { color: var(--cyan); }
.term-body .co { color: var(--coral); }
.cursor { display: inline-block; width: 8px; height: 15px; background: var(--brand); vertical-align: -2px; animation: blink 1.1s steps(2) infinite; }

/* ============================ marquee / strip ============================ */
.strip { border-block: 1px solid var(--line); padding: 22px 0; overflow: hidden; }
.strip .track { display: flex; gap: 56px; width: max-content; animation: slide 38s linear infinite; font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-dim); }
.strip .track span { display: inline-flex; align-items: center; gap: 56px; }
.strip .track b { color: var(--brand); font-weight: 400; }
@media (prefers-reduced-motion: reduce) { .strip .track { animation: none; } }

/* ============================ instrument cards ============================ */
.tools-grid { display: grid; gap: 26px; }
.tool {
  --accent: var(--brand);
  position: relative;
  display: grid; grid-template-columns: 0.92fr 1.08fr; gap: 0;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--ink-800), var(--ink-850));
  overflow: hidden;
  transition: border-color 0.4s var(--ease), transform 0.4s var(--ease);
}
.tool:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line-2)); }
.tool::before { /* accent spine */
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--accent), transparent 75%);
}
@media (max-width: 860px) { .tool { grid-template-columns: 1fr; } }

.tool-info { padding: clamp(26px, 3.4vw, 40px); border-right: 1px solid var(--line); }
@media (max-width: 860px) { .tool-info { border-right: none; border-bottom: 1px solid var(--line); } }
.tool-index { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.2em; color: var(--text-dim); }
.tool h3 { font-size: clamp(26px, 3.2vw, 34px); margin: 14px 0 6px; }
.tool h3 .accent { color: var(--accent); }
.tool .tagline { color: var(--text); font-size: 15.5px; margin-bottom: 22px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; padding: 5px 11px; border: 1px solid var(--line-2); border-radius: 100px; color: var(--text-dim); transition: color 0.25s, border-color 0.25s; }
.tool:hover .chip { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }

.gates { display: grid; gap: 9px; margin-top: 6px; }
.gate { display: flex; align-items: center; gap: 11px; font-family: var(--font-mono); font-size: 12px; color: var(--text); }
.gate .led { width: 9px; height: 9px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 9px var(--lime); flex: none; }
.gate .k { color: var(--text-dim); }
.tool-demo { padding: clamp(20px, 2.6vw, 28px); display: flex; flex-direction: column; gap: 14px; background: rgba(0,0,0,0.16); }
.tool-demo .term-body { padding: 16px 18px; font-size: 12.2px; background: var(--ink-900); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.tool-links { display: flex; gap: 18px; font-family: var(--font-mono); font-size: 12px; margin-top: auto; }
.tool-links a { color: var(--accent); display: inline-flex; align-items: center; gap: 7px; transition: gap 0.25s var(--ease), opacity .2s; }
.tool-links a:hover { gap: 11px; }
.tool-links a.muted { color: var(--text-dim); }

/* ============================ how-it-works steps ============================ */
.flow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
@media (max-width: 860px) { .flow { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .flow { grid-template-columns: 1fr; } }
.step { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 22px 18px; background: var(--ink-800); position: relative; transition: border-color 0.3s, transform 0.3s; }
.step:hover { border-color: var(--line-3); transform: translateY(-3px); }
.step .num { font-family: var(--font-mono); font-size: 11px; color: var(--brand); letter-spacing: 0.16em; }
.step h4 { font-family: var(--font-display); font-size: 17px; color: var(--text-hi); margin: 12px 0 7px; font-weight: 600; }
.step p { font-size: 13.5px; color: var(--text-dim); line-height: 1.6; }
.step .arrow { position: absolute; right: -12px; top: 50%; color: var(--text-faint); font-family: var(--font-mono); }
@media (max-width: 860px) { .step .arrow { display: none; } }

/* ============================ dashboard embed ============================ */
.dash-frame { border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--ink-850); }
.dash-frame .term-bar .title { color: var(--coral); }
.dash-frame iframe { width: 100%; height: 760px; border: 0; display: block; background: #0b0e13; }
@media (max-width: 700px) { .dash-frame iframe { height: 1180px; } }

/* ============================ footer ============================ */
footer { border-top: 1px solid var(--line); padding: 64px 0 48px; }
.foot-grid { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; flex-wrap: wrap; }
.foot-grid h3 { font-size: clamp(26px, 4vw, 40px); }
.foot-grid .mono { color: var(--text-dim); font-size: 12.5px; margin-top: 14px; }
.foot-links { display: flex; gap: 22px; font-family: var(--font-mono); font-size: 13px; }
.foot-links a { color: var(--text); display: inline-flex; gap: 8px; align-items: center; transition: color 0.2s; }
.foot-links a:hover { color: var(--brand); }
.colophon { margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; letter-spacing: 0.04em; }

/* ============================ reveal animation ============================ */
/* Scoped under .js (added by main.js): if JS never runs or fails to load, content
   stays fully visible instead of being stuck at opacity:0. */
.js [data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* ============================ keyframes ============================ */
@keyframes rise { to { transform: translateY(0); } }
@keyframes fade { to { opacity: 1; } }
@keyframes fade-up { to { opacity: 1; transform: none; } }
@keyframes blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 4px rgba(244, 169, 60, 0.16); } 50% { box-shadow: 0 0 0 7px rgba(244, 169, 60, 0.05); } }
@keyframes slide { to { transform: translateX(-50%); } }
