/* Sentinel — plain CSS port of the original Tailwind/oklch design tokens */

@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Manrope:wght@400;500;700&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  --radius: 12px;
  --background: oklch(0.11 0.032 262);
  --foreground: oklch(0.97 0.008 240);
  --panel: oklch(0.16 0.038 262);
  --gold: oklch(0.72 0.17 250);
  --gold-dim: oklch(0.6 0.12 250);
  --hairline: oklch(0.72 0.17 250 / 22%);
  --primary: oklch(0.62 0.2 258);
  --primary-foreground: oklch(0.98 0.01 240);
  --secondary: oklch(0.26 0.05 258);
  --muted-foreground: oklch(0.74 0.025 240);
  --destructive: oklch(0.62 0.19 25);
  --border: oklch(1 0 0 / 12%);
  --input: oklch(1 0 0 / 16%);

  --font-display: "Space Grotesk", "Helvetica Neue", sans-serif;
  --font-sub: "Manrope", "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sub);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }

.max-w-6xl { max-width: 72rem; margin-inline: auto; padding-inline: 1.5rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-2xl { max-width: 42rem; }

/* ---------- Nav ---------- */
.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 50;
  padding: 1rem;
}

.site-nav {
  position: relative;
  margin-inline: auto;
  max-width: 72rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: 1.25rem;
  gap: 0.75rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.site-nav.scrolled {
  border: 1px solid oklch(1 0 0 / 14%);
  background: oklch(1 0 0 / 6%);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px oklch(0 0 0 / 20%);
}

.brand { display: flex; align-items: center; gap: 0.625rem; }
.brand-mark { height: 1.75rem; width: auto; display: block; }
.brand-text { display: flex; align-items: baseline; gap: 0.75rem; }
.brand-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.brand-tag {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.28em;
  color: var(--gold);
  text-transform: uppercase;
  display: none;
}

.nav-links {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  background: oklch(0.14 0.035 262 / 98%);
  border: 1px solid var(--hairline);
  border-radius: 1rem;
  padding: 0.5rem;
  backdrop-filter: blur(12px);
}
.nav-links.open { display: flex; }
.nav-links li { border-bottom: 1px solid var(--hairline); }
.nav-links li:last-child { border-bottom: none; }
.nav-links a {
  display: block;
  padding: 0.75rem 0.5rem;
  font-family: var(--font-sub);
  font-size: 0.875rem;
  color: var(--muted-foreground);
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--foreground); }

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 1.25rem;
  height: 2px;
  background: var(--foreground);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.btn-pill {
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 0.5rem 1.25rem;
  font-family: var(--font-sub);
  font-size: 0.875rem;
  font-weight: 500;
  transition: opacity 0.2s ease;
  display: inline-block;
}
.btn-pill:hover { opacity: 0.9; }

