/* === TOKENS === */

:root[data-theme="dark"] {
  --bg-base:        #0A0A0B;
  --bg-grad-from:   #0E1116;
  --bg-grad-to:     #0A0A0B;
  --surface:        #13161B;
  --text:           #E5E7EB;
  --muted:          #9CA3AF;
  --accent:         #22D3EE;
  /* Text/contrast-critical variant of --accent. Dark theme's --accent already
     passes WCAG AA (4.5:1+) as text, so this is just an alias — token exists
     so light theme can diverge without touching --accent itself. */
  --accent-text:    #22D3EE;
  --accent-purple:  #A78BFA;
  --border:         rgba(255,255,255,0.08);
  --header-bg:      rgba(10,10,11,0.85);
}

:root[data-theme="light"] {
  --bg-base:        #FAFAFA;
  --bg-grad-from:   #FAFAFA;
  --bg-grad-to:     #F4F4F5;
  --surface:        #FFFFFF;
  --text:           #0F172A;
  --muted:          #475569;
  --accent:         #0891B2;
  /* --accent (#0891B2) must match the pitch deck's token exactly, but at
     3.52-3.68:1 it fails WCAG AA (4.5:1) wherever it renders as text or as a
     fill behind --bg-base text. --accent-text is a darker, deck-independent
     variant (5.15:1 on --bg-base) used only for those contrast-critical
     cases; --accent itself keeps every border/decorative use unchanged. */
  --accent-text:    #0E7490;
  --accent-purple:  #7C3AED;
  --border:         rgba(0,0,0,0.08);
  --header-bg:      rgba(250,250,250,0.85);
}

:root {
  --font-sans: "Inter", "Noto Sans JP", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --maxw: 1120px;
  --pad-x: clamp(20px, 5vw, 48px);
  --section-y: clamp(72px, 10vw, 128px);
}

/* === RESET === */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; font: inherit; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  min-height: 100%;
  background: linear-gradient(180deg, var(--bg-grad-from), var(--bg-grad-to)) fixed, var(--bg-base);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; display: block; }
button { background: none; border: none; cursor: pointer; color: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip-link {
  position: absolute; left: -9999px;
  background: var(--accent-text); color: var(--bg-base);
  padding: 12px 20px; border-radius: 8px; z-index: 100;
}
.skip-link:focus { left: 16px; top: 16px; }

/* === HEADER === */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 14px var(--pad-x);
  display: flex; align-items: center; gap: 24px;
}

.wordmark {
  font-family: var(--font-mono);
  font-weight: 700; font-size: 18px;
  letter-spacing: 0.02em;
  color: var(--text);
}
.wordmark::before { content: "▍"; color: var(--accent); margin-right: 4px; }

.site-nav { margin-left: auto; display: flex; gap: 24px; }
.site-nav a { font-size: 14px; color: var(--muted); transition: color .18s ease; }
.site-nav a:hover { color: var(--accent); }

.theme-toggle {
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--border);
  display: grid; place-items: center;
  color: var(--muted); font-size: 16px;
  transition: color .18s ease, border-color .18s ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

@media (max-width: 768px) {
  .site-nav { display: none; }
  .theme-toggle { margin-left: auto; }
}

/* === SECTION PRIMITIVES === */

.section { padding: var(--section-y) 0; }
.section + .section { border-top: 1px solid var(--border); }

.section-inner { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad-x); }

.section-label {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent-text);
  display: block; margin-bottom: 12px;
}

.section h2 {
  font-size: clamp(26px, 3.6vw, 40px);
  font-weight: 700; line-height: 1.35;
  letter-spacing: 0.01em;
  margin-bottom: 20px;
}

.section-lead {
  font-size: clamp(15px, 1.6vw, 18px);
  color: var(--muted);
  max-width: 68ch;
  margin-bottom: 48px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: clamp(20px, 2.6vw, 32px);
}

.card h3 { font-size: 17px; font-weight: 700; margin-bottom: 10px; line-height: 1.5; }
.card p  { font-size: 14px; color: var(--muted); }

/* === FOOTER === */

.site-footer { border-top: 1px solid var(--border); padding: 40px 0; }

.footer-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad-x);
  display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center;
  font-size: 13px; color: var(--muted);
}

.footer-mark { font-family: var(--font-mono); font-weight: 700; color: var(--text); }
.footer-copy { margin-left: auto; }

@media (max-width: 768px) {
  .footer-copy { margin-left: 0; width: 100%; }
}

/* === HERO === */

