/* ─────────────────────────────────────────────
   Threadon.io — Style
   Technical-first dark theme
   Matches spo-lite dashboard aesthetic
───────────────────────────────────────────── */

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #080d1a;
  --bg-dim:     #0d1528;
  --bg-card:    rgba(255,255,255,0.03);
  --border:     rgba(255,255,255,0.07);
  --border-h:   rgba(0,212,255,0.25);
  --text:       #e2e8f0;
  --muted:      #64748b;
  --cyan:       #00d4ff;
  --cyan-dim:   rgba(0,212,255,0.12);
  --purple:     #a78bfa;
  --amber:      #f59e0b;
  --green:      #10b981;
  --red:        #ef4444;
  --font:       'Inter', system-ui, sans-serif;
  --mono:       'JetBrains Mono', monospace;
  --radius:     0.5rem;
  --shadow:     0 0 40px rgba(0,212,255,0.06);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cyan); text-decoration: none; transition: opacity .15s; }
a:hover { opacity: .75; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.mono { font-family: var(--mono); }

/* ── Nav ── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(8,13,26,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px;
}
.nav-logo {
  display: flex; align-items: center; gap: .5rem;
  color: var(--text); font-weight: 700; font-size: 1.1rem;
}
.logo-accent { color: var(--cyan); }
.nav-links {
  display: flex; align-items: center; gap: 2rem;
  list-style: none;
}
.nav-links a {
  color: var(--muted); font-size: .875rem; transition: color .15s;
}
.nav-links a:hover { color: var(--text); opacity: 1; }
.nav-github {
  display: flex; align-items: center; gap: .4rem;
  color: var(--muted) !important;
  border: 1px solid var(--border);
  padding: .3rem .75rem; border-radius: 999px;
  font-size: .8rem !important;
}
.nav-github:hover { border-color: var(--border-h); color: var(--cyan) !important; }
.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.25rem; cursor: pointer; }

/* ── Hero ── */
.hero {
  position: relative; overflow: hidden;
  padding: 7rem 0 5rem;
  min-height: 90vh; display: flex; align-items: center;
}
.hero-grid {
  position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(0,212,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, black 0%, transparent 100%);
}
.hero-content { position: relative; z-index: 1; }
.hero-tag {
  display: inline-block; margin-bottom: 1.25rem;
  font-family: var(--mono); font-size: .75rem;
  color: var(--cyan); border: 1px solid rgba(0,212,255,0.3);
  padding: .25rem .75rem; border-radius: 999px;
  background: rgba(0,212,255,0.06);
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700; line-height: 1.2;
  letter-spacing: -.02em; margin-bottom: 1.25rem;
}
.gradient-text {
  background: linear-gradient(135deg, #00d4ff 0%, #a78bfa 50%, #00d4ff 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% auto; animation: shimmer 4s linear infinite;
}
@keyframes shimmer { to { background-position: 200% center; } }
.hero-sub {
  font-size: 1.05rem; color: var(--muted); max-width: 600px;
  margin-bottom: 2rem; line-height: 1.7;
}
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 3rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .6rem 1.25rem; border-radius: var(--radius);
  font-size: .9rem; font-weight: 500; transition: all .2s;
  cursor: pointer; border: 1px solid transparent;
}
.btn-primary {
  background: var(--cyan); color: #080d1a;
  border-color: var(--cyan);
}
.btn-primary:hover { background: #22e5ff; opacity: 1; box-shadow: 0 0 20px rgba(0,212,255,0.4); }
.btn-ghost {
  background: transparent; color: var(--muted);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--border-h); color: var(--text); opacity: 1; }
.btn-sm { font-size: .82rem; padding: .45rem 1rem; }

/* Terminal */
.terminal {
  border-radius: .75rem;
  border: 1px solid var(--border);
  background: #0a0f20;
  overflow: hidden;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.04);
  max-width: 680px;
}
.terminal-bar {
  display: flex; align-items: center; gap: .4rem;
  padding: .65rem 1rem;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-red { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green { background: #28c840; }
.terminal-title { margin-left: .5rem; font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.terminal-body {
  padding: 1.25rem 1.5rem;
  font-family: var(--mono); font-size: .82rem;
  line-height: 1.8; overflow-x: auto;
  white-space: pre;
}
.t-comment { color: #4a5568; }
.t-prompt { color: var(--cyan); }
.t-out { color: #94a3b8; }

/* ── Sections ── */
.section { padding: 6rem 0; }
.section-dim { padding: 6rem 0; background: var(--bg-dim); }
.section-label {
  font-family: var(--mono); font-size: .72rem;
  color: var(--cyan); text-transform: uppercase; letter-spacing: .1em;
  margin-bottom: .75rem;
}
.section-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700; line-height: 1.2;
  margin-bottom: 1rem;
}
.section-sub {
  font-size: 1rem; color: var(--muted);
  max-width: 560px; margin-bottom: 3rem; line-height: 1.7;
}

/* ── Stack grid ── */
.stack-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 1rem; margin-bottom: 2.5rem;
}
.stack-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: .75rem; padding: 1.5rem;
  display: flex; flex-direction: column; gap: .75rem;
  transition: border-color .2s, transform .2s;
}
.stack-card:hover { border-color: var(--border-h); transform: translateY(-2px); }
.stack-featured {
  border-color: rgba(0,212,255,0.3);
  background: rgba(0,212,255,0.04);
  box-shadow: 0 0 30px rgba(0,212,255,0.08);
}
.stack-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .25rem; }
.stack-badge {
  font-family: var(--mono); font-size: .75rem; font-weight: 700;
  padding: .2rem .6rem; border-radius: .3rem;
}
.badge-spo { background: rgba(0,212,255,0.15); color: var(--cyan); border: 1px solid rgba(0,212,255,0.3); }
.badge-mcl { background: rgba(167,139,250,0.12); color: var(--purple); border: 1px solid rgba(167,139,250,0.25); }
.badge-gift { background: rgba(16,185,129,0.1); color: var(--green); border: 1px solid rgba(16,185,129,0.25); }
.stack-card h3 { font-size: 1rem; font-weight: 600; }
.stack-card p { font-size: .85rem; color: var(--muted); line-height: 1.6; }
.stack-features {
  list-style: none; display: flex; flex-direction: column; gap: .35rem; flex: 1;
}
.stack-features li {
  font-size: .8rem; color: #94a3b8;
  padding-left: 1rem; position: relative;
}
.stack-features li::before { content: '›'; position: absolute; left: 0; color: var(--cyan); }
.stack-dep { font-family: var(--mono); font-size: .7rem; color: var(--muted); margin-top: .25rem; }

.stack-status { font-size: .7rem; }
.status-live { display: flex; align-items: center; gap: .35rem; color: var(--green); font-weight: 500; }
.status-soon { color: var(--muted); font-family: var(--mono); }
.live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot { 0%,100%{opacity:1}50%{opacity:.4} }

/* Architecture flow */
.arch-flow {
  display: flex; align-items: center; justify-content: center;
  gap: 1rem; margin-top: 1rem;
  padding: 1.25rem; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: .75rem;
}
.arch-node {
  display: flex; flex-direction: column; align-items: center; gap: .3rem;
  text-align: center; flex: 1;
}
.arch-node-center { flex: 1.2; }
.arch-label {
  font-family: var(--mono); font-size: .85rem; font-weight: 700; color: var(--muted);
}
.arch-label-spo { color: var(--cyan); }
.arch-desc-sm { font-size: .72rem; color: var(--muted); }
.arch-arrow-h { color: var(--muted); font-size: 1.2rem; flex-shrink: 0; }

/* ── Feature grid ── */
.feature-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
}
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: .75rem; padding: 1.5rem;
  display: flex; flex-direction: column; gap: .75rem;
  transition: border-color .2s;
}
.feature-card:hover { border-color: var(--border-h); }
.feature-icon { font-size: 1.4rem; }
.feature-card h3 { font-size: .95rem; font-weight: 600; }
.feature-card p { font-size: .83rem; color: var(--muted); line-height: 1.6; flex: 1; }
.feature-card code { font-family: var(--mono); font-size: .78rem; color: var(--cyan); }
.code-snip {
  font-family: var(--mono); font-size: .76rem; line-height: 1.8;
  color: #94a3b8; background: rgba(0,0,0,0.3);
  border: 1px solid var(--border); border-radius: .4rem;
  padding: .6rem .8rem; margin-top: auto;
}