@media (min-width: 640px) { .brand-tag { display: inline; } }
@media (min-width: 768px) {
  .nav-toggle { display: none; }
  .nav-links {
    display: flex;
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
    background: none;
    border: none;
    padding: 0;
    backdrop-filter: none;
  }
  .nav-links li { border-bottom: none; }
  .nav-links a { padding: 0; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-top: 10rem;
  padding-bottom: 8rem;
  background: linear-gradient(180deg, oklch(0.13 0.04 262), oklch(0.1 0.03 262));
}

.hero::before {
  content: "";
  position: absolute;
  inset: -25%;
  z-index: 0;
  background:
    radial-gradient(70% 90% at 74% 48%, oklch(0.42 0.19 258 / 55%), transparent 62%),
    radial-gradient(50% 60% at 95% 40%, oklch(0.55 0.2 250 / 35%), transparent 70%),
    radial-gradient(45% 55% at 18% 74%, oklch(0.72 0.17 250 / 22%), transparent 65%);
  animation: hero-drift 24s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes hero-drift {
  0%   { transform: translate3d(0, 0, 0) scale(1) rotate(0deg); }
  50%  { transform: translate3d(-3%, 2%, 0) scale(1.08) rotate(3deg); }
  100% { transform: translate3d(3%, -2%, 0) scale(1.05) rotate(-2deg); }
}

@media (prefers-reduced-motion: reduce) {
  .hero::before { animation: none; }
}

.hero-fade {
  pointer-events: none;
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 12rem;
  z-index: 1;
  background: linear-gradient(to bottom, transparent, var(--background));
}

.hero-inner { position: relative; z-index: 2; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0;
}

.hero h1 {
  margin: 2rem 0 0;
  font-family: var(--font-display);
  font-size: 3rem;
  line-height: 1.05;
  font-weight: 200;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.gold-rule {
  margin-top: 2rem;
  height: 1px;
  width: 10rem;
  background: linear-gradient(to right, var(--gold), transparent);
}

.hero-lead {
  margin-top: 2rem;
  max-width: 48rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.3;
  font-weight: 300;
}

.hero-sub {
  margin-top: 1.5rem;
  max-width: 42rem;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--muted-foreground);
}

.hero-actions {
  margin-top: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 0.75rem 1.75rem;
  font-family: var(--font-sub);
  font-size: 0.875rem;
  font-weight: 500;
  transition: transform 0.2s ease;
}
.btn-primary:hover { transform: translateY(-2px); }

.btn-glass {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 999px;
  border: 1px solid oklch(1 0 0 / 14%);
  background: oklch(1 0 0 / 6%);
  backdrop-filter: blur(12px);
  padding: 0.75rem 1.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s ease;
}
.btn-glass:hover { color: var(--gold); }

@media (min-width: 640px) {
  .hero h1 { font-size: 4.5rem; }
  .hero-lead { font-size: 1.875rem; }
  .hero-sub { font-size: 1.125rem; }
}

/* ---------- Sections ---------- */
.section {
  border-top: 1px solid var(--hairline);
  padding-block: 6rem;
}

.section-head { display: flex; align-items: baseline; gap: 1.5rem; }

.index-num { font-family: var(--font-mono); font-size: 0.75rem; color: var(--gold-dim); }

.label-caps {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin: 0;
}

.section h2 {
  margin: 1.5rem 0 0;
  max-width: 56rem;
  font-family: var(--font-display);
  font-size: 2.25rem;
  line-height: 1.2;
  font-weight: 300;
}
@media (min-width: 640px) { .section h2 { font-size: 3rem; } }

.section-body { margin-top: 3rem; }

/* Problem list */
.problem-list li {
  display: flex;
  gap: 2rem;
  padding-block: 2rem;
  border-top: 1px solid var(--hairline);
}
.problem-list li:first-child { border-top: 0; padding-top: 0; }
.problem-list .idx { font-family: var(--font-mono); font-size: 0.75rem; color: var(--gold); flex-shrink: 0; }
.problem-list p { margin: 0; font-size: 1.125rem; line-height: 1.6; color: var(--muted-foreground); }

/* Engines */
.engine-grid { display: grid; gap: 1px; background: var(--hairline); }
@media (min-width: 768px) { .engine-grid { grid-template-columns: 1fr 1fr; } }
.engine-card { background: var(--panel); padding: 2rem; }
.engine-card h3 { margin: 1rem 0 0; font-family: var(--font-display); font-size: 1.875rem; font-weight: 300; }
.engine-card > p { margin-top: 1.5rem; font-size: 1rem; line-height: 1.6; color: var(--muted-foreground); }
.engine-card ul, .engine-card ol { margin-top: 2rem; display: flex; flex-direction: column; gap: 0.5rem; }
.engine-card li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid oklch(1 0 0 / 8%);
  padding-bottom: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}
.engine-card li span:last-child { color: var(--gold-dim); }
.engine-card ol li .p-num { color: var(--gold); }

.engine-closer {
  margin-top: 3rem;
  max-width: 56rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--hairline);
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.3;
  font-weight: 300;
}

/* Methodology */
.method-grid { display: grid; gap: 3rem; }
@media (min-width: 1024px) { .method-grid { grid-template-columns: 1fr 1fr; } }

.dim-row { margin-bottom: 1rem; }
.dim-row-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--muted-foreground);
}
.dim-row-head span:first-child { color: var(--foreground); }
.dim-row-head span:last-child { color: var(--gold); }
.dim-bar-track { margin-top: 0.5rem; height: 3px; width: 100%; background: var(--secondary); }
.dim-bar-fill { height: 100%; background: var(--gold); }

.rollup {
  margin-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 1rem;
  border-top: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}
.rollup span:first-child { color: var(--gold-dim); }