.hero { padding-top: clamp(64px, 9vw, 112px); padding-bottom: clamp(72px, 10vw, 128px); }

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(32px, 5.6vw, 60px);
  font-weight: 700; line-height: 1.28; letter-spacing: 0.005em;
  margin-bottom: 24px;
}

.hero-sub {
  font-size: clamp(16px, 1.9vw, 20px);
  color: var(--muted); max-width: 60ch; margin-bottom: 40px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

.btn-primary, .btn-ghost {
  display: inline-flex; align-items: center;
  padding: 13px 28px; border-radius: 10px;
  font-size: 15px; font-weight: 700;
  transition: transform .18s ease, opacity .18s ease, border-color .18s ease, color .18s ease;
}

.btn-primary { background: var(--accent-text); color: var(--bg-base); }
.btn-primary:hover { transform: translateY(-2px); opacity: .92; }

.btn-ghost { border: 1px solid var(--border); color: var(--muted); }
.btn-ghost:hover { color: var(--accent); border-color: var(--accent); }

/* === GRIDS === */

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

@media (max-width: 768px) {
  .grid-3 { grid-template-columns: 1fr; }
}

.card-num {
  font-family: var(--font-mono);
  font-size: 20px; color: var(--accent-text);
  display: block; margin-bottom: 12px;
}

/* === PILLS === */

.pill-row { display: flex; flex-wrap: wrap; gap: 12px; }

.pill {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 8px 16px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent-text);
}

/* === TAXI TEAM === */

.taxi-quote {
  font-size: clamp(18px, 2.4vw, 26px);
  font-weight: 700;
  line-height: 1.55;
  max-width: 30ch;
  margin-bottom: 48px;
  padding-left: 20px;
  border-left: 3px solid var(--accent-purple);
}

.taxi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

@media (max-width: 768px) {
  .taxi-grid { grid-template-columns: 1fr; }
}

.taxi-card h3 { color: var(--accent-text); }

.source-note { font-size: 13px; color: var(--muted); }
.source-note a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }

/* === SUB HEADING (used by Task 4) === */

.sub-heading {
  font-size: clamp(19px, 2.2vw, 24px);
  font-weight: 700;
  margin-bottom: 28px;
  padding-left: 14px;
  border-left: 3px solid var(--accent);
}

/* === ENGAGEMENT MODEL === */

.model-split {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 20px;
  margin-bottom: 64px;
}

.model-col { display: flex; flex-direction: column; }
.model-flag { font-size: 26px; display: block; margin-bottom: 12px; }

/* Scoped to .model-col (0-2-0) so it beats .card p (0-1-1) — a bare
   .model-phase (0-1-0) would lose that specificity fight and render as
   plain muted body text instead of an accent mono eyebrow. */
.model-col .model-phase {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent-text);
  margin: 14px 0 12px;
}

.model-steps { display: grid; gap: 10px; }

.model-steps li {
  font-size: 14px; color: var(--muted);
  padding-left: 18px; position: relative;
}
.model-steps li::before {
  content: "—"; position: absolute; left: 0; color: var(--accent);
}

.model-arrow {
  display: grid; place-items: center;
  font-size: 26px; color: var(--accent);
}

@media (max-width: 768px) {
  .model-split { grid-template-columns: 1fr; }
  .model-arrow { transform: rotate(90deg); padding: 4px 0; }
}

/* === AI FLOW === */

.flow { margin-bottom: 48px; }

.flow-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

@media (max-width: 768px) {
  .flow-row { grid-template-columns: 1fr; }
}

.flow-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
}

.flow-name {
  font-family: var(--font-mono);
  font-size: 15px; font-weight: 700; color: var(--text);
  display: block; margin-bottom: 12px;
}

.flow-human { font-size: 14px; color: var(--muted); margin-bottom: 14px; }

.flow-ai {
  font-size: 13px;
  color: var(--accent-purple);
  border-top: 1px dashed var(--border);
  padding-top: 12px;
}

.model-note { font-size: 15px; margin-bottom: 18px; }

/* === CONTACT === */

.contact-cta { font-family: var(--font-mono); font-size: 17px; margin-bottom: 40px; }

.contact-meta { display: flex; flex-wrap: wrap; gap: 12px 56px; }

.contact-meta dt {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 4px;
}

.contact-meta dd { font-size: 15px; }

/* === SCROLL REVEAL === */

.reveal { opacity: 0; transform: translateY(16px); }

.reveal.is-visible {
  opacity: 1; transform: none;
  transition: opacity .5s ease, transform .5s ease;
}

/* === MOTION === */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}
