@font-face {
  font-family: 'Geist';
  src: url('assets/fonts/Geist-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: 'Geist Mono';
  src: url('assets/fonts/GeistMono-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #0b1118;
  --bg-alt: #101924;
  --surface: #131f2d;
  --surface-hi: #192838;
  --border: #294052;
  --text: #e5eef2;
  --text-muted: #9cb0bc;
  --accent: #62d3bc;
  --accent-strong: #8ce5cf;
  --accent-soft: rgb(98 211 188 / 0.12);
  --accent-2: var(--accent);
  --accent-2-soft: var(--accent-soft);
  --shadow: 0 24px 70px -38px rgb(9 28 34 / 0.85);
  --font-sans: 'Geist', 'Segoe UI Variable', system-ui, sans-serif;
  --font-mono: 'Geist Mono', 'Cascadia Code', ui-monospace, monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --container: 1180px;
}

[data-theme='light'] {
  --bg: #f6f8f8;
  --bg-alt: #ecf1f1;
  --surface: #ffffff;
  --surface-hi: #f1f6f5;
  --border: #cbd8d7;
  --text: #142227;
  --text-muted: #52666d;
  --accent: #087d6b;
  --accent-strong: #056454;
  --accent-soft: rgb(8 125 107 / 0.11);
  --shadow: 0 22px 60px -42px rgb(15 56 57 / 0.55);
}

body { font-family: var(--font-sans); letter-spacing: -0.012em; }
html.lenis { scroll-behavior: auto; }
body::before { opacity: .018; }
.container { width: min(var(--container), calc(100% - 48px)); }
.site-header { background: color-mix(in srgb, var(--bg) 90%, transparent); }
.logo-mark { border-radius: 8px; }
.logo-text { font-family: var(--font-mono); font-size: .8rem; letter-spacing: -.05em; }
.nav-list a { font-size: .85rem; }
.theme-toggle { border-radius: 8px; }

.hero {
  min-height: min(100dvh, 720px);
  padding: calc(var(--header-h) + 48px) 0 56px;
}
.hero-glow {
  width: 760px;
  height: 760px;
  left: 64%;
  background: radial-gradient(circle, rgb(98 211 188 / .1), transparent 64%);
}
.hero-inner { grid-template-columns: minmax(0, 1.05fr) minmax(330px, .8fr); gap: clamp(36px, 7vw, 96px); }
.hero-text { max-width: 680px; }
.hero-kicker {
  margin: 0 0 18px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: clamp(.72rem, 1vw, .84rem);
  font-weight: 600;
  letter-spacing: .035em;
}
.hero-name {
  max-width: 16ch;
  font-size: clamp(2.7rem, 5vw, 4.9rem);
  line-height: .98;
  letter-spacing: -.065em;
  text-wrap: balance;
  margin: 0 0 22px;
}
.hero-desc { max-width: 45ch; font-size: clamp(1rem, 1.5vw, 1.16rem); line-height: 1.62; margin: 0 0 28px; }
.hero-actions { align-items: center; margin: 0; gap: 18px; }
.btn { border-radius: 8px; font-family: var(--font-sans); }
.btn-primary { background: var(--accent); color: #06251f; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.hero-contact-link { color: var(--text-muted); font-weight: 600; font-size: .93rem; }
.hero-contact-link:hover { color: var(--accent); }

.hero-hardware {
  position: relative;
  min-height: 420px;
  margin: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--border));
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.hero-hardware::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, color-mix(in srgb, var(--bg) 50%, transparent), transparent 56%);
}
.hero-hardware img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: 68% center; transition: transform .7s cubic-bezier(.16, 1, .3, 1); }
@media (hover: hover) { .hero-hardware:hover img { transform: scale(1.035); } }