.tier-grid { margin-top: 1.5rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--hairline); }
.tier-card { background: var(--panel); padding: 1rem; }
.tier-card p:first-child { margin: 0; font-family: var(--font-mono); font-size: 0.875rem; color: var(--gold); }
.tier-card p:last-child { margin: 0.5rem 0 0; font-family: var(--font-mono); font-size: 0.6875rem; color: var(--muted-foreground); }

.roles-svg { margin-top: 1.5rem; width: 100%; height: auto; }

.layer-list { margin-top: 1.5rem; border: 1px solid var(--border); }
.layer-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}
.layer-list li:last-child { border-bottom: 0; }
.layer-list li span:last-child { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--gold-dim); }

.output-box {
  margin-top: 2rem;
  border: 1px solid var(--hairline);
  background: var(--panel);
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  line-height: 1.6;
  color: var(--muted-foreground);
}
.output-box p { margin: 0; }
.output-box p:first-child { color: var(--gold-dim); }
.output-box p:not(:first-child) { color: var(--foreground); margin-top: 0.5rem; }

/* Validation */
.validation-grid { display: grid; gap: 3rem; }
@media (min-width: 1024px) { .validation-grid { grid-template-columns: 2fr 1fr; } }
.panel-box { border: 1px solid var(--hairline); background: var(--panel); padding: 2rem; }
.panel-box .lede { margin-top: 1.5rem; font-family: var(--font-display); font-size: 1.5rem; line-height: 1.3; font-weight: 300; }
.panel-box .flag {
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
.crosscheck-list { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 0.75rem; }
.crosscheck-list li { font-family: var(--font-mono); font-size: 0.75rem; }

.workbook-grid { margin-top: 1.5rem; display: grid; gap: 1px; background: var(--hairline); }
@media (min-width: 640px) { .workbook-grid { grid-template-columns: repeat(3, 1fr); } }
.workbook-card { background: var(--panel); padding: 1.5rem; }
.workbook-card p:first-child { margin: 0; font-family: var(--font-display); font-size: 1.5rem; font-weight: 300; }
.workbook-card p:last-child { margin: 0.5rem 0 0; font-family: var(--font-mono); font-size: 0.6875rem; color: var(--muted-foreground); }

/* Console */
.console-frame { position: relative; margin-top: 3rem; border: 1px solid var(--hairline); background: var(--panel); border-radius: 1rem; overflow: hidden; }
.console-titlebar { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--hairline); padding: 0.5rem 1rem; }
.console-titlebar span { font-family: var(--font-mono); font-size: 0.625rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold-dim); }
.live-dot { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--gold) !important; }
.live-dot::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--gold); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

.console-dashboard {
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(60% 80% at 30% 20%, oklch(0.42 0.19 258 / 45%), transparent 60%),
    linear-gradient(160deg, oklch(0.16 0.04 262), oklch(0.1 0.03 262));
}
@media (min-width: 768px) { .console-dashboard { flex-direction: row; } }

.console-graph { flex: 1 1 60%; padding: 1.5rem; display: flex; align-items: center; min-width: 0; }
.console-graph svg { width: 100%; height: auto; display: block; }

.node { fill: oklch(0.32 0.05 258); stroke: var(--hairline); stroke-width: 1; }
.node-cascade { fill: var(--gold); animation: node-pulse 2.4s ease-in-out infinite; }
.node-pivot { fill: var(--destructive); stroke: var(--gold); stroke-width: 2; }
@keyframes node-pulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

.edge { fill: none; }
.edge-static { stroke: var(--hairline); stroke-width: 1; }
.edge-cascade { stroke: var(--gold); stroke-width: 2; stroke-dasharray: 6 6; opacity: 0.9; animation: edge-flow 2.4s linear infinite; }
@keyframes edge-flow { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }

.node-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-anchor: middle;
  fill: var(--muted-foreground);
}

