/* ============================================================================
   Turian Engine — site theme
   Dark, technical, with a Zig-amber → orange signature gradient and a violet
   counter-accent.  No external CSS framework; everything is hand-rolled.
   ============================================================================ */

:root {
  /* Brand */
  --amber:   #f7a41d;   /* Zig homage */
  --orange:  #ff6b35;
  --violet:  #7c5cff;
  --cyan:    #34d6e0;

  /* Surfaces */
  --bg:        #0a0b10;
  --bg-soft:   #0f111a;
  --surface:   #14161f;
  --surface-2: #1b1e2b;
  --border:    rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  /* Text */
  --text:   #e9eaf2;
  --muted:  #9aa3b2;
  --faint:  #6b7385;

  /* Signature gradient */
  --grad: linear-gradient(135deg, var(--amber) 0%, var(--orange) 55%, var(--violet) 130%);
  --grad-text: linear-gradient(120deg, #ffd27a 0%, var(--amber) 35%, var(--orange) 70%, #ff9bd0 110%);

  --radius:    16px;
  --radius-sm: 10px;
  --maxw:      1180px;
  --nav-h:     68px;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, "Cascadia Code", monospace;

  --shadow:    0 20px 60px -20px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 0 1px var(--border), 0 24px 70px -30px rgba(247, 164, 29, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Ambient page glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 600px at 78% -8%, rgba(247, 164, 29, 0.13), transparent 60%),
    radial-gradient(800px 600px at 12% 4%, rgba(124, 92, 255, 0.12), transparent 55%),
    radial-gradient(700px 700px at 50% 110%, rgba(52, 214, 224, 0.06), transparent 60%);
  pointer-events: none;
}

a { color: var(--amber); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--orange); }

h1, h2, h3, h4 { line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 .5em; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1rem; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: clamp(64px, 9vw, 120px) 0; position: relative; }
.eyebrow {
  display: inline-block; font-family: var(--font-mono); font-size: .8rem;
  letter-spacing: .18em; text-transform: uppercase; color: var(--amber);
  margin-bottom: 14px;
}
.gradient-text {
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.section-head { max-width: 680px; margin: 0 auto clamp(40px, 6vw, 64px); text-align: center; }
.section-head p { color: var(--muted); font-size: 1.08rem; }

/* ---------- Buttons ---------- */
.btn {
  --b: transparent;
  display: inline-flex; align-items: center; gap: .55em;
  font-weight: 600; font-size: .98rem;
  padding: .8em 1.4em; border-radius: 999px;
  border: 1px solid var(--b); cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--grad); color: #1a1205;
  box-shadow: 0 10px 30px -10px rgba(255, 107, 53, 0.6);
}
.btn-primary:hover { color: #1a1205; box-shadow: 0 16px 40px -12px rgba(255, 107, 53, 0.75); }
.btn-ghost { --b: var(--border-strong); background: rgba(255,255,255,.03); color: var(--text); }
.btn-ghost:hover { --b: var(--amber); color: var(--text); background: rgba(247,164,29,.06); }
.btn svg { width: 1.1em; height: 1.1em; }

/* ---------- Navbar ---------- */
.nav {
  position: sticky; top: 0; z-index: 50; height: var(--nav-h);
  display: flex; align-items: center;
  backdrop-filter: blur(14px);
  background: rgba(10, 11, 16, 0.6);
  border-bottom: 1px solid transparent;
  transition: background .25s ease, border-color .25s ease;
}
.nav.scrolled { background: rgba(10, 11, 16, 0.85); border-bottom-color: var(--border); }
.nav .container { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: .6em; font-weight: 800; font-size: 1.15rem; color: var(--text); letter-spacing: -.02em; }
.brand:hover { color: var(--text); }
.brand img, .brand .logo-mark { width: 30px; height: 30px; }
.brand b { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { color: var(--muted); font-size: .95rem; font-weight: 500; padding: .5em .8em; border-radius: 8px; }
.nav-links a:hover { color: var(--text); background: rgba(255,255,255,.04); }
.nav-cta { margin-left: 8px; }
.nav-toggle { display: none; background: none; border: 0; color: var(--text); cursor: pointer; padding: 8px; }

/* ---------- Hero ---------- */
.hero { position: relative; padding-top: clamp(56px, 8vw, 96px); padding-bottom: clamp(40px, 6vw, 72px); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 5.6vw, 4.1rem); font-weight: 800; margin-bottom: .35em; }
.hero .lede { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--muted); max-width: 36ch; margin-bottom: 1.8em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 28px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 10px; }
.pill {
  font-family: var(--font-mono); font-size: .78rem; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px; padding: .35em .9em;
  background: rgba(255,255,255,.02);
}
.pill b { color: var(--amber); font-weight: 600; }

