/* EFC — public site (index.html, docs.html). workspace.html uses workspace.css. */

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

:root {
  color-scheme: dark;
  --bg:         #08090b;
  --bg-card:    #0e1014;
  --bg-raised:  #14171c;
  --border:     #1d2127;
  --border-lit: #2b3038;
  --text:       #e8eaed;
  --text-dim:   #959ba5;
  --text-muted: #5b616b;
  --accent:     #F0A030;
  --accent-2:   #f6c37a;
  --accent-dim: rgba(240,160,48,.10);
  --purple:     #b9a8f5;
  --blue:       #7cb6f2;
  --orange:     #f0a070;
  --green:      #8cc49f;
  --red:        #f07a72;
  --font-mono:  'JetBrains Mono', ui-monospace, monospace;
  --font-sans:  'Inter', system-ui, sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --ease-out:   cubic-bezier(.16,1,.3,1);
  --container:  1120px;
  --r:          8px;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
button { font: inherit; color: inherit; }
img, svg { display: block; }
::selection { background: var(--accent); color: #111; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

code {
  font-family: var(--font-mono);
  font-size: .86em;
  background: var(--bg-raised);
  color: var(--accent-2);
  padding: 1px 5px;
  border-radius: 4px;
}
pre code { background: none; padding: 0; color: inherit; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .container { padding: 0 16px; } }

/* ─── LOGO / BUTTONS ─── */
.logo { font-family: var(--font-mono); font-size: 1.05rem; font-weight: 500; letter-spacing: -.5px; display: flex; align-items: center; gap: 9px; }
.logo-dot { color: var(--accent); }
.logo-img { width: 22px; height: 22px; color: var(--accent); flex-shrink: 0; }

.btn-primary, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 500; font-size: .875rem; line-height: 1;
  padding: 10px 16px; border-radius: var(--r);
  white-space: nowrap; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--accent); color: #1a1100; border: 1px solid var(--accent); }
.btn-primary:hover { background: #f3b04f; }
.btn-ghost { border: 1px solid var(--border-lit); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--text-dim); }
.btn-lg { font-size: .9rem; padding: 12px 18px; }

.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.hamburger span { display: block; width: 20px; height: 2px; background: var(--text-dim); transition: transform .25s, opacity .2s; }

/* ─── WINDOWS (code panels) ─── */
.window { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; text-align: left; min-width: 0; }
.code-bar { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-bottom: 1px solid var(--border); }
.code-bar-label { font-family: var(--font-mono); font-size: .72rem; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
pre { font-family: var(--font-mono); font-size: .78rem; line-height: 1.75; padding: 18px 20px; overflow-x: auto; tab-size: 2; color: #cfd3d9; }

.c-dim    { color: var(--text-muted); }
.c-green  { color: var(--green); }
.c-purple { color: var(--purple); }
.c-blue   { color: var(--blue); }
.c-orange { color: var(--orange); }
.c-accent { color: var(--accent); }
.c-red    { color: var(--red); }

/* ─── NAV ─── */
#navbar { position: fixed; inset: 0 0 auto 0; z-index: 100; border-bottom: 1px solid transparent; transition: background .25s, border-color .25s; }
#navbar.scrolled { background: rgba(8,9,11,.88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom-color: var(--border); }
.nav-inner { max-width: var(--container); margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 24px; }
.nav-links { display: flex; gap: 26px; margin-left: auto; }
.nav-links a { font-size: .875rem; color: var(--text-dim); transition: color .15s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }
.mobile-menu { display: none; }

/* ─── SECTIONS ─── */
section { position: relative; scroll-margin-top: 64px; }
.sec { padding: 104px 0; border-top: 1px solid var(--border); }
.sec-head { max-width: 560px; margin-bottom: 48px; }
.label { font-family: var(--font-mono); font-size: .75rem; color: var(--accent); margin-bottom: 14px; }
.h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); font-weight: 600; letter-spacing: -.03em; line-height: 1.15; text-wrap: balance; }
.lede, .hero-sub, .story-text { text-wrap: pretty; }
.lede { font-size: 1.02rem; color: var(--text-dim); margin-top: 16px; line-height: 1.7; }
.aside { font-size: .9rem; color: var(--text-muted); margin-top: 20px; line-height: 1.65; }
.aside code { color: var(--text-dim); }

.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 64px; align-items: start; }
.split .sec-head { margin-bottom: 0; }
.split.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }

