/* ================================================================
   AIGP DOCS — DESIGN SYSTEM v1.0
   F1 engineering aesthetic · monochrome + one accent (#00a896)
   Single source of truth for every file in documents/
   ================================================================ */

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

:root {
  /* === surfaces (jet → graphite) === */
  --jet: #0a0a0b;
  --graphite-1: #111214;
  --graphite-2: #17191b;
  --graphite-3: #1f2124;

  /* === lines === */
  --line: #2b2e32;
  --line-bright: #3a3e43;

  /* === type === */
  --dim: #5a5e63;
  --silver: #a8acb1;
  --snow: #eef0f2;

  /* === single accent === */
  --petronas: #00a896;
  --petronas-bright: #00c2ad;
  --petronas-glow: rgba(0, 168, 150, 0.45);

  /* === rare annotation === */
  --amber: #d8a93a;
  --amber-glow: rgba(216, 169, 58, 0.45);

  /* === motion === */
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
  --fast: 120ms;
  --med: 220ms;

  /* === spacing (8px grid) === */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-12: 48px;
  --s-16: 64px;
  --s-20: 80px;

  /* === radii (sharp) === */
  --r-1: 2px;
  --r-2: 4px;
  --r-3: 6px;

  /* === layout === */
  --max: 960px;
}

/* === reset === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  background: var(--jet);
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Helvetica Neue', sans-serif;
  font-weight: 400;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--silver);
  background: var(--jet);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;

  /* CAD-paper dot grid at 3% opacity */
  background-image: radial-gradient(circle, rgba(168, 172, 177, 0.035) 1px, transparent 1px);
  background-size: 24px 24px;
  background-attachment: fixed;
}

/* === layout wrapper === */
.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px var(--s-16);
}

/* === top nav === */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 10, 11, 0.85);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
}

.brand {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--snow);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
}

.brand::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--petronas);
  box-shadow: 0 0 10px var(--petronas-glow);
  border-radius: 1px;
  flex-shrink: 0;
}

.brand span {
  color: var(--dim);
  font-weight: 400;
  letter-spacing: 0.22em;
  font-size: 11px;
  margin-left: 2px;
}

nav a.nl {
  font-size: 12px;
  font-weight: 400;
  color: var(--silver);
  text-decoration: none;
  margin-left: var(--s-6);
  transition: color var(--fast) var(--ease);
  border: none;
}

nav a.nl:hover { color: var(--snow); }

nav .spacer { flex: 1; }

.status-stamp {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--dim);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.08em;
}

.status-stamp::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--petronas);
  box-shadow: 0 0 6px var(--petronas-glow);
  border-radius: 1px;
  display: inline-block;
}

/* === typography === */
h1 {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 32px;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--snow);
  margin-bottom: var(--s-3);
}

h2 {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--snow);
  margin: var(--s-16) 0 var(--s-4);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
}

h3 {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 13.5px;
  letter-spacing: 0;
  color: var(--snow);
  margin: var(--s-6) 0 var(--s-2);
}

p {
  color: var(--silver);
  margin: 0 0 var(--s-3);
}

a {
  color: var(--petronas-bright);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--fast) var(--ease);
}

a:hover { border-bottom-color: var(--petronas); }

ul, ol {
  padding-left: var(--s-5);
  margin: var(--s-2) 0 var(--s-3);
  color: var(--silver);
}

li { margin: var(--s-1) 0; }

hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: var(--s-8) 0;
}

/* === section number + eyebrow === */
.section-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--petronas);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: var(--s-3);
  display: block;
}

.sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.08em;
  margin-bottom: var(--s-8);
}

/* === code + data === */
code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--snow);
  background: var(--graphite-2);
  padding: 1px 6px;
  border-radius: var(--r-1);
  border: 1px solid var(--line);
}

