/* 365 Sleep — shared styles for the public pages.
   The home page implements "365 Sleep Website.dc.html" from the 365 Sleep design
   project: Cormorant Garamond headings (500, second line italic gold), Spectral
   body, Manrope only for button caps and numerals. Gold #D4B36A on cream #E8E6DF
   over the night gradient #0A0E2A → #050510 → #0A0E2A.
   #050510 is the same ground the app paints behind every screen. */

:root {
  --ink: #e8e6df;
  --ink-dim: rgba(232, 230, 223, 0.75);
  --ink-faint: rgba(232, 230, 223, 0.55);
  --ink-ghost: rgba(232, 230, 223, 0.4);
  --ground: #050510;
  --deep: #0a0e2a;
  --raised: #0d0f1e;
  --line: #1c2036;
  --accent: #d4b36a;
  --accent-soft: #e2c685;
  --rule: rgba(212, 179, 106, 0.15);
  --measure: 42rem;
  --page: 1120px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: Manrope, -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* The design sets Spectral as the page font. Scoped to the home page: the legal
   documents are long-form and stay in Manrope, where they were reviewed. */
/* The gradient spans the document, not the viewport — no `fixed` attachment.
   iOS Safari ignores it, and it forces a full repaint on every scroll frame. */
body.home {
  font-family: Spectral, Georgia, 'Times New Roman', serif;
  background: linear-gradient(180deg, var(--deep) 0%, var(--ground) 45%, var(--deep) 100%);
}

.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 1.5rem; }

img { max-width: 100%; }

/* Header ------------------------------------------------------------------ */

.site-header { border-bottom: 1px solid var(--line); position: relative; z-index: 5; }

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.15rem;
  padding-bottom: 1.15rem;
}

/* Used by the legal pages, which keep the wordmark rather than the pill. */
.brand {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.5rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}

.brand em { font-style: italic; color: var(--accent); }

.nav-links { display: flex; gap: 1.35rem; font-size: 0.94rem; }
.nav-links a { color: var(--ink-dim); text-decoration: none; }
.nav-links a:hover { color: var(--ink); }

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

h1, h2, h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

h1 { font-size: clamp(2.3rem, 6vw, 3.1rem); margin: 0 0 0.4rem; }
h1 em { font-style: italic; color: var(--accent); }
h2 { font-size: 1.65rem; margin: 2.6rem 0 0.7rem; }
h3 { font-size: 1.22rem; margin: 1.8rem 0 0.4rem; }

a { color: var(--accent); }
a:hover { color: var(--accent-soft); }

.kicker {
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.7rem;
}

.updated { color: var(--ink-faint); font-size: 0.9rem; margin-bottom: 2.2rem; }

.intro { font-size: 1.08rem; color: var(--ink-dim); }

/* Document body ----------------------------------------------------------- */

.doc { max-width: var(--measure); margin: 0 auto; padding: 3.2rem 1.5rem 5rem; }

.doc ul, .doc ol { padding-left: 1.2rem; }
.doc li { margin: 0.35rem 0; }

.doc dl { margin: 1rem 0; }
.doc dt { font-weight: 600; margin-top: 1rem; }
.doc dd { margin: 0.15rem 0 0; color: var(--ink-dim); }

.card {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.3rem 1.4rem;
  margin: 1.6rem 0;
}

.card h3 { margin-top: 0; }

.note { color: var(--ink-dim); font-size: 0.95rem; }

table { width: 100%; border-collapse: collapse; margin: 1.2rem 0; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--ink-faint); font-weight: 600; font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; }

/* ==========================================================================
   Home — "365 Sleep Website.dc.html"
   Sections are separated by a hairline gold rule rather than by a background
   change; the page gradient runs behind all of them.
   ========================================================================== */

.shell { max-width: var(--page); margin: 0 auto; padding: 0 32px; }

.rule { border-top: 1px solid var(--rule); }