.reveal { opacity: 0; transform: translateY(12px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }

/* ─── HERO ─── */
.hero { padding: 152px 0 0; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.hero-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 55% 40% at 50% 0%, #000 10%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 55% 40% at 50% 0%, #000 10%, transparent 75%);
  opacity: .5;
}
.hero-glow { position: absolute; left: 50%; top: 46%; width: 900px; height: 420px; translate: -50% 0; background: radial-gradient(closest-side, rgba(240,160,48,.08), transparent); }
.hero-inner { position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; }
.release { display: inline-flex; align-items: center; gap: 10px; font-size: .8rem; color: var(--text-dim); margin-bottom: 28px; transition: color .15s; }
.release:hover { color: var(--text); }
.release-tag { font-family: var(--font-mono); font-size: .7rem; color: var(--accent); border: 1px solid rgba(240,160,48,.35); padding: 1px 6px; border-radius: 4px; }
.hero-title { font-size: clamp(2.4rem, 5.8vw, 4.5rem); font-weight: 700; letter-spacing: -.045em; line-height: 1.02; animation: fadeUp .8s var(--ease-out) both; }
.hero-title .serif { font-family: var(--font-serif); font-weight: 400; font-style: italic; letter-spacing: -.01em; color: var(--accent); }
.hero-sub { font-size: 1.08rem; color: var(--text-dim); max-width: 520px; margin: 22px auto 32px; line-height: 1.65; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; align-items: center; }
.fade-up { opacity: 0; animation: fadeUp .8s var(--ease-out) forwards; animation-delay: var(--d, .3s); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.install { display: inline-flex; align-items: center; gap: 14px; font-family: var(--font-mono); font-size: .82rem; background: var(--bg-card); border: 1px solid var(--border-lit); padding: 6px 6px 6px 14px; border-radius: var(--r); color: var(--text); }
.install .c-dim { user-select: none; }
.copy-btn { font-family: var(--font-sans); font-size: .75rem; font-weight: 500; color: var(--text-dim); background: var(--bg-raised); border: 1px solid var(--border); padding: 5px 10px; border-radius: 6px; cursor: pointer; transition: color .15s, border-color .15s; }
.copy-btn:hover { color: var(--text); border-color: var(--border-lit); }
.copy-btn.copied { color: var(--green); }

.hero-shots { position: relative; margin-top: 72px; }
.shots { position: relative; max-width: 1000px; margin: 0 auto; }
.shot { border-radius: 10px; overflow: hidden; border: 1px solid var(--border-lit); background: var(--bg-card); }
.shot img { width: 100%; height: auto; }
.shot-bar { display: flex; justify-content: center; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--bg-raised); }
.shot-url { font-family: var(--font-mono); font-size: .68rem; color: var(--text-muted); }
.shot-main { width: 80%; }
.side-wrap { position: absolute; right: 0; top: 18%; width: 42%; z-index: 2; }
.shot-side { box-shadow: 0 24px 60px -20px rgba(0,0,0,.9), 0 0 0 6px var(--bg); }
.shots-fade { position: absolute; left: -24px; right: -24px; bottom: -1px; height: 40%; z-index: 3; background: linear-gradient(transparent, var(--bg) 88%); pointer-events: none; }
.shots-note { position: relative; z-index: 4; text-align: center; font-size: .8rem; color: var(--text-muted); margin-top: -28px; padding-bottom: 8px; }

/* ─── STORY ─── */
.story { padding: 120px 0 112px; border-top: 1px solid var(--border); }
.story-text { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 500; letter-spacing: -.025em; line-height: 1.3; max-width: 820px; }
.story-text .w { opacity: .18; transition: opacity .25s linear; }
.story-text .w.lit { opacity: 1; }
.story-text .em .w.lit { color: var(--accent); }

/* ─── ROUTING (sticky steps) ─── */
.scrolly { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); gap: 64px; }
.steps { padding: 4vh 0 16vh; }
.step { min-height: 52vh; display: flex; flex-direction: column; justify-content: center; opacity: .3; transition: opacity .4s; }
.step.active { opacity: 1; }
.step h3 { font-size: 1.2rem; font-weight: 600; letter-spacing: -.015em; margin-bottom: 8px; }
.step p { color: var(--text-dim); max-width: 380px; }
.sticky { position: sticky; top: 100px; height: calc(100vh - 160px); max-height: 560px; display: flex; flex-direction: column; justify-content: center; }

