/* ============================================
   shouldyoubuyit.com — Ultra Minimal 3D Theme
   ============================================ */

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

:root {
  --bg: #fafaf9;
  --fg: #18181b;
  --fg-muted: #71717a;
  --fg-dim: #a1a1aa;
  --accent: #18181b;
  
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Bricolage Grotesque', 'Space Grotesk', sans-serif;

  --yes: #059669;
  --yes-bg: rgba(5, 150, 105, 0.07);
  --no: #e11d48;
  --no-bg: rgba(225, 29, 72, 0.07);
  --maybe: #d97706;
  --maybe-bg: rgba(217, 119, 6, 0.07);

  --radius-btn: 999px;
  --radius-card: 16px;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  overflow-x: hidden;
}

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.header {
  padding: 1.75rem 2rem;
  text-align: center;
}

.wordmark {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.03em;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.wordmark:hover {
  opacity: 1;
}

.wordmark span {
  color: var(--fg-dim);
  font-weight: 400;
}

/* Main & Hero */
.main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem 1.5rem 3rem;
  width: 100%;
  max-width: 520px;
}

.title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--fg);
  margin-top: 1rem;
}

.subtitle {
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: clamp(0.9rem, 2.5vw, 1.05rem);
  color: var(--fg-muted);
  font-weight: 400;
  line-height: 1.5;
  max-width: 360px;
}

/* 3D Coin Stage — Placed at the top of Hero section so flips have 100% open space above */
.coin-stage {
  position: relative;
  width: 100%;
  max-width: 320px;
  height: 400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: visible;
  -webkit-tap-highlight-color: transparent;
}

.coin-canvas-container {
  width: 100%;
  height: 100%;
  position: relative;
  touch-action: none;
  overflow: visible;
}

.coin-canvas-container canvas {
  outline: none;
  display: block;
}

.coin-hint {
  position: absolute;
  bottom: 0px;
  font-size: 0.72rem;
  color: var(--fg-dim);
  letter-spacing: 0.02em;
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.coin-stage:hover .coin-hint {
  opacity: 0.85;
}

/* Result Section */
.result {
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  padding: 0 1rem;
}

.result-answer {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 4.5rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1;
  opacity: 0;
  transform: scale(0.7) translateY(10px);
  transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  padding: 0.25rem 1.35rem;
  border-radius: var(--radius-card);
}

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

.result-answer.yes {
  color: var(--yes);
  background: var(--yes-bg);
}

.result-answer.no {
  color: var(--no);
  background: var(--no-bg);
}

.result-answer.maybe {
  color: var(--maybe);
  background: var(--maybe-bg);
}

.result-quip {
  margin-top: 0.625rem;
  font-size: 0.95rem;
  color: var(--fg-muted);
  font-weight: 400;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease 0.1s, transform 0.3s ease 0.1s;
}

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

/* Button & Loading State */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 2.75rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #ffffff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(24, 24, 27, 0.12);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  min-width: 160px;
}

.btn-content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn.flipping .btn-spinner {
  display: inline-block;
}

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

.btn:hover:not(:disabled) {
  background: #27272a;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(24, 24, 27, 0.2);
}

.btn:active:not(:disabled) {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 2px 8px rgba(24, 24, 27, 0.15);
}

.btn:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Meta info */
.meta {
  margin-top: 1.25rem;
  font-size: 0.8rem;
  color: var(--fg-dim);
  font-weight: 400;
  min-height: 1.2em;
}

/* Footer */
.footer {
  padding: 1.75rem 2rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--fg-dim);
}

/* Responsive */
@media (max-width: 480px) {
  .hero {
    padding: 1rem 1rem 2.5rem;
  }

  .coin-stage {
    max-width: 240px;
    height: 220px;
    margin: 1.25rem 0 1rem;
  }

  .btn {
    padding: 0.8rem 2.25rem;
    font-size: 0.95rem;
    width: 100%;
    max-width: 280px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .result-answer, .result-quip, .btn {
    transition: none !important;
    animation: none !important;
  }
}
