/* ============================================================================
   HYNTS Landing Page — Design System & Styles
   Editorial / newspaper aesthetic with dark/light theme support
   ============================================================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Merriweather:ital,wght@0,400;0,700;0,900;1,400;1,700&family=Inter:wght@400;500;600;700&family=Courier+Prime:wght@400;700&display=swap');

/* ==========================================================================
   Theme Tokens (CSS Custom Properties)
   ========================================================================== */

:root {
  /* Dark mode — default */
  --paper-bg: #18181B;
  --paper-card: #27272A;
  --ink-primary: #E4E4E7;
  --ink-secondary: #A1A1AA;
  --ink-border: #52525B;
  --accent-highlight: #F59E0B;
  --accent-success: #34D399;
  --accent-error: #F87171;
  --shadow-hard: 3px 3px 0 #000;
  --shadow-hard-accent: 3px 3px 0 #F59E0B;

  /* Layout */
  --content-max: 800px;
  --section-padding: 120px;
  --nav-height: 64px;
}

[data-theme="light"] {
  --paper-bg: #F4F1EA;
  --paper-card: #FDFBF7;
  --ink-primary: #2C2E33;
  --ink-secondary: #585B61;
  --ink-border: #D1CDC5;
  --accent-highlight: #EF9C22;
  --accent-success: #6B8F71;
  --accent-error: #C45A5A;
  --shadow-hard: 2px 2px 0 #2C2E33;
  --shadow-hard-accent: 2px 2px 0 #EF9C22;
}

/* System preference fallback */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --paper-bg: #F4F1EA;
    --paper-card: #FDFBF7;
    --ink-primary: #2C2E33;
    --ink-secondary: #585B61;
    --ink-border: #D1CDC5;
    --accent-highlight: #EF9C22;
    --accent-success: #6B8F71;
    --accent-error: #C45A5A;
    --shadow-hard: 2px 2px 0 #2C2E33;
    --shadow-hard-accent: 2px 2px 0 #EF9C22;
  }
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--paper-bg);
  color: var(--ink-primary);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent-highlight);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

a:hover {
  opacity: 0.8;
}

::selection {
  background: var(--accent-highlight);
  color: var(--paper-bg);
}

/* ==========================================================================
   Typography
   ========================================================================== */

.font-headline {
  font-family: 'Merriweather', Georgia, serif;
  font-weight: 900;
  line-height: 1.2;
}

.font-body {
  font-family: 'Inter', sans-serif;
}

.font-mono {
  font-family: 'Courier Prime', 'Courier New', monospace;
  font-weight: 700;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 24px;
}

.container--wide {
  max-width: 1080px;
}

section {
  padding: var(--section-padding) 0;
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--paper-bg);
  border-bottom: 1px solid var(--ink-border);
  transition: background-color 0.3s ease;
}

.nav__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__brand {
  font-family: 'Merriweather', Georgia, serif;
  font-weight: 900;
  font-size: 20px;
  color: var(--ink-primary);
  letter-spacing: -0.5px;
}

.nav__brand span {
  color: var(--accent-highlight);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
}

.nav__links a {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: color 0.2s ease;
}

.nav__links a:hover {
  color: var(--accent-highlight);
  opacity: 1;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--ink-border);
  color: var(--ink-secondary);
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--accent-highlight);
  color: var(--accent-highlight);
}

/* Mobile nav toggle */
.nav__mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--ink-primary);
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: calc(var(--nav-height) + 40px);
  padding-bottom: 80px;
}

.hero__edition {
  display: inline-block;
  font-family: 'Courier Prime', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent-highlight);
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 6px 14px;
  margin-bottom: 32px;
}

.hero__wordmark {
  font-family: 'Merriweather', Georgia, serif;
  font-size: clamp(48px, 10vw, 80px);
  font-weight: 900;
  color: var(--ink-primary);
  letter-spacing: -2px;
  margin-bottom: 16px;
}

.hero__rule {
  width: 60px;
  height: 3px;
  background: var(--accent-highlight);
  margin: 0 auto 24px;
  border: none;
}