.system-trace {
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--border));
  border-radius: var(--radius);
  background: linear-gradient(145deg, color-mix(in srgb, var(--surface) 90%, var(--accent-soft)), var(--surface));
  box-shadow: var(--shadow);
  transform: none;
}
.trace-label, .case-kicker {
  margin: 0 0 14px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.system-trace ol { list-style: none; margin: 0; padding: 0; }
.system-trace li { display: grid; grid-template-columns: 32px 1fr; gap: 2px 14px; padding: 13px 0; border-top: 1px solid var(--border); }
.system-trace li:first-child { border-top: 0; padding-top: 0; }
.system-trace li span { grid-row: span 2; color: var(--accent); font-family: var(--font-mono); font-size: .72rem; padding-top: 2px; }
.system-trace strong { font-size: .98rem; }
.system-trace small { color: var(--text-muted); font-family: var(--font-mono); font-size: .73rem; }

.proof-rail { border-block: 1px solid var(--border); background: var(--bg-alt); }
.proof-rail .container { display: flex; flex-wrap: wrap; gap: 0; }
.proof-rail span { padding: 17px 20px 17px 0; margin-right: 20px; color: var(--text-muted); font-family: var(--font-mono); font-size: .74rem; border-right: 1px solid var(--border); }
.proof-rail span:last-child { border-right: 0; }

.view-bar { padding: 42px 0 0; }
.view-bar .container { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 36px; align-items: center; }
.view-bar h2 { margin: 0; font-size: clamp(1.25rem, 2vw, 1.65rem); letter-spacing: -.045em; }
.view-bar p { margin: 0; color: var(--text-muted); max-width: 50ch; }
.view-bar [data-view-content] { grid-column: 1 / -1; font-size: .92rem; }
.view-toggle, .focus-controls, .ota-failures { display: flex; flex-wrap: wrap; gap: 8px; }
.view-toggle { padding: 4px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.view-toggle button, .focus-controls button, .ota-failures button {
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  padding: 9px 11px;
  font: 600 .78rem var(--font-sans);
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}
.view-toggle button.is-active, .focus-controls button.is-active, .ota-failures button.is-active { background: var(--accent); color: #06251f; }
.focus-controls button { border-color: var(--border); background: var(--surface); }
.focus-controls button:hover, .ota-failures button:hover { border-color: var(--accent); color: var(--accent); }

.section { padding: clamp(84px, 10vw, 132px) 0; }
.section-title { display: block; font-size: clamp(2rem, 4vw, 3.4rem); letter-spacing: -.06em; margin-bottom: 14px; }
.section-title::after, .section-num { display: none; }
.section-lead { max-width: 52ch; margin-bottom: clamp(30px, 5vw, 54px); font-size: 1.02rem; }

.principles-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--border); }
.principle { padding: 28px 28px 30px 0; border-bottom: 1px solid var(--border); }
.principle + .principle { padding-left: 28px; border-left: 1px solid var(--border); }
.principle h3 { margin: 0 0 10px; font-size: 1.15rem; letter-spacing: -.035em; }
.principle p { max-width: 31ch; margin: 0 0 18px; color: var(--text-muted); font-size: .92rem; }
.principle a, .capability-row a { color: var(--accent); font-size: .86rem; font-weight: 600; }

.focus-controls { margin-bottom: 20px; }
.capability-matrix { border-top: 1px solid var(--border); }
.capability-row { display: grid; grid-template-columns: 1fr 1.45fr .75fr; gap: 24px; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--border); transition: opacity .2s ease, transform .2s ease; }
.capability-row h3, .capability-row p { margin: 0; }
.capability-row h3 { font-size: .98rem; letter-spacing: -.02em; }
.capability-row p { color: var(--text-muted); font-size: .9rem; }
.capability-head { padding-block: 10px; color: var(--text-muted); font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; }
.capability-row.is-focus-muted, .timeline-item.is-focus-muted { opacity: .34; }
.capability-row.is-focus-match, .timeline-item.is-focus-match { opacity: 1; }

.case-study-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(310px, .8fr); gap: 24px; align-items: start; }
.project { padding: 30px; border-color: var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: none; }
.project:hover { transform: none; border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); box-shadow: var(--shadow); }
.project.featured { grid-row: span 2; background: linear-gradient(150deg, color-mix(in srgb, var(--surface) 92%, var(--accent-soft)), var(--surface)); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.project-compact { min-height: 0; }
.case-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.case-header h3 { margin: 0; min-height: 0; font-size: clamp(1.35rem, 2vw, 1.75rem); letter-spacing: -.045em; }
.case-scope { flex: 0 0 auto; color: var(--text-muted); font-family: var(--font-mono); font-size: .68rem; }
.case-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 28px; }
.case-fields section { border-top: 1px solid var(--border); padding-top: 12px; }
.case-fields h4 { margin: 0 0 7px; color: var(--accent); font-family: var(--font-mono); font-size: .7rem; letter-spacing: .05em; text-transform: uppercase; }
.case-fields p { margin: 0; color: var(--text-muted); font-size: .88rem; line-height: 1.58; }
.project > [data-view-content] { margin: 26px 0 0; color: var(--text); font-size: .94rem; }