/* Masthead ---------------------------------------------------------------- */

.masthead {
  max-width: var(--page);
  margin: 0 auto;
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.logo-pill {
  width: 58px;
  height: 24px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(212, 179, 106, 0.8);
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
  text-decoration: none;
}

.logo-pill span {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  line-height: 1;
}

.logo-pill .lp-num {
  background: var(--accent);
  color: var(--deep);
  font-size: 13px;
  font-variant-numeric: lining-nums;
}

.logo-pill .lp-word { background: rgba(10, 14, 42, 0.7); color: var(--accent); font-size: 11px; }

.mast-nav { display: flex; align-items: center; gap: 34px; }

.mast-nav a {
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--ink-dim);
  text-decoration: none;
}

.mast-nav a:hover { color: var(--ink); }

.nav-cta {
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 9px 22px;
  font-size: 11px;
  letter-spacing: 0.26em;
  color: var(--accent);
  text-decoration: none;
  transition: background 0.2s ease;
}

.nav-cta:hover { background: rgba(212, 179, 106, 0.12); color: var(--accent); }

/* Shared bits -------------------------------------------------------------- */

.pill {
  display: inline-block;
  border: 1px solid rgba(212, 179, 106, 0.5);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--accent);
  text-transform: uppercase;
}

.display {
  margin: 0;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.display em { font-style: italic; color: var(--accent); }

.lede {
  margin: 0;
  font-size: 18px;
  font-weight: 300;
  line-height: 1.65;
  color: var(--ink-dim);
  max-width: 440px;
  text-wrap: pretty;
}

/* Store badges — the official Apple and Google artwork, which may not be
   recoloured or reproportioned, so they are sized by height only. */
.store-badges { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.store-badges a { display: block; line-height: 0; border-radius: 8px; }
.store-badges img { height: 52px; width: auto; display: block; }
.store-badges a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Hero --------------------------------------------------------------------- */

.hero {
  max-width: var(--page);
  margin: 0 auto;
  padding: 64px 32px 90px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 60px;
  align-items: center;
}

.hero-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; }

.hero h1 { font-size: clamp(2.6rem, 5.4vw, 64px); }

.hero .store-badges { margin-top: 8px; }

.pull {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 20px;
  border-left: 1px solid rgba(212, 179, 106, 0.4);
  padding-left: 18px;
}

.pull blockquote {
  margin: 0;
  font-size: 15px;
  font-style: italic;
  line-height: 1.55;
  color: rgba(232, 230, 223, 0.8);
  max-width: 420px;
}

.pull cite { font-style: normal; font-size: 11px; letter-spacing: 0.24em; color: var(--accent); }

/* Phone -------------------------------------------------------------------- */

.phone {
  position: relative;
  width: 340px;
  height: 640px;
  max-width: 100%;
  border-radius: 44px;
  border: 7px solid #1a1d2b;
  overflow: hidden;
  background: var(--ground);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
  justify-self: end;
}

.phone > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.55; }

.phone-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 5, 16, 0.4), transparent 35%, rgba(5, 5, 16, 0.95) 75%);
}

.dial {
  position: absolute;
  left: 50%;
  top: 215px;
  transform: translate(-50%, -50%);
  width: 230px;
  height: 230px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dial-glow {
  position: absolute;
  inset: -28px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(212, 179, 106, 0.38), transparent 70%);
  filter: blur(18px);
}

.dial-face {
  position: absolute;
  inset: 6px;
  border-radius: 999px;
  background: radial-gradient(circle at 50% 45%, rgba(20, 16, 8, 0.55), rgba(5, 5, 16, 0.9) 72%);
  animation: orb-breath 4s ease-in-out infinite alternate;
}

@keyframes orb-breath {
  from { box-shadow: 0 0 70px rgba(212, 179, 106, 0.35), inset 0 0 40px rgba(212, 179, 106, 0.45); }
  to { box-shadow: 0 0 95px rgba(212, 179, 106, 0.55), inset 0 0 52px rgba(212, 179, 106, 0.6); }
}

