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

:root {
  --bg: #0a0a0a;
  --bg-card: #141414;
  --bg-input: #1a1a1a;
  --text: #f0f0f0;
  --text-dim: #888;
  --accent: #00d4ff;
  --accent-glow: rgba(0, 212, 255, 0.3);
  --gold: #d4a853;
  --gold-glow: rgba(212, 168, 83, 0.3);
  --border: #2a2a2a;
  --radius: 12px;
  --max-w: 640px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Navigation ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
}

.nav-brand span {
  color: var(--accent);
}

#langToggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.2s;
}

#langToggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Hero Section ── */
.hero {
  padding: 100px 0 40px;
  text-align: center;
}

.hero-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1rem;
  color: var(--text-dim);
  max-width: 480px;
  margin: 0 auto 28px;
  line-height: 1.6;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: var(--accent);
  color: #000;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.25s;
  text-decoration: none;
  box-shadow: 0 0 24px var(--accent-glow);
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 40px var(--accent-glow);
}

.hero-price {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.hero-price strong {
  color: var(--gold);
  font-size: 1.1rem;
}

/* ── Examples ── */
.examples {
  padding: 40px 0;
}

.examples-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 20px;
}

.examples-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 0 20px 16px;
  scrollbar-width: none;
}

.examples-scroll::-webkit-scrollbar { display: none; }

.example-card {
  flex: 0 0 200px;
  scroll-snap-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  transition: border-color 0.3s;
}

.example-card:hover {
  border-color: var(--accent);
}

.example-card svg {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 10px;
}

.example-card .name {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* ── Input Section ── */
.input-section {
  padding: 20px 0 40px;
}

.input-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.input-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  margin-bottom: 10px;
  display: block;
}

#wordInput {
  width: 100%;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-align: center;
  text-transform: uppercase;
  padding: 16px;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

#wordInput:focus {
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
}

#wordInput::placeholder {
  color: #444;
  font-weight: 400;
}

.input-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: 8px;
}

/* ── Customize Toggle ── */
.customize-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
  padding: 8px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.8rem;
  cursor: pointer;
  width: 100%;
  transition: color 0.2s;
}

.customize-toggle:hover { color: var(--text); }

.customize-toggle .arrow {
  transition: transform 0.2s;
  font-size: 0.65rem;
}

.customize-toggle.open .arrow {
  transform: rotate(180deg);
}

.customize-panel {
  display: none;
  padding-top: 16px;
  gap: 16px;
}

.customize-panel.open {
  display: flex;
  flex-direction: column;
}

.customize-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.customize-row label {
  font-size: 0.8rem;
  color: var(--text-dim);
  min-width: 80px;
}

.stroke-presets {
  display: flex;
  gap: 8px;
}

.stroke-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.stroke-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 212, 255, 0.1);
}

.color-input {
  width: 36px;
  height: 36px;
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  padding: 2px;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
}

.color-input::-webkit-color-swatch-wrapper { padding: 0; }
.color-input::-webkit-color-swatch { border: none; border-radius: 5px; }

/* ── Preview ── */
.preview-section {
  margin-top: 24px;
}

.preview-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 12px;
}

.preview-container {
  position: relative;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 320px;
  margin: 0 auto;
}

.preview-container svg {
  width: 100%;
  height: 100%;
}

.preview-container .preview-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 16px;
  background: linear-gradient(to top, rgba(10,10,10,0.7) 0%, transparent 50%);
  pointer-events: none;
}

.preview-overlay span {
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

.preview-placeholder {
  color: #333;
  font-size: 0.85rem;
  text-align: center;
  padding: 20px;
}

/* ── CTA Bar ── */
.cta-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 20px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  z-index: 100;
  display: none;
}

.cta-bar.visible {
  display: block;
}

.cta-buy {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  background: linear-gradient(135deg, var(--accent), #0099cc);
  color: #000;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 0 30px var(--accent-glow);
}

.cta-buy:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 50px var(--accent-glow);
}

.cta-buy:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.cta-buy .price {
  opacity: 0.8;
  font-weight: 400;
}