.console-panel {
  flex: 1 1 40%;
  padding: 1.5rem;
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
@media (min-width: 768px) {
  .console-panel { border-top: none; border-left: 1px solid var(--hairline); max-width: 300px; }
}

.console-readout { display: flex; flex-direction: column; gap: 0.375rem; }
.readout-value { font-family: var(--font-display); font-size: 1.5rem; font-weight: 300; color: var(--foreground); }
.readout-alert { font-family: var(--font-mono); font-size: 1rem; color: var(--gold); }

.console-log { display: flex; flex-direction: column; gap: 0.625rem; margin: auto 0 0; padding: 0; }
.console-log li { list-style: none; font-family: var(--font-mono); font-size: 0.6875rem; line-height: 1.5; color: var(--muted-foreground); }
.console-log .t { display: block; color: var(--gold-dim); letter-spacing: 0.1em; }

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-inline: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  border-radius: 0 0 1rem 1rem;
  overflow: hidden;
}
@media (min-width: 640px) { .metrics-grid { grid-template-columns: repeat(4, 1fr); } }
.metric { padding: 1.5rem; border-top: 1px solid var(--hairline); }
.metric dt { margin: 0; }
.metric dd { margin: 0.75rem 0 0; font-family: var(--font-mono); font-size: 1.5rem; }

.capability-grid { margin-top: 4rem; display: grid; gap: 1px; }
@media (min-width: 640px) { .capability-grid { grid-template-columns: repeat(3, 1fr); } }
.capability-card { border: 1px solid var(--hairline); background: var(--panel); padding: 1.5rem; border-radius: 1rem; }
.capability-card .tag { font-family: var(--font-mono); font-size: 0.625rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); }
.capability-card h3 { margin: 1rem 0 0; font-family: var(--font-display); font-size: 1.5rem; line-height: 1.3; font-weight: 300; }
.capability-card p { margin-top: 0.75rem; font-size: 1rem; line-height: 1.6; color: var(--muted-foreground); }

/* CTA */
.cta-btn {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--gold);
  padding: 0.75rem 2rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  transition: background-color 0.2s ease, color 0.2s ease;
  background: transparent;
  cursor: pointer;
}
.cta-btn:hover { background: var(--gold); color: var(--primary-foreground); }

/* Contact form */
.contact-form { max-width: 42rem; }
.form-grid { display: grid; gap: 1.5rem; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.field-group { margin-top: 1.5rem; }
.form-grid .field-group { margin-top: 0; }
.field-group input,
.field-group select,
.field-group textarea {
  margin-top: 0.5rem;
  width: 100%;
  border: 1px solid var(--input);
  background: var(--background);
  color: var(--foreground);
  padding: 0.75rem 1rem;
  font-family: var(--font-sub);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease;
}
.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus { border-color: var(--gold); }
.field-error { margin-top: 0.5rem; font-family: var(--font-mono); font-size: 0.6875rem; color: var(--destructive); }

.form-notice {
  margin-bottom: 1.5rem;
  border: 1px solid var(--hairline);
  background: var(--panel);
  padding: 1rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.6;
}
.form-notice.success { color: var(--gold); }
.form-notice.error { color: var(--destructive); }

/* Contact page layout */
.contact-hero { border-top: 1px solid var(--hairline); padding-top: 10rem; padding-bottom: 6rem; }
.contact-hero h1 {
  margin: 1.5rem 0 0;
  max-width: 56rem;
  font-family: var(--font-display);
  font-size: 2.25rem;
  line-height: 1.2;
  font-weight: 300;
}
@media (min-width: 640px) { .contact-hero h1 { font-size: 3rem; } }
.contact-hero p { margin-top: 2rem; max-width: 48rem; font-size: 1.125rem; line-height: 1.6; color: var(--muted-foreground); }

.contact-layout { display: grid; gap: 4rem; padding-block: 6rem; }
@media (min-width: 1024px) { .contact-layout { grid-template-columns: 1.2fr 0.8fr; } }
.contact-aside { display: flex; flex-direction: column; gap: 2.5rem; }
.contact-aside ul { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.75rem; font-size: 0.875rem; line-height: 1.6; color: var(--muted-foreground); }
.contact-aside p.body { margin-top: 1rem; font-size: 0.875rem; line-height: 1.6; color: var(--muted-foreground); }
.contact-aside p.mono-body {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.6;
  color: var(--muted-foreground);
}

/* Footer */
.site-footer { border-top: 1px solid var(--hairline); padding-block: 3rem; }
.site-footer .inner { display: flex; flex-direction: column; gap: 1rem; justify-content: space-between; }
@media (min-width: 640px) { .site-footer .inner { flex-direction: row; align-items: baseline; } }
.site-footer .brandline { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.32em; text-transform: uppercase; margin: 0; }
.site-footer .tagline { font-size: 0.875rem; color: var(--muted-foreground); margin: 0; }
