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

:root {
  --teal: #0891B2;
  --teal-dark: #0E7490;
  --teal-light: #22D3EE;
  --teal-glow: #0891B220;
  --bg: #09090B;
  --surface: #131316;
  --surface-2: #1A1A1E;
  --surface-3: #222226;
  --text: #F4F4F5;
  --text-2: #A1A1AA;
  --text-3: #52525B;
  --border: #27272A;
  --danger: #EF4444;
  --safe: #22D3EE;
  --radius: 20px;
}

/* ── Light Theme ────────────────────────────────────────────────────────── */
[data-theme="light"] {
  --bg: #F8FAFB;
  --surface: #FFFFFF;
  --surface-2: #F0F2F4;
  --surface-3: #E4E7EB;
  --text: #1A1A2E;
  --text-2: #4A5568;
  --text-3: #8896A6;
  --border: #D8DEE4;
  --teal-glow: #0891B215;
  --safe: #0891B2;
}
[data-theme="light"] .nav {
  background: rgba(248,250,251,0.88);
}
[data-theme="light"] .trans-bad { background: #f0f0f0; }
[data-theme="light"] .trans-bad span { color: #bbb; }
[data-theme="light"] .trans-good {
  background-image:
    linear-gradient(45deg, #d8dee4 25%, transparent 25%),
    linear-gradient(-45deg, #d8dee4 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d8dee4 75%),
    linear-gradient(-45deg, transparent 75%, #d8dee4 75%);
  background-color: var(--surface-2);
}
[data-theme="light"] .copy-svg-preview {
  background-image:
    linear-gradient(45deg, var(--surface-3) 25%, transparent 25%),
    linear-gradient(-45deg, var(--surface-3) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--surface-3) 75%),
    linear-gradient(-45deg, transparent 75%, var(--surface-3) 75%);
}
[data-theme="light"] .hero-sub code { color: var(--text-3); }
[data-theme="light"] code { color: var(--teal-dark); }
[data-theme="light"] .bento-copy {
  background: linear-gradient(135deg, var(--surface), rgba(8,145,178,0.05));
}
/* Fix icon visibility in light mode — teal-light is too faint on white */
[data-theme="light"] .perm-icon,
[data-theme="light"] .opensource-icon,
[data-theme="light"] .free-icon { color: var(--teal); }
/* Fix dark mode demo toggle visibility */
[data-theme="light"] .dark-sun, [data-theme="light"] .dark-moon { color: var(--text-3); }
[data-theme="light"] .dark-moon.active { color: var(--teal); }
[data-theme="light"] .dark-toggle { background: var(--surface-3); border-color: var(--border); }
/* Fix transparency demo labels */
[data-theme="light"] .trans-good span { color: var(--teal); }
[data-theme="light"] .trans-bad { background: #e8e8e8; border: 1px solid var(--border); }
[data-theme="light"] .trans-bad span { color: #888; }
/* Fix sanitize labels */
[data-theme="light"] .sanitize-label.safe { color: var(--teal); }
[data-theme="light"] .safe { color: var(--teal); }
/* Fix name rows */
[data-theme="light"] .name-row.good { color: var(--teal-dark); }
[data-theme="light"] .name-check { color: var(--teal-dark); }
/* Fix zip accent */
[data-theme="light"] .zip-file { color: var(--teal); }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  overflow-x: hidden;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
a { color: inherit; text-decoration: none; }

code {
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.85em;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--teal-light);
}

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; border: none; border-radius: 12px;
  cursor: pointer; transition: all 0.2s; text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--teal); color: white; }
.btn-primary:hover { background: var(--teal-dark); transform: translateY(-1px); box-shadow: 0 8px 30px rgba(8,145,178,0.35); }
.btn-sm { padding: 8px 16px; font-size: 14px; border-radius: 10px; }
.btn-lg { padding: 16px 32px; font-size: 17px; border-radius: 14px; }

/* ── Nav ──────────────────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(9,9,11,0.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.nav-brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a:not(.btn) { color: var(--text-2); font-size: 14px; font-weight: 500; transition: color 0.15s; }
.nav-links a:not(.btn):hover { color: var(--text); }

/* ── Hero ─────────────────────────────────────────────────────────────── */
.hero {
  padding: 160px 0 80px;
  text-align: center;
}
.hero-eyebrow {
  font-size: 14px; font-weight: 600; color: var(--teal-light);
  letter-spacing: 1px; text-transform: uppercase; margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(44px, 6vw, 72px);
  font-weight: 800; letter-spacing: -2px; line-height: 1.05; margin-bottom: 24px;
}
.hero h1 .highlight { color: var(--teal-light); }
.hero-sub {
  font-size: 18px; color: var(--text-2); line-height: 1.7;
  max-width: 560px; margin: 0 auto 36px;
}
.hero-sub code { text-decoration: line-through; color: var(--text-3); opacity: 0.8; }
.hero-actions { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.hero-compat { font-size: 13px; color: var(--text-3); }

/* ── Bento Grid ───────────────────────────────────────────────────────── */
.bento { padding: 40px 0 80px; }

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

.bento-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  overflow: hidden;
  transition: border-color 0.25s, transform 0.25s;
}
.bento-card:hover { border-color: rgba(8,145,178,0.4); transform: translateY(-2px); }
.bento-card h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.2; margin-bottom: 10px; }
.bento-card h3 { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; margin-bottom: 8px; }
.bento-card p { font-size: 14px; color: var(--text-2); line-height: 1.55; }

.bento-wide { grid-column: span 2; }

/* ── Copy Demo Card ───────────────────────────────────────────────────── */
.bento-copy {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center;
  background: linear-gradient(135deg, var(--surface), rgba(8,145,178,0.06));
  border-color: rgba(8,145,178,0.2);
}
.copy-demo { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.copy-demo-card {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px;
  padding: 20px; width: 180px; text-align: center;
}
.copy-svg-preview {
  width: 100%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  background-image:
    linear-gradient(45deg, var(--surface-3) 25%, transparent 25%),
    linear-gradient(-45deg, var(--surface-3) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--surface-3) 75%),
    linear-gradient(-45deg, transparent 75%, var(--surface-3) 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
  background-color: var(--surface);
  border-radius: 10px; margin-bottom: 12px; padding: 24px;
}
.copy-svg-preview svg { width: 64px; height: 64px; }
.copy-actions { display: flex; gap: 6px; }
.copy-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text-2); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.copy-btn.active { background: var(--teal); border-color: var(--teal); color: white; }
.copy-toast {
  background: var(--teal); color: white; padding: 8px 18px; border-radius: 10px;
  font-size: 13px; font-weight: 600; opacity: 0; transform: translateY(6px);
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.copy-toast.show { opacity: 1; transform: translateY(0); }

/* ── Names Demo ───────────────────────────────────────────────────────── */
.names-demo { margin-top: 16px; display: flex; flex-direction: column; gap: 4px; }
.name-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px; border-radius: 6px; font-size: 13px;
  font-family: 'SF Mono', Consolas, monospace;
}
.name-row.bad { color: var(--text-3); text-decoration: line-through; }
.name-row.good { color: var(--teal-light); background: rgba(8,145,178,0.08); }
.name-x { color: var(--danger); font-size: 14px; }
.name-check { color: var(--teal-light); font-size: 14px; font-weight: 700; }

/* ── Search Demo ──────────────────────────────────────────────────────── */
.search-demo { margin-top: 16px; }
.search-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; margin-bottom: 8px;
}
.search-text { font-size: 14px; color: var(--text); }
.search-cursor { color: var(--teal-light); animation: blink 1s infinite; font-weight: 200; }
@keyframes blink { 0%,50% { opacity: 1; } 51%,100% { opacity: 0; } }
.search-results { display: flex; flex-direction: column; gap: 3px; }
.search-result {
  padding: 6px 10px; border-radius: 6px; font-size: 13px;
  font-family: 'SF Mono', Consolas, monospace; color: var(--text-2);
  background: var(--surface-2); opacity: 0; transform: translateY(4px);
  transition: all 0.3s ease;
}
.search-result.visible { opacity: 1; transform: translateY(0); }

/* ── Sanitize Demo ────────────────────────────────────────────────────── */
.bento-sanitize { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; }
.sanitize-demo { display: flex; align-items: center; gap: 12px; }
.sanitize-before, .sanitize-after {
  flex: 1; background: var(--surface-2); border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border);
}
.sanitize-after { border-color: rgba(8,145,178,0.3); }
.sanitize-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px;
  padding: 8px 14px; background: var(--surface-3); color: var(--text-3);
  border-bottom: 1px solid var(--border);
}
.sanitize-label.safe { background: rgba(8,145,178,0.1); color: var(--teal-light); }
.sanitize-demo pre { padding: 12px 14px; font-size: 12px; line-height: 1.6; overflow-x: auto; }
.sanitize-demo code { background: none; padding: 0; color: var(--text-3); font-size: 12px; }
.danger { color: var(--danger); text-decoration: line-through; }
.safe { color: var(--teal-light); }
.sanitize-arrow { color: var(--text-3); flex-shrink: 0; }