.dial-read { position: relative; display: flex; flex-direction: column; align-items: center; line-height: 1; }

.dial-read .hz { font-family: Manrope, system-ui, sans-serif; font-weight: 200; font-size: 52px; color: var(--ink); }
.dial-read .hz small { font-size: 20px; color: rgba(232, 230, 223, 0.65); }
.dial-read .band-name { margin-top: 0.5rem; font-size: 9px; letter-spacing: 0.32em; color: var(--accent); }

.now-playing {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.np-title { margin: 0; font-family: 'Cormorant Garamond', Georgia, serif; font-size: 27px; font-style: italic; color: var(--ink); }

.np-sub {
  margin: 0;
  font-size: 13px;
  color: var(--ink-faint);
  text-align: center;
  max-width: 230px;
  line-height: 1.45;
}

.transport { display: flex; align-items: center; gap: 20px; margin-top: 12px; }

.tbtn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(212, 179, 106, 0.5);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.tbtn svg { width: 16px; height: 16px; }
.tbtn-main { width: 58px; height: 58px; border-color: var(--accent); background: rgba(212, 179, 106, 0.1); color: var(--ink); }
.tbtn-main svg { width: 23px; height: 23px; }

/* Mixer -------------------------------------------------------------------- */

.mixer { background: radial-gradient(500px 400px at 20% 30%, rgba(212, 179, 106, 0.08), transparent 70%); }

.mixer .shell {
  padding-top: 96px;
  padding-bottom: 96px;
  display: grid;
  grid-template-columns: 400px minmax(0, 1fr);
  gap: 70px;
  align-items: center;
}

.mix-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(10, 14, 42, 0.6);
  border: 1px solid rgba(212, 179, 106, 0.35);
  border-radius: 24px;
  padding: 28px;
}

.mix-head { margin: 0 0 2px; font-size: 9px; letter-spacing: 0.3em; color: var(--accent); }

.mix-row {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(212, 179, 106, 0.3);
  background: rgba(212, 179, 106, 0.05);
  border-radius: 14px;
  padding: 13px 16px;
}

.mix-row img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }

.mix-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mix-name { margin: 0; font-size: 15px; color: var(--ink); line-height: 1.2; }
.mix-kind { margin: 0; font-size: 9px; letter-spacing: 0.2em; color: var(--accent); }
.mix-pct { font-family: Manrope, system-ui, sans-serif; font-weight: 300; font-size: 12px; color: var(--accent); }

.mix-add {
  border: 1px dashed rgba(212, 179, 106, 0.4);
  border-radius: 14px;
  padding: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 9px;
  letter-spacing: 0.24em;
  color: rgba(212, 179, 106, 0.8);
}

.mix-add svg { width: 14px; height: 14px; }

.mixer-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.mixer-copy h2 { font-size: clamp(2.1rem, 4vw, 46px); line-height: 1.1; }
.mixer-copy .lede { font-size: 17px; max-width: 460px; }

/* Science ------------------------------------------------------------------ */

.science .shell {
  padding-top: 96px;
  padding-bottom: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 44px;
}

.science h2 { font-size: clamp(2.1rem, 4vw, 46px); text-align: center; }

.quotes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; width: 100%; }

.quote-card {
  margin: 0;
  background: rgba(232, 230, 223, 0.06);
  border: 1px solid rgba(232, 230, 223, 0.12);
  border-radius: 20px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quote-card blockquote { margin: 0; font-size: 16px; font-weight: 300; line-height: 1.6; color: rgba(232, 230, 223, 0.9); }

.quote-card figcaption {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  font-family: Manrope, system-ui, sans-serif;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--accent);
}

.quote-card figcaption i { width: 20px; height: 1px; background: rgba(212, 179, 106, 0.6); flex-shrink: 0; }

