/* ==========================================================================
   The Burnout Sleep Fix — design tokens, base, layout, starfield, motion
   ========================================================================== */

:root {
  /* Palette */
  --color-bg: #0F0D13;
  --color-bg-soft: #161320;
  --color-bg-elevated: #1c1826;
  --color-rose: #D4939A;
  --color-blush: #EFC4C8;
  --color-mauve: #C4A8C8;
  --color-text: #F2EDE8;
  --color-text-muted: rgba(242, 237, 232, 0.64);
  --color-text-faint: rgba(242, 237, 232, 0.42);
  --color-gold: #D4A86C;
  --color-gold-soft: rgba(212, 168, 108, 0.16);
  --color-gold-text: #0F0D13;
  --color-border: rgba(242, 237, 232, 0.08);
  --color-border-rose: rgba(212, 147, 154, 0.18);
  --color-accent: var(--color-rose);

  /* Type */
  --font-serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Motion */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --reveal-duration: 500ms;

  /* Layout */
  --section-padding: 56px;
  --container-max: 600px;
  --gutter: 20px;

  /* Radii + shadow */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-gold: 0 10px 30px -8px rgba(212, 168, 108, 0.45);

  /* Type scale — mobile */
  --fs-body: 16px;
  --fs-eyebrow: 12px;
  --fs-h1: 38px;
  --fs-h2: 28px;
  --fs-subheadline: 17px;
  --fs-quote: 19px;
  --fs-btn: 16px;
  --fs-small: 12px;

  /* Announcement bar height */
  --announcement-h: 44px;
}

@media (min-width: 768px) {
  :root {
    --section-padding: 96px;
    --container-max: 860px;

    /* Type scale — desktop */
    --fs-body: 18px;
    --fs-eyebrow: 13px;
    --fs-h1: 64px;
    --fs-h2: 44px;
    --fs-subheadline: 19px;
    --fs-quote: 24px;
    --fs-btn: 17px;
    --fs-small: 13px;

    /* Announcement bar height */
    --announcement-h: 52px;
  }
}

/* ---------------------------------------------------------------------- */
/* Reset + base                                                             */
/* ---------------------------------------------------------------------- */

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

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

body {
  margin: 0;
  min-height: 100vh;
  padding-top: var(--announcement-h);
  background: var(--color-bg) !important;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

button {
  font-family: inherit;
  cursor: pointer;
}

a {
  color: inherit;
}

#root {
  position: relative;
  z-index: 1;
}

/* ---------------------------------------------------------------------- */
/* Background atmosphere + starfield                                       */
/* ---------------------------------------------------------------------- */

.atmos {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 50% at 50% -8%, rgba(196, 168, 200, 0.16), transparent 60%),
    radial-gradient(ellipse 65% 40% at 88% 12%, rgba(212, 147, 154, 0.12), transparent 55%),
    radial-gradient(ellipse 100% 55% at 50% 100%, rgba(212, 168, 108, 0.05), transparent 65%);
}

.stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.star {
  position: absolute;
  border-radius: 50%;
  background: var(--color-text);
  opacity: var(--o, 0.5);
  animation: twinkle var(--tw, 4s) ease-in-out var(--d, 0s) infinite;
  will-change: opacity, transform;
}

.star.glow {
  box-shadow: 0 0 6px 1px rgba(242, 237, 232, 0.45);
}

.star.amber {
  background: var(--color-gold);
}

.star.amber.glow {
  box-shadow: 0 0 8px 2px rgba(212, 168, 108, 0.4);
}

@keyframes twinkle {
  0%, 100% { opacity: var(--o, 0.5); transform: scale(1); }
  50% { opacity: calc(var(--o, 0.5) * 0.3); transform: scale(0.82); }
}

.shooting {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: rgba(242, 237, 232, 0.9);
  animation: shoot 11s ease-in infinite;
  animation-delay: 3s;
}

.shooting::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  width: 90px;
  height: 1px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, transparent, rgba(242, 237, 232, 0.55));
}

.shooting.two {
  animation-delay: 7.5s;
  animation-duration: 14s;
}

@keyframes shoot {
  0% { transform: translate(0, 0) rotate(24deg); opacity: 0; }
  2% { opacity: 1; }
  16% { transform: translate(240px, 120px) rotate(24deg); opacity: 0; }
  100% { transform: translate(240px, 120px) rotate(24deg); opacity: 0; }
}

/* ---------------------------------------------------------------------- */
/* Layout                                                                   */
/* ---------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  position: relative;
  padding: var(--section-padding) 0;
}

.section-divider {
  border: none;
  height: 1px;
  margin: 0;
  background: var(--color-border-rose);
}

/* ---------------------------------------------------------------------- */
/* Typography                                                               */
/* ---------------------------------------------------------------------- */

.eyebrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-accent);
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--color-text);
}

.headline-hero {
  font-size: var(--fs-h1);
  font-weight: 600;
  line-height: 1.12;
}

.section-title {
  font-size: var(--fs-h2);
  font-weight: 500;
}

.subheadline {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-subheadline);
  line-height: 1.65;
  font-weight: 400;
  color: var(--color-text-muted);
}

.quote {
  margin: 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: var(--fs-quote);
  line-height: 1.55;
  color: var(--color-blush);
}

.muted {
  color: var(--color-text-muted);
}

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

/* ---------------------------------------------------------------------- */
/* Scroll reveal animation                                                  */
/* ---------------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity var(--reveal-duration) var(--ease-out),
    transform var(--reveal-duration) var(--ease-out);
  transition-delay: calc(var(--reveal-index, 0) * 100ms);
}

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

/* ---------------------------------------------------------------------- */
/* Reduced motion                                                           */
/* ---------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    transition: opacity 250ms ease;
    transform: none !important;
  }

  .star,
  .shooting,
  .hero-particle,
  .badge-ring,
  .strike-line {
    animation: none !important;
  }
}

/* Mirrors the prefers-reduced-motion rules above for the dev tweaks panel,
   so reduced motion can be previewed without changing OS settings. */
html.reduce-motion {
  scroll-behavior: auto;
}

html.reduce-motion .reveal {
  transition: opacity 250ms ease;
  transform: none !important;
}

html.reduce-motion .star,
html.reduce-motion .shooting,
html.reduce-motion .hero-particle,
html.reduce-motion .badge-ring,
html.reduce-motion .strike-line {
  animation: none !important;
}
