/* =============================================
   DESIGN TOKENS
   ============================================= */
:root {
  --bg: #0a0a0a;
  --surface: #111111;
  --border: #1f1f1f;
  --text-primary: #f5f5f5;
  --text-muted: #6b7280;
  --text-subtle: #374151;

  /* Answer states */
  --yes-color: #22c55e;
  --yes-glow: rgba(34, 197, 94, 0.18);
  --no-color: #ef4444;
  --no-glow: rgba(239, 68, 68, 0.18);
  --perhaps-color: #f59e0b;
  --perhaps-glow: rgba(245, 158, 11, 0.18);
  --idle-color: #3f3f46;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;

  /* Typography */
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --fw-regular: 400;
  --fw-bold: 700;
  --fw-black: 900;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 0.35s;
}

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

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

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text-primary);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-sm);
  overflow: hidden;
  line-height: 1.4;
}

/* =============================================
   LAYOUT
   ============================================= */
#main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  max-width: 900px;
  gap: var(--space-md);
  padding: var(--space-sm);
}

/* =============================================
   HERO
   ============================================= */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
}

.eyebrow {
  font-size: clamp(0.7rem, 1.5vw, 0.875rem);
  font-weight: var(--fw-regular);
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(1.6rem, 5vw, 2.75rem);
  font-weight: var(--fw-black);
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

/* =============================================
   ANSWER DISPLAY
   ============================================= */
.answer-section {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.answer-display {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1.5rem;
  padding: var(--space-md) var(--space-lg);
  min-width: min(90vw, 480px);
  min-height: 200px;
  border: 2px solid var(--border);
  background: var(--surface);
  transition:
    border-color var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease),
    background var(--duration) var(--ease);
  will-change: transform;
}

.answer-display.state-yes {
  border-color: var(--yes-color);
  box-shadow: 0 0 60px var(--yes-glow), 0 0 120px var(--yes-glow);
  background: rgba(34, 197, 94, 0.04);
}

.answer-display.state-no {
  border-color: var(--no-color);
  box-shadow: 0 0 60px var(--no-glow), 0 0 120px var(--no-glow);
  background: rgba(239, 68, 68, 0.04);
}

.answer-display.state-perhaps {
  border-color: var(--perhaps-color);
  box-shadow: 0 0 60px var(--perhaps-glow), 0 0 120px var(--perhaps-glow);
  background: rgba(245, 158, 11, 0.04);
}

.answer-display.is-rolling {
  animation: shake 0.45s var(--ease);
}

.answer-text {
  font-size: clamp(3.5rem, 15vw, 8rem);
  font-weight: var(--fw-black);
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--idle-color);
  transition: color var(--duration) var(--ease);
  user-select: none;
}

.answer-text.state-yes  { color: var(--yes-color); }
.answer-text.state-no   { color: var(--no-color); }
.answer-text.state-perhaps { color: var(--perhaps-color); }

/* =============================================
   CTA BUTTONS
   ============================================= */
.cta-section {
  display: flex;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  border: none;
  border-radius: 100px;
  font-family: var(--font);
  font-weight: var(--fw-bold);
  cursor: pointer;
  text-decoration: none;
  transition:
    transform var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease),
    background var(--duration) var(--ease),
    opacity var(--duration) var(--ease);
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.btn:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 3px;
}

.btn:active {
  transform: scale(0.96) !important;
}

.btn-primary {
  background: var(--text-primary);
  color: var(--bg);
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  padding: 0.85em 2.4em;
  letter-spacing: 0.01em;
  box-shadow: 0 0 0 0 rgba(245, 245, 245, 0);
}

.btn-primary:hover {
  transform: scale(1.04);
  box-shadow: 0 8px 32px rgba(245, 245, 245, 0.12);
}

.btn-coffee {
  background: transparent;
  color: #d1d5db;
  font-size: clamp(0.8rem, 1.8vw, 0.9rem);
  padding: 0.6em 1.4em;
  border: 1px solid #4b5563;
  letter-spacing: 0.02em;
}

.btn-coffee:hover {
  color: var(--text-primary);
  border-color: #9ca3af;
  background: rgba(255,255,255,0.06);
  transform: scale(1.03);
}

/* =============================================
   MADE BY SECTION
   ============================================= */
.made-by-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
}

.made-by-text {
  font-size: clamp(0.7rem, 1.5vw, 0.8rem);
  color: var(--text-muted);
  font-weight: var(--fw-regular);
  letter-spacing: 0.02em;
}

/* =============================================
   DISCLAIMER
   ============================================= */
.disclaimer {
  max-width: 600px;
  text-align: center;
  margin: 0 auto;
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: rgba(255,255,255,0.03);
}

.disclaimer p {
  font-size: clamp(0.7rem, 1.4vw, 0.775rem);
  color: var(--text-muted);
  line-height: 1.5;
}

.disclaimer strong {
  color: #9ca3af;
  font-weight: var(--fw-bold);
}

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
  width: 100%;
  text-align: center;
  padding: var(--space-sm);
  border-top: 1px solid var(--border);
}

.footer-link {
  font-size: 0.8rem;
  color: #9ca3af;
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color var(--duration) var(--ease);
}

.footer-link:hover {
  color: var(--text-primary);
}

.footer-link:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 3px;
  border-radius: 2px;
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes shake {
  0%  { transform: translateY(0); }
  15% { transform: translateY(-6px) rotate(-0.5deg); }
  35% { transform: translateY(5px) rotate(0.5deg); }
  55% { transform: translateY(-4px) rotate(-0.3deg); }
  75% { transform: translateY(3px) rotate(0.2deg); }
  90% { transform: translateY(-2px); }
  100%{ transform: translateY(0); }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.answer-text.animate-in {
  animation: fadeInScale 0.3s var(--ease) forwards;
}

/* =============================================
   RESPONSIVE
   ============================================= */

/* Tablet */
@media (max-width: 768px) {
  #main-content {
    gap: var(--space-md);
    padding: var(--space-lg) var(--space-sm);
  }

  .answer-display {
    min-height: 160px;
    padding: var(--space-md);
    border-radius: 1.25rem;
  }
}

/* Mobile */
@media (max-width: 480px) {
  body {
    padding: var(--space-sm) var(--space-xs);
  }

  #main-content {
    gap: var(--space-md);
    padding: var(--space-md) var(--space-xs);
  }

  .answer-display {
    min-width: 90vw;
    min-height: 140px;
    padding: var(--space-sm) var(--space-md);
    border-radius: 1rem;
  }

  .hero-title {
    letter-spacing: -0.01em;
  }

  .btn-primary {
    width: 100%;
    max-width: 340px;
  }
}

/* Very small screens */
@media (max-width: 360px) {
  .answer-display {
    min-height: 120px;
    border-radius: 0.875rem;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
