@import url("/assets/fonts/fonts.css");

/* ============ tokens ============ */
:root {
  --paper: #FAFAF8;
  --ink: #17161A;
  --ink-2: #5A5762;
  --hair: #E4E2E8;
  --violet: #7C3AED;
  --violet-d: #5B21B6;
  --surface: #FFFFFF;
  --c1: #7C3AED; /* categorical, fixed order */
  --c2: #0D9488;
  --c3: #B45309;
  --c4: #3B5BDB;
  --c-other: #8B8794;
  --display: "Bricolage Grotesque", Georgia, serif;
  --body: "IBM Plex Sans", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", Menlo, monospace;
}

/* ============ base ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { overflow-x: clip; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--violet); color: #fff; }
a { color: inherit; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 clamp(24px, 6vw, 72px); }

/* ============ header ============ */
.site-head { border-bottom: 2.5px solid var(--violet); }
.site-head .wrap {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-top: 22px; padding-bottom: 18px;
}
.brand { font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; text-decoration: none; }
.brand b { color: var(--violet); font-weight: 500; }
.head-meta { font-family: var(--mono); font-size: 12px; color: var(--ink-2); letter-spacing: .04em; }

/* ============ hero ============ */
.hero { padding-top: clamp(64px, 12vh, 128px); padding-bottom: clamp(48px, 8vh, 88px); }
.hero h1 {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(2.1rem, 9vw, 5.4rem);
  line-height: 1.02; letter-spacing: -0.022em;
  max-width: 16ch;
}
.hero h1 em { font-style: normal; color: var(--violet); }
.hero .statement {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.25rem, 2.6vw, 1.7rem);
  line-height: 1.3; letter-spacing: -0.01em;
  max-width: 30ch; margin-top: 28px;
}
.hero .kicker {
  font-family: var(--mono); font-size: 13px; color: var(--ink-2);
  letter-spacing: .06em; margin-top: 26px;
}
.hero .kicker span + span::before { content: "·"; margin: 0 10px; color: var(--violet); }
.hero .lede { max-width: 62ch; margin-top: 30px; color: var(--ink-2); font-size: 1.05rem; }

/* ============ sections ============ */
.section { border-top: 1px solid var(--hair); padding: clamp(44px, 7vh, 72px) 0; }
.section-grid { display: grid; grid-template-columns: 170px 1fr; gap: clamp(28px, 5vw, 64px); }
.sec-label {
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2);
  padding-top: 6px;
}
.sec-label::before { content: ""; display: block; width: 28px; height: 2.5px; background: var(--violet); margin-bottom: 12px; }

/* work entries — typographic, no card chrome */
.entry { padding: 26px 0; }
.entry + .entry { border-top: 1px solid var(--hair); }
.entry h3 { font-family: var(--display); font-weight: 600; font-size: 1.35rem; letter-spacing: -0.01em; }
.entry .meta { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); letter-spacing: .04em; margin-top: 6px; }
.entry p { margin-top: 12px; max-width: 62ch; color: var(--ink-2); }
.entry p strong { color: var(--ink); font-weight: 600; }

/* timeline */
.tl { list-style: none; }
.tl li { display: grid; grid-template-columns: 128px 1fr; gap: 24px; padding: 13px 0; border-top: 1px solid var(--hair); }
.tl li:first-child { border-top: 0; }
.tl .yr { font-family: var(--mono); font-size: 13px; color: var(--ink-2); padding-top: 2px; }
.tl .what strong { font-weight: 600; }
.tl .what span { color: var(--ink-2); }

/* what-i-bring list */
.bring { list-style: none; counter-reset: bring; }
.bring li { padding: 22px 0; border-top: 1px solid var(--hair); max-width: 70ch; }
.bring li:first-child { border-top: 0; padding-top: 0; }
.bring h3 { font-family: var(--display); font-weight: 600; font-size: 1.18rem; margin-bottom: 8px; }
.bring p { color: var(--ink-2); }
.bring p strong { color: var(--ink); font-weight: 600; }