.ota-lab, .architecture-replay { margin-top: 30px; padding-top: 24px; border-top: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border)); }
.lab-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.lab-heading h4 { margin: 0; font-size: 1.08rem; }
.lab-heading > p { margin: 4px 0 0; color: var(--text-muted); font-size: .84rem; max-width: 34ch; }
#otaStatus { color: var(--accent); font-family: var(--font-mono); font-size: .72rem; white-space: nowrap; }
.ota-failures { margin-top: 20px; }
.ota-slots { display: grid; grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1fr); gap: 12px; align-items: center; margin-top: 18px; }
.ota-slot { min-height: 92px; padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: color-mix(in srgb, var(--bg) 54%, var(--surface)); }
.ota-slot strong { display: block; margin: 5px 0 2px; color: var(--text); font: 700 1.5rem/1 var(--font-mono); }
.ota-slot small, .slot-label { display: block; color: var(--text-muted); font: .68rem/1.45 var(--font-mono); }
.slot-label { color: var(--accent); letter-spacing: .04em; text-transform: uppercase; }
.ota-transfer { position: relative; height: 1px; background: var(--border); overflow: visible; }
.ota-transfer::after { content: ''; position: absolute; top: 50%; left: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); opacity: 0; transform: translate(-50%, -50%); }
.ota-lab[data-ota-phase='staging'] .ota-transfer::after,
.ota-lab[data-ota-phase='switching'] .ota-transfer::after { opacity: 1; animation: ota-transfer 1.1s cubic-bezier(.16, 1, .3, 1) infinite; }
.ota-lab[data-ota-phase='committed'] [data-ota-slot='live'] { border-color: color-mix(in srgb, var(--accent) 64%, var(--border)); background: var(--accent-soft); }
.ota-lab[data-ota-phase='rollback'] [data-ota-slot='live'] { border-color: #d79f4b; }
.ota-lab[data-ota-phase='rejected'] [data-ota-slot='candidate'] { border-color: #d76a6a; }
@keyframes ota-transfer { from { transform: translate(-50%, -50%); } to { transform: translate(calc(72px - 50%), -50%); } }
.ota-pipeline, .replay-steps { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; list-style: none; padding: 0; margin: 22px 0; }
.ota-pipeline li, .replay-steps li { position: relative; padding: 10px 8px; border: 1px solid var(--border); border-radius: 7px; color: var(--text-muted); font: 600 .67rem/1.25 var(--font-mono); text-align: center; }
.ota-pipeline li[data-state='active'], .replay-steps li.is-active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.ota-pipeline li[data-state='complete'] { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); color: var(--text); }
.ota-pipeline li[data-state='warning'] { border-color: #d79f4b; color: #d79f4b; }
.ota-pipeline li[data-state='error'] { border-color: #d76a6a; color: #d76a6a; }
.ota-pipeline li[data-state='rollback'] { border-color: #d79f4b; color: #d79f4b; }
.lab-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.lab-actions .btn { padding: 10px 14px; font-size: .82rem; }
.ota-log { min-height: 72px; max-height: 180px; overflow: auto; margin: 20px 0 0; padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: color-mix(in srgb, var(--bg) 75%, var(--surface)); color: var(--text-muted); font: .73rem/1.6 var(--font-mono); white-space: pre-wrap; }
.ota-log li { list-style: none; }
.ota-log [data-log-type='error'] { color: #df7777; }
.ota-log [data-log-type='warning'] { color: #d9a751; }
.ota-log [data-log-type='success'] { color: var(--accent); }
.replay-steps { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.timeline { padding-left: 0; }
.timeline::before { left: 8px; }
.timeline-item { padding-left: 38px; transition: opacity .2s ease; }
.timeline-body { padding-right: min(24vw, 260px); }
.timeline-body h3 { font-size: 1.05rem; letter-spacing: -.025em; }
.timeline-body p:not(.timeline-date) { max-width: 60ch; }

.engineering-notes { position: relative; overflow: hidden; }
.notes-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(240px, .8fr); grid-template-rows: 1fr 1fr; gap: 18px 42px; max-width: 1060px; }
.note-feature { position: relative; grid-row: span 2; min-height: 310px; padding: clamp(28px, 4vw, 48px); overflow: hidden; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border)); border-radius: var(--radius); background: linear-gradient(135deg, color-mix(in srgb, var(--surface) 90%, var(--accent-soft)), var(--surface)); }
.note-feature::after { content: ''; position: absolute; width: 360px; height: 360px; right: -170px; bottom: -180px; border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent); border-radius: 50%; box-shadow: 0 0 0 34px color-mix(in srgb, var(--accent) 7%, transparent), 0 0 0 69px color-mix(in srgb, var(--accent) 4%, transparent); pointer-events: none; }
.note-index { position: relative; z-index: 1; display: block; margin-bottom: 74px; color: var(--accent); font: 600 .78rem var(--font-mono); }
.note-feature h3 { position: relative; z-index: 1; max-width: 13ch; margin: 0 0 14px; font-size: clamp(1.65rem, 3vw, 2.65rem); line-height: 1; letter-spacing: -.055em; }
.note-feature p { position: relative; z-index: 1; max-width: 47ch; margin: 0; color: var(--text-muted); }
.note-compact { align-self: center; padding: 8px 0 22px; border-bottom: 1px solid var(--border); }
.note-compact h3 { margin: 0 0 9px; font-size: 1.12rem; letter-spacing: -.03em; }
.note-compact p { max-width: 42ch; margin: 0; color: var(--text-muted); }

.contact-inner { text-align: left; }
.section-title.center { justify-content: flex-start; }
.contact-lead { margin: 0 0 28px; max-width: 46ch; }
.contact-cta { justify-content: flex-start; }

.guided-tour { position: fixed; right: 22px; bottom: 22px; z-index: 30; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.tour-start { padding: 11px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); font: 600 .8rem var(--font-sans); }
.tour-start:hover { border-color: var(--accent); color: var(--accent); }
#tourPanel { width: min(390px, calc(100vw - 44px)); padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
#tourPanel h2 { margin: 0 0 8px; font-size: 1.1rem; }
#tourPanel p:not(.case-kicker) { margin: 0; color: var(--text-muted); font-size: .86rem; line-height: 1.55; }
#tourPanel .lab-actions button { padding: 8px 11px; border: 1px solid var(--border); border-radius: 7px; background: transparent; color: var(--text); font: 600 .76rem var(--font-sans); }
#tourPanel .lab-actions button:first-child { background: var(--accent); border-color: var(--accent); color: #06251f; }

.footer-links { display: flex; gap: 14px; align-items: center; }
.footer-links a { color: var(--text-muted); font-size: .8rem; }
.footer-links a:hover { color: var(--accent); }
.to-top { margin-left: 0; }
.scroll-hint { display: none; }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 34px; }
  .hero-name { max-width: 13ch; }
  .system-trace { max-width: none; }
  .case-study-layout { grid-template-columns: 1fr; }
  .project.featured { grid-row: auto; }
  .timeline-body { padding-right: 0; }
}

@media (max-width: 720px) {
  body::before { display: none; }
  .container { width: min(var(--container), calc(100% - 36px)); }
  .hero { min-height: auto; padding: calc(var(--header-h) + 54px) 0 54px; }
  .hero-name { font-size: clamp(2.4rem, 11vw, 3.4rem); }
  .hero-hardware { min-height: min(84vw, 430px); }
  .proof-rail .container { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proof-rail span { margin: 0; padding: 12px 10px 12px 0; border-right: 0; font-size: .66rem; }
  .view-bar { padding-top: 30px; }
  .view-bar .container { grid-template-columns: 1fr; }
  .view-toggle { width: max-content; }
  .principles-grid { grid-template-columns: 1fr; }
  .principle, .principle + .principle { padding: 22px 0; border-left: 0; }
  .capability-head { display: none; }
  .capability-row { grid-template-columns: 1fr; gap: 8px; padding: 19px 0; }
  .case-study-layout { gap: 14px; }
  .project { padding: 22px; }
  .case-header { flex-direction: column; gap: 8px; margin-bottom: 20px; }
  .case-fields { grid-template-columns: 1fr; gap: 14px; }
  .ota-pipeline { grid-template-columns: 1fr 1fr; }
  .ota-slots { grid-template-columns: 1fr; }
  .ota-transfer { width: 1px; height: 28px; margin: -4px auto; }
  .ota-lab[data-ota-phase='staging'] .ota-transfer::after,
  .ota-lab[data-ota-phase='switching'] .ota-transfer::after { animation-name: ota-transfer-mobile; }
  .notes-layout { grid-template-columns: 1fr; grid-template-rows: auto; gap: 26px; }
  .note-feature { grid-row: auto; min-height: 0; }
  .note-index { margin-bottom: 44px; }
  .replay-steps { grid-template-columns: 1fr; }
  .timeline-item { padding-left: 30px; }
  .timeline::before, .timeline-marker { animation: none !important; }
  .guided-tour { right: 12px; bottom: 12px; }
  #tourPanel { width: min(360px, calc(100vw - 24px)); }
  .footer-inner { flex-wrap: wrap; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .capability-row, .timeline-item, .view-toggle button, .focus-controls button, .ota-failures button, .hero-hardware img { transition: none; }
  .ota-lab[data-ota-phase='staging'] .ota-transfer::after, .ota-lab[data-ota-phase='switching'] .ota-transfer::after { animation: none; }
}

@keyframes ota-transfer-mobile { from { transform: translate(-50%, -50%); } to { transform: translate(-50%, calc(28px - 50%)); } }