/* floating orbs */
.orb { position: absolute; border-radius: 50%; filter: blur(36px); opacity: .55; z-index: -1; animation: float 14s ease-in-out infinite; }
.orb.a { width: 320px; height: 320px; background: radial-gradient(circle, rgba(247,164,29,.7), transparent 70%); top: -60px; right: -40px; }
.orb.b { width: 260px; height: 260px; background: radial-gradient(circle, rgba(124,92,255,.6), transparent 70%); bottom: -80px; left: 20%; animation-delay: -5s; }
@keyframes float { 0%,100% { transform: translateY(0) translateX(0);} 50% { transform: translateY(-26px) translateX(14px);} }

/* code/terminal window */
.window {
  border-radius: var(--radius); border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: var(--shadow); overflow: hidden;
}
.window-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: rgba(0,0,0,.25); }
.window-bar .dot { width: 11px; height: 11px; border-radius: 50%; }
.dot.r { background: #ff5f57; } .dot.y { background: #febc2e; } .dot.g { background: #28c840; }
.window-bar .title { margin-left: 8px; font-family: var(--font-mono); font-size: .78rem; color: var(--faint); }
.window pre { margin: 0; padding: 20px 22px; background: transparent !important; font-size: .86rem; line-height: 1.7; overflow-x: auto; }
.window code { font-family: var(--font-mono); }

.term { font-family: var(--font-mono); font-size: .86rem; padding: 20px 22px; line-height: 1.9; }
.term .pr { color: var(--cyan); } .term .cm { color: var(--text); } .term .out { color: var(--faint); }

/* ---------- Marquee / stat strip ---------- */
.strip { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: rgba(255,255,255,.015); }
.strip .container { display: flex; flex-wrap: wrap; justify-content: space-around; gap: 24px; padding-top: 26px; padding-bottom: 26px; }
.stat { text-align: center; }
.stat b { display: block; font-size: 1.7rem; font-weight: 800; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat span { font-size: .85rem; color: var(--muted); font-family: var(--font-mono); }

/* ---------- Feature grid ---------- */
.grid { display: grid; gap: 20px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  position: relative; padding: 28px; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012));
  border: 1px solid var(--border);
  transition: transform .2s ease, border-color .2s ease, box-shadow .25s ease;
  overflow: hidden;
}
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: var(--grad); opacity: 0;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  transition: opacity .25s ease; pointer-events: none;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-glow); }
.card:hover::after { opacity: .9; }
.card .ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 16px; background: rgba(247,164,29,.12); color: var(--amber); }
.card .ic svg { width: 24px; height: 24px; }
.card h3 { margin-bottom: .4em; }
.card p { color: var(--muted); font-size: .96rem; margin: 0; }

/* ---------- Split showcase ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.split ul { list-style: none; padding: 0; margin: 1.4em 0 0; display: grid; gap: 14px; }
.split li { display: flex; gap: 12px; color: var(--muted); }
.split li svg { flex: none; width: 22px; height: 22px; color: var(--amber); margin-top: 2px; }
.split li b { color: var(--text); font-weight: 600; }

/* ---------- Steps ---------- */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.step { padding: 26px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); position: relative; }
.step::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono); font-size: 1.05rem; font-weight: 700;
  color: #1a1205; background: var(--grad); width: 40px; height: 40px;
  display: grid; place-items: center; border-radius: 11px; margin-bottom: 16px;
}
.step h3 { font-size: 1.1rem; }
.step p { color: var(--muted); font-size: .95rem; margin: 0; }

