/* ═══════════════════════════════════════════
   DEETCODES WAITLIST — REDESIGN
   ═══════════════════════════════════════════ */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --bg-main: #000000;
  --bg-subtle: #09090b;
  --bg-card: #0a0a0e;
  --bg-card-hover: #111115;

  --accent: #2dd4bf;
  --accent-secondary: #8b5cf6;
  --accent-dim: rgba(45, 212, 191, 0.08);
  --accent-glow: rgba(45, 212, 191, 0.2);

  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-tertiary: #71717a;
  --text-dim: #3f3f46;

  --border: #1a1a20;
  --border-light: #2a2a32;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  height: 100%;
}

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

/* Dot grid */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.04) 1px, transparent 0);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: -1;
}

/* ── LAYOUT ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4 {
  color: #fff;
  letter-spacing: -0.03em;
  font-weight: 700;
  line-height: 1.1;
}

.text-gradient {
  background: linear-gradient(135deg, #ffffff 0%, #2dd4bf 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── COMPONENTS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: var(--font-sans);
  text-decoration: none;
}

.btn-primary {
  background: var(--text-primary);
  color: #000;
  padding: 10px 24px;
  border-radius: 8px;
}

.btn-primary:hover {
  background: #e4e4e7;
  transform: translateY(-1px);
}

.pill-label {
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  margin-bottom: 16px;
  text-transform: uppercase;
  display: inline-block;
}

/* ── NAV ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  z-index: 100;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.nav-container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-weight: 600;
  font-size: 1.05rem;
}

.logo-icon {
  width: 22px;
  height: 22px;
  color: var(--accent);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mob-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 6px;
  padding: 4px;
}

.mob-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text-secondary);
}

/* ── HERO ── */
.hero {
  padding: 140px 0 0;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(45,212,191,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero-center {
  text-align: center;
  max-width: 750px;
  margin: 0 auto;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
  font-weight: 500;
}

.hero-tag span.dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
  animation: pulse-dot 2s ease infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 24px;
  letter-spacing: -0.04em;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 560px;
}

.hero-form-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 440px;
}

.form-row {
  display: flex;
  gap: 8px;
}

.form-row input {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
  font-family: var(--font-sans);
}

.form-row input:focus {
  border-color: var(--accent);
}

/* ── HERO DEMO WINDOW ── */
.hero-demo {
  margin-top: 60px;
  padding-bottom: 80px;
}

.demo-window {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03),
    0 30px 60px -15px rgba(0,0,0,0.6);
}

.demo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #111114;
  border-bottom: 1px solid var(--border);
}

.demo-dots {
  display: flex;
  gap: 8px;
}

