/* ============================================================
   NOVA CODER QUANTUM INTERFACE, design system v1.0
   Codex Laboratories AI · novacoder.codexlabsai.com
   ============================================================ */

:root {
  /* Palette */
  --void: #060A12;
  --navy: #0B1324;
  --slate: #111D32;
  --graphite: #192840;
  --cyan: #54E5F7;
  --violet: #9D83FF;
  --ion: #4D96FF;
  --white: #F5F9FF;
  --emerald: #45D6AD;
  --amber: #F3B85F;
  --plasma: #FF718A;
  --muted: #9FB1C9;
  --border: #2A3B56;

  /* Derived */
  --bg: var(--void);
  --bg-2: var(--navy);
  --panel: var(--slate);
  --raised: var(--graphite);
  --text: #DDE7F5;
  --text-strong: var(--white);
  --text-dim: var(--muted);
  --line: var(--border);
  --accent: var(--cyan);
  --accent-2: var(--violet);
  --accent-3: var(--ion);

  /* Type */
  --font-ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas,
    "Liberation Mono", monospace;

  /* Rhythm */
  --maxw: 1180px;
  --radius: 14px;
  --radius-sm: 9px;
  --glow-cyan: 0 0 22px rgba(84, 229, 247, .18);
  --glow-violet: 0 0 26px rgba(157, 131, 255, .16);
  --shadow: 0 18px 50px rgba(2, 6, 14, .55);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

body {
  margin: 0;
  background:
    radial-gradient(1100px 620px at 78% -12%, rgba(77, 150, 255, .10), transparent 62%),
    radial-gradient(900px 540px at 8% 4%, rgba(157, 131, 255, .07), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16.5px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Precision grid layer, fixed behind content */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(84, 229, 247, .028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(84, 229, 247, .028) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 62% at 50% 0%, #000 0%, transparent 78%);
}

::selection { background: rgba(84, 229, 247, .28); color: var(--white); }

h1, h2, h3, h4 {
  color: var(--text-strong);
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.16;
  margin: 0 0 .55em;
}
h1 { font-size: clamp(2.3rem, 5.2vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3.1vw, 2.2rem); }
h3 { font-size: 1.18rem; }
p  { margin: 0 0 1rem; }
a  { color: var(--accent); text-decoration: none; }
a:hover { color: #8ef0fb; }
img, svg { max-width: 100%; }
code, pre { font-family: var(--font-mono); font-size: .92em; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--cyan); color: var(--void);
  padding: .6rem 1rem; font-weight: 600; z-index: 200;
}
.skip-link:focus { left: 8px; top: 8px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 26px; position: relative; z-index: 1; }

/* ---------------- Navigation ---------------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(6, 10, 18, .72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid rgba(42, 59, 86, .6);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 26px;
  display: flex; align-items: center; gap: 18px;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--white); font-weight: 700; letter-spacing: .02em; }
.brand:hover { color: var(--white); }
.brand .mark { width: 30px; height: 30px; flex: 0 0 auto; }
.brand small { display: block; font-size: .58rem; letter-spacing: .24em; color: var(--muted); font-weight: 500; margin-top: 1px; }
.brand > span { line-height: 1.05; }

.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; list-style: none; padding: 0; }
.nav-links a {
  color: var(--muted); font-size: .92rem; font-weight: 500;
  padding: .5rem .72rem; border-radius: 8px;
  transition: color .16s, background .16s;
}
.nav-links a:hover { color: var(--white); background: rgba(84, 229, 247, .07); }
.nav-links a[aria-current="page"] { color: var(--cyan); }
.nav-cta {
  margin-left: 10px;
  color: var(--void) !important;
  background: linear-gradient(135deg, var(--cyan), var(--ion)) !important;
  font-weight: 700 !important;
  box-shadow: var(--glow-cyan);
}
.nav-cta:hover { filter: brightness(1.08); }

/* Nav dropdowns — click-toggled via .open (JS), hover/focus on
   devices that can hover; mobile menu turns them into accordions. */
.has-dropdown { position: relative; }
.dropdown-toggle {
  appearance: none; -webkit-appearance: none; background: none; border: 0; cursor: pointer;
  color: var(--muted); font: inherit; font-size: .92rem; font-weight: 500;
  line-height: 20px;
  padding: .5rem .72rem; border-radius: 8px;
  display: inline-flex; align-items: center; gap: 6px;
  transition: color .16s, background .16s;
}
.dropdown-toggle::after {
  content: ""; width: 7px; height: 7px; flex: 0 0 auto;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform .16s;
}
.dropdown-toggle:hover { color: var(--white); background: rgba(84, 229, 247, .07); }
.has-dropdown.current > .dropdown-toggle { color: var(--cyan); }
.has-dropdown.open > .dropdown-toggle::after,
.has-dropdown:hover > .dropdown-toggle::after { transform: rotate(225deg); }
.dropdown {
  display: none; position: absolute; top: calc(100% + 6px); left: 0;
  min-width: 190px; margin: 0; padding: 8px; list-style: none;
  background: rgba(8, 13, 23, .97);
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .45);
}
.dropdown a { display: block; padding: .55rem .7rem; }
.has-dropdown:focus-within > .dropdown,
.has-dropdown.open > .dropdown { display: block; }
@media (hover: hover) {
  .has-dropdown:hover > .dropdown { display: block; }
}

.nav-toggle {
  display: none; margin-left: auto;
  background: none; border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); padding: .5rem .62rem; cursor: pointer;
}

@media (max-width: 880px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: rgb(8, 13, 23);
    border-bottom: 1px solid var(--line);
    padding: 12px 22px 20px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .75rem .8rem; font-size: 1rem; }
  .nav-cta { margin: 10px 0 0; text-align: center; }
  .dropdown-toggle { width: 100%; justify-content: space-between;
    padding: .75rem .8rem; font-size: 1rem; }
  .dropdown {
    position: static; box-shadow: none; border: 0; border-radius: 0;
    border-left: 2px solid var(--line); background: none;
    margin: 0 0 4px 14px; padding: 0 0 0 10px; min-width: 0;
  }
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .78rem 1.5rem; border-radius: 10px;
  font-weight: 650; font-size: .98rem; letter-spacing: .01em;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .16s, box-shadow .2s, background .2s, border-color .2s;
}
.btn-primary {
  color: var(--void);
  background: linear-gradient(135deg, var(--cyan) 0%, var(--ion) 100%);
  box-shadow: var(--glow-cyan);
}
.btn-primary:hover { color: var(--void); transform: translateY(-2px); box-shadow: 0 0 34px rgba(84, 229, 247, .32); }
.btn-ghost {
  color: var(--text-strong);
  border-color: var(--line);
  background: rgba(17, 29, 50, .55);
}
.btn-ghost:hover { color: var(--white); border-color: var(--cyan); transform: translateY(-2px); }

