/* SleepFuzz landing — modern, colorful, scroll reveals */

:root {
  --bg-deep: #0a0a0f;
  --bg-card: rgba(18, 18, 28, 0.72);
  --stroke: rgba(255, 255, 255, 0.08);
  --text: #f4f4f8;
  --muted: rgba(244, 244, 248, 0.65);
  --accent-teal: #2dd4bf;
  --accent-violet: #a78bfa;
  --accent-amber: #fbbf24;
  --accent-rose: #fb7185;
  --accent-sky: #38bdf8;
  --glow-teal: rgba(45, 212, 191, 0.35);
  --glow-violet: rgba(167, 139, 250, 0.3);
  --font-sans: "Nunito", system-ui, sans-serif;
  --font-sketch: "Cabin Sketch", sans-serif;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --max: 1120px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  /* Match transparent screen cutout in iphone-frame.png — tweak if bezel doesn’t align */
  --iphone-screen-inset-t: 2.4%;
  --iphone-screen-inset-r: 5.9%;
  --iphone-screen-inset-b: 2.4%;
  --iphone-screen-inset-l: 5.9%;
  --iphone-max: 340px;
  --iphone-max-sm: 200px;
}

.cabin-sketch-regular {
  font-family: "Cabin Sketch", sans-serif;
  font-weight: 400;
  font-style: normal;
}