/* ── Trust Badges ── */
.trust {
  padding: 20px 0 120px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.trust-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 212, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: var(--accent);
  flex-shrink: 0;
}

/* ── Footer ── */
.footer {
  padding: 20px;
  text-align: center;
  font-size: 0.7rem;
  color: #444;
  border-top: 1px solid var(--border);
}

/* ── Loading Spinner ── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Reveal Page ── */
.reveal-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #050505;
}

.reveal-status {
  font-size: 0.9rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  margin-bottom: 20px;
  text-align: center;
}

.reveal-canvas {
  width: 100%;
  max-width: 500px;
  aspect-ratio: 1;
  position: relative;
}

.reveal-canvas svg {
  width: 100%;
  height: 100%;
  display: block;
}

.reveal-canvas canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.reveal-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-top: 24px;
  opacity: 0;
  transition: opacity 0.6s;
  text-align: center;
}

.reveal-title.visible { opacity: 1; }

.reveal-stats {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 8px;
  opacity: 0;
  transition: opacity 0.6s;
  text-align: center;
}

.reveal-stats.visible { opacity: 1; }

.reveal-buttons {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  opacity: 0;
  transition: opacity 0.6s;
}

.reveal-buttons.visible { opacity: 1; }

.reveal-btn {
  padding: 14px 28px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.reveal-btn:hover {
  border-color: var(--accent);
  background: rgba(0, 212, 255, 0.05);
}

.reveal-btn.primary {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  font-weight: 700;
}

.reveal-btn.primary:hover {
  box-shadow: 0 0 24px var(--accent-glow);
}

.reveal-another {
  margin-top: 32px;
  opacity: 0;
  transition: opacity 0.6s;
}

.reveal-another.visible { opacity: 1; }

.reveal-another a {
  color: var(--text-dim);
  font-size: 0.8rem;
  text-decoration: none;
  transition: color 0.2s;
}

.reveal-another a:hover { color: var(--accent); }

/* ── Glow animation for reveal ── */
.reveal-glow {
  position: absolute;
  inset: -50%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s;
}

.reveal-glow.pulse {
  animation: glowPulse 1.5s ease-out;
}

@keyframes glowPulse {
  0% { opacity: 0.8; transform: scale(0.3); }
  100% { opacity: 0; transform: scale(1.5); }
}

/* ── SVG draw animation ── */
.draw-path {
  stroke-dasharray: var(--path-len);
  stroke-dashoffset: var(--path-len);
  animation: drawLine var(--draw-dur) ease-in-out var(--draw-delay) forwards;
  filter: drop-shadow(0 0 6px var(--accent));
  transition: filter 1s ease 0.3s, stroke 1s ease 0.3s;
}

.draw-path.settled {
  filter: none;
}

@keyframes drawLine {
  to { stroke-dashoffset: 0; }
}

/* ── Desktop ── */
@media (min-width: 768px) {
  .hero { padding: 140px 0 60px; }
  .hero-title { font-size: 3rem; }
  .hero-sub { font-size: 1.15rem; }

  .examples-scroll {
    justify-content: center;
    flex-wrap: wrap;
    overflow-x: visible;
    scroll-snap-type: none;
    padding: 0;
  }

  .example-card {
    flex: 0 0 180px;
  }

  .input-card {
    padding: 32px;
  }

  #wordInput {
    font-size: 2rem;
    padding: 20px;
  }

  .preview-container {
    max-width: 400px;
  }

  .cta-bar {
    position: static;
    background: transparent;
    backdrop-filter: none;
    border-top: none;
    padding: 24px 0;
  }

  .cta-bar.visible {
    display: block;
  }

  .cta-buy {
    max-width: 400px;
  }

  .trust {
    flex-direction: row;
    justify-content: center;
    padding-bottom: 60px;
  }

  .reveal-canvas {
    max-width: 600px;
  }

  .reveal-buttons {
    gap: 16px;
  }
}

@media (min-width: 1024px) {
  .hero-title { font-size: 3.5rem; }
}