/* ---------------- Hero ---------------- */
.hero {
  position: relative; overflow: hidden;
  padding: 96px 0 84px;
  background:
    radial-gradient(760px 420px at 50% -8%, rgba(84, 229, 247, .10), transparent 65%),
    radial-gradient(620px 400px at 84% 30%, rgba(157, 131, 255, .09), transparent 68%),
    linear-gradient(180deg, var(--navy) 0%, var(--bg) 100%);
  border-bottom: 1px solid rgba(42, 59, 86, .5);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
@media (max-width: 960px) { .hero-grid { grid-template-columns: 1fr; gap: 44px; } }

.kicker {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .78rem; font-weight: 650; letter-spacing: .22em; text-transform: uppercase;
  color: var(--cyan); margin-bottom: 20px;
}
.kicker::before { content: ""; width: 26px; height: 1px; background: linear-gradient(90deg, transparent, var(--cyan)); }

.hero h1 {
  font-size: clamp(2.6rem, 5.6vw, 4.15rem);
  letter-spacing: -0.028em;
  background: linear-gradient(115deg, var(--white) 55%, var(--cyan) 92%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .sub { font-size: 1.18rem; color: var(--text-dim); max-width: 32rem; margin-bottom: 34px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-meta { margin-top: 30px; font-size: .85rem; color: var(--muted); display: flex; gap: 22px; flex-wrap: wrap; }
.hero-meta span { display: inline-flex; align-items: center; gap: .45rem; }
.hero-meta .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 8px var(--emerald); }

/* Orbital hero artwork */
.hero-art { position: relative; }
.orbit-stage { position: relative; width: 100%; aspect-ratio: 1 / .92; }
.orbit-stage svg { width: 100%; height: 100%; display: block; }
.orbit-ring { transform-origin: center; }
.orbit-spin-a { animation: spin 46s linear infinite; }
.orbit-spin-b { animation: spin 64s linear infinite reverse; }
.orbit-spin-c { animation: spin 90s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.float-slow { animation: floaty 7s ease-in-out infinite; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

/* Console card inside hero */
.console-card {
  position: absolute; left: 7%; right: 7%; bottom: 4%;
  background: rgba(11, 19, 36, .92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow), 0 0 0 1px rgba(84, 229, 247, .05);
  overflow: hidden;
}
.console-head {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 13px; border-bottom: 1px solid var(--line);
  background: rgba(25, 40, 64, .5);
}
.console-head i { width: 9px; height: 9px; border-radius: 50%; }
.console-head i:nth-child(1) { background: var(--plasma); }
.console-head i:nth-child(2) { background: var(--amber); }
.console-head i:nth-child(3) { background: var(--emerald); }
.console-head span { margin-left: 8px; font-size: .72rem; color: var(--muted); font-family: var(--font-mono); }
.console-body {
  padding: 13px 15px; font-family: var(--font-mono); font-size: .74rem;
  line-height: 1.72; color: #A9C1DE;
}
.console-body .c { color: var(--muted); }
.console-body .p { color: var(--cyan); }
.console-body .v { color: var(--violet); }
.console-body .ok { color: var(--emerald); }
.caret { display: inline-block; width: 7px; height: 13px; background: var(--cyan); vertical-align: -2px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------------- Sections ---------------- */
.section { padding: 84px 0; position: relative; }
.section + .section { border-top: 1px solid rgba(42, 59, 86, .42); }
.section.alt { background: linear-gradient(180deg, rgba(11, 19, 36, .55), rgba(6, 10, 18, 0)); }
.section-head { max-width: 46rem; margin-bottom: 46px; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head .kicker { justify-content: center; }
.section-head.center .kicker::before { display: none; }
.section-head p { color: var(--text-dim); font-size: 1.05rem; }

/* Cards / grids */
.grid { display: grid; gap: 18px; }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .grid.c3, .grid.c4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; } }

.card {
  position: relative;
  background: linear-gradient(165deg, var(--slate) 0%, var(--navy) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform .2s, border-color .2s, box-shadow .25s;
}
.card:hover { transform: translateY(-3px); border-color: rgba(84, 229, 247, .45); box-shadow: var(--shadow); }
.card h3 { margin-bottom: .45rem; }
.card p { color: var(--text-dim); font-size: .94rem; margin: 0; }
.card .icon {
  width: 42px; height: 42px; border-radius: 10px;
  display: grid; place-items: center; margin-bottom: 15px;
  background: rgba(84, 229, 247, .08);
  border: 1px solid rgba(84, 229, 247, .22);
  color: var(--cyan);
}
.card .icon svg { width: 22px; height: 22px; }
.card.violet .icon { background: rgba(157, 131, 255, .09); border-color: rgba(157, 131, 255, .25); color: var(--violet); }
.card.ion .icon { background: rgba(77, 150, 255, .09); border-color: rgba(77, 150, 255, .25); color: var(--ion); }
.card.emerald .icon { background: rgba(69, 214, 173, .08); border-color: rgba(69, 214, 173, .25); color: var(--emerald); }

.badge {
  display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; padding: .22rem .6rem; border-radius: 99px;
  border: 1px solid var(--line); color: var(--muted); vertical-align: 2px;
}
.badge.live { color: var(--emerald); border-color: rgba(69, 214, 173, .4); background: rgba(69, 214, 173, .08); }
.badge.beta { color: var(--amber); border-color: rgba(243, 184, 95, .4); background: rgba(243, 184, 95, .08); }

/* Stat band */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { text-align: center; padding: 22px 10px; }
.stat b { display: block; font-size: 2rem; color: var(--white); font-weight: 700; }
.stat span { font-size: .82rem; color: var(--muted); letter-spacing: .04em; }

/* Code block */
.codeblock {
  background: #080E1B;
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}
.codeblock .bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 14px; background: rgba(25, 40, 64, .55);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono); font-size: .72rem; color: var(--muted);
}
.codeblock pre {
  margin: 0; padding: 18px; overflow-x: auto;
  font-size: .82rem; line-height: 1.7; color: #B7CBE6;
}
.codeblock .k { color: var(--violet); }   /* keyword */
.codeblock .s { color: var(--emerald); }  /* string */
.codeblock .f { color: var(--cyan); }     /* function */
.codeblock .n { color: var(--amber); }    /* number */
.codeblock .c { color: #5E7391; }         /* comment */
.copy-btn {
  background: none; border: 1px solid var(--line); border-radius: 6px;
  color: var(--muted); font-size: .68rem; font-family: var(--font-ui);
  padding: .3rem .6rem; cursor: pointer;
}
.copy-btn:hover { color: var(--cyan); border-color: var(--cyan); }

/* Feature list rows */
.frow { display: flex; gap: 16px; align-items: flex-start; padding: 15px 0; border-bottom: 1px solid rgba(42, 59, 86, .4); }
.frow:last-child { border-bottom: 0; }
.frow .tick { flex: 0 0 auto; width: 24px; height: 24px; margin-top: 2px; color: var(--emerald); }
.frow h4 { margin: 0 0 3px; font-size: 1rem; }
.frow p { margin: 0; font-size: .9rem; color: var(--text-dim); }

/* Split showcase */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 52px; align-items: center; }
@media (max-width: 920px) { .split { grid-template-columns: 1fr; gap: 34px; } }
.split .media {
  border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--slate), var(--navy));
  overflow: hidden; box-shadow: var(--shadow);
}

/* CTA band */
.cta-band {
  text-align: center; padding: 78px 24px;
  border-radius: 20px;
  background:
    radial-gradient(480px 220px at 50% -40%, rgba(84, 229, 247, .14), transparent 70%),
    linear-gradient(160deg, var(--slate), var(--navy));
  border: 1px solid rgba(84, 229, 247, .28);
  box-shadow: var(--glow-cyan), var(--shadow);
}
.cta-band h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
.cta-band p { color: var(--text-dim); max-width: 34rem; margin: 0 auto 30px; }

/* Footer */
.footer {
  border-top: 1px solid var(--line);
  background: var(--navy);
  padding: 56px 0 34px;
  margin-top: 20px;
}
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 36px; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer h3 { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-strong); margin-bottom: 14px; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 9px; }
.footer a { color: var(--muted); font-size: .9rem; }
.footer a:hover { color: var(--cyan); }
.footer .base { margin-top: 40px; padding-top: 22px; border-top: 1px solid rgba(42, 59, 86, .5); display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; font-size: .82rem; color: #6E82A0; }

/* Reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .55s ease, transform .55s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* Prose (docs-ish pages) */
.prose { max-width: 46rem; }
.prose h2 { margin-top: 2.2em; }
.prose h3 { margin-top: 1.8em; }
.prose ul { padding-left: 1.2rem; color: var(--text-dim); }
.prose li { margin-bottom: .35rem; }
.prose table { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 1.2rem 0; }
.prose th, .prose td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--line); }
.prose th { color: var(--text-strong); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.prose td { color: var(--text-dim); }
.prose td code, .prose p code { color: var(--cyan); background: rgba(84, 229, 247, .08); padding: .1rem .38rem; border-radius: 5px; }

/* Page hero (interior pages) */
.page-hero {
  padding: 70px 0 46px;
  background:
    radial-gradient(560px 300px at 50% -20%, rgba(84, 229, 247, .09), transparent 65%),
    linear-gradient(180deg, var(--navy), var(--bg));
  border-bottom: 1px solid rgba(42, 59, 86, .5);
}
.page-hero p.lead { font-size: 1.12rem; color: var(--text-dim); max-width: 42rem; }

/* Diagram frame */
.diagram { background: #080E1B; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.diagram svg { width: 100%; height: auto; display: block; }

/* Small helper */
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.center { text-align: center; }
.mt-2 { margin-top: 1.6rem; }

/* ---------------- Docs portal ---------------- */
.crumbs { font-size: .8rem; color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--cyan); }
.doc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 44px; align-items: start; }
@media (max-width: 920px) { .doc-grid { grid-template-columns: 1fr; } }
.toc { position: sticky; top: 84px; border-left: 1px solid var(--line); padding-left: 18px; }
.toc h2 { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin-bottom: 7px; }
.toc a { color: var(--muted); font-size: .82rem; line-height: 1.35; display: block; }
.toc a:hover { color: var(--cyan); }
.doc-body { max-width: 44rem; }
.doc-body pre {
  background: #080E1B; border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; overflow-x: auto; font-size: .8rem; line-height: 1.65; color: #B7CBE6;
}
.doc-body h1 { font-size: 1.8rem; }
.doc-body h2 { font-size: 1.3rem; margin-top: 1.9em; padding-top: .6em; border-top: 1px solid rgba(42,59,86,.4); }
.doc-body h3 { font-size: 1.05rem; margin-top: 1.6em; }
.doc-body img { border-radius: 10px; border: 1px solid var(--line); }
.doc-body blockquote { border-left: 3px solid var(--cyan); margin: 1rem 0; padding: .2rem 1rem; color: var(--text-dim); background: rgba(84,229,247,.05); border-radius: 0 8px 8px 0; }
.doc-body hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.doc-body a { word-break: break-word; }