/* ── Principles ── */
.principles-list { display: flex; flex-direction: column; gap: 1.5rem; max-width: 720px; }
.principle {
  display: flex; gap: 1.5rem; align-items: flex-start;
  padding-bottom: 1.5rem; border-bottom: 1px solid var(--border);
}
.principle:last-child { border-bottom: none; }
.p-num {
  font-family: var(--mono); font-size: .8rem;
  color: var(--cyan); flex-shrink: 0;
  width: 2rem; padding-top: .15rem;
}
.principle h4 { font-size: .95rem; font-weight: 600; margin-bottom: .4rem; }
.principle p { font-size: .85rem; color: var(--muted); line-height: 1.7; }

/* ── CTA section ── */
.section-cta {
  padding: 5rem 0;
  background: linear-gradient(135deg, rgba(0,212,255,0.04) 0%, rgba(167,139,250,0.04) 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.section-cta h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; margin-bottom: .75rem; }
.section-cta p { color: var(--muted); margin-bottom: 2rem; }
.section-cta .hero-actions { justify-content: center; }

/* ── Footer ── */
.footer { padding: 3rem 0 1.5rem; border-top: 1px solid var(--border); }
.footer-inner {
  display: flex; gap: 3rem; justify-content: space-between; flex-wrap: wrap;
  margin-bottom: 2.5rem;
}
.footer-brand { display: flex; flex-direction: column; gap: .75rem; }
.footer-brand p { font-size: .82rem; color: var(--muted); max-width: 220px; line-height: 1.6; }
.footer-links { display: flex; gap: 3rem; flex-wrap: wrap; }
.footer-col { display: flex; flex-direction: column; gap: .5rem; }
.footer-col-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; margin-bottom: .25rem; }
.footer-col a { font-size: .85rem; color: var(--muted); }
.footer-col a:hover { color: var(--text); opacity: 1; }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 1.5rem; border-top: 1px solid var(--border);
  font-size: .75rem; color: var(--muted);
}
.footer-bottom .mono { font-family: var(--mono); font-size: .72rem; color: rgba(0,212,255,0.5); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .stack-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .arch-flow { flex-direction: column; }
  .arch-arrow-h { transform: rotate(90deg); }
  .footer-inner { flex-direction: column; }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute;
    top: 56px; left: 0; right: 0;
    background: rgba(8,13,26,0.98); padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border); gap: 1rem; z-index: 50;
  }
  .feature-grid { grid-template-columns: 1fr; }
  .hero { min-height: unset; padding: 5rem 0 3rem; }
  .footer-links { flex-direction: column; gap: 1.5rem; }
}

/* ── Scroll fade-in ── */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .5s, transform .5s; }
.reveal.visible { opacity: 1; transform: translateY(0); }
