/* Git Tide — tokens from DESIGN.md */
:root {
  --deep-ocean: #101D2B;
  --ocean-current: #173D4A;
  --teal: #27B8A5;
  --seafoam: #91DED0;

  --bg: #F5F7F8;
  --surface: #FFFFFF;
  --surface-2: #EAF1F2;
  --text: #101D2B;
  --text-2: #536B73;
  --border: #D6E1E3;
  --accent: #27B8A5;
  --accent-fg: #101D2B;
  --accent-text: #0F6F63; /* teal as small text needs more contrast on light */

  --term-bg: #101D2B;
  --term-text: #F5F7F8;
  --term-dim: #A9BBC3;
  --term-border: #29404C;

  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 10px;
  --max: 1120px;
}

:root:not([data-theme]) { color-scheme: light dark; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101D2B; --surface: #132532; --surface-2: #173D4A;
    --text: #F5F7F8; --text-2: #A9BBC3; --border: #29404C;
    --accent-text: #91DED0;
    --term-bg: #0B1621;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101D2B; --surface: #132532; --surface-2: #173D4A;
  --text: #F5F7F8; --text-2: #A9BBC3; --border: #29404C;
  --accent-text: #91DED0;
  --term-bg: #0B1621;
}
:root[data-theme="light"] { color-scheme: light; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-weight: 600; margin: 0; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.75rem, 7vw, 5rem); line-height: 1.02; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.5rem); line-height: 1.15; margin-bottom: 1.5rem; }
h3 { font-size: 1.125rem; line-height: 1.3; letter-spacing: -0.01em; }
p { margin: 0 0 1rem; }
a { color: var(--accent-text); }
code, pre { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(100% - 32px, var(--max)); margin-inline: auto; }
.section { padding: clamp(64px, 10vw, 120px) 0; }
.section.alt { background: var(--surface-2); }
.lead { font-size: 1.125rem; line-height: 1.65; color: var(--text-2); }
.narrow { max-width: 56ch; }
.note { font-size: .875rem; color: var(--text-2); max-width: 70ch; }
.two { display: grid; gap: 2.5rem; grid-template-columns: 1fr; align-items: start; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-fg); padding: 8px 14px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 94%, transparent); border-bottom: 1px solid var(--border); }
.bar { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 1.125rem; }
.mark { width: 32px; height: 16px; color: var(--accent); }
.nav { display: none; gap: 28px; margin-left: auto; margin-right: 12px; }
.nav a { color: var(--text-2); text-decoration: none; font-weight: 500; font-size: .9375rem; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--text); }
.nav a.on { color: var(--text); border-color: var(--accent); }
.actions { display: flex; gap: 8px; align-items: center; }
.lang { display: inline-flex; height: 44px; padding: 3px; gap: 2px; border: 1px solid var(--border); border-radius: 8px; }
.lang button { min-width: 40px; background: none; border: 0; border-radius: 5px; color: var(--text-2); font: 600 .8125rem var(--sans); letter-spacing: .02em; cursor: pointer; transition: background-color .15s, color .15s; }
.lang button:hover { color: var(--text); }
.lang button[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg); }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; background: transparent; color: var(--text); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }
.i-sun, .i-moon { grid-area: 1 / 1; transition: transform .5s cubic-bezier(.4, 0, .2, 1), opacity .3s; }
.i-sun { opacity: 0; transform: rotate(-90deg) scale(.4); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { opacity: 1; transform: none; }
  :root:not([data-theme="light"]) .i-moon { opacity: 0; transform: rotate(90deg) scale(.4); }
}
:root[data-theme="dark"] .i-sun { opacity: 1; transform: none; }
:root[data-theme="dark"] .i-moon { opacity: 0; transform: rotate(90deg) scale(.4); }

/* Theme switch: new theme expands from the toggle button (View Transitions) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }

@media (max-width: 767px) {
  .nav.open { display: flex; flex-direction: column; gap: 4px; position: absolute; top: 64px; left: 0; right: 0; margin: 0; padding: 12px 16px 16px; background: var(--bg); border-bottom: 1px solid var(--border); }
  .nav.open a { padding: 12px 0; font-size: 1rem; }
}
@media (min-width: 768px) {
  .nav { display: flex; }
  .menu-btn { display: none; }
  .two { grid-template-columns: 1fr 1fr; gap: 4rem; }
}

/* Hero */
body { overflow-x: clip; }
.hero { position: relative; z-index: 0; display: grid; gap: 3.5rem; padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 6vw, 72px); align-items: center; }
.hero-mark { position: absolute; z-index: -1; left: 30%; top: 50%; width: min(1000px, 140vw); height: calc(min(1000px, 140vw) / 2); transform: translateY(-50%); color: var(--surface-2); opacity: .75; pointer-events: none; }
@media (min-width: 960px) { .hero { grid-template-columns: .9fr 1.1fr; gap: 4rem; } }
.hero h1 { max-width: 11ch; margin-bottom: 1.5rem; }
.hero .lead { max-width: 48ch; margin-bottom: 2rem; }
.btns { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; border-radius: 8px; font-weight: 600; text-decoration: none; border: 1px solid transparent; transition: background-color .15s, border-color .15s; }
.btn.primary { background: var(--accent); color: var(--accent-fg); }
.btn.primary:hover { background: var(--seafoam); }
.btn.ghost { color: var(--text); border-color: var(--border); background: var(--surface); }
.btn.ghost:hover { border-color: var(--accent); }
.status { margin-top: 1.5rem; font-size: .875rem; color: var(--text-2); display: flex; align-items: center; gap: 10px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }

