/* ============================================================================
   HUEFUL — Landing page (hueful.app)
   Plain CSS implementation of the Hueful design system tokens + landing page.
   Source of truth: ../Games/gradient/Design/colors_and_type.css + tokens.json
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300..600&family=Inter:wght@400;500;600&display=swap');

/* ============================================================================
   TOKENS — colors, type, spacing, motion (from colors_and_type.css)
   ============================================================================ */
:root {
  /* Font families */
  --font-serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  --font-mono:  'SF Mono', ui-monospace, 'JetBrains Mono', Menlo, monospace;
  --serif-opsz-display: 144;

  /* Warm neutrals — cream paper, warm near-black ink. Never #FFF, never #000. */
  --cream-50:  #FAF8F4;
  --cream-100: #F4F0E8;
  --cream-150: #ECE6DB;
  --cream-200: #E0D9CC;
  --cream-300: #CDC4B3;
  --paper-raised: #FFFEFB;

  --ink-900: #211E19;
  --ink-700: #4C473F;
  --ink-500: #756F63;
  --ink-400: #9A9384;
  --ink-300: #BCB5A6;

  /* Spectrum — the only "brand color", used as gradient. */
  --hue-rose:   #E8628C;
  --hue-coral:  #EF8F5A;
  --hue-amber:  #D9A638;
  --hue-sage:   #8FB46A;
  --hue-teal:   #5BB8A6;
  --hue-sky:    #5B92D6;
  --hue-violet: #9B7BD4;

  --spectrum: linear-gradient(90deg,
      var(--hue-rose)   0%,
      var(--hue-coral)  18%,
      var(--hue-amber)  34%,
      var(--hue-sage)   50%,
      var(--hue-teal)   64%,
      var(--hue-sky)    80%,
      var(--hue-violet) 92%,
      var(--hue-rose)   100%);

  /* Semantic feedback (desaturated) */
  --feedback-perfect: #6FA888;
  --feedback-close:   #C9A24B;
  --feedback-far:     #B57B6A;

  /* Elevation — warm-tinted shadows */
  --shadow-xs: 0 1px 2px rgba(56, 46, 33, 0.06);
  --shadow-sm: 0 2px 8px rgba(56, 46, 33, 0.07);
  --shadow-md: 0 8px 24px rgba(56, 46, 33, 0.09);
  --shadow-lg: 0 18px 48px rgba(56, 46, 33, 0.12);
  --shadow-swatch: 0 6px 20px rgba(56, 46, 33, 0.14);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  --radius-pill: 999px;

  /* Spacing — 4px base */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px;
  --space-12: 48px; --space-16: 64px; --space-20: 80px; --space-24: 96px;
  --space-32: 128px;

  /* Motion */
  --ease-calm: cubic-bezier(0.4, 0.0, 0.2, 1);
  --dur-fast: 160ms;
  --dur-base: 300ms;
  --dur-slow: 500ms;

  /* Semantic role aliases (light is default) */
  --bg:            var(--cream-50);
  --bg-sunken:     var(--cream-100);
  --surface:       var(--paper-raised);
  --surface-2:     var(--cream-100);
  --border:        var(--cream-200);
  --border-strong: var(--cream-300);
  --text:          var(--ink-900);
  --text-2:        var(--ink-700);
  --text-muted:    var(--ink-500);
  --text-faint:    var(--ink-400);
}

/* Dark mode — same warmth. Espresso, not pure black. Triggered by either
   prefers-color-scheme:dark OR explicit [data-theme="dark"]. */