pre {
  background: var(--graphite-1);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: var(--s-4);
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.6;
  color: var(--silver);
  margin: var(--s-3) 0;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* === hero card with corner brackets === */
.hero-card {
  position: relative;
  padding: var(--s-12) var(--s-8) var(--s-8);
  background:
    linear-gradient(180deg, var(--graphite-1) 0%, rgba(10,10,11,0.4) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  margin: var(--s-12) 0 var(--s-8);
}

.corner-bracket {
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
}
.corner-bracket.tl { top: -1px; left: -1px; border-top: 1px solid var(--petronas); border-left: 1px solid var(--petronas); }
.corner-bracket.tr { top: -1px; right: -1px; border-top: 1px solid var(--petronas); border-right: 1px solid var(--petronas); }
.corner-bracket.bl { bottom: -1px; left: -1px; border-bottom: 1px solid var(--petronas); border-left: 1px solid var(--petronas); }
.corner-bracket.br { bottom: -1px; right: -1px; border-bottom: 1px solid var(--petronas); border-right: 1px solid var(--petronas); }

.hero-lede {
  max-width: 560px;
  color: var(--silver);
  font-size: 15px;
  line-height: 1.65;
}

/* === data sheet (spec table) === */
.datasheet {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  margin-top: var(--s-12);
  border-top: 1px solid var(--line);
}

.datasheet > * {
  padding: var(--s-3) var(--s-2);
  border-bottom: 1px solid var(--line);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.5;
}

.datasheet .key {
  color: var(--dim);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 10px;
  padding-top: calc(var(--s-3) + 2px);
}

.datasheet .val {
  color: var(--snow);
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  font-weight: 400;
}

.datasheet .meta {
  color: var(--silver);
  text-align: right;
  letter-spacing: 0.06em;
}

.datasheet .val.now::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--petronas);
  box-shadow: 0 0 6px var(--petronas-glow);
  border-radius: 1px;
  margin-right: var(--s-3);
  vertical-align: middle;
}

/* === telemetry tile === */
.tile {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: var(--s-4) var(--s-4) var(--s-5);
  background: var(--graphite-1);
  transition: border-color var(--fast) var(--ease);
}

.tile:hover { border-color: var(--line-bright); }

.tile .label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: var(--s-3);
}

.tile .value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 28px;
  font-weight: 400;
  color: var(--snow);
  letter-spacing: -0.02em;
  line-height: 1;
}

.tile .value .unit {
  font-size: 13px;
  color: var(--dim);
  margin-left: 2px;
  letter-spacing: 0;
}

.tile .value .ms {
  font-size: 20px;
  color: var(--dim);
}

.tile .bar {
  height: 2px;
  background: var(--graphite-3);
  margin-top: var(--s-3);
  position: relative;
  overflow: hidden;
}

.tile .bar::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--pct, 40%);
  background: var(--petronas);
}

/* === callouts (3 intensity, never red) === */
.callout {
  padding: var(--s-3) var(--s-4);
  margin: var(--s-4) 0;
  background: var(--graphite-1);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  font-size: 13px;
  color: var(--silver);
  line-height: 1.6;
}

.callout.live {
  border-left: 2px solid var(--petronas);
  padding-left: calc(var(--s-4) - 1px);
}

.callout.alert {
  position: relative;
  padding-left: calc(var(--s-4) + 14px);
}
.callout.alert::before {
  content: '';
  position: absolute;
  left: var(--s-4);
  top: var(--s-4);
  width: 6px;
  height: 6px;
  background: var(--amber);
  box-shadow: 0 0 6px var(--amber-glow);
  border-radius: 1px;
}

.callout.retired {
  border-color: var(--graphite-3);
  color: var(--dim);
  background: transparent;
}
.callout.retired b { color: var(--silver); }

.callout b, .callout strong { color: var(--snow); font-weight: 500; }

/* === tables === */
table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--s-4) 0 var(--s-6);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--silver);
}

table th {
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: left;
  color: var(--dim);
  padding: var(--s-3) var(--s-3);
  border-bottom: 1px solid var(--line-bright);
}

table td {
  padding: var(--s-3);
  border-bottom: 1px solid var(--line);
  color: var(--silver);
  vertical-align: top;
}

table tr:hover td { background: rgba(255, 255, 255, 0.02); }

table td.num, table th.num,
table td[data-num], table th[data-num] {
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--snow);
}

table td.metric { color: var(--petronas-bright); font-weight: 500; }
table td.retired { color: var(--dim); text-decoration: line-through; }