.route-stage { display: grid; grid-template-columns: 180px minmax(0, 1fr); }
.tree { border-right: 1px solid var(--border); padding: 14px 8px; font-family: var(--font-mono); font-size: .74rem; color: var(--text-dim); }
.tree div { padding: 3px 10px; border-radius: 4px; white-space: nowrap; transition: background .3s, color .3s, opacity .3s; }
.tree .d { color: var(--text); }
.tree .f.hide { opacity: 0; height: 0; padding: 0 10px; overflow: hidden; }
.tree .f.on { background: var(--accent-dim); color: var(--accent-2); }
.ind1 { margin-left: 14px; } .ind2 { margin-left: 28px; }
.stage-right { display: flex; flex-direction: column; min-width: 0; }
.route-table { padding: 14px 16px; border-bottom: 1px solid var(--border); font-family: var(--font-mono); font-size: .74rem; min-height: 168px; }
.route-table .hd { color: var(--text-muted); font-size: .68rem; margin-bottom: 8px; }
.rt { display: grid; grid-template-columns: 52px 1fr; gap: 8px; padding: 3px 0; opacity: 0; transition: opacity .35s; }
.rt.show { opacity: 1; }
.rt.new .path { color: var(--accent-2); }
.verb.get { color: var(--green); } .verb.post { color: var(--blue); }
.code-swap { position: relative; flex: 1; min-height: 210px; }
.code-swap pre { position: absolute; inset: 0; opacity: 0; transition: opacity .35s; pointer-events: none; font-size: .74rem; padding: 16px 18px; }
.code-swap pre.on { opacity: 1; pointer-events: auto; }