/* prose */
.prose { max-width: 66ch; }
.prose p + p { margin-top: 16px; }
.prose a { color: var(--violet-d); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.srcnote { font-family: var(--mono); font-size: 12px; color: var(--ink-2); margin-top: 14px; }
.srcnote a { color: var(--ink-2); }

/* buttons */
.btn {
  display: inline-block; font-family: var(--mono); font-size: 13px; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase; text-decoration: none;
  border: 1.5px solid var(--ink); padding: 13px 22px; color: var(--ink);
  transition: background .18s cubic-bezier(.22,1,.36,1), color .18s cubic-bezier(.22,1,.36,1), border-color .18s;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn-violet { border-color: var(--violet); color: var(--violet-d); }
.btn-violet:hover { background: var(--violet); border-color: var(--violet); color: #fff; }

/* contact + footer */
.contact-mail {
  font-family: var(--mono); font-size: clamp(1.05rem, 2.4vw, 1.5rem);
  text-decoration: none; border-bottom: 2.5px solid var(--violet);
  padding-bottom: 3px; transition: color .18s;
}
.contact-mail:hover { color: var(--violet-d); }
.site-foot { border-top: 1px solid var(--hair); }
.site-foot .wrap { padding-top: 26px; padding-bottom: 40px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-foot p { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }

/* ============ fleet console ============ */
.console { background: var(--surface); border: 1px solid var(--hair); }
.console-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 16px 20px; border-bottom: 1px solid var(--hair);
}
.console-title { font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }
.console-title b { color: var(--violet); font-weight: 500; }
.console-note { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); }
.console-body { padding: 20px; display: grid; gap: 28px; }
.panel { min-width: 0; max-width: 100%; }
#fleet-bars, #spend-chart, #review-chart { overflow-x: auto; }
.panel h4 { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 4px; }
.panel .sub { font-size: 13.5px; color: var(--ink-2); margin-bottom: 12px; max-width: 70ch; }
.panel svg { display: block; width: 100%; height: auto; }
.panel .fnote { font-family: var(--mono); font-size: 11px; color: var(--ink-2); margin-top: 10px; }

.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.legend span { font-size: 12.5px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; display: inline-block; }

/* agent detail list (panel A) */
.agent-list { border-top: 1px solid var(--hair); margin-top: 12px; }
.agent-list .row {
  display: grid; grid-template-columns: 1fr 90px 90px 90px 90px; gap: 10px;
  font-family: var(--mono); font-size: 12.5px; padding: 8px 0; border-bottom: 1px solid var(--hair);
}
.agent-list .row.hd { color: var(--ink-2); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.agent-list .row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-production { color: var(--violet-d); }
.status-pilot { color: var(--c3); }

/* decision rules (panel C) */
.rules { border-left: 2.5px solid var(--violet); padding: 4px 0 4px 18px; margin-top: 14px; max-width: 66ch; }
.rules p { font-size: 13.5px; color: var(--ink-2); }
.rules p strong { color: var(--ink); font-weight: 600; }
.rules code { font-family: var(--mono); font-size: 12.5px; color: var(--ink); }

/* tooltip */
.tip {
  position: absolute; z-index: 10; pointer-events: none;
  background: var(--ink); color: var(--paper);
  font-family: var(--mono); font-size: 12px; line-height: 1.5;
  padding: 8px 10px; max-width: 240px;
  opacity: 0; transition: opacity .12s;
}
.tip.on { opacity: 1; }
.tip b { color: #C9B2F5; font-weight: 500; }

/* data table fallback */
.data-fallback { margin-top: 14px; }
.data-fallback summary { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.data-fallback table { border-collapse: collapse; margin-top: 10px; font-size: 13px; }
.data-fallback th, .data-fallback td { border: 1px solid var(--hair); padding: 6px 10px; text-align: left; font-family: var(--mono); font-size: 12px; }
.data-fallback th { background: var(--paper); }

/* ============ motion ============ */
.reveal { opacity: 0; transform: translateY(10px); animation: rise .65s cubic-bezier(.22,1,.36,1) forwards; }
.d1 { animation-delay: .05s; } .d2 { animation-delay: .15s; } .d3 { animation-delay: .25s; }
.d4 { animation-delay: .35s; } .d5 { animation-delay: .45s; }
@keyframes rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
  .btn, .contact-mail, .tip { transition: none; }
}

/* focus */
a:focus-visible, .btn:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2.5px solid var(--violet); outline-offset: 3px;
}

/* ============ responsive ============ */
@media (max-width: 640px) {
  #fleet-bars svg, #spend-chart svg, #review-chart svg { min-width: 560px; }
}
@media (max-width: 760px) {
  .section-grid { grid-template-columns: 1fr; gap: 20px; }
  .tl li { grid-template-columns: 92px 1fr; gap: 14px; }
  .agent-list .row { grid-template-columns: 1fr 70px 70px; }
  .agent-list .row span:nth-child(4), .agent-list .row span:nth-child(5) { display: none; }
  .console-body { padding: 16px; }
}
@media (max-width: 380px) {
  body { font-size: 15.5px; }
  .agent-list .row { grid-template-columns: 1fr 64px 64px; gap: 6px; }
}