:root[data-theme="dark"] {
  --cream-50:  #1A1713;
  --cream-100: #221E19;
  --cream-150: #2A251F;
  --cream-200: #38322A;
  --cream-300: #4A4338;
  --paper-raised: #26221C;
  --ink-900: #F3EEE4;
  --ink-700: #CFC8BA;
  --ink-500: #9A9384;
  --ink-400: #756F63;
  --ink-300: #5A544A;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.30);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.55);
  --shadow-swatch: 0 8px 28px rgba(0, 0, 0, 0.55);
  --hue-amber: #E8B84B;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --cream-50:  #1A1713;
    --cream-100: #221E19;
    --cream-150: #2A251F;
    --cream-200: #38322A;
    --cream-300: #4A4338;
    --paper-raised: #26221C;
    --ink-900: #F3EEE4;
    --ink-700: #CFC8BA;
    --ink-500: #9A9384;
    --ink-400: #756F63;
    --ink-300: #5A544A;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.30);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.55);
    --shadow-swatch: 0 8px 28px rgba(0, 0, 0, 0.55);
    --hue-amber: #E8B84B;
    /* Update theme-color for dark mode browsers */
  }
}

/* ============================================================================
   RESET + BASE
   ============================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }

/* ============================================================================
   TYPOGRAPHY CLASSES — match the Hueful spec
   ============================================================================ */
.hf-display, .hf-h1, .hf-h2, .hf-h3 {
  font-family: var(--font-serif);
  color: var(--text);
  font-weight: 380;
  letter-spacing: -0.015em;
  text-wrap: balance;
  margin: 0;
}
.hf-display {
  font-size: clamp(46px, 7vw, 76px);
  line-height: 1.04;
  font-weight: 360;
  font-variation-settings: 'opsz' var(--serif-opsz-display);
  letter-spacing: -0.025em;
}
.hf-h1 {
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.08;
}
.hf-h2 { font-size: 30px; line-height: 1.14; font-weight: 400; }
.hf-h3 { font-size: 22px; line-height: 1.25; font-weight: 450; letter-spacing: -0.01em; }

.hf-body-lg, .hf-body, .hf-small, .hf-caption {
  font-family: var(--font-sans);
  color: var(--text-2);
}
.hf-body-lg { font-size: 18px; line-height: 1.6; font-weight: 400; }
.hf-body    { font-size: 16px; line-height: 1.6; font-weight: 400; }
.hf-small   { font-size: 14px; line-height: 1.55; font-weight: 400; }
.hf-caption { font-size: 12px; line-height: 1.4; font-weight: 400; color: var(--text-muted); }

.hf-overline {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ============================================================================
   LAYOUT
   ============================================================================ */
.shell { max-width: 1080px; margin: 0 auto; padding: 0 28px; }

/* ============================================================================
   NAV — sticky, warm translucent
   ============================================================================ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--cream-50) 82%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1080px; margin: 0 auto;
  padding: 16px 28px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-brand { display: flex; align-items: center; gap: 11px; }
.nav-brand-name {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.nav-links { display: flex; align-items: center; gap: 28px; }
.navlink {
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--text-2);
  transition: color var(--dur-fast) var(--ease-calm);
}
.navlink:hover { color: var(--text); }

/* ============================================================================
   APP STORE BUTTON
   ============================================================================ */
.cta-app {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--ink-900);
  color: var(--cream-50);
  border-radius: var(--radius-pill);
  padding: 15px 26px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 16px;
  transition: opacity var(--dur-fast);
  border: none;
}
.cta-app:hover { opacity: 0.88; }
.cta-app:active { opacity: 0.78; }
.cta-app.small { padding: 11px 20px; font-size: 14px; }
.cta-app svg.apple-glyph { width: 18px; height: 18px; }

/* Non-clickable "Coming Soon" variant — used until the iOS app ships.
   Visually present, intentionally restrained, no hover affordance. */
.cta-app.coming-soon {
  background: var(--cream-100);
  color: var(--text-2);
  border: 1px solid var(--border);
  cursor: default;
  font-weight: 500;
}
.cta-app.coming-soon:hover,
.cta-app.coming-soon:active { opacity: 1; }
.cta-app.coming-soon svg.apple-glyph { opacity: 0.55; }

/* ============================================================================
   HERO
   ============================================================================ */