@media (max-width: 899px) { .hero-mark { opacity: .35; } }

/* Terminal */
.term { margin: 0; background: var(--term-bg); color: var(--term-text); border: 1px solid var(--term-border); border-radius: 12px; overflow: hidden; min-width: 0; }
.term-bar { display: flex; align-items: center; border-bottom: 1px solid var(--term-border); }
.tabs { display: flex; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--term-dim); font: 500 .8125rem/1 var(--mono); padding: 14px 16px; cursor: pointer; transition: color .15s; }
.tabs button:hover { color: var(--term-text); }
.tabs button[aria-selected="true"] { color: var(--seafoam); border-bottom-color: var(--teal); }
.tabs button:focus-visible { outline-offset: -3px; }
.term pre { margin: 0; padding: 22px 20px; overflow-x: auto; font-size: .875rem; line-height: 1.75; }
.demo { box-shadow: 0 24px 60px -24px rgb(0 0 0 / .45); }
.demo pre { min-height: 15.5em; padding: 28px 24px; font-size: .9375rem; }
@media (max-width: 480px) { .demo pre { font-size: .8125rem; padding: 22px 16px; } }
.term code { font-weight: 400; }
.term .cmd { font-weight: 500; }
.term .p, .term .dim { color: var(--term-dim); }
.term .ok { color: var(--seafoam); }
.term .warn { color: #F2C879; }
.term .err { color: #F29A8B; }
.caret { display: inline-block; width: .55em; height: 1.1em; background: var(--seafoam); vertical-align: text-bottom; margin-left: 1px; }
.term-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--term-border); font-size: .75rem; color: var(--term-dim); }
.link-btn { background: none; border: 0; color: var(--seafoam); font: 500 .75rem var(--sans); cursor: pointer; padding: 0 8px; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; }
.term pre:focus-visible { outline-offset: -3px; }

/* Value */
.points, .principles, .rows { list-style: none; margin: 0; padding: 0; }
.points li { padding: 18px 0; border-top: 1px solid var(--border); font-weight: 500; font-size: 1.25rem; letter-spacing: -0.01em; }
.points li:last-child { border-bottom: 1px solid var(--border); }

/* How */
.steps { margin: 0 0 1.5rem; padding-left: 1.25rem; color: var(--text-2); font-size: 1.0625rem; }
.steps li { padding: 4px 0 4px 6px; }
.steps li::marker { color: var(--accent-text); font-weight: 600; }
.steps code { color: var(--text); font-weight: 500; }
.flow { display: flex; flex-direction: column; align-items: stretch; max-width: 380px; width: 100%; }
.node { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; font-weight: 600; text-align: center; }
.node code { font-weight: 500; }
.node.accent { border-color: var(--accent); }
.node ul { list-style: none; margin: 10px 0 0; padding: 0; font-weight: 400; font-size: .875rem; color: var(--text-2); }
.node.optional { border-style: dashed; color: var(--text-2); }
.node small { display: block; font-weight: 400; font-size: .75rem; }
.arrow { width: 0; height: 28px; margin: 0 auto; border-left: 2px solid var(--border); position: relative; }
.arrow::after { content: ""; position: absolute; bottom: -1px; left: -6px; border: 5px solid transparent; border-top: 7px solid var(--border); border-bottom: 0; }
.arrow.dashed { border-left-style: dashed; }

