/* ============================================================
   CREWFILE — terminal editorial, archetype: mouse-reactive gradient
   All-mono type system. One accent. No curves except terminals.
   ============================================================ */

:root {
  --bg: #0b0d0c;
  --bg-2: #101413;
  --panel: #0e1211;
  --ink: #e8efe9;
  --mute: #8a968d;
  --dim: #5a655d;
  --accent: #3dff8b;
  --accent-dim: rgba(61, 255, 139, 0.14);
  --line: rgba(232, 239, 233, 0.13);
  --g1: rgba(61, 255, 139, 0.11);
  --g2: rgba(56, 132, 255, 0.09);
  --mono: "JetBrains Mono", "IBM Plex Mono", "Cascadia Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --max: 1120px;
}

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

html {
  overflow-x: clip;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

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

::selection { background: var(--accent); color: var(--bg); }

/* ---------- background layers ---------- */

.bg-gradient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle 640px at var(--mx, 70%) var(--my, 20%), var(--g1) 0%, transparent 60%),
    radial-gradient(circle 900px at calc(var(--mx, 70%) - 25%) calc(var(--my, 20%) + 40%), var(--g2) 0%, transparent 60%),
    var(--bg);
}

.bg-scanlines {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0, 0, 0, 0.22) 4px
  );
}

main, .nav, .footer { position: relative; z-index: 1; }

/* ---------- primitives ---------- */

.kicker {
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 1.6rem;
}

.section-title {
  font-size: clamp(1.9rem, 4.6vw, 3.4rem);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin-bottom: 1.4rem;
}
.section-title em {
  font-style: normal;
  color: var(--accent);
}

.hl { color: var(--accent); }

/* accessible, keyword-bearing headings kept out of the visual layout */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.blink { animation: blink 1.1s steps(1) infinite; color: var(--accent); }
@keyframes blink { 50% { opacity: 0; } }