/* ── Transparency Demo ────────────────────────────────────────────────── */
.transparency-demo { margin-top: 16px; display: flex; gap: 10px; }
.trans-bad, .trans-good {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px;
  border-radius: 12px; padding: 20px 10px;
}
.trans-bad { background: white; }
.trans-bad svg { width: 40px; height: 40px; /* invisible on white! */ }
.trans-bad span { font-size: 11px; color: #999; font-weight: 600; }
.trans-good {
  background-image:
    linear-gradient(45deg, #2a2a2e 25%, transparent 25%),
    linear-gradient(-45deg, #2a2a2e 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #2a2a2e 75%),
    linear-gradient(-45deg, transparent 75%, #2a2a2e 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
  background-color: var(--surface-2);
}
.trans-good svg { width: 40px; height: 40px; }
.trans-good span { font-size: 11px; color: var(--teal-light); font-weight: 600; }

/* ── Dark Mode Demo ───────────────────────────────────────────────────── */
.bento-dark { text-align: center; }
.dark-demo { margin-top: 16px; display: flex; justify-content: center; }
.dark-toggle {
  display: flex; gap: 4px; padding: 4px;
  background: var(--surface-2); border-radius: 12px; border: 1px solid var(--border);
}
.dark-sun, .dark-moon {
  padding: 10px 16px; border-radius: 10px; color: var(--text-3);
  transition: all 0.2s; cursor: pointer;
}
.dark-moon.active { background: var(--surface-3); color: var(--teal-light); }

/* ── ZIP Demo ─────────────────────────────────────────────────────────── */
.zip-demo { margin-top: 16px; }
.zip-file {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; background: var(--teal-glow); border: 1px solid rgba(8,145,178,0.2);
  border-radius: 10px; margin-bottom: 8px; color: var(--teal-light); font-weight: 600; font-size: 14px;
}
.zip-contents { display: flex; flex-direction: column; gap: 3px; }
.zip-item {
  padding: 5px 10px 5px 28px; font-size: 12px; color: var(--text-3);
  font-family: 'SF Mono', Consolas, monospace;
  border-left: 2px solid var(--border); margin-left: 8px;
}
.zip-item:last-child { color: var(--text-2); font-family: inherit; font-weight: 500; }

/* ── Permissions Card ─────────────────────────────────────────────────── */
.bento-permissions { text-align: center; display: flex; flex-direction: column; align-items: center; }
.perm-icon { margin-bottom: 12px; color: var(--teal-light); }

/* ── Open Source Card ────────────────────────────────────────────────── */
.bento-opensource { text-align: center; display: flex; flex-direction: column; align-items: center; }
.opensource-icon { margin-bottom: 12px; color: var(--teal-light); }

/* ── Free Forever Card ───────────────────────────────────────────────── */
.bento-free { text-align: center; display: flex; flex-direction: column; align-items: center; }
.free-icon { margin-bottom: 12px; color: var(--teal-light); }

/* ── Theme Toggle Button ─────────────────────────────────────────────── */
.icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text-2); cursor: pointer;
  transition: all 0.2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--teal); }
.theme-icon-sun { display: none; }
.theme-icon-moon { display: block; }
[data-theme="light"] .theme-icon-sun { display: block; }
[data-theme="light"] .theme-icon-moon { display: none; }

/* ── Easter Egg Counter ───────────────────────────────────────────────── */
.egg { padding: 60px 0; text-align: center; }
.egg-text { font-size: 20px; font-weight: 600; color: var(--text-2); }
.egg-text strong { color: var(--teal-light); font-size: 28px; font-variant-numeric: tabular-nums; }
.egg-sub { display: block; font-size: 14px; color: var(--text-3); margin-top: 4px; font-weight: 400; }

/* ── CTA ──────────────────────────────────────────────────────────────── */
.cta { padding: 80px 0 100px; text-align: center; }
.cta h2 {
  font-size: clamp(36px, 5vw, 56px); font-weight: 800;
  letter-spacing: -1.5px; line-height: 1.08; margin-bottom: 16px;
}
.cta > .container > p { font-size: 17px; color: var(--text-2); margin-bottom: 32px; }
.cta-compat { font-size: 13px; color: var(--text-3); margin-top: 16px; }

/* ── Footer ───────────────────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--border); padding: 28px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-size: 13px; color: var(--text-3); transition: color 0.15s; }
.footer-links a:hover { color: var(--text); }
.footer-copy { font-size: 12px; color: var(--text-3); }

/* ── Animations ───────────────────────────────────────────────────────── */
.fade-up {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .bento-grid { grid-template-columns: 1fr 1fr; }
  .bento-wide { grid-column: span 2; }
  .bento-copy { grid-template-columns: 1fr; gap: 20px; }
  .bento-sanitize { grid-template-columns: 1fr; }
  .sanitize-demo { flex-direction: column; }
  .sanitize-arrow { transform: rotate(90deg); }
  .hero h1 { letter-spacing: -1.5px; }
}

@media (max-width: 640px) {
  .bento-grid { grid-template-columns: 1fr; }
  .bento-wide { grid-column: span 1; }
  .nav-links a:not(.btn) { display: none; }
  .footer-inner { flex-direction: column; text-align: center; }
  .hero { padding: 120px 0 60px; }
}