.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.red { background: #ef4444; }
.dot.yellow { background: #eab308; }
.dot.green { background: #22c55e; }

.demo-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.demo-controls {
  display: flex;
  gap: 4px;
}

.ctrl-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-tertiary);
  padding: 4px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  transition: all 0.15s;
}

.ctrl-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }
.ctrl-btn.play { color: #22c55e; }

.demo-body {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  min-height: 320px;
}

.demo-code {
  padding: 24px;
  background: #08080a;
  border-right: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.8;
  display: flex;
  gap: 16px;
}

.line-nums {
  color: var(--text-dim);
  text-align: right;
  user-select: none;
}

.code-content { color: #d4d4d8; }

.cline {
  position: relative;
  padding: 1px 4px;
  border-left: 2px solid transparent;
  transition: all 0.3s;
}

.cline.active-line {
  background: rgba(45, 212, 191, 0.06);
  border-left-color: var(--accent);
}

.indent { padding-left: 16px; }
.indent-2 { padding-left: 32px; }

.k { color: #c084fc; }
.f { color: #38bdf8; }
.num { color: #f59e0b; }

/* Viz Panel */
.demo-viz {
  padding: 24px;
  background: #0c0c0f;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.viz-section {}

.viz-label {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  margin-bottom: 8px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.viz-grid { display: flex; gap: 12px; }

.viz-item {
  background: #141418;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 70px;
  transition: all 0.3s;
}

.viz-item.changed {
  border-color: var(--accent);
  background: rgba(45, 212, 191, 0.05);
}

.v-label { font-size: 0.7rem; color: var(--text-tertiary); }
.v-val {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: #fff;
  font-weight: 600;
  transition: all 0.3s;
}

.array-container { display: flex; gap: 8px; }

.arr-cell {
  width: 44px;
  height: 44px;
  background: #141418;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.9rem;
  position: relative;
  transition: all 0.3s;
}

.arr-cell.active {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
  color: #22c55e;
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.15);
  transform: translateY(-2px);
}

.idx-lbl {
  position: absolute;
  bottom: -18px;
  left: 0; right: 0;
  text-align: center;
  font-size: 0.65rem;
  color: var(--text-dim);
}

/* Hash Map viz */
.hashmap-viz {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: #141418;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  min-height: 36px;
  transition: all 0.3s;
}

.hm-entry {
  display: inline-block;
  padding: 2px 8px;
  margin: 2px;
  background: var(--accent-dim);
  border: 1px solid rgba(45, 212, 191, 0.15);
  border-radius: 4px;
  color: var(--accent);
  font-size: 0.78rem;
  animation: hm-pop 0.3s ease;
}

@keyframes hm-pop {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.hm-empty { color: var(--text-dim); }

.viz-result {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
}

.result-target {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  padding: 6px 12px;
  background: #141418;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.result-found {
  font-size: 0.82rem;
  color: #22c55e;
  padding: 6px 12px;
  background: rgba(34, 197, 94, 0.05);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 6px;
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.4s ease;
}

.result-found.show {
  opacity: 1;
  transform: translateY(0);
}

/* ═══════════════════════════════════
   SHOWCASE SECTIONS
   ═══════════════════════════════════ */

.showcase {
  padding: 100px 0;
  border-top: 1px solid var(--border);
}

.showcase-alt {
  background: #030305;
}

.showcase-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 80px;
  align-items: center;
}

.showcase-row.reverse {
  grid-template-columns: 1.2fr 1fr;
}

.showcase-row.reverse .showcase-text {
  order: 2;
}

.showcase-row.reverse .showcase-visual {
  order: 1;
}

.showcase-text h2 {
  font-size: 2.5rem;
  margin-bottom: 20px;
}

.showcase-text p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ── EXEC DEMO (Two Pointers) ── */
.exec-demo {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}

.exec-code-panel {
  padding: 24px;
  background: #08080a;
  border-right: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.9;
}

.exec-line {
  padding: 2px 8px;
  border-left: 2px solid transparent;
  transition: all 0.3s;
  border-radius: 0 4px 4px 0;
}

.exec-line.active-line {
  background: rgba(45, 212, 191, 0.06);
  border-left-color: var(--accent);
}

.exec-line .ln {
  color: var(--text-dim);
  margin-right: 12px;
  user-select: none;
  display: inline-block;
  min-width: 16px;
  text-align: right;
}

.exec-vars-panel {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.exec-var {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #141418;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.3s;
}

.exec-var.changed {
  border-color: var(--accent);
  background: rgba(45, 212, 191, 0.04);
}

.exec-var-name {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.exec-var-val {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  transition: all 0.2s;
}

.exec-array {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.ea-cell {
  width: 44px;
  height: 44px;
  background: #141418;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all 0.3s;
}

.ea-cell.left-ptr {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 15px rgba(45, 212, 191, 0.1);
}

.ea-cell.right-ptr {
  border-color: #f59e0b;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.1);
}

.ea-cell.found {
  border-color: #22c55e;
  color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.15);
  transform: translateY(-3px);
}

/* ── PATTERNS DEMO ── */
.patterns-demo {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pattern-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  transition: all 0.25s;
}

.pattern-group:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
}

.pattern-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  margin-bottom: 10px;
}

.pattern-icon {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  border-radius: 8px;
  color: var(--accent);
  flex-shrink: 0;
}

.pattern-count {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-tertiary);
  background: rgba(255,255,255,0.04);
  padding: 3px 10px;
  border-radius: 100px;
}

.pattern-problems {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-left: 40px;
}

.pp {
  font-size: 0.78rem;
  color: var(--text-secondary);
  padding: 4px 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-mono);
  transition: all 0.2s;
}

.pp:hover:not(.dim) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.pp.dim {
  color: var(--text-dim);
  border-color: transparent;
  background: transparent;
}

/* ── CTA SECTION ── */
.cta-section {
  padding: 120px 0;
  text-align: center;
  border-top: 1px solid var(--border);
  position: relative;
}

.cta-section::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(45,212,191,0.04) 0%, transparent 70%);
  pointer-events: none;
}

.cta-title {
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: 20px;
  letter-spacing: -0.03em;
}

.cta-sub {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin: 0 auto 40px;
  max-width: 480px;
}

.cta-section .hero-form-wrapper {
  margin: 0 auto;
}

/* ── FOOTER ── */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  background: #030305;
}

.footer-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.footer-logo {
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}

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

/* ── ANIMATIONS ── */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── TOAST ── */
#toast-container {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  color: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateY(120%);
  transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.toast.active { transform: translateY(0); }

.toast-icon { width: 20px; height: 20px; color: var(--accent); flex-shrink: 0; }
.toast-content { flex: 1; }
.toast-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 2px; }
.toast-msg { font-size: 0.85rem; color: var(--text-secondary); }

/* ═══════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════ */

@media (max-width: 900px) {
  .hero { padding: 100px 0 0; }

  .hero-title { font-size: 2.5rem; }

  .hero-sub { font-size: 1rem; }

  .form-row {
    flex-direction: column;
    gap: 12px;
  }

  .form-row input, .form-row button { width: 100%; }

  .demo-body {
    grid-template-columns: 1fr;
  }

  .demo-code {
    border-right: none;
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
  }

  .showcase-row,
  .showcase-row.reverse {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .showcase-row.reverse .showcase-text { order: 1; }
  .showcase-row.reverse .showcase-visual { order: 2; }

  .showcase-text h2 { font-size: 2rem; }

  .exec-demo {
    grid-template-columns: 1fr;
  }

  .exec-code-panel {
    border-right: none;
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
  }

  .exec-array { flex-wrap: wrap; }

  .cta-title { font-size: 2rem; }

  .nav-right .btn { display: none; }
  .mob-toggle { display: flex; }

  .pattern-problems { padding-left: 0; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 2rem; }

  .arr-cell, .ea-cell { width: 38px; height: 38px; font-size: 0.82rem; }
}

@media (max-width: 600px) {
  #toast-container {
    bottom: 24px;
    right: 24px;
    left: 24px;
  }

  .toast {
    min-width: 0;
    width: 100%;
    transform: translateY(150%);
  }

  .toast.active { transform: translateY(0); }
}