.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.85rem 1.7rem;
  border: 1px solid var(--accent);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.btn-solid { background: var(--accent); color: #06130b; }
.btn-solid:hover { background: transparent; color: var(--accent); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent); color: #06130b; }
.btn:active { transform: translateY(1px); }

/* reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }
/* defensive: split elements never stay hidden */
.reveal[data-split] { opacity: 1; transform: none; }

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem clamp(1.2rem, 4vw, 3rem);
  border-bottom: 1px solid transparent;
  transition: background 0.25s ease, border-color 0.25s ease;
}
.nav.is-scrolled {
  background: rgba(11, 13, 12, 0.88);
  border-bottom-color: var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nav-brand {
  color: var(--ink);
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-links { display: flex; gap: 1.8rem; }
.nav-links a {
  color: var(--mute);
  text-decoration: none;
  font-size: 0.86rem;
  position: relative;
  transition: color 0.18s ease;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.22s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }

.nav-cta {
  font-size: 0.82rem;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.45rem 1rem;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease;
}
.nav-cta:hover { background: var(--accent); color: #06130b; }

@media (max-width: 720px) {
  .nav-links { display: none; }
}

/* ---------- hero ---------- */

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(4rem, 10vh, 7rem) clamp(1.2rem, 4vw, 3rem) 4rem;
  text-align: left;
}

.hero-title {
  font-size: clamp(2.4rem, 7.2vw, 5.4rem);
  line-height: 1.04;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-wrap: balance;
  max-width: 16ch;
}
.hero-title em {
  font-style: normal;
  color: var(--accent);
  position: relative;
  white-space: nowrap;
}

.hero-sub {
  margin-top: 1.8rem;
  max-width: 58ch;
  color: var(--mute);
  font-size: clamp(0.95rem, 1.4vw, 1.05rem);
}

.hero-actions {
  margin-top: 2.4rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* terminal window */
.hero-terminal, .demo-terminal {
  margin-top: 3.6rem;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.term-bar span {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--dim);
  opacity: 0.5;
}
.term-bar span:first-child { background: var(--accent); opacity: 0.8; }
.term-bar p {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--dim);
}
.term-body {
  padding: 1.3rem 1.4rem 1.5rem;
  font-size: clamp(0.8rem, 1.5vw, 0.95rem);
  line-height: 1.9;
}
.term-line { white-space: pre-wrap; }
.term-line.is-hidden { display: none; }
.term-prompt { color: var(--accent); }
.term-dim { color: var(--mute); }
.term-ok { color: var(--accent); font-weight: 700; }
.term-tall { min-height: 240px; }

/* ---------- stats ---------- */

.stats {
  max-width: var(--max);
  margin: 0 auto;
  padding: 4.5rem clamp(1.2rem, 4vw, 3rem);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.stat {
  background: var(--bg);
  padding: 2rem 1.4rem;
  text-align: center;
}
.stat strong {
  display: block;
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.stat span {
  color: var(--mute);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- manifesto ---------- */

.manifesto {
  max-width: var(--max);
  margin: 0 auto;
  padding: 5rem clamp(1.2rem, 4vw, 3rem);
}
.manifesto-text {
  font-size: clamp(1.15rem, 2.4vw, 1.7rem);
  line-height: 1.55;
  max-width: 62ch;
  color: var(--ink);
  font-weight: 500;
}

/* ---------- how ---------- */

.how {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem clamp(1.2rem, 4vw, 3rem) 5rem;
}
.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.how-step {
  background: var(--bg);
  padding: 2.2rem 1.8rem;
  transition: background 0.25s ease;
}
.how-step:hover { background: var(--bg-2); }
.how-num {
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
}
.how-step h3 {
  margin: 0.9rem 0 0.7rem;
  font-size: 1.15rem;
  font-weight: 700;
}
.how-step p {
  color: var(--mute);
  font-size: 0.9rem;
}
@media (max-width: 860px) {
  .how-grid { grid-template-columns: 1fr; }
}

/* ---------- team (expanding rows) ---------- */

.team {
  max-width: var(--max);
  margin: 0 auto;
  padding: 4rem clamp(1.2rem, 4vw, 3rem) 5rem;
}
.team .section-title { margin-bottom: 3rem; }

.dept {
  border: 1px solid var(--line);
  border-bottom: none;
  background: var(--panel);
}
.dept:last-of-type { border-bottom: 1px solid var(--line); }

.dept-head {
  width: 100%;
  display: flex;
  align-items: baseline;
  gap: 1.4rem;
  padding: 1.6rem 1.8rem;
  background: transparent;
  border: none;
  color: var(--ink);
  font-family: var(--mono);
  cursor: pointer;
  text-align: left;
  transition: background 0.2s ease;
}
.dept-head:hover { background: var(--bg-2); }

.dept-name {
  font-size: clamp(1.2rem, 2.6vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.dept-meta {
  color: var(--dim);
  font-size: 0.82rem;
  margin-left: auto;
}
.dept-toggle {
  color: var(--accent);
  font-size: 1.4rem;
  font-weight: 400;
  transition: transform 0.25s ease;
}
.dept.is-open .dept-toggle { transform: rotate(45deg); }

.dept-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s ease;
}
.dept.is-open .dept-body { grid-template-rows: 1fr; }
.dept-body > .dept-cols { overflow: hidden; }

.dept-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 2.5rem;
  padding: 0 1.8rem;
}
.dept.is-open .dept-cols { padding: 0.4rem 1.8rem 2rem; }
.dept-cols h4 {
  color: var(--accent);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin: 1.2rem 0 0.4rem;
}
.dept-cols p {
  color: var(--mute);
  font-size: 0.88rem;
}

.tag {
  display: inline-block;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.15rem 0.5rem;
  margin-left: 0.6rem;
  vertical-align: middle;
}

@media (max-width: 720px) {
  .dept-cols { grid-template-columns: 1fr; }
  .dept-head { flex-wrap: wrap; gap: 0.5rem; }
  .dept-meta { margin-left: 0; width: 100%; order: 3; }
}

/* ---------- demo ---------- */

.demo {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem clamp(1.2rem, 4vw, 3rem) 5rem;
}
.demo-terminal { margin-top: 2.5rem; }

/* ---------- pricing ---------- */

.pricing {
  max-width: var(--max);
  margin: 0 auto;
  padding: 4rem clamp(1.2rem, 4vw, 3rem) 5rem;
}
.pricing-sub { color: var(--mute); max-width: 52ch; margin-bottom: 3rem; }

.price-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
  align-items: start;
}

.price-card {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 2.2rem 1.9rem;
  display: flex;
  flex-direction: column;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.price-card:hover { border-color: var(--accent); transform: translateY(-4px); }

.price-featured {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--accent-dim) 0%, var(--panel) 45%);
  position: relative;
}
.featured-tag {
  position: absolute;
  top: -0.7rem;
  left: 1.9rem;
  background: var(--accent);
  color: #06130b;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.2rem 0.7rem;
}

.price-card h3 { font-size: 1.1rem; font-weight: 700; }
.price {
  font-size: 3.2rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.03em;
  margin: 0.8rem 0 1.2rem;
}
.price span { color: var(--accent); font-size: 1.6rem; vertical-align: super; }

.price-card ul {
  list-style: none;
  margin-bottom: 2rem;
  flex-grow: 1;
}
.price-card li {
  color: var(--mute);
  font-size: 0.86rem;
  padding: 0.42rem 0 0.42rem 1.4rem;
  position: relative;
  border-bottom: 1px dashed var(--line);
}
.price-card li::before {
  content: "▸";
  color: var(--accent);
  position: absolute;
  left: 0;
}
.btn-buy { text-align: center; }

.pricing-note {
  margin-top: 2.4rem;
  color: var(--dim);
  font-size: 0.8rem;
  max-width: 62ch;
}

@media (max-width: 900px) {
  .price-grid { grid-template-columns: 1fr; max-width: 460px; }
  .price-featured { order: -1; }
}

/* ---------- faq ---------- */

.faq {
  max-width: 800px;
  margin: 0 auto;
  padding: 4rem clamp(1.2rem, 4vw, 3rem) 5rem;
}
.faq-list details {
  border: 1px solid var(--line);
  border-bottom: none;
  background: var(--panel);
}
.faq-list details:last-child { border-bottom: 1px solid var(--line); }
.faq-list summary {
  cursor: pointer;
  padding: 1.2rem 1.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  list-style: none;
  position: relative;
  padding-right: 3rem;
  transition: color 0.18s ease;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 1.2rem;
  transition: transform 0.2s ease;
}
.faq-list details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-list summary:hover { color: var(--accent); }
.faq-list details p {
  padding: 0 1.5rem 1.4rem;
  color: var(--mute);
  font-size: 0.88rem;
}

/* ---------- free tools ---------- */

.free {
  max-width: var(--max);
  margin: 0 auto;
  padding: 4rem clamp(1.2rem, 4vw, 3rem) 6rem;
  text-align: center;
}
.free .kicker { text-align: center; }
.free .section-title { margin-inline: auto; }
.free-sub {
  color: var(--mute);
  max-width: 52ch;
  margin: 0 auto 2.4rem;
}
.free-form {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
}
.free-form input {
  font-family: var(--mono);
  font-size: 0.92rem;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 0.85rem 1.2rem;
  min-width: min(340px, 80vw);
  transition: border-color 0.2s ease;
}
.free-form input:focus {
  outline: none;
  border-color: var(--accent);
}
.free-form input::placeholder { color: var(--dim); }
.free-note { color: var(--accent); margin-top: 1.4rem; font-size: 0.9rem; }
.free-legal { color: var(--dim); margin-top: 1.2rem; font-size: 0.78rem; }

/* ---------- footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  background: rgba(14, 18, 17, 0.7);
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3.4rem clamp(1.2rem, 4vw, 3rem) 2.4rem;
}

.footer-brand { font-weight: 700; font-size: 1.05rem; margin-bottom: 1.6rem; }

.footer-term {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  font-size: 0.88rem;
}
.footer-term p { color: var(--dim); }
.footer-sep { color: var(--dim); margin-right: 0.9rem; }
.footer-term a {
  color: var(--mute);
  text-decoration: underline;
  text-decoration-color: var(--dim);
  text-decoration-style: dotted;
  text-underline-offset: 4px;
  margin-right: 1.3rem;
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}
.footer-term a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
  text-decoration-style: solid;
}

.footer-rule {
  border-top: 1px dashed var(--line);
  margin: 2.6rem 0 1.6rem;
}

.footer-disclaimer {
  color: var(--dim);
  font-size: 0.74rem;
  line-height: 1.7;
  max-width: 76ch;
}
.footer-disclaimer strong { color: var(--mute); }

.footer-copy {
  color: var(--dim);
  font-size: 0.74rem;
  margin-top: 1.2rem;
}

@media (max-width: 600px) {
  .footer-term { font-size: 0.8rem; }
  .footer-term a { margin-right: 0.7rem; }
}

/* ---------- reduced motion: only intrusive effects ---------- */
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; flex-wrap: wrap; }
  .bg-scanlines { display: none; }
  /* micro-interactions (hover, reveals, blink) intentionally kept */
}
