/* ============================================
   ForkStack — Light Theme
   ============================================ */

:root {
  --bg: #ffffff;
  --bg-raised: #f5f5f5;
  --bg-card: #ffffff;
  --fg: #111111;
  --fg-dim: #6b7280;
  --accent: #16a34a;
  --accent-dim: rgba(22, 163, 74, 0.08);
  --accent-hover: rgba(22, 163, 74, 0.14);
  --red: #dc2626;
  --yellow: #d97706;
  --cyan: #0891b2;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --font-body: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --max-w: 1120px;
  --radius: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
  --shadow-lg: 0 16px 40px rgba(0,0,0,0.10), 0 4px 16px rgba(0,0,0,0.06);
}

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

html { scroll-behavior: smooth; }

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

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== HERO ===== */
.hero {
  padding: 100px 24px 80px;
  max-width: var(--max-w);
  margin: 0 auto;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
  color: var(--fg);
}

.hero h1 .accent {
  color: var(--accent);
}

.lede {
  font-size: 1.1rem;
  color: var(--fg-dim);
  max-width: 480px;
  line-height: 1.7;
}

/* Terminal */
.hero-terminal {
  background: #1a1a2e;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.15);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.dot.red { background: var(--red); }
.dot.yellow { background: var(--yellow); }
.dot.green { background: var(--accent); }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  margin-left: 8px;
}

.terminal-body {
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.9;
  color: rgba(255,255,255,0.85);
}

.terminal-body .line { white-space: nowrap; }
.terminal-body .dim { color: rgba(255,255,255,0.4); }
.terminal-body .prompt { color: var(--accent); margin-right: 8px; }
.terminal-body .found { color: var(--accent); font-weight: 500; }
.terminal-body .oss { color: var(--cyan); }
.terminal-body .savings { color: var(--accent); margin-left: 12px; }
.terminal-body .result { color: rgba(255,255,255,0.85); margin-top: 4px; }
.terminal-body .big-savings { color: var(--accent); font-weight: 700; font-size: 1rem; }

/* ===== PROBLEM ===== */
.problem {
  padding: 100px 0;
  border-top: 1px solid var(--border);
}

.problem-split {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 60px;
  align-items: start;
}

.problem-left h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  position: sticky;
  top: 40px;
}

.problem-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: var(--shadow-sm);
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-mono);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
  margin-bottom: 12px;
}

.stat-desc {
  font-size: 0.95rem;
  color: var(--fg-dim);
  line-height: 1.6;
}

/* ===== HOW ===== */
.how {
  padding: 100px 0;
  border-top: 1px solid var(--border);
}

.how h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 60px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.step {
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 20px;
  letter-spacing: 0.05em;
}

.step h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.step p {
  color: var(--fg-dim);
  font-size: 0.95rem;
  line-height: 1.65;
}

/* ===== ALTERNATIVES ===== */
.alternatives {
  padding: 100px 0;
  border-top: 1px solid var(--border);
}

.alternatives h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.section-sub {
  color: var(--fg-dim);
  font-size: 1.05rem;
  margin-bottom: 48px;
  max-width: 560px;
}

.swap-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.swap-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-sm);
}

.swap-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.swap-from {
  font-size: 0.95rem;
  color: var(--fg-dim);
  text-decoration: line-through;
  text-decoration-color: var(--red);
}

.swap-arrow {
  color: var(--accent);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.swap-to {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--fg);
}

.swap-tag {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--fg-dim);
  background: var(--bg-raised);
  padding: 4px 10px;
  border-radius: 100px;
  white-space: nowrap;
}

/* ===== CLOSING ===== */
.closing {
  padding: 120px 0;
  border-top: 1px solid var(--border);
}

.closing-block {
  max-width: 680px;
}

.closing h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.closing p {
  font-size: 1.05rem;
  color: var(--fg-dim);
  line-height: 1.7;
  margin-bottom: 16px;
}

.closing-tagline {
  color: var(--fg) !important;
  font-weight: 600;
  font-size: 1.15rem !important;
}

/* ===== FOOTER ===== */
.site-footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-brand {
  font-weight: 600;
  font-size: 1rem;
}

.footer-note {
  font-size: 0.8rem;
  color: var(--fg-dim);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero { padding: 60px 24px 60px; }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .problem-split {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .problem-left h2 { position: static; }
  .steps { grid-template-columns: 1fr; gap: 20px; }
  .swap-grid { grid-template-columns: 1fr; }
  .footer-content {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
  .terminal-body { overflow-x: auto; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.8rem; }
  .stat-number { font-size: 1.6rem; }
  .swap-card { flex-wrap: wrap; }
  .swap-tag { margin-left: 0; margin-top: 8px; }
}

/* ===== LATEST ANSWERS (homepage) ===== */
.latest-answers {
  padding: 100px 0;
  border-top: 1px solid var(--border);
}

.latest-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.latest-header h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.latest-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  padding-top: 8px;
}

.stat-pill {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 6px 14px;
  border-radius: 100px;
  white-space: nowrap;
}

.btn-browse {
  font-size: 0.88rem;
  color: var(--fg-dim);
  text-decoration: none;
  transition: color 0.15s;
}

.btn-browse:hover { color: var(--fg); }

/* Home search bar */
.home-search {
  position: relative;
  margin-bottom: 40px;
}

.home-search input {
  width: 100%;
  max-width: 560px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 14px 20px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-sm);
}

.home-search input::placeholder { color: var(--fg-dim); }

.home-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.home-search .search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  max-width: 560px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 400px;
  overflow-y: auto;
  z-index: 200;
}

/* Latest answers grid */
.latest-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.latest-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-sm);
}

.latest-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.latest-card-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.latest-card-title a {
  color: var(--fg);
  text-decoration: none;
  transition: color 0.15s;
}

.latest-card-title a:hover { color: var(--accent); }

.latest-card-summary {
  font-size: 0.85rem;
  color: var(--fg-dim);
  line-height: 1.6;
  flex: 1;
}

.latest-card-link {
  font-size: 0.82rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  margin-top: auto;
  align-self: flex-start;
}

.latest-card-link:hover { text-decoration: underline; }

.latest-footer {
  text-align: center;
}

.btn-all-answers {
  display: inline-block;
  color: var(--fg-dim);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 12px 24px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  transition: color 0.15s, border-color 0.15s;
}

.btn-all-answers:hover {
  color: var(--fg);
  border-color: var(--fg);
}

@media (max-width: 768px) {
  .latest-grid { grid-template-columns: 1fr; }
  .latest-header { flex-direction: column; }
  .latest-stats { padding-top: 0; }
  .home-search input { max-width: 100%; }
  .home-search .search-dropdown { max-width: 100%; }
}

@media (max-width: 480px) {
  .latest-card { padding: 20px; }
}