/* ============================================================
   Termtastic landing page — phosphor-green terminal aesthetic
   Pure CSS, no external fonts or assets.
   ============================================================ */

:root {
  --bg:        #0a0d0a;
  --panel:     #0d110d;
  --panel-2:   #0f150f;
  --green:     #5fdd8f;   /* primary phosphor text */
  --green-hi:  #7cfc9e;   /* bright accent */
  --green-dim: #2f6b45;   /* secondary / comments */
  --green-dimmer: #1c3a28;
  --border:    rgba(95, 221, 143, .20);
  --border-hi: rgba(95, 221, 143, .45);
  --glow:      rgba(95, 221, 143, .35);
  --red:       #ff5f57;
  --yellow:    #febc2e;
  --traffic-g: #28c840;
  --blue:      #5fa8ff;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;

  --maxw: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--green);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* faint radial vignette in the page background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(120% 80% at 70% -10%, rgba(95,221,143,.06), transparent 60%),
    radial-gradient(90% 60% at 0% 110%, rgba(95,221,143,.05), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }
code, em { font-style: normal; color: var(--green-hi); }

/* ---------- decorative CRT scanline overlay ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0px,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,.18) 3px,
    rgba(0,0,0,0) 4px
  );
  mix-blend-mode: multiply;
  opacity: .35;
}
/* The scanlines are a landing-page affectation — over the embedded live
   demo they read as a rendering artifact, so hide them while the demo
   page is active (script.js toggles the body class on route change). */
body.demo-active .overlay { display: none; }

/* ---------- scroll progress bar ---------- */
.progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--green-dim), var(--green-hi));
  box-shadow: 0 0 8px var(--glow);
  z-index: 10000;
  transition: width .08s linear;
}

/* ---------- NAV ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10, 13, 10, .82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--green-hi);
  letter-spacing: .5px;
  white-space: nowrap;
}
.brand .dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--green-hi);
  box-shadow: 0 0 10px var(--green-hi);
  animation: dotGlow 2.2s ease-in-out infinite;
}
@keyframes dotGlow {
  0%, 100% {
    background: var(--green-dim);
    box-shadow: 0 0 2px rgba(124,252,158,.25);
    opacity: .35;
  }
  50% {
    background: var(--green-hi);
    box-shadow: 0 0 14px var(--green-hi), 0 0 28px rgba(124,252,158,1),
                0 0 46px rgba(124,252,158,.6);
    opacity: 1;
  }
}
.tabs {
  display: flex;
  gap: 4px;
  margin-left: auto;
  flex-wrap: wrap;
}
.tabs a {
  padding: 5px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--green-dim);
  font-size: 13px;
  transition: color .2s, border-color .2s, background .2s;
}
.tabs a:hover { color: var(--green); border-color: var(--border); }
.tabs a.active {
  color: var(--green-hi);
  border-color: var(--border-hi);
  background: rgba(95,221,143,.06);
}
/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  padding: 11px 20px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .3px;
  border: 1px solid var(--border-hi);
  transition: transform .15s, box-shadow .2s, background .2s, color .2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--green-hi);
  color: #06140c;
  box-shadow: 0 0 0 rgba(95,221,143,0);
}
.btn-primary:hover { box-shadow: 0 6px 26px var(--glow); }
.btn-ghost { color: var(--green); background: transparent; }
.btn-ghost:hover { background: rgba(95,221,143,.08); box-shadow: 0 0 18px rgba(95,221,143,.12); }

/* ---------- layout sections ---------- */
section { position: relative; z-index: 1; }