/* ─── CLUSTER ─── */
.cluster { padding: 20px; }
.cluster-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.cl-stat { font-family: var(--font-mono); font-size: .74rem; color: var(--text-dim); }
.cl-stat b { color: var(--text); font-weight: 500; }
.cl-arena { position: relative; height: 270px; }
.cl-lb { position: absolute; left: 50%; top: 0; translate: -50% 0; font-family: var(--font-mono); font-size: .72rem; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--border-lit); background: var(--bg-raised); color: var(--text-dim); z-index: 2; white-space: nowrap; }
.cl-workers { position: absolute; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.worker { border: 1px solid var(--border-lit); background: var(--bg); border-radius: 6px; padding: 10px; font-family: var(--font-mono); font-size: .7rem; color: var(--text-dim); transition: border-color .25s, opacity .25s; }
.worker .wn { color: var(--text); display: flex; justify-content: space-between; align-items: center; }
.worker .led { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.worker .bar { height: 2px; background: var(--border); margin-top: 10px; overflow: hidden; }
.worker .bar i { display: block; height: 100%; width: 0; background: var(--text-dim); transition: width .3s; }
.worker .cnt { margin-top: 6px; }
.worker.hit { border-color: var(--text-muted); }
.worker.dead { border-color: var(--red); opacity: .6; }
.worker.dead .led { background: var(--red); }
.worker.boot { border-style: dashed; }
.worker.boot .led { background: var(--accent); }
.packet { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); left: 0; top: 0; pointer-events: none; z-index: 1; }
.cl-log { margin-top: 16px; height: 64px; overflow: hidden; font-family: var(--font-mono); font-size: .7rem; color: var(--text-dim); border-top: 1px solid var(--border); padding-top: 10px; display: flex; flex-direction: column; justify-content: flex-end; }
.cl-log div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-crash { font-size: .75rem; border: 1px solid var(--border-lit); color: var(--text); background: transparent; padding: 6px 10px; border-radius: 6px; cursor: pointer; transition: border-color .15s, color .15s; }
.btn-crash:hover { border-color: var(--red); color: var(--red); }
.btn-crash:disabled { opacity: .4; cursor: default; }

/* ─── JOB TIMELINE ─── */
.flow-body { padding: 8px 20px; }
.flow-row { display: grid; grid-template-columns: 12px 1fr auto; gap: 14px; align-items: start; padding: 11px 0; position: relative; opacity: .3; transition: opacity .35s; }
.flow-row + .flow-row { border-top: 1px solid var(--border); }
.flow-row.on { opacity: 1; }
.flow-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; background: var(--text-muted); }
.flow-row.on .flow-dot { background: var(--text-dim); }
.flow-row.ok.on .flow-dot { background: var(--green); }
.flow-row.fail.on .flow-dot { background: var(--red); }
.flow-t { font-size: .9rem; font-weight: 500; }
.flow-s { font-family: var(--font-mono); font-size: .72rem; color: var(--text-dim); margin-top: 2px; }
.flow-time { font-family: var(--font-mono); font-size: .72rem; color: var(--text-muted); padding-top: 3px; }

/* ─── DATA TABS ─── */
.tabs { display: flex; gap: 22px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.tabs button { background: none; border: 0; padding: 0 0 10px; cursor: pointer; font-family: var(--font-mono); font-size: .8rem; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s; }
.tabs button:hover { color: var(--text-dim); }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }

/* ─── ALSO INCLUDED ─── */
.list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 64px; border-top: 1px solid var(--border); }
.list > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.list dt { font-weight: 500; }
.list dd { color: var(--text-dim); font-size: .94rem; }
.more { margin-top: 28px; font-size: .92rem; }
.more a { color: var(--accent-2); }
.more a:hover { color: var(--accent); }

/* ─── CHANGELOG ─── */
.releases { list-style: none; border-top: 1px solid var(--border); max-width: 820px; }
.releases li { display: grid; grid-template-columns: 72px 72px minmax(0, 1fr); gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border); align-items: baseline; }
.releases .v { font-family: var(--font-mono); font-size: .82rem; color: var(--text); }
.releases time { font-size: .82rem; color: var(--text-muted); }
.releases p { grid-column: 3; color: var(--text-dim); font-size: .94rem; }
.next { margin-top: 24px; font-size: .92rem; color: var(--text-dim); max-width: 820px; }
.next b { color: var(--text); font-weight: 500; }

/* ─── CTA ─── */
.cta { padding: 140px 0; text-align: center; overflow: hidden; border-top: 1px solid var(--border); }
.cta-logo { width: 84px; height: 84px; margin: 0 auto 30px; color: var(--accent); filter: drop-shadow(0 0 24px rgba(240,160,48,.28)); }
.cta-logo rect { transform-box: fill-box; transform-origin: left center; transform: scaleX(0); transition: transform 1s var(--ease-out); }
.cta.in .cta-logo rect { transform: none; }
.cta.in .cta-logo rect:nth-child(2) { transition-delay: .15s; }
.cta.in .cta-logo rect:nth-child(3) { transition-delay: .3s; }
.cta h2 { font-size: clamp(2.4rem, 6vw, 4.6rem); letter-spacing: -.045em; line-height: 1; font-weight: 700; }
.cta h2 .serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--accent); }
.cta p { color: var(--text-dim); max-width: 520px; margin: 22px auto 34px; font-size: 1.05rem; }
.cta-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.cta-orb { position: absolute; left: 50%; bottom: -300px; translate: -50% 0; width: 900px; height: 500px; background: radial-gradient(closest-side, rgba(240,160,48,.2), transparent); pointer-events: none; }