/* ---------- Roadmap timeline ---------- */
.timeline { max-width: 760px; margin: 0 auto; position: relative; padding-left: 8px; }
.timeline::before { content: ""; position: absolute; left: 19px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--amber), var(--violet), transparent); }
.tl-item { position: relative; padding: 0 0 30px 56px; }
.tl-item .node { position: absolute; left: 8px; top: 2px; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); border: 2px solid var(--border-strong); display: grid; place-items: center; }
.tl-item.done .node { background: var(--grad); border-color: transparent; }
.tl-item.active .node { border-color: var(--amber); box-shadow: 0 0 0 4px rgba(247,164,29,.18); }
.tl-item .node svg { width: 13px; height: 13px; color: #1a1205; }
.tl-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.tl-head h3 { margin: 0; font-size: 1.12rem; }
.tag { font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; padding: .25em .7em; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--muted); }
.tag.done { color: #28c840; border-color: rgba(40,200,64,.4); background: rgba(40,200,64,.08); }
.tag.active { color: var(--amber); border-color: rgba(247,164,29,.5); background: rgba(247,164,29,.08); }
.tl-item p { color: var(--muted); font-size: .95rem; margin: 0; }

/* ---------- CTA band ---------- */
.cta-band { position: relative; border-radius: 24px; padding: clamp(40px, 6vw, 72px); text-align: center; overflow: hidden; border: 1px solid var(--border-strong); background: linear-gradient(135deg, rgba(247,164,29,.12), rgba(124,92,255,.12)); }
.cta-band h2 { margin-bottom: .3em; }
.cta-band p { color: var(--muted); max-width: 50ch; margin: 0 auto 1.6em; }
.cta-band .btn-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 56px 0 40px; color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 40px; }
.footer h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); margin-bottom: 14px; }
.footer a { display: block; color: var(--muted); font-size: .95rem; padding: 4px 0; }
.footer a:hover { color: var(--amber); }
.footer .brand { margin-bottom: 12px; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; border-top: 1px solid var(--border); padding-top: 24px; font-size: .85rem; color: var(--faint); }

/* ---------- Docs layout ---------- */
.docs-wrap { display: grid; grid-template-columns: 250px 1fr; gap: 48px; max-width: var(--maxw); margin: 0 auto; padding: 48px 24px 96px; align-items: start; }
.docs-side { position: sticky; top: calc(var(--nav-h) + 24px); }
.docs-side h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); margin: 0 0 10px; }
.docs-side nav { display: flex; flex-direction: column; gap: 2px; margin-bottom: 24px; }
.docs-side nav a { color: var(--muted); font-size: .95rem; padding: .45em .7em; border-radius: 8px; border-left: 2px solid transparent; }
.docs-side nav a:hover { color: var(--text); background: rgba(255,255,255,.03); }
.docs-side nav a.active { color: var(--amber); border-left-color: var(--amber); background: rgba(247,164,29,.06); }
.prose { max-width: 760px; min-width: 0; }
.prose h1 { font-size: clamp(2rem, 4vw, 2.7rem); margin-bottom: .5em; }
.prose h2 { margin-top: 1.8em; padding-bottom: .3em; border-bottom: 1px solid var(--border); }
.prose h3 { margin-top: 1.6em; }
.prose code { font-family: var(--font-mono); font-size: .88em; background: rgba(255,255,255,.06); padding: .15em .4em; border-radius: 6px; }
.prose pre { background: var(--surface) !important; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 18px 20px; overflow-x: auto; font-size: .87rem; line-height: 1.7; }
.prose pre code { background: none; padding: 0; font-size: inherit; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: .94rem; }
.prose th, .prose td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.prose th { color: var(--text); font-weight: 600; }
.prose td { color: var(--muted); }
.prose blockquote { margin: 1.5em 0; padding: .6em 1.2em; border-left: 3px solid var(--amber); background: rgba(247,164,29,.05); border-radius: 0 8px 8px 0; color: var(--muted); }
.prose blockquote p { margin: .3em 0; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.5em 0; }
.prose ul, .prose ol { color: var(--muted); }
.prose li { margin: .35em 0; }
.prose a { border-bottom: 1px solid transparent; }
.prose a:hover { border-bottom-color: currentColor; }
.page-head { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Blog ---------- */
.posts { display: grid; gap: 20px; max-width: 820px; margin: 0 auto; }
.post-card { display: block; padding: 28px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); transition: transform .2s ease, border-color .2s ease; }
.post-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.post-card .meta { font-family: var(--font-mono); font-size: .8rem; color: var(--faint); margin-bottom: 8px; }
.post-card h3 { color: var(--text); margin-bottom: .3em; }
.post-card p { color: var(--muted); margin: 0; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .hero-grid, .split { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .grid.cols-3, .grid.cols-2, .steps { grid-template-columns: 1fr; }
  .docs-wrap { grid-template-columns: 1fr; }
  .docs-side { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { position: fixed; inset: var(--nav-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 0; background: rgba(10,11,16,.97); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); padding: 12px; transform: translateY(-130%); transition: transform .28s ease; }
  .nav-links.open { transform: none; }
  .nav-links a { padding: .8em 1em; }
  .nav-toggle { display: block; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
  .strip .container { gap: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
