:root {
  color-scheme: light;
  --bg: #f7f8f4;
  --paper: #ffffff;
  --ink: #172126;
  --muted: #5d6868;
  --line: #dce4df;
  --mint: #dfeee8;
  --mint-strong: #b7d5c9;
  --teal: #1d6a62;
  --sun: #f3c64f;
  --shadow: 0 28px 80px rgba(23, 33, 38, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

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

a {
  color: inherit;
}

button {
  font: inherit;
}

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 48px);
  background: rgba(247, 248, 244, 0.88);
  border-bottom: 1px solid rgba(220, 228, 223, 0.82);
  backdrop-filter: blur(18px);
}

.brand {
  display: grid;
  gap: 0;
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 0.96;
  text-decoration: none;
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 34px);
  color: #324042;
  font-size: 0.86rem;
  font-weight: 800;
}

.nav a {
  text-decoration: none;
}

.hero {
  position: relative;
  min-height: 92vh;
  overflow: hidden;
  background: #f1f7f4;
  isolation: isolate;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: linear-gradient(90deg, rgba(247, 248, 244, 0.98) 0%, rgba(247, 248, 244, 0.82) 48%, rgba(223, 238, 232, 0.74) 100%);
}

.hero__bg::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.24;
  background: url("assets/sleep-cover.webp") right 5% center / min(54vw, 680px) auto no-repeat;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 30vh;
  z-index: -1;
  background: linear-gradient(0deg, var(--bg), rgba(247, 248, 244, 0));
}

.hero__inner {
  width: min(1180px, calc(100% - 40px));
  min-height: 92vh;
  display: grid;
  grid-template-columns: minmax(0, 0.98fr) minmax(280px, 0.56fr);
  align-items: center;
  gap: clamp(30px, 6vw, 82px);
  margin: 0 auto;
  padding: 100px 0 48px;
}

.hero__copy {
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--teal);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 9.5ch;
  margin-bottom: 24px;
  font-size: clamp(3.35rem, 8vw, 6.35rem);
  font-weight: 950;
  line-height: 0.9;
  letter-spacing: 0;
  text-transform: uppercase;
}

h2 {
  margin-bottom: 24px;
  font-size: clamp(1.72rem, 4vw, 3.45rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0;
  text-transform: uppercase;
}

h3 {
  margin-bottom: 10px;
  font-size: 0.96rem;
  font-weight: 900;
  line-height: 1.16;
  text-transform: uppercase;
}

.hero__lede {
  max-width: 640px;
  margin-bottom: 34px;
  color: #2b3638;
  font-size: clamp(1.22rem, 2.2vw, 1.72rem);
  line-height: 1.28;
}

.hero__actions,
.buy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: 11px 20px;
  font-size: 0.9rem;
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}

.button:hover,
.story-card button:hover,
.modal-close:hover {
  transform: translateY(-1px);
}

.button,
.story-card button,
.modal-close {
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.button--primary {
  background: var(--ink);
  color: var(--paper);
}

.button--secondary {
  background: rgba(255, 255, 255, 0.52);
}

.hero__product {
  margin: 0;
  align-self: end;
  transform: rotate(2deg);
  animation: book-float 6s ease-in-out infinite;
}

.hero__product img {
  width: min(340px, 100%);
  margin-left: auto;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.proof-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-block: 1px solid var(--line);
  background: var(--ink);
  color: var(--paper);
}

.proof-strip p {
  min-height: 86px;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  text-transform: uppercase;
}

.section,
.preview,
.callout,
.buy {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.section {
  display: grid;
  grid-template-columns: minmax(0, 0.74fr) minmax(0, 1fr);
  gap: clamp(34px, 7vw, 90px);
  padding: clamp(70px, 10vw, 130px) 0;
  border-bottom: 1px solid var(--line);
}

.section__copy {
  align-self: start;
}

.section__copy p {
  max-width: 650px;
  color: var(--muted);
  font-size: clamp(1.04rem, 1.8vw, 1.28rem);
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-self: end;
}

.story-grid article {
  min-height: 270px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: var(--paper);
}

.story-card {
  overflow: hidden;
  transition:
    min-height 220ms ease,
    box-shadow 220ms ease,
    transform 220ms ease;
}

.story-card.is-open {
  min-height: 340px;
  box-shadow: 0 22px 54px rgba(23, 33, 38, 0.1);
  transform: translateY(-3px);
}

.story-card button {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.story-card button span {
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.story-card button strong {
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}

.story-card__more {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows 220ms ease,
    opacity 220ms ease,
    margin-top 220ms ease;
}

.story-card__more p {
  overflow: hidden;
}

.story-card.is-open .story-card__more {
  grid-template-rows: 1fr;
  margin-top: 16px;
  opacity: 1;
}

.story-grid article:nth-child(2) {
  background: var(--mint);
}

.story-grid article:nth-child(3) {
  background: #fff6d3;
}

.story-grid p,
.feature p {
  margin-bottom: 0;
  color: var(--muted);
}

.preview {
  padding: clamp(70px, 10vw, 130px) 0;
}

.preview__copy {
  max-width: 870px;
  margin-bottom: 34px;
}

.preview__copy p {
  max-width: 670px;
  color: var(--muted);
  font-size: clamp(1.04rem, 1.7vw, 1.24rem);
}

.preview__rail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 3vw, 30px);
  align-items: start;
}

.preview__rail figure,
.authors__image {
  margin: 0;
}

.preview__rail figure {
  overflow: hidden;
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 24px 60px rgba(23, 33, 38, 0.1);
  cursor: pointer;
  transition:
    transform 220ms ease,
    box-shadow 220ms ease;
}

.preview__rail figure:hover {
  transform: translateY(-6px) rotate(-1deg);
  box-shadow: 0 34px 80px rgba(23, 33, 38, 0.16);
}

.preview__rail figure:nth-child(2) {
  margin-top: 48px;
}

.preview__rail figure:nth-child(3) {
  margin-top: 96px;
}

.feature-list {
  display: grid;
  gap: 18px;
}

.feature {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--paper);
  transition:
    transform 220ms ease,
    box-shadow 220ms ease;
}

.feature:hover {
  transform: translateX(6px);
  box-shadow: 0 18px 48px rgba(23, 33, 38, 0.08);
}

.feature img {
  width: 148px;
  aspect-ratio: 1 / 1.32;
  object-fit: cover;
  object-position: top;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.feature span {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--teal);
  font-weight: 900;
}

.callout {
  padding: clamp(62px, 9vw, 110px) clamp(20px, 5vw, 62px);
  border-radius: 8px;
  background: var(--mint);
}

.quiz {
  width: min(1180px, calc(100% - 40px));
  display: grid;
  grid-template-columns: minmax(0, 0.62fr) minmax(320px, 0.78fr);
  gap: clamp(30px, 6vw, 82px);
  align-items: start;
  margin: 0 auto;
  padding: clamp(70px, 10vw, 130px) 0;
  border-bottom: 1px solid var(--line);
}

.quiz__copy p {
  max-width: 590px;
  color: var(--muted);
  font-size: clamp(1.04rem, 1.8vw, 1.28rem);
}

.quiz__form {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(18px, 3vw, 30px);
  background: var(--paper);
  box-shadow: 0 24px 60px rgba(23, 33, 38, 0.08);
}

.quiz fieldset {
  display: grid;
  gap: 10px;
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 0 0 16px;
}

.quiz legend {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 900;
  text-transform: uppercase;
}

.quiz label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #384547;
  cursor: pointer;
}