.cabin-sketch-bold {
  font-family: "Cabin Sketch", sans-serif;
  font-weight: 700;
  font-style: normal;
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-scale {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .hero-video {
    display: none;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 500;
  color: var(--text);
  background: var(--bg-deep);
  line-height: 1.6;
  overflow-x: hidden;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Wordmark — Nunito Black approximates SF Rounded Black */
.wordmark {
  font-family: var(--font-sans);
  font-weight: 900;
  font-size: clamp(2.5rem, 8vw, 4.25rem);
  letter-spacing: 0.08em;
  text-transform: lowercase;
  background: linear-gradient(180deg, #d4d4d8 0%, #8b8b95 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter:
    drop-shadow(0 0 10px rgba(255, 255, 255, 0.45))
    drop-shadow(0 0 26px rgba(255, 255, 255, 0.2))
    drop-shadow(0 0 48px rgba(255, 255, 255, 0.08))
    drop-shadow(0 2px 18px rgba(0, 0, 0, 0.55));
}

.wordmark-sm {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
}

.wordmark--hero {
  margin: 0;
  flex: 0 1 auto;
  text-align: left;
  font-size: clamp(1.85rem, 5vw, 2.75rem);
  letter-spacing: 0.07em;
}

.tagline {
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  font-weight: 600;
  color: var(--muted);
  max-width: 32rem;
  margin: 0 auto;
}

.tagline--hero {
  max-width: min(44rem, 100%);
  padding-inline: clamp(0.5rem, 3vw, 1rem);
  margin: clamp(1.1rem, 3vw, 1.75rem) auto 0;
  font-weight: 700;
  font-size: clamp(1.15rem, 2.85vw, 1.5rem);
  color: rgba(244, 244, 248, 0.82);
  line-height: 1.5;
}

/* Icon + wordmark row — directly under distressed kicker */
.hero-title-lockup {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: clamp(0.45rem, 1.6vw, 0.95rem);
  margin: 0 auto 0;
  padding-block: clamp(0.85rem, 2.5vw, 1.5rem);
  width: 100%;
  max-width: min(100%, 36rem);
}

@media (max-width: 360px) {
  .hero-title-lockup {
    flex-wrap: wrap;
    max-width: 100%;
  }

  .app-icon--hero {
    width: clamp(56px, 18vw, 72px);
  }
}

/* Hero punk lines — Cabin Sketch; no horizontal padding/max-width squeeze; lines never wrap */
.hero-kicker {
  font-family: var(--font-sketch);
  font-weight: 400;
  text-transform: uppercase;
  color: #f5f5f5;
  margin: clamp(2rem, 5.5vw, 3.25rem) 0 clamp(0.85rem, 2.5vw, 1.35rem);
  padding: 0;
  width: 100%;
  max-width: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.06em;
  line-height: 1.05;
  text-shadow:
    0 0 36px rgba(239, 68, 68, 0.28),
    0 2px 0 rgba(0, 0, 0, 0.45),
    0 4px 20px rgba(0, 0, 0, 0.55);
}

.hero-kicker__line {
  display: block;
  width: max-content;
  max-width: none;
  margin: 0 auto;
  text-align: center;
  white-space: nowrap;
}

/*
 * Scale to viewport: approximate avg glyph width in Cabin Sketch caps.
 * Longest line ≈26 chars → divisor ~17; headline ≈14 chars → divisor ~9.
 */
.hero-kicker__line--yell {
  font-weight: 700;
  font-size: min(4.75rem, max(1.2rem, calc((100vw - 4.5rem) / 9)));
  letter-spacing: 0.02em;
  margin-bottom: 0.04em;
}

.hero-kicker__line--mutter {
  font-weight: 400;
  font-size: min(1.9rem, max(0.65rem, calc((100vw - 2rem) / 17)));
  letter-spacing: 0.015em;
  opacity: 0.96;
}

.hero-sub {
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  font-weight: 700;
  color: rgba(244, 244, 248, 0.82);
  max-width: 36rem;
  margin: 1.35rem auto 0;
  line-height: 1.55;
}

.hero-sub strong {
  color: var(--text);
  font-weight: 900;
}

.free-callout {
  margin-top: 2rem;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(45, 212, 191, 0.28);
  background: rgba(45, 212, 191, 0.08);
  font-size: 0.95rem;
  font-weight: 700;
  color: rgba(244, 244, 248, 0.88);
  max-width: 38rem;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

.free-callout strong {
  color: var(--accent-teal);
  font-weight: 900;
}

.section--tight {
  padding-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-bottom: clamp(2.5rem, 5vw, 3.5rem);
}

.dev-callout {
  text-align: center;
  max-width: 28rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
}

.dev-callout p {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.55;
}

.dev-callout a {
  color: var(--accent-sky);
  font-weight: 900;
  text-decoration: none;
}

.dev-callout a:hover {
  text-decoration: underline;
}

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 1.5rem 4rem;
  isolation: isolate;
}

.hero-video-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.68;
}

.hero-gradient {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 50% 12%, rgba(220, 38, 38, 0.11) 0%, transparent 42%),
    radial-gradient(ellipse 100% 80% at 50% 0%, rgba(167, 139, 250, 0.17) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 80% 60%, rgba(45, 212, 191, 0.14) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 10% 70%, rgba(251, 191, 36, 0.08) 0%, transparent 45%),
    linear-gradient(180deg, rgba(10, 10, 15, 0.28) 0%, var(--bg-deep) 92%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: min(52rem, 100%);
  padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
  padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
}

.pill-teal {
  border-color: rgba(45, 212, 191, 0.35);
  color: var(--accent-teal);
  box-shadow: 0 0 24px var(--glow-teal);
}

.pill-violet {
  border-color: rgba(167, 139, 250, 0.35);
  color: var(--accent-violet);
  box-shadow: 0 0 20px var(--glow-violet);
}

.pill-punk {
  border-color: rgba(248, 113, 113, 0.45);
  color: #fecaca;
  background: rgba(220, 38, 38, 0.12);
  box-shadow:
    0 0 20px rgba(239, 68, 68, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.store-link {
  display: inline-block;
  margin-top: 2rem;
  transition: transform 0.25s var(--ease-out), filter 0.25s;
}

.store-link:hover {
  transform: scale(1.04);
  filter: brightness(1.08);
}

.store-link img {
  display: block;
  height: clamp(48px, 12vw, 56px);
  width: auto;
}

.scroll-hint {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  animation: float-y 2.5s ease-in-out infinite;
}

@keyframes float-y {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-hint { animation: none; }
}

/* Sections */
.section {
  padding: clamp(4rem, 10vw, 6.5rem) 1.5rem;
  position: relative;
}

.section-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-teal);
  margin-bottom: 0.75rem;
}

.section h2 {
  font-size: clamp(1.85rem, 4vw, 2.6rem);
  font-weight: 900;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.section-lead {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 38rem;
  margin-bottom: 2.5rem;
}

.feature-title {
  font-size: 1.35rem;
  font-weight: 900;
  margin: 0 0 0.65rem;
  letter-spacing: -0.02em;
  color: var(--accent-sky);
}

/* Scroll reveals */
.reveal,
.reveal-left,
.reveal-right,
.reveal-scale {
  opacity: 0;
  transition:
    opacity 0.85s var(--ease-out),
    transform 0.85s var(--ease-out);
}

.reveal {
  transform: translateY(36px);
}

.reveal-left {
  transform: translateX(-40px);
}

.reveal-right {
  transform: translateX(40px);
}

.reveal-scale {
  transform: scale(0.94);
}

.reveal.is-visible,
.reveal-left.is-visible,
.reveal-right.is-visible,
.reveal-scale.is-visible {
  opacity: 1;
  transform: none;
}

/* --------------------------------------------------------------------------
   iPhone mockup — frame image is in-flow (sets size); screen + media sit under it
   -------------------------------------------------------------------------- */
.iphone {
  position: relative;
  width: min(100%, var(--iphone-max));
  max-width: 100%;
  margin-inline: auto;
  line-height: 0;
}

.iphone--sm {
  --iphone-max: var(--iphone-max-sm);
}

.iphone__screen {
  position: absolute;
  z-index: 1;
  top: var(--iphone-screen-inset-t);
  right: var(--iphone-screen-inset-r);
  bottom: var(--iphone-screen-inset-b);
  left: var(--iphone-screen-inset-l);
  border-radius: 12% / 5.5%;
  overflow: hidden;
  background: #000;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.demo-video-wrap {
  position: relative;
  width: 100%;
  height: 100%;
}

.demo-video-wrap video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: top center;
}

.iphone__screen img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: top center;
}

/* Mute / unmute — demo video in phone mockup */
.demo-video-mute {
  position: absolute;
  z-index: 4;
  right: 5%;
  bottom: 6%;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #f5f5f5;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background 0.2s, transform 0.15s;
}

.demo-video-mute:hover {
  background: rgba(0, 0, 0, 0.72);
}

.demo-video-mute:active {
  transform: scale(0.96);
}

.demo-video-mute:focus-visible {
  outline: 2px solid var(--accent-teal);
  outline-offset: 2px;
}

.demo-video-mute__icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.demo-video-mute__icon--off {
  display: none;
}

.demo-video-mute--muted .demo-video-mute__icon--on {
  display: none;
}

.demo-video-mute--muted .demo-video-mute__icon--off {
  display: flex;
}

.iphone__frame {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

/* Split rows: copy + phone */
.showcase-grid {
  display: grid;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 900px) {
  .showcase-grid {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
    gap: 3.5rem;
  }
}

.split-feature {
  display: grid;
  gap: 2.5rem;
  align-items: center;
  margin-bottom: clamp(3.5rem, 8vw, 5rem);
}

.split-feature:last-child {
  margin-bottom: 0;
}

@media (min-width: 880px) {
  .split-feature {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
    gap: 3rem;
  }

  .split-feature--reverse {
    grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
  }

  .split-feature--reverse .split-feature__copy {
    order: 2;
  }

  .split-feature--reverse .split-feature__device {
    order: 1;
  }
}

.split-feature__copy .section-lead:last-child {
  margin-bottom: 0;
}

/* Presets + themes: phone + text */
.split-wide {
  display: grid;
  gap: 2rem;
  align-items: start;
}

@media (min-width: 900px) {
  .split-wide {
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
    gap: 3rem;
    align-items: center;
  }
}

/* Theme grid: multiple small phones, correct AR */
.theme-phone-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  max-width: 440px;
  margin-inline: auto;
}

@media (min-width: 600px) {
  .theme-phone-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-width: none;
  }
}

.theme-phone-grid .iphone {
  --iphone-max: 160px;
}

@media (min-width: 600px) {
  .theme-phone-grid .iphone {
    --iphone-max: 140px;
  }
}

/* Noise strip */
.noise-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.noise-card {
  flex: 1 1 200px;
  padding: 1.35rem 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--stroke);
  font-weight: 800;
}