.hero { padding: clamp(48px, 9vw, 110px) 0 0; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(40px, 6vw, 72px);
  align-items: center;
}
.hero-headline { margin: 18px 0 22px; }
.hero-lede {
  max-width: 440px;
  color: var(--text-2);
  margin-bottom: 32px;
}
.hero-cta-row {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.hero-meta { color: var(--text-muted); }

.hero-visual {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 28px;
  background: var(--spectrum);
  background-size: 200% 100%;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  max-width: 420px;
  justify-self: end;
  width: 100%;
  animation: hue-cycle 60s linear infinite;
}
@keyframes hue-cycle {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
.hero-visual::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(160deg, transparent 40%, rgba(33, 30, 25, 0.28));
}
.hero-visual-caption {
  position: absolute; left: 26px; bottom: 26px; right: 26px;
  color: #fff; z-index: 1;
}
.hero-visual-overline {
  font-family: var(--font-sans);
  font-size: 13px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  opacity: 0.85;
}
.hero-visual-title {
  font-family: var(--font-serif);
  font-size: 34px;
  margin-top: 6px;
}

/* ============================================================================
   HOW IT WORKS
   ============================================================================ */
.how { padding: clamp(64px, 11vw, 140px) 0 0; }
.how-intro { margin-bottom: 52px; }
.how-intro h2 { margin-bottom: 12px; }
.how-intro p { color: var(--text-2); max-width: 460px; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.how-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 26px;
  box-shadow: var(--shadow-sm);
}
.how-swatch {
  width: 56px; height: 56px;
  border-radius: var(--radius-lg);
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}
.how-card h3 { margin-bottom: 8px; }
.how-card p { color: var(--text-2); }

/* ============================================================================
   RITUAL
   ============================================================================ */
.ritual { padding: clamp(64px, 11vw, 140px) 0 0; }
.ritual-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(36px, 6vw, 72px);
  align-items: center;
}
.ritual-copy h2 { margin: 14px 0 20px; }
.ritual-copy .lede { color: var(--text-2); margin-bottom: 18px; }
.ritual-copy .muted { color: var(--text-muted); }

.ritual-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 30px;
  box-shadow: var(--shadow-md);
}
.palette-bar {
  display: flex; height: 30px;
  border-radius: var(--radius-pill); overflow: hidden;
  margin: 14px 0 26px;
  box-shadow: var(--shadow-sm);
}
.palette-bar > span { flex: 1; display: block; }
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  gap: 9px;
}
.calendar-grid > span {
  aspect-ratio: 1;
  border-radius: 50%;
  display: block;
}

/* ============================================================================
   SHARE
   ============================================================================ */
.share {
  padding: clamp(64px, 11vw, 140px) 0 0;
  text-align: center;
}
.share h2 { margin-bottom: 14px; }
.share-lede {
  color: var(--text-2);
  max-width: 460px;
  margin: 0 auto 48px;
}
.share-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 240px));
  gap: 22px;
  justify-content: center;
}
.share-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  padding: 26px;
  aspect-ratio: 1;
  display: flex; flex-direction: column;
  justify-content: space-between;
  text-align: left;
}
.share-tile-title {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--text);
}
.share-tile-row { display: flex; gap: 9px; }
.share-tile-row > span {
  width: 34px; height: 34px;
  border-radius: 9px;
  display: block;
}
.share-tile-meta {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-muted);
}
.share-cta-wrap { margin-top: 56px; }

/* ============================================================================
   FOOTER
   ============================================================================ */
.footer {
  margin-top: clamp(72px, 12vw, 150px);
  border-top: 1px solid var(--border);
}
.footer-inner {
  max-width: 1080px; margin: 0 auto;
  padding: 40px 28px;
  display: flex; flex-wrap: wrap; gap: 20px;
  align-items: center; justify-content: space-between;
}
.footer-brand { display: flex; align-items: center; gap: 11px; }
.footer-brand-name {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--text);
}
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 820px) {
  .hero-grid, .ritual-grid { grid-template-columns: 1fr; }
  .how-grid { grid-template-columns: 1fr; }
  .share-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-visual { justify-self: start; max-width: 100%; aspect-ratio: 16 / 11; }
  .nav-links .navlink { display: none; }
}
@media (max-width: 520px) {
  .share-grid { grid-template-columns: 1fr; }
}
