/* ================================================================
   CacheCore — styles.css
   Dark developer-first landing page
   ================================================================ */

/* ─── TOKENS ─────────────────────────────────────────────────── */
:root {
  --bg:           #0a0a0a;
  --bg-2:         #111111;
  --bg-3:         #161616;
  --text:         #f0f0f0;
  --text-muted:   #777;
  --text-dim:     #444;
  --accent:       #4FC3F7;
  --accent-hover: #81d4fa;
  --accent-dim:   rgba(79, 195, 247, 0.12);
  --accent-glow:  rgba(79, 195, 247, 0.18);
  --green:        #27c93f;
  --green-dim:    rgba(39, 201, 63, 0.14);
  --border:       rgba(255, 255, 255, 0.07);
  --border-2:     rgba(255, 255, 255, 0.12);

  --font-sans:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  --radius:       8px;
  --radius-lg:    14px;
  --max-w:        1080px;
  --section-gap:  120px;
  --nav-h:        64px;
}

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

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }

/* ─── LAYOUT ─────────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 28px;
}

/* ─── BUTTONS ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s, box-shadow 0.18s;
  white-space: nowrap;
  border: 1px solid transparent;
  line-height: 1;
}

.btn-sm  { padding: 9px 18px; font-size: 13px; }
.btn-md  { padding: 11px 22px; font-size: 14px; }
.btn-lg  { padding: 13px 28px; font-size: 15px; }

.btn-primary {
  background: var(--accent);
  color: #05080a;
  border-color: var(--accent);
  font-weight: 600;
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 0 24px var(--accent-glow);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.btn-outline:hover {
  background: var(--accent-dim);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-2);
}
.btn-ghost:hover {
  color: var(--text);
  border-color: rgba(255,255,255,0.22);
}

/* ─── NAV ────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 200;
  height: var(--nav-h);
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(10, 10, 10, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom-color: var(--border);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 28px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-img {
  height: 26px;
  width: auto;
  /* Invert dark logo to white for dark background */
  filter: brightness(0) invert(1);
  opacity: 0.92;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-link {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.18s;
}
.nav-link:hover { color: var(--text); }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.25s, opacity 0.25s;
  transform-origin: center;
}
.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile menu */
.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 12px 28px 20px;
  background: rgba(10,10,10,0.96);
  border-bottom: 1px solid var(--border);
}
.mobile-menu.open { display: flex; }
.mobile-menu .nav-link { padding: 10px 0; font-size: 15px; }
.mobile-menu .btn { align-self: flex-start; margin-top: 8px; }

/* ─── FADE-IN ANIMATIONS ─────────────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: none;
}

/* ─── HERO ───────────────────────────────────────────────────── */
.hero {
  padding: calc(var(--nav-h) + 88px) 0 100px;
  text-align: center;
}

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

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-bottom: 44px;
}

.yc-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f5a623;
  box-shadow: 0 0 8px rgba(245, 166, 35, 0.6);
  flex-shrink: 0;
}

