/* ============================================================
   NyxOS — GitHub Pages manual
   Night-themed (Nyx = goddess of night): deep space + neon mint.
   ============================================================ */

:root {
  --bg:        #05060a;
  --bg-2:      #080a12;
  --surface:   rgba(255,255,255,.035);
  --surface-2: rgba(255,255,255,.06);
  --border:    rgba(255,255,255,.09);
  --border-2:  rgba(255,255,255,.16);
  --text:      #e7e9f0;
  --muted:     #9aa0b4;
  --faint:     #6b7288;
  --accent:    #a855f7;
  --accent-2:  #7c22ce;
  --accent-3:  #d946ef;
  --danger:    #ff5c72;
  --amber:     #ffcb47;
  --radius:    16px;
  --maxw:      1180px;
  --ease:      cubic-bezier(.2,.7,.2,1);
  --mono:      "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --display:   "Space Grotesk", "Inter", system-ui, sans-serif;
  --sans:      "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }

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

/* cosmic backdrop */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -3;
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(168,85,247,.15), transparent 60%),
    radial-gradient(1000px 600px at 5% 0%, rgba(217,70,239,.08), transparent 55%),
    linear-gradient(180deg, #05060a 0%, #070812 40%, #05060a 100%);
}
#starfield { position: fixed; inset: 0; z-index: -2; opacity: .7; }
.glow { position: fixed; z-index: -1; filter: blur(90px); opacity: .4; pointer-events: none; border-radius: 50%; }
.glow-1 { width: 500px; height: 500px; top: -120px; right: -80px; background: radial-gradient(circle, rgba(168,85,247,.5), transparent 70%); }
.glow-2 { width: 460px; height: 460px; top: 40vh; left: -160px; background: radial-gradient(circle, rgba(217,70,239,.32), transparent 70%); }

a { color: inherit; text-decoration: none; }
.mono { font-family: var(--mono); font-size: .9em; color: var(--accent); background: rgba(168,85,247,.07); padding: .05em .4em; border-radius: 6px; }
.muted { color: var(--muted); }

/* ============ NAV ============ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; gap: 1.4rem;
  padding: .7rem clamp(1rem, 4vw, 2.2rem);
  background: rgba(6,7,12,.6);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.nav.scrolled { border-bottom-color: var(--border); background: rgba(6,7,12,.82); }
.brand { display: flex; align-items: center; gap: .55rem; font-family: var(--display); font-weight: 700; }
.brand-mark { display: grid; place-items: center; filter: drop-shadow(0 0 8px rgba(168,85,247,.5)); }
.brand-name { font-size: 1.22rem; letter-spacing: .3px; }
.brand-name span { color: var(--accent); }
.nav-links { display: flex; gap: .3rem; margin-left: 1rem; margin-right: auto; }
.nav-links a {
  padding: .45rem .8rem; border-radius: 9px; font-size: .92rem; color: var(--muted);
  font-weight: 500; transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface); }
.nav-links a.active { color: var(--accent); }
.nav-actions { display: flex; align-items: center; gap: .6rem; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .55rem 1.05rem; border-radius: 10px; font-weight: 600; font-size: .92rem;
  border: 1px solid transparent; cursor: pointer; transition: transform .15s var(--ease), box-shadow .25s, background .2s, border-color .2s;
  white-space: nowrap;
}
.btn-lg { padding: .8rem 1.5rem; font-size: 1rem; border-radius: 12px; }
.btn-solid { background: var(--accent); color: #fff; box-shadow: 0 6px 24px -8px rgba(168,85,247,.6); }
.btn-solid:hover { transform: translateY(-2px); box-shadow: 0 12px 32px -8px rgba(168,85,247,.75); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-2); }
.btn-ghost:hover { background: var(--surface-2); transform: translateY(-2px); border-color: var(--accent); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 6px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: .3s; }

/* ============ LAYOUT ============ */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem); }
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; border-top: 1px solid var(--border); }
.section-head { max-width: 760px; margin-bottom: 2.6rem; }
.kicker {
  display: inline-block; font-family: var(--mono); font-size: .78rem; letter-spacing: 2px;
  text-transform: uppercase; color: var(--accent); margin-bottom: .8rem;
  padding: .25rem .7rem; border: 1px solid rgba(168,85,247,.25); border-radius: 20px;
}
h2 { font-family: var(--display); font-size: clamp(1.7rem, 3.6vw, 2.5rem); line-height: 1.15; margin: 0 0 .8rem; letter-spacing: -.5px; }
h3 { font-family: var(--display); font-size: 1.15rem; margin: 0 0 .5rem; }
.lead { color: var(--muted); font-size: 1.08rem; margin: 0; }