.noise-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.noise-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 600;
}

.noise-pink {
  background: linear-gradient(135deg, rgba(251, 113, 133, 0.15), rgba(167, 139, 250, 0.1));
  border-color: rgba(251, 113, 133, 0.25);
}

.noise-white {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(244, 244, 248, 0.08));
  border-color: rgba(56, 189, 248, 0.2);
}

.noise-brown {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(180, 83, 9, 0.15));
  border-color: rgba(251, 191, 36, 0.25);
}

.badge-free {
  display: inline-block;
  margin-top: 0.65rem;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  background: rgba(45, 212, 191, 0.2);
  color: var(--accent-teal);
}

.badge-pro {
  display: inline-block;
  margin-top: 0.65rem;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  background: rgba(167, 139, 250, 0.2);
  color: var(--accent-violet);
}

/* Presets */
.preset-grid {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 600px) {
  .preset-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .preset-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.preset-item {
  padding: 1rem 1.15rem;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
  transition: background 0.25s, border-color 0.25s;
}

.preset-item:hover {
  background: rgba(167, 139, 250, 0.08);
  border-color: rgba(167, 139, 250, 0.2);
}

.preset-item strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 900;
  margin-bottom: 0.25rem;
  color: var(--accent-sky);
}

.preset-item span {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

/* Pro table */
.pro-panel {
  border-radius: var(--radius-xl);
  border: 1px solid rgba(167, 139, 250, 0.25);
  background:
    radial-gradient(ellipse 80% 60% at 100% 0%, rgba(167, 139, 250, 0.12), transparent),
    var(--bg-card);
  backdrop-filter: blur(20px);
  padding: clamp(1.75rem, 4vw, 2.5rem);
  overflow: hidden;
}

.pro-price {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 900;
  color: var(--accent-amber);
  margin: 0.5rem 0 0.25rem;
}

.pro-price-star {
  font-size: 0.55em;
  font-weight: 900;
  vertical-align: super;
  margin-left: 0.06em;
}

.pro-note {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.pro-note-star {
  margin-right: 0.2em;
  font-weight: 900;
  color: var(--accent-amber);
}

.comparison {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  font-weight: 600;
}

.comparison th,
.comparison td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--stroke);
}