/* ---------- page views (single-file router) ---------- */
.page { display: none; }
.page.is-active {
  display: block;
  animation: pageFade .4s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes pageFade {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- HERO ---------- */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 80px 20px 60px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.kicker {
  color: var(--green-dim);
  font-size: 13px;
  letter-spacing: 1px;
  margin-bottom: 16px;
}
h1 {
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.08;
  margin: 0 0 20px;
  font-weight: 700;
  letter-spacing: -.5px;
  color: #d6ffe6;
}
.glow {
  color: var(--green-hi);
  text-shadow: 0 0 24px var(--glow), 0 0 4px var(--glow);
}
.lede {
  color: var(--green);
  font-size: 16px;
  max-width: 46ch;
  margin: 0 0 28px;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-meta {
  margin-top: 22px;
  color: var(--green-dim);
  font-size: 13px;
}

/* ---------- terminal window component ---------- */
.term {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.55);
}
.term-focused {
  border-color: var(--border-hi);
  box-shadow: 0 0 0 1px var(--border-hi), 0 24px 70px rgba(0,0,0,.6),
              0 0 50px rgba(95,221,143,.12);
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
}
.lights { display: flex; gap: 7px; }
.lights i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.lights .r { background: var(--red); }
.lights .y { background: var(--yellow); }
.lights .g { background: var(--traffic-g); }
.term-title {
  color: var(--green-dim);
  font-size: 12px;
  letter-spacing: 1px;
}
.term-body {
  padding: 18px;
  min-height: 320px;
  font-size: 13.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

/* hero terminal typed lines */
.t-line { display: block; }
.t-prompt { color: var(--green-dim); }
.t-cmd    { color: var(--green-hi); }
.t-out    { color: var(--green); opacity: .92; }
.t-dim    { color: var(--green-dim); }
.t-blue   { color: var(--blue); }
.t-cursor {
  display: inline-block;
  width: 8px;
  background: var(--green-hi);
  color: var(--green-hi);
  animation: blink 1.05s steps(1) infinite;
  margin-left: 1px;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- FEATURES ---------- */
.features {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 20px 30px;
  display: flex;
  flex-direction: column;
  gap: 96px;
}
.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.feature[data-side="right"] .feature-copy { order: 2; }
.feature[data-side="right"] .shot { order: 1; }

.feature-index {
  color: var(--green-dimmer);
  font-size: 56px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}
.feature h3 {
  font-size: clamp(24px, 3vw, 32px);
  margin: 0 0 14px;
  color: #d6ffe6;
  letter-spacing: -.3px;
}

/* "experimental" badge */
.badge-exp {
  display: inline-block;
  vertical-align: middle;
  margin-left: 10px;
  padding: 3px 9px;
  border: 1px solid var(--yellow);
  border-radius: 999px;
  color: var(--yellow);
  background: rgba(254, 188, 46, .08);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .8px;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 0 12px rgba(254, 188, 46, .12);
}
/* inline variant used inside list items */
.badge-exp.sm { margin-left: 6px; padding: 1px 7px; font-size: 10px; }
.feature p {
  color: var(--green);
  max-width: 48ch;
  margin: 0 0 22px;
  min-height: 4.8em;   /* reserve space so typing doesn't reflow the layout */
}
/* blinking caret shown to the right of text while it types in */
.type-caret {
  display: inline-block;
  color: var(--green-hi);
  margin-left: 2px;
  text-shadow: 0 0 8px var(--glow);
  animation: blink 1.05s steps(1) infinite;
}
.kv { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.kv li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--green);
  font-size: 14px;
}
.kv li span:first-child:not(.led) {
  flex: none;
  min-width: 64px;
  color: var(--green-hi);
  font-weight: 600;
}
.kv em { color: var(--green-dim); }

/* status LEDs used in feature lists */
.led {
  width: 9px; height: 9px; border-radius: 50%;
  display: inline-block; flex: none;
  transform: translateY(1px);
}
.led-r { background: var(--red);    box-shadow: 0 0 8px var(--red); }
.led-b { background: var(--blue);   box-shadow: 0 0 8px var(--blue); }
.led-g { background: var(--traffic-g); box-shadow: 0 0 8px var(--traffic-g); }
.led-y { background: var(--yellow); box-shadow: 0 0 8px var(--yellow); }

/* ---------- screenshot placeholder ---------- */
.shot { margin: 0; }
.shot-canvas {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  aspect-ratio: 16 / 10;
  margin: 14px;
  border: 1px dashed var(--border-hi);
  border-radius: 8px;
  color: var(--green-dim);
  font-size: 13px;
  letter-spacing: .5px;
  background:
    repeating-linear-gradient(45deg,
      rgba(95,221,143,.03) 0, rgba(95,221,143,.03) 10px,
      transparent 10px, transparent 20px);
}
.shot-glyph { font-size: 22px; color: var(--green-dim); }
/* if a real <img> is dropped in, make it fill the frame nicely */
.shot .term img { display: block; width: 100%; height: auto; }

/* ---------- CTA ---------- */
.cta {
  max-width: 760px;
  margin: 60px auto;
  padding: 56px 28px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    radial-gradient(120% 120% at 50% 0%, rgba(95,221,143,.07), transparent 60%),
    var(--panel);
}
.cta h2 {
  font-size: clamp(26px, 4vw, 38px);
  margin: 0 0 10px;
  color: #d6ffe6;
}
.cta p { color: var(--green-dim); margin: 0 0 26px; }
.cta .hero-cta { justify-content: center; }

/* ---------- LIVE DEMO PAGE ---------- */
.demo {
  /* wider than --maxw: the embedded client wants real estate */
  max-width: 1480px;
  margin: 0 auto;
  padding: 56px 20px 40px;
}
.demo .dl-head { margin-bottom: 32px; }
.demo-frame {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.demo-frame .term-bar { flex: none; }
.demo-frame iframe {
  display: block;
  width: 100%;
  border: 0;
  /* fill most of the viewport below the nav + page head */
  height: calc(100vh - 320px);
  min-height: 560px;
  background: #fff; /* the client paints its own theme over this */
}
@media (max-width: 820px) {
  .demo { padding: 36px 12px 24px; }
  .demo-frame iframe { height: 70vh; min-height: 420px; }
}

/* ---------- DOWNLOAD PAGE ---------- */
.dl {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 72px 20px 40px;
}
.dl-head { text-align: center; margin-bottom: 44px; }
.dl-head h1 { color: #d6ffe6; }
.dl-head .lede { margin-left: auto; margin-right: auto; }
.dl-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.dl-card { display: flex; flex-direction: column; }
.dl-card .term-bar { flex: none; }
.dl-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.dl-plat {
  font-size: 22px;
  color: #d6ffe6;
  font-weight: 700;
  letter-spacing: -.2px;
}
.dl-ver { color: var(--green-dim); font-size: 13px; }
.dl-body p { color: var(--green); margin: 4px 0 0; font-size: 14px; }
.dl-body .btn { align-self: flex-start; margin-top: auto; }
.dl-note {
  margin: 36px auto 0;
  max-width: 60ch;
  text-align: center;
  color: var(--green-dim);
  font-size: 13px;
}
.dl-note code { color: var(--green); }
/* Story page reuses the download card styles, but wants 3 columns. */
.story-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.story-grid .dl-body p { font-size: 14.5px; line-height: 1.6; }
@media (max-width: 820px) {
  .dl { padding: 44px 18px 28px; }
  .dl-grid { grid-template-columns: 1fr; }
  .story-grid { grid-template-columns: 1fr; }
}

/* ---------- FOOTER ---------- */
.footer {
  border-top: 1px solid var(--border);
  background: var(--panel-2);
  padding: 22px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  max-width: var(--maxw);
  margin: 0 auto;
}
.prompt { color: var(--green); font-size: 13px; }
.prompt .path { color: var(--green-dim); }
.cursor { color: var(--green-hi); animation: blink 1.05s steps(1) infinite; }
.footer-meta { color: var(--green); font-size: 12px; }

/* ---------- reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1);
  will-change: opacity, transform;
}
.feature[data-side="left"].reveal  { transform: translateX(-40px); }
.feature[data-side="right"].reveal { transform: translateX(40px); }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .hero { padding: 48px 18px 36px; }
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .feature { grid-template-columns: 1fr; gap: 28px; }
  .feature[data-side="right"] .feature-copy,
  .feature[data-side="right"] .shot { order: initial; }
  .features { gap: 64px; }
  .feature-index { font-size: 44px; }
  .feature[data-side="left"].reveal,
  .feature[data-side="right"].reveal { transform: translateY(28px); }
}

/* ---------- reduced motion: show everything, kill animation ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none; }
  .page.is-active { animation: none; }
  .progress { transition: none; }
  .t-cursor, .cursor { animation: none; }
  .brand .dot { animation: none; }
  .btn:hover { transform: none; }
}