.hero__tagline {
  font-family: 'Merriweather', Georgia, serif;
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 700;
  font-style: italic;
  color: var(--ink-primary);
  margin-bottom: 16px;
}

.hero__desc {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-secondary);
  max-width: 520px;
  margin: 0 auto 40px;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 14px 28px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
}

.btn:hover {
  opacity: 1;
  transform: translate(-1px, -1px);
}

.btn:active {
  transform: translate(1px, 1px);
  box-shadow: none !important;
}

.btn--primary {
  background: var(--accent-highlight);
  color: var(--paper-bg);
  box-shadow: var(--shadow-hard);
}

.btn--primary:hover {
  box-shadow: 4px 4px 0 var(--ink-primary);
}

.btn--secondary {
  background: var(--ink-primary);
  color: var(--paper-bg);
  box-shadow: var(--shadow-hard);
}

.btn--outline {
  background: transparent;
  color: var(--ink-primary);
  border: 1px solid var(--ink-border);
}

.btn--outline:hover {
  border-color: var(--accent-highlight);
  color: var(--accent-highlight);
}

/* ==========================================================================
   Section Headers
   ========================================================================== */

.section-label {
  display: inline-block;
  font-family: 'Courier Prime', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink-secondary);
  border: 1px solid var(--ink-border);
  padding: 4px 10px;
  margin-bottom: 20px;
}

.section-title {
  font-family: 'Merriweather', Georgia, serif;
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 900;
  color: var(--ink-primary);
  margin-bottom: 12px;
  line-height: 1.25;
}

.section-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-secondary);
  max-width: 560px;
}

.section-rule {
  width: 40px;
  height: 2px;
  background: var(--accent-highlight);
  border: none;
  margin: 24px 0 0;
}

.text-center {
  text-align: center;
}

.text-center .section-subtitle {
  margin-left: auto;
  margin-right: auto;
}

.text-center .section-rule {
  margin-left: auto;
  margin-right: auto;
}

/* ==========================================================================
   How It Works
   ========================================================================== */

.how-it-works {
  background: var(--paper-bg);
}

.steps {
  margin-top: 56px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--paper-card);
  border: 1px solid var(--ink-border);
  padding: 20px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.step:hover {
  border-color: var(--accent-highlight);
  box-shadow: var(--shadow-hard-accent);
}

.step__number {
  font-family: 'Courier Prime', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-secondary);
  border: 1px solid var(--ink-border);
  padding: 4px 10px;
  flex-shrink: 0;
}

.step__content h3 {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-primary);
  margin-bottom: 4px;
}

.step__content p {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--ink-secondary);
  line-height: 1.5;
}

/* ==========================================================================
   Closeness Bar Demo
   ========================================================================== */

.closeness-demo {
  background: var(--paper-card);
  border-top: 1px solid var(--ink-border);
  border-bottom: 1px solid var(--ink-border);
}

.demo-box {
  margin-top: 48px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.demo-guess {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--paper-bg);
  border: 1px solid var(--ink-border);
  padding: 16px 20px;
}

.demo-guess__word {
  font-family: 'Courier Prime', monospace;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink-primary);
  letter-spacing: 3px;
  text-transform: uppercase;
}

.demo-guess__score {
  font-family: 'Courier Prime', monospace;
  font-size: 18px;
  font-weight: 700;
  padding: 4px 12px;
  border: 1px solid;
  transition: color 0.4s ease, border-color 0.4s ease;
}

.demo-bar {
  margin-top: 12px;
  height: 8px;
  border: 1px solid var(--ink-border);
  background: transparent;
  position: relative;
  overflow: hidden;
}

.demo-bar__fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  transition: width 1.8s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.4s ease;
}

.demo-label {
  margin-top: 10px;
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.4s ease, color 0.4s ease;
}

.demo-label.visible {
  opacity: 1;
}

.demo-footnote {
  margin-top: 24px;
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-style: italic;
  color: var(--ink-secondary);
  opacity: 0.7;
  line-height: 1.5;
}

/* ==========================================================================
   Game Modes
   ========================================================================== */