/* ─── FOOTER ─── */
.footer { border-top: 1px solid var(--border); padding: 64px 0 32px; background: var(--bg-card); }
.footer-inner { display: grid; grid-template-columns: 1.4fr 2fr; gap: 48px; }
.footer-brand p { font-size: .88rem; color: var(--text-dim); margin-top: 14px; max-width: 300px; }
.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col-label { font-family: var(--font-mono); font-size: .68rem; font-weight: 600; color: var(--text-muted); letter-spacing: 1.2px; text-transform: uppercase; margin-bottom: 4px; }
.footer-col a { font-size: .88rem; color: var(--text-dim); transition: color .2s; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 52px; padding-top: 24px; border-top: 1px solid var(--border); font-size: .8rem; color: var(--text-muted); }

/* ─── RESPONSIVE ─── */
@media (max-width: 1000px) {
  .split, .split.even, .scrolly { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .split.even { gap: 16px; }
  .list { grid-template-columns: 1fr; }
  /* routing: the panel stays pinned above the steps */
  .scrolly { gap: 0; }
  .scrolly .sticky { order: -1; top: 64px; height: auto; max-height: none; z-index: 2; padding: 8px 0; background: linear-gradient(var(--bg) 88%, transparent); }
  .step { min-height: 38vh; }
  .steps { padding-bottom: 40vh; }
  .shot-main { width: 88%; }
  .side-wrap { width: 46%; top: 24%; }
}
@media (max-width: 760px) {
  .nav-links, .nav-cta { display: none; }
  .hamburger { display: flex; margin-left: auto; }
  .mobile-menu { display: flex; flex-direction: column; max-height: 0; overflow: hidden; transition: max-height .3s var(--ease-out); background: rgba(8,9,11,.97); padding: 0 24px; }
  .mobile-menu.open { max-height: 320px; border-bottom: 1px solid var(--border); }
  .mobile-menu a { padding: 12px 0; font-size: .95rem; color: var(--text-dim); border-bottom: 1px solid var(--border); }
  .mobile-menu a:last-child { border-bottom: 0; margin-bottom: 10px; }
  #navbar.menu-open { background: rgba(8,9,11,.97); }
  #navbar.menu-open .hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  #navbar.menu-open .hamburger span:nth-child(2) { opacity: 0; }
  #navbar.menu-open .hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .releases li { grid-template-columns: 64px minmax(0, 1fr); }
  .releases time { display: none; }
  .releases p { grid-column: 2; }
  .footer-inner { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .nav-inner { padding: 0 16px; }
  .hero { padding-top: 116px; }
  .hero-title { font-size: clamp(2.1rem, 10vw, 2.8rem); }
  .hero-title br { display: none; }
  .hero-sub { font-size: 1rem; }
  .hero-actions { flex-direction: column; align-items: stretch; width: 100%; }
  .install { justify-content: space-between; font-size: .76rem; }
  .hero-shots { margin-top: 48px; }
  .shot-main { width: 100%; }
  .side-wrap { position: relative; width: 80%; top: auto; margin: -20% 0 0 auto; }
  .shots-note { margin-top: 0; }
  .sec { padding: 80px 0; }
  .story { padding: 88px 0; }
  .route-stage { grid-template-columns: 1fr; }
  .tree { border-right: 0; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 2px; padding: 10px; }
  .tree div { margin-left: 0; }
  .tree .d { display: none; }
  .route-table { min-height: 128px; }
  .code-swap { min-height: 170px; }
  .code-swap pre { font-size: .68rem; }
  .cl-arena { height: 250px; }
  .cl-workers { grid-template-columns: repeat(2, 1fr); }
  .list > div { grid-template-columns: 1fr; gap: 4px; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .cta { padding: 100px 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .reveal, .fade-up { opacity: 1; transform: none; }
  .cta-logo rect { transform: none; }
}