.quiz input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-top: 3px;
  accent-color: var(--teal);
}

.quiz__result {
  display: none;
  border-radius: 8px;
  padding: 20px;
  background: var(--mint);
  color: var(--ink);
}

.quiz__result.is-visible {
  display: block;
}

.quiz__result strong {
  display: block;
  margin-bottom: 8px;
  font-size: clamp(1.18rem, 2.4vw, 1.62rem);
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}

.callout h2 {
  max-width: 1040px;
  margin-bottom: 0;
  font-size: clamp(1.86rem, 4.6vw, 4rem);
}

.section--authors {
  grid-template-columns: minmax(260px, 0.52fr) minmax(0, 0.74fr);
  align-items: center;
}

.authors__image img {
  width: min(420px, 100%);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.buy {
  justify-content: space-between;
  gap: 28px;
  padding: clamp(66px, 10vw, 120px) 0;
}

.buy div {
  max-width: 820px;
}

.buy p {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.14rem;
}

.buy .button {
  flex: 0 0 auto;
}

.preview-modal {
  width: min(1080px, calc(100% - 28px));
  max-height: min(860px, calc(100vh - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.preview-modal::backdrop {
  background: rgba(23, 33, 38, 0.58);
  backdrop-filter: blur(7px);
}

.preview-modal__bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px;
  background: rgba(247, 248, 244, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.preview-modal__bar h2 {
  margin-bottom: 0;
  font-size: clamp(1.38rem, 4vw, 2.4rem);
}

.modal-close {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.modal-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 22px;
}

.modal-gallery img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.reveal {
  opacity: 1;
  transform: none;
}

.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 620ms ease,
    transform 620ms ease;
}

.js .hero.reveal {
  opacity: 1;
  transform: none;
}

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

@keyframes book-float {
  0%,
  100% {
    transform: rotate(2deg) translateY(0);
  }

  50% {
    transform: rotate(1deg) translateY(-12px);
  }
}

@media (max-width: 980px) {
  .hero__bg {
    background: linear-gradient(180deg, rgba(247, 248, 244, 0.96) 0%, rgba(247, 248, 244, 0.88) 64%, rgba(223, 238, 232, 0.72) 100%);
  }

  .hero__bg::before {
    opacity: 0.13;
    background-position: center 78%;
    background-size: min(78vw, 420px) auto;
  }

  .hero__inner,
  .section,
  .section--authors,
  .quiz {
    grid-template-columns: 1fr;
  }

  .hero__product {
    display: none;
  }

  .proof-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .story-grid article {
    min-height: 180px;
  }
}

@media (max-width: 720px) {
  .site-header {
    position: sticky;
    align-items: flex-start;
  }

  .nav {
    max-width: 220px;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px 14px;
    font-size: 0.78rem;
  }

  .hero {
    min-height: 780px;
  }

  .hero__inner {
    min-height: 780px;
    width: min(100% - 28px, 620px);
    align-items: start;
    padding-top: 64px;
  }

  h1 {
    font-size: clamp(3rem, 14.5vw, 5.35rem);
  }

  h2 {
    font-size: clamp(1.72rem, 8vw, 2.8rem);
  }

  .proof-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section,
  .preview,
  .callout,
  .buy,
  .quiz {
    width: min(100% - 28px, 620px);
  }

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

  .preview__rail figure:nth-child(2),
  .preview__rail figure:nth-child(3) {
    margin-top: 0;
  }

  .feature {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 16px;
  }

  .feature img {
    width: 104px;
  }

  .button,
  .buy .button {
    width: 100%;
  }

  .modal-gallery {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .site-header {
    padding-inline: 14px;
  }

  .nav {
    max-width: 170px;
  }

  .hero {
    min-height: 690px;
  }

  .hero__inner {
    min-height: 690px;
  }

  .proof-strip p {
    min-height: 74px;
    padding: 12px 8px;
    font-size: 0.68rem;
  }

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

  .feature img {
    width: min(180px, 100%);
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