.comparison th {
  font-weight: 900;
  color: var(--accent-teal);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.comparison td:last-child {
  color: var(--accent-violet);
}

.yes { color: var(--accent-teal); font-weight: 900; }
.lock { color: var(--muted); }

/* FAQ */
.faq-list {
  max-width: 40rem;
}

.faq-item {
  border-bottom: 1px solid var(--stroke);
  padding: 1.25rem 0;
}

.faq-item h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 900;
}

.faq-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

/* Footer */
.site-footer {
  padding: 3rem 1.5rem;
  border-top: 1px solid var(--stroke);
  text-align: center;
}

.site-footer .wordmark-sm {
  display: inline-block;
  margin-bottom: 0.75rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.footer-links a {
  color: var(--accent-sky);
  font-weight: 800;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-copy {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

/* Nav */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 10, 15, 0.72);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}

.site-nav.is-scrolled {
  border-bottom-color: var(--stroke);
}

.site-nav a.logo-nav {
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* App icon — 1024×1024 source; rounded like iOS */
.app-icon {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 22%;
  box-shadow:
    0 0 14px rgba(255, 255, 255, 0.28),
    0 0 32px rgba(255, 255, 255, 0.12),
    0 4px 24px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.app-icon--nav {
  width: 50px;
  flex-shrink: 0;
}

.app-icon--hero {
  width: clamp(64px, 15vw, 88px);
  flex-shrink: 0;
  margin: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 800;
  font-size: 0.88rem;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-cta img {
  height: 40px;
  width: auto;
  display: block;
}

@media (max-width: 720px) {
  .nav-links a:not(.nav-cta) {
    display: none;
  }
}