.hero-headline {
  font-size: clamp(56px, 8.5vw, 92px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.035em;
  margin-bottom: 28px;
  color: var(--text);
}

.hero-sub {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 420px;
  margin-bottom: 40px;
  line-height: 1.55;
}

.hero-ctas {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.social-proof {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dim);
  letter-spacing: 0.03em;
  margin-bottom: 60px;
}

/* ─── TERMINAL ───────────────────────────────────────────────── */
.terminal {
  width: 100%;
  max-width: 620px;
  background: #0d0d0d;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04),
    0 24px 64px rgba(0,0,0,0.5),
    0 0 48px var(--accent-glow);
  text-align: left;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 13px 18px;
  background: #0f0f0f;
  border-bottom: 1px solid var(--border);
}
.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.dot-red    { background: #ff5f57; }
.dot-yellow { background: #ffbd2e; }
.dot-green  { background: #28c840; }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-left: 6px;
}

.terminal-body {
  padding: 22px 22px 26px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  min-height: 100px;
  position: relative;
}

.terminal-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  overflow: hidden;
  margin-bottom: 6px;
  transition: opacity 0.2s;
}

.terminal-after {
  opacity: 0; /* shown by JS */
}

.t-prompt { color: var(--accent); user-select: none; flex-shrink: 0; }
.t-text   { color: var(--text); white-space: pre; }

.terminal-after .t-text { color: var(--green); }

.hit-badge {
  display: inline-block;
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(39, 201, 63, 0.28);
  border-radius: 4px;
  padding: 1px 8px;
  font-size: 10px;
  letter-spacing: 0.1em;
  font-weight: 700;
  opacity: 0; /* shown by JS */
  transition: opacity 0.3s;
  flex-shrink: 0;
}

.t-cursor {
  display: inline-block;
  color: var(--accent);
  animation: blink 1s step-end infinite;
  font-size: 14px;
  line-height: 1;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ─── SECTION SHARED ─────────────────────────────────────────── */
.section {
  padding: var(--section-gap) 0;
  border-top: 1px solid var(--border);
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--text-dim);
  margin-bottom: 56px;
}

/* ─── HOW IT WORKS ───────────────────────────────────────────── */
.steps {
  display: flex;
  align-items: flex-start;
}

.step {
  flex: 1;
  padding: 0 36px;
}
.step:first-of-type { padding-left: 0; }
.step:last-of-type  { padding-right: 0; }

.step-sep {
  width: 1px;
  height: 72px;
  background: var(--border);
  flex-shrink: 0;
  margin-top: 4px;
}

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

.step-title {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text);
  margin-bottom: 14px;
}

.step-desc {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ─── FEATURES ───────────────────────────────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.feature-card {
  background: var(--bg);
  padding: 38px 34px;
  border-left: 2px solid var(--accent);
  transition: background 0.2s;
}
.feature-card:hover { background: var(--bg-3); }

.feature-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.feature-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ─── STATS BAR ──────────────────────────────────────────────── */
.stats-bar {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 80px 0;
  background: linear-gradient(180deg, rgba(79,195,247,0.04) 0%, transparent 100%);
}

.stats {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 760px;
  margin: 0 auto;
}

.stat {
  flex: 1;
  text-align: center;
  padding: 0 48px;
}

.stat-sep {
  width: 1px;
  height: 56px;
  background: var(--border-2);
  flex-shrink: 0;
}

.stat-number {
  font-family: var(--font-mono);
  font-size: clamp(38px, 5vw, 54px);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

/* ─── CTA SECTION ────────────────────────────────────────────── */
.cta-section {
  text-align: center;
}
.cta-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.cta-headline {
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
}

.fine-print {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dim);
  letter-spacing: 0.03em;
  margin-top: -8px;
}

/* ─── FOOTER ─────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-copy {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}
.footer-links {
  display: flex;
  gap: 24px;
}
.footer-link {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.18s;
}
.footer-link:hover { color: var(--text); }

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 800px) {
  :root {
    --section-gap: 80px;
  }

  .nav-links { display: none; }
  .hamburger { display: flex; }

  .hero {
    padding: calc(var(--nav-h) + 60px) 0 80px;
  }

  .hero-sub { font-size: 16px; }

  .steps {
    flex-direction: column;
    gap: 40px;
  }
  .step {
    padding: 0 !important;
  }
  .step-sep { display: none; }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .stats {
    flex-direction: column;
    gap: 36px;
  }
  .stat { padding: 0; }
  .stat-sep { display: none; }

  .terminal-body { font-size: 11.5px; }
  .t-text { white-space: pre-wrap; word-break: break-all; }

  .footer-inner {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

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

/* ─── MODAL ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-card {
  background: #111111;
  border: 1px solid #222222;
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  padding: 40px;
  position: relative;
  transform: translateY(18px);
  transition: transform 0.22s ease;
}
.modal-overlay.open .modal-card {
  transform: none;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  font-family: var(--font-sans);
  transition: color 0.18s;
}
.modal-close:hover { color: var(--text); }

.modal-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.modal-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 30px;
}

.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  margin-bottom: 7px;
}

.form-input {
  display: block;
  width: 100%;
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 11px 14px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  -webkit-appearance: none;
  appearance: none;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.1);
}
.form-input::placeholder { color: var(--text-dim); }

.form-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23555' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}
.form-select option { background: #111111; }

.form-error {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #ff6b6b;
  margin-bottom: 14px;
  min-height: 14px;
  line-height: 1.5;
}

.btn-modal-submit {
  width: 100%;
  padding: 13px;
  font-size: 14px;
  font-weight: 600;
}

@keyframes pulse-opacity {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.45; }
}
.btn-modal-submit.loading {
  animation: pulse-opacity 0.9s ease infinite;
  pointer-events: none;
}

/* Success state */
#modal-success-state {
  text-align: center;
  padding: 16px 0 8px;
}
.success-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 24px;
}
.success-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.success-sub {
  font-size: 14px;
  color: var(--text-muted);
}

@media (max-width: 480px) {
  .container { padding: 0 18px; }
  .hero-badge { font-size: 9px; letter-spacing: 0.1em; text-align: center; }
  .feature-card { padding: 28px 22px; }
  .stat-number { font-size: 36px; }
}