/* === status LED === */
.led {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--petronas);
  box-shadow: 0 0 6px var(--petronas-glow);
  border-radius: 1px;
  margin-right: var(--s-2);
  vertical-align: middle;
  flex-shrink: 0;
}

.led.dim { background: var(--dim); box-shadow: none; }
.led.amber { background: var(--amber); box-shadow: 0 0 6px var(--amber-glow); }

/* === card grid (all cards same weight, accent only on .active) === */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-3);
  margin-top: var(--s-3);
}

.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  padding: var(--s-4);
  background: var(--graphite-1);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  text-decoration: none;
  color: var(--silver);
  border-bottom: 1px solid var(--line);
}

.card:hover {
  border-color: var(--line-bright);
  background: var(--graphite-2);
}

.card.active {
  border-left: 2px solid var(--petronas);
  padding-left: calc(var(--s-4) - 1px);
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-1);
}

.card h3 {
  font-size: 14px;
  font-weight: 500;
  color: var(--snow);
  margin: 0;
  letter-spacing: -0.005em;
}

.card .tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--dim);
  text-transform: uppercase;
  flex-shrink: 0;
}
.card.active .tag { color: var(--petronas); }

.card p {
  font-size: 12.5px;
  color: var(--silver);
  margin: 0;
  flex: 1;
  line-height: 1.6;
}

.card-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--dim);
  margin-top: var(--s-2);
  padding-top: var(--s-3);
  border-top: 1px solid var(--line);
  display: flex;
  gap: var(--s-2);
  letter-spacing: 0.06em;
}

.card-meta .sep::before {
  content: '·';
  margin: 0 var(--s-1);
  color: var(--dim);
}

/* === sector timeline === */
.sector-line {
  position: relative;
  height: 72px;
  margin: var(--s-8) 0 var(--s-6);
}

.sector-line .rule {
  position: absolute;
  top: 28px;
  left: 12px;
  right: 12px;
  height: 1px;
  background: var(--line-bright);
}

.sector-line .tick {
  position: absolute;
  top: 20px;
  width: 1px;
  height: 16px;
  background: var(--dim);
  transform: translateX(-50%);
}

.sector-line .tick.active {
  background: var(--petronas);
  box-shadow: 0 0 6px var(--petronas-glow);
  width: 2px;
  height: 22px;
  top: 17px;
}

.sector-line .tick-label {
  position: absolute;
  top: 0;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
  transform: translateX(-50%);
  text-align: center;
}

.sector-line .tick-sub {
  position: absolute;
  top: 48px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--silver);
  letter-spacing: 0.06em;
  white-space: nowrap;
  transform: translateX(-50%);
  text-align: center;
}

.sector-line .tick.active ~ .tick-label.active,
.sector-line .tick-label.active { color: var(--snow); }

/* === pipeline map (replaces ASCII) === */
.pipeline-map {
  position: relative;
  padding: var(--s-6) var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--graphite-1);
  margin: var(--s-4) 0;
}

.pipeline-map .corner-bracket {
  width: 10px;
  height: 10px;
}

/* === lap stamp footer === */
.lap-stamp {
  margin-top: var(--s-20);
  padding: var(--s-4) 0;
  border-top: 1px solid var(--line);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--dim);
  display: flex;
  justify-content: space-between;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lap-stamp a { color: var(--dim); }
.lap-stamp a:hover { color: var(--silver); border-bottom-color: transparent; }

/* === misc helpers === */
.mono { font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; }
.dim { color: var(--dim); }
.snow { color: var(--snow); }
.accent { color: var(--petronas-bright); }
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: var(--s-8); }

/* === responsive === */
@media (max-width: 768px) {
  .page { padding: 0 20px var(--s-12); }
  nav { padding: 0 20px; }
  h1 { font-size: 26px; }
  h2 { font-size: 17px; }
  .hero-card { padding: var(--s-8) var(--s-5); }
  .grid, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .datasheet { grid-template-columns: 80px 1fr; }
  .datasheet .meta { grid-column: 2; text-align: left; color: var(--dim); font-size: 11px; padding-top: 0; }
  .lap-stamp { flex-direction: column; gap: var(--s-2); }
  nav .nl { margin-left: var(--s-3); }
}