/* Features: rows, not cards */
.rows { margin-top: 2.5rem; }
.rows li { display: grid; gap: 6px 24px; padding: 24px 0; border-top: 1px solid var(--border); align-items: baseline; transition: background-color .15s; }
.rows li:last-child { border-bottom: 1px solid var(--border); }
.rows p { margin: 4px 0 0; color: var(--text-2); max-width: 46ch; }
.rows code { font-size: .8125rem; font-weight: 500; color: var(--accent-text); }
.state { font-size: .8125rem; color: var(--text-2); }
.state::before { content: ""; display: inline-block; width: 7px; height: 7px; border: 1.5px solid var(--text-2); border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
@media (min-width: 800px) {
  .rows li { grid-template-columns: 1.3fr 1fr 120px; }
  .state { text-align: right; }
}

/* Example */
.seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 1.5rem; }
.seg button { font: 600 .9375rem var(--sans); color: var(--text-2); background: none; border: 0; border-radius: 7px; padding: 10px 16px; cursor: pointer; transition: background-color .15s, color .15s; }
.seg button small { font-weight: 500; opacity: .8; margin-left: 6px; }
.seg button[aria-selected="true"] { background: var(--accent); color: var(--accent-fg); }
.compare { display: grid; gap: 20px; grid-template-columns: 1fr; margin-bottom: 1.25rem; }
@media (min-width: 800px) { .compare { grid-template-columns: 1fr 1fr; align-items: stretch; } }
#cmp { display: flex; align-items: center; }
#cmp pre { width: 100%; }
.graph { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.graph svg { width: 100%; height: auto; display: block; }
.graph figcaption { font-size: .8125rem; color: var(--text-2); margin-top: 8px; }
.graph .lanes path, .graph .join { stroke: var(--border); stroke-width: 2; fill: none; }
.graph .lbl text { font: 500 12px var(--mono); fill: var(--text-2); }
.graph .dots circle { fill: var(--surface); stroke: var(--text-2); stroke-width: 2; }
.graph .merge { stroke: var(--teal); stroke-width: 3; fill: none; stroke-dasharray: 80; stroke-dashoffset: 0; }
.graph .new { fill: var(--teal); }
.graph.pre .merge { stroke-dashoffset: 80; }
.graph.pre .new.late { opacity: 0; }
.graph.go .merge { transition: stroke-dashoffset .8s ease .2s; }
.graph.go .new.late { transition: opacity .3s ease .9s; }

/* Principles */
.principles li { padding: 20px 0; border-top: 1px solid var(--border); color: var(--text-2); }
.principles li:last-child { border-bottom: 1px solid var(--border); }
.principles strong { color: var(--text); display: block; font-size: 1.1875rem; font-weight: 600; letter-spacing: -0.01em; }
@media (min-width: 768px) { .principles li { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: baseline; } }

/* CTA */
.cta { background: var(--deep-ocean); color: #F5F7F8; padding: clamp(72px, 11vw, 136px) 0; position: relative; overflow: hidden; }
.cta .wrap { position: relative; }
.cta h2 { max-width: 14ch; }
.cta .lead { color: #A9BBC3; }
.install { position: relative; max-width: 780px; margin: 2rem 0 .75rem; background: #0B1621; border: 1px solid #29404C; border-radius: 12px; }
.install pre { margin: 0; padding: 20px 96px 20px 20px; overflow-x: auto; font-size: .875rem; line-height: 1.7; color: #F5F7F8; }
.install pre:focus-visible { outline-offset: -3px; }
.copy-btn { position: absolute; top: 10px; right: 10px; min-height: 40px; padding: 0 14px; background: transparent; border: 1px solid #29404C; border-radius: 8px; color: #91DED0; font: 600 .8125rem var(--sans); cursor: pointer; }
.copy-btn:hover { border-color: var(--teal); }
.req { color: #A9BBC3; font-size: .875rem; margin-bottom: 1.75rem; }
.cta-mark { position: absolute; right: -40px; top: 50%; width: min(560px, 80vw); height: calc(min(560px, 80vw) / 2); transform: translateY(-50%); color: var(--ocean-current); opacity: .55; pointer-events: none; }

/* FAQ */
details { max-width: 800px; }
details { border-top: 1px solid var(--border); }
details:last-of-type { border-bottom: 1px solid var(--border); }
summary { cursor: pointer; list-style: none; padding: 20px 32px 20px 0; font-weight: 600; font-size: 1.0625rem; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font: 500 1.25rem var(--mono); color: var(--accent-text); }
details[open] summary::after { content: "–"; }
details p { color: var(--text-2); padding-bottom: 20px; margin: 0; max-width: 62ch; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 48px 0; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; align-items: flex-end; }
.foot-links { display: flex; gap: 24px; }
.foot-links a { color: var(--text-2); text-decoration: none; font-weight: 500; font-size: .9375rem; padding: 10px 0; }
.foot-links a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }
.nav a.ext::after { content: " ↗"; font-size: .8em; }
.tag-line { margin: 10px 0 0; color: var(--text-2); }
.copy { margin: 0; font-size: .875rem; color: var(--text-2); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