/* ============ HERO ============ */
.hero {
  display: grid; grid-template-columns: minmax(0,1.05fr) minmax(0,.95fr); gap: 3rem; align-items: center;
  padding: clamp(7rem, 14vh, 10rem) 0 clamp(3rem, 6vw, 5rem);
}
.hero-copy, .hero-term { min-width: 0; }
.eyebrow {
  font-family: var(--mono); font-size: .82rem; letter-spacing: 1px; color: var(--accent);
  text-transform: uppercase; display: inline-block; margin-bottom: 1.2rem;
  padding: .3rem .8rem; border: 1px solid rgba(168,85,247,.3); border-radius: 20px; background: rgba(168,85,247,.06);
}
.hero-title { font-family: var(--display); font-weight: 700; font-size: clamp(3.4rem, 9vw, 6rem); line-height: .95; margin: 0 0 1.2rem; letter-spacing: -2px; }
.grad {
  background: linear-gradient(120deg, var(--accent) 10%, var(--accent-3) 50%, var(--accent-2) 90%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-sub { font-size: 1.18rem; color: var(--muted); max-width: 32em; margin: 0 0 1.6rem; }
.hero-sub strong { color: var(--text); font-weight: 600; }
.hero-badges { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.8rem; }
.pill {
  font-family: var(--mono); font-size: .82rem; padding: .35rem .8rem; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
}
.pill-accent { color: var(--accent); border-color: rgba(168,85,247,.35); background: rgba(168,85,247,.06); }
.hero-cta { display: flex; gap: .8rem; flex-wrap: wrap; }

/* hero terminal */
.term {
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border-2);
  background: linear-gradient(180deg, rgba(10,12,20,.95), rgba(6,8,14,.98));
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.02), 0 0 60px -20px rgba(168,85,247,.4);
}
.term-bar, .shot-bar {
  display: flex; align-items: center; gap: .5rem; padding: .7rem 1rem;
  background: rgba(255,255,255,.03); border-bottom: 1px solid var(--border);
}
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.dot.r { background: #ff5f57; } .dot.y { background: #febc2e; } .dot.g { background: #28c840; }
.term-title, .shot-url { margin-left: .6rem; font-family: var(--mono); font-size: .78rem; color: var(--faint); }
.term-body {
  margin: 0; padding: 1.2rem 1.3rem 1.6rem; font-family: var(--mono); font-size: .75rem;
  line-height: 1.45; color: #c9d1e4; min-height: 480px; white-space: pre; overflow-x: auto;
}
.term-body .p { color: var(--accent); } .term-body .k { color: #c084fc; }
.term-body .v { color: var(--accent-3); } .term-body .m { color: #6b7288; }
.cursor { color: var(--accent); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ============ STATS ============ */
.stats {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px;
  background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  margin-bottom: 1rem;
}
.stat { background: var(--bg-2); padding: 1.3rem 1.1rem; text-align: center; }
.stat b { display: block; font-family: var(--display); font-size: 1.35rem; color: var(--text); }
.stat span { font-size: .8rem; color: var(--faint); }

/* ============ OVERVIEW / SHOT ============ */
.shot { margin-top: 2.6rem; }
.shot-frame {
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border-2);
  background: var(--bg-2); box-shadow: 0 50px 90px -40px rgba(0,0,0,.9), 0 0 70px -30px rgba(168,85,247,.25);
}
.shot-frame img { display: block; width: 100%; height: auto; }

/* ============ FEATURES GRID ============ */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.card {
  position: relative; padding: 1.6rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  transition: transform .25s var(--ease), border-color .25s, background .25s;
  overflow: hidden;
}
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(135deg, rgba(168,85,247,.6), transparent 40%, rgba(217,70,239,.5));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .3s;
}
.card:hover { transform: translateY(-4px); background: var(--surface-2); }
.card:hover::after { opacity: 1; }
.card-ic {
  width: 46px; height: 46px; display: grid; place-items: center; font-size: 1.35rem;
  border-radius: 12px; margin-bottom: 1rem;
  background: linear-gradient(135deg, rgba(168,85,247,.14), rgba(217,70,239,.14));
  border: 1px solid var(--border);
}
.card p { color: var(--muted); font-size: .95rem; margin: 0; }

/* ============ ARCHITECTURE ============ */
.arch { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.arch-col { padding: 1.8rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.flow { margin: 0; padding-left: 1.2rem; counter-reset: step; list-style: none; }
.flow li { position: relative; padding: .55rem 0 .55rem 1.6rem; border-left: 1px solid var(--border-2); color: var(--muted); }
.flow li b { color: var(--text); }
.flow li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: -13px; top: .6rem; width: 24px; height: 24px;
  display: grid; place-items: center; font-family: var(--mono); font-size: .72rem;
  background: var(--bg-2); color: var(--accent); border: 1px solid var(--border-2); border-radius: 50%;
}
.flow li:last-child { border-left-color: transparent; }
.memmap { display: flex; flex-direction: column; gap: .5rem; }
.mem.row {
  display: flex; justify-content: space-between; gap: 1rem; align-items: center;
  padding: .6rem .8rem; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--border);
}
.mem.row .mono { color: var(--accent-3); background: none; padding: 0; }
.mem.row em { color: var(--muted); font-style: normal; font-size: .86rem; text-align: right; }
.mem.row.accent { border-color: rgba(0,255,157,.3); }
.mem.row.accent .mono { color: var(--accent); }

/* ============ MANUAL / STEPS ============ */
.steps { display: flex; flex-direction: column; gap: 1.4rem; }
.step { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 1.2rem; align-items: start; }
.step > div { min-width: 0; }
.step-n {
  width: 40px; height: 40px; display: grid; place-items: center; flex: none;
  font-family: var(--display); font-weight: 700; font-size: 1.1rem;
  border-radius: 12px; background: linear-gradient(135deg, var(--accent), var(--accent-3)); color: #fff;
}
.code { border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: #070911; margin-top: .8rem; }
.code-bar { padding: .5rem .9rem; background: rgba(255,255,255,.03); border-bottom: 1px solid var(--border); font-family: var(--mono); font-size: .75rem; color: var(--faint); }
.code pre { margin: 0; padding: 1rem 1.1rem; overflow-x: auto; }
.code code { font-family: var(--mono); font-size: .84rem; color: #d6def0; line-height: 1.7; }
.c-c { color: var(--faint); }

/* command table */
.cmd-table { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.cmd-table table { width: 100%; border-collapse: collapse; }
.cmd-table th, .cmd-table td { text-align: left; padding: .95rem 1.1rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.cmd-table thead th { background: var(--surface-2); font-family: var(--display); font-size: .9rem; letter-spacing: .3px; }
.cmd-table tbody tr:last-child td { border-bottom: 0; }
.cmd-table td:first-child { color: var(--accent-3); font-weight: 600; white-space: nowrap; width: 165px; }
.cmd-table .mono { background: none; color: #cdd5ea; padding: 0; line-height: 2; }

/* ============ NETWORKING ============ */
.net { display: grid; grid-template-columns: .9fr 1.1fr; gap: 1.6rem; align-items: start; }
.net-stack { display: flex; flex-direction: column; gap: .5rem; }
.layer {
  padding: .85rem 1.1rem; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); font-family: var(--display); font-weight: 600; position: relative; overflow: hidden;
}
.layer span { display: block; font-family: var(--mono); font-size: .74rem; font-weight: 400; color: var(--faint); margin-top: .15rem; }
.layer::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.layer.l7::before { background: var(--accent-3); } .layer.l4::before { background: var(--accent); }
.layer.l4b::before { background: var(--amber); } .layer.l3::before { background: var(--accent-2); }
.layer.l2::before { background: #ff8a5c; } .layer.l1::before { background: var(--danger); }
.net-notes { padding: 1.8rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.ticks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .9rem; }
.ticks li { position: relative; padding-left: 1.9rem; color: var(--muted); font-size: .95rem; }
.ticks li b { color: var(--text); }
.ticks li::before {
  content: "✓"; position: absolute; left: 0; top: 0; width: 22px; height: 22px;
  display: grid; place-items: center; font-size: .72rem; color: var(--accent);
  background: rgba(168,85,247,.1); border: 1px solid rgba(168,85,247,.3); border-radius: 6px;
}

/* ============ RELEASES TIMELINE ============ */
.timeline { display: flex; flex-direction: column; gap: 1rem; position: relative; }
.tl {
  display: grid; grid-template-columns: 110px 1fr; gap: 1.4rem; align-items: start;
  padding: 1.4rem 1.6rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  transition: border-color .25s, transform .2s var(--ease);
}
.tl:hover { transform: translateX(4px); border-color: var(--border-2); }
.tl-v { font-family: var(--mono); font-weight: 700; color: var(--accent-3); font-size: .95rem; padding-top: .15rem; }
.tl p { color: var(--muted); margin: .1rem 0 0; font-size: .95rem; }
.tl.accent { border-color: rgba(168,85,247,.35); background: linear-gradient(120deg, rgba(168,85,247,.06), var(--surface)); }
.tl.accent .tl-v { color: var(--accent); }

/* ============ CTA + FOOTER ============ */
.cta-card {
  text-align: center; padding: clamp(2.5rem, 6vw, 4rem); border-radius: 24px;
  background: radial-gradient(700px 300px at 50% -20%, rgba(168,85,247,.2), transparent 70%), var(--surface);
  border: 1px solid var(--border-2);
}
.cta-card p { color: var(--muted); max-width: 46em; margin: .6rem auto 1.8rem; }
.cta-card .hero-cta { justify-content: center; }

.footer { border-top: 1px solid var(--border); margin-top: 2rem; padding: 3rem clamp(1rem,4vw,2rem) 2rem; max-width: var(--maxw); margin-inline: auto; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; padding-bottom: 2rem; border-bottom: 1px solid var(--border); }
.foot-brand .brand-name { font-family: var(--display); font-size: 1.3rem; }
.foot-brand .brand-name span { color: var(--accent); }
.foot-brand p { max-width: 26em; margin: .6rem 0 0; font-size: .92rem; }
.foot-links { display: flex; flex-direction: column; gap: .5rem; }
.foot-links h4 { font-family: var(--display); font-size: .85rem; text-transform: uppercase; letter-spacing: 1px; color: var(--faint); margin: 0 0 .3rem; }
.foot-links a { color: var(--muted); font-size: .92rem; transition: color .2s; }
.foot-links a:hover { color: var(--accent); }
.foot-bar { display: flex; justify-content: space-between; gap: 1rem; padding-top: 1.5rem; color: var(--faint); font-size: .85rem; flex-wrap: wrap; }

/* ============ REVEAL ANIMATION ============ */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  .cursor { animation: none; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1000px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0;
    background: rgba(6,7,12,.97); backdrop-filter: blur(14px); padding: .8rem;
    border-bottom: 1px solid var(--border); gap: .2rem; margin: 0;
  }
  .nav-links.open a { padding: .8rem 1rem; }
  .nav-toggle { display: flex; }
  .nav-actions .btn-ghost { display: none; }
}
@media (max-width: 940px) {
  .hero { grid-template-columns: minmax(0,1fr); gap: 2.2rem; }
  .hero-term { order: 2; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .arch, .net { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0;
    background: rgba(6,7,12,.97); backdrop-filter: blur(14px); padding: .8rem;
    border-bottom: 1px solid var(--border); gap: .2rem; margin: 0;
  }
  .nav-links.open a { padding: .8rem 1rem; }
  .nav-toggle { display: flex; }
  .nav-actions .btn-ghost { display: none; }
  .grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .cmd-table td:first-child { width: auto; }
  .tl { grid-template-columns: 1fr; gap: .4rem; }
  .foot-grid { grid-template-columns: 1fr; }
}