.science-foot {
  margin: 0;
  font-size: 14px;
  color: var(--ink-faint);
  max-width: 560px;
  text-align: center;
  line-height: 1.6;
}

/* Library ------------------------------------------------------------------ */

.library .shell {
  padding-top: 96px;
  padding-bottom: 60px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.library-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.library-head h2 { margin: 0; font-size: clamp(2.1rem, 4vw, 46px); }
.library-head p { margin: 0 0 8px; font-size: 13px; color: var(--ink-faint); }

.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; }

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

/* `height: auto` is load-bearing: the width/height attributes on the <img>
   (kept so the box is reserved before the art arrives) otherwise fix the used
   height, and `aspect-ratio` only applies when one dimension is auto. */
.tile img {
  aspect-ratio: 1;
  width: 100%;
  height: auto;
  border-radius: 16px;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.tile:hover img { transform: translateY(-3px); }

.tile-name { margin: 0; font-size: 14px; color: var(--ink); line-height: 1.25; }
.tile-tag { margin: 2px 0 0; font-size: 8px; letter-spacing: 0.2em; color: var(--accent); }

/* Closing ------------------------------------------------------------------ */

.closing { background: radial-gradient(600px 400px at 50% 100%, rgba(212, 179, 106, 0.12), transparent 70%); }

.closing .shell {
  padding-top: 110px;
  padding-bottom: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.closing h2 { font-size: clamp(2.3rem, 4.6vw, 54px); text-align: center; line-height: 1.1; }
.closing .store-badges { margin-top: 6px; justify-content: center; }

.home-footer {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 32px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-top: 1px solid rgba(232, 230, 223, 0.08);
}

.home-footer span { font-size: 12px; color: var(--ink-ghost); padding-top: 24px; }
.home-footer nav { display: flex; gap: 26px; padding-top: 24px; }
.home-footer a { font-size: 12px; color: var(--ink-ghost); text-decoration: none; }
.home-footer a:hover { color: var(--ink); }

/* Footer (legal pages) ----------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 1.5rem 3rem;
  color: var(--ink-faint);
  font-size: 0.9rem;
  text-align: center;
}

.site-footer a { color: var(--ink-dim); text-decoration: none; margin: 0 0.6rem; }
.site-footer a:hover { color: var(--ink); }

/* Responsive ---------------------------------------------------------------
   The design is drawn at one desktop width; these are the reflows it implies. */

@media (max-width: 1040px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quotes { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
    padding-bottom: 64px;
    justify-items: center;
    text-align: center;
  }
  .hero-copy { align-items: center; }
  .hero .lede { text-align: center; }
  .pull { border-left: none; padding-left: 0; border-top: 1px solid rgba(212, 179, 106, 0.4); padding-top: 14px; align-items: center; }
  .phone { justify-self: center; }
  .mixer .shell { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .mixer-copy { order: -1; }
}

@media (max-width: 720px) {
  .masthead { flex-wrap: wrap; gap: 1rem; padding: 20px 24px; }
  .mast-nav { gap: 16px; width: 100%; justify-content: space-between; }
  .mast-nav a { font-size: 11px; letter-spacing: 0.08em; white-space: nowrap; }
  .nav-cta { padding: 8px 14px; letter-spacing: 0.16em; }
  .shell, .hero, .home-footer { padding-left: 24px; padding-right: 24px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .mixer .shell, .science .shell, .library .shell { padding-top: 64px; padding-bottom: 64px; }
  .closing .shell { padding-top: 76px; padding-bottom: 76px; }
  .store-badges img { height: 46px; }
  .home-footer { justify-content: center; text-align: center; }
}

@media (max-width: 400px) {
  .phone { width: 100%; height: auto; aspect-ratio: 340 / 640; }
  .dial { top: 33.6%; width: 68%; height: auto; aspect-ratio: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .dial-face { animation: none; }
  .tile img { transition: none; }
  .tile:hover img { transform: none; }
}