.game-modes {
  background: var(--paper-bg);
}

.modes-grid {
  margin-top: 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mode-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
  background: var(--paper-card);
  border: 1px solid var(--ink-border);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.mode-card:hover {
  border-color: var(--accent-highlight);
  box-shadow: var(--shadow-hard-accent);
  transform: translate(-1px, -1px);
}

.mode-card__icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.mode-card__label {
  font-family: 'Courier Prime', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-primary);
  margin-bottom: 4px;
}

.mode-card__desc {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--ink-secondary);
  line-height: 1.4;
}

/* ==========================================================================
   Why Hynts / Features
   ========================================================================== */

.features {
  background: var(--paper-card);
  border-top: 1px solid var(--ink-border);
  border-bottom: 1px solid var(--ink-border);
}

.features-grid {
  margin-top: 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.feature {
  position: relative;
}

.feature__icon {
  font-size: 28px;
  margin-bottom: 12px;
}

.feature__title {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-primary);
  margin-bottom: 6px;
}

.feature__desc {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--ink-secondary);
  line-height: 1.5;
}

/* ==========================================================================
   Final CTA
   ========================================================================== */

.final-cta {
  text-align: center;
  padding: 100px 0 120px;
}

.final-cta .section-rule {
  margin: 24px auto 40px;
}

.final-cta .hero__cta {
  margin-top: 40px;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  border-top: 1px solid var(--ink-border);
  padding: 40px 0;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer__links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.footer__links a {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: color 0.2s ease;
}

.footer__links a:hover {
  color: var(--accent-highlight);
}

.footer__copy {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--ink-secondary);
}

/* ==========================================================================
   Scroll Reveal Animations
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* Fade-up for hero elements */
.hero-fade {
  opacity: 0;
  transform: translateY(20px);
  animation: heroFadeUp 0.7s ease forwards;
}

.hero-fade:nth-child(1) { animation-delay: 0.1s; }
.hero-fade:nth-child(2) { animation-delay: 0.2s; }
.hero-fade:nth-child(3) { animation-delay: 0.3s; }
.hero-fade:nth-child(4) { animation-delay: 0.4s; }
.hero-fade:nth-child(5) { animation-delay: 0.5s; }
.hero-fade:nth-child(6) { animation-delay: 0.6s; }
.hero-fade:nth-child(7) { animation-delay: 0.7s; }

@keyframes heroFadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Legal Pages (Privacy & Terms)
   ========================================================================== */

.legal {
  padding-top: calc(var(--nav-height) + 60px);
  padding-bottom: 80px;
}

.legal h1 {
  font-family: 'Merriweather', Georgia, serif;
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 900;
  color: var(--ink-primary);
  margin-bottom: 8px;
}

.legal .legal__date {
  font-family: 'Courier Prime', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink-secondary);
  margin-bottom: 32px;
}

.legal hr {
  border: none;
  height: 2px;
  background: var(--accent-highlight);
  width: 40px;
  margin: 0 0 40px;
}

.legal h2 {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink-primary);
  margin-top: 40px;
  margin-bottom: 12px;
}

.legal h3 {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-primary);
  margin-top: 24px;
  margin-bottom: 8px;
}

.legal p {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: var(--ink-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}

.legal ul, .legal ol {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: var(--ink-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
  padding-left: 24px;
}

.legal li {
  margin-bottom: 6px;
}

.legal a {
  color: var(--accent-highlight);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal strong {
  color: var(--ink-primary);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
  :root {
    --section-padding: 80px;
  }

  .nav__links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--paper-bg);
    border-bottom: 1px solid var(--ink-border);
    flex-direction: column;
    padding: 20px 24px;
    gap: 16px;
  }

  .nav__links.open {
    display: flex;
  }

  .nav__mobile-toggle {
    display: block;
  }

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

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

  .footer__inner {
    flex-direction: column;
    text-align: center;
  }

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

@media (max-width: 480px) {
  :root {
    --section-padding: 60px;
  }

  .hero__wordmark {
    letter-spacing: -1px;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .step {
    flex-direction: column;
    gap: 10px;
  }
}
