/* Clearwater Road Studios — clearwaterroadstudios.com
   One stylesheet for the whole site. No frameworks, no external requests.

   Black where the dark chrome goes (header, hero, feature panel, footer).
   White where the reading happens.

   Header wordmark: the system font (SF on Apple devices) at Light. Nothing is
  fetched from outside this folder — no fonts, no scripts, no analytics.

  Palette taken from the app itself (LongevityFoodLab):
     ring gradient  #6724B7 → #8144F2 → #7F99FF   SupplementStackView.stackScoreRingGradientColors
                                                  (mirrors EatingWindowView — the fasting ring)
     accent         #B9A0F7                       stackSlotHeaderColor, Forest skin (used on black)
     card stroke    white 10%                     fastingInnerCardStroke, Forest skin (used on black)

   Studio brand gradient sampled from the Clear Water Road Studios logo (cwr_logo.jpg):
     #2172FF blue → #8F1CC2 violet → #FA53BD pink
*/

:root {
  /* light ground — where the reading happens */
  --paper:       #FFFFFF;
  --paper-2:     #F5F4F9;   /* faint violet-grey, not a warm cream */
  --rule:        #E4E2EC;
  --ink:         #1B1922;
  --ink-soft:    #55515F;
  --ink-faint:   #7C7789;

  /* dark chrome */
  --black:       #000000;
  --black-2:     #08070C;
  --on-black:    #EDEBF2;
  --on-black-soft: #A9A4B8;
  --on-black-faint: #7A7488;
  --stroke:      rgba(255, 255, 255, 0.10);   /* the app's own card stroke */
  --stroke-firm: rgba(255, 255, 255, 0.20);

  /* the studio's own gradient, sampled from the logo */
  --brand-blue:   #2172FF;
  --brand-violet: #8F1CC2;
  --brand-pink:   #FA53BD;

  /* the app's ring */
  --violet-deep: #6724B7;
  --violet:      #8144F2;
  --periwinkle:  #7F99FF;
  --lilac:       #B9A0F7;   /* the app's Forest-skin accent — for use on black */

  --radius:  14px;
  --maxw:    1080px;
  --measure: 68ch;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.66;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--violet-deep); text-underline-offset: 3px; }
a:hover { color: var(--violet); }

:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
/* Long-form blocks keep a readable measure but stay flush with the
   left edge of every other section, so the page has one spine. */
.wrap.narrow { max-width: var(--maxw); }
.wrap.narrow > * { max-width: var(--measure); }
.narrow { max-width: var(--measure); }

/* ---------- Header (black) ---------- */

.site-header {
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  color: var(--on-black);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--on-black);
  text-decoration: none;
  font-weight: 300;              /* SF Light on Apple devices */
  letter-spacing: 0.012em;
  font-size: 19px;
  padding: 14px 0;
}
.brand:hover { color: #fff; }
.brand svg, .brand img { flex: none; }
.brand-mark { width: 26px; height: 26px; }

nav.site-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding-bottom: 8px;
}
nav.site-nav a {
  color: var(--on-black-soft);
  text-decoration: none;
  font-size: 15px;
  padding: 7px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
nav.site-nav a:hover { color: #fff; background: rgba(255,255,255,0.08); }
nav.site-nav a[aria-current="page"] {
  color: #fff;
  background: linear-gradient(100deg, var(--brand-blue) -20%, var(--brand-violet) 70%, var(--brand-pink) 150%);
  font-weight: 600;
}

@media (min-width: 720px) {
  nav.site-nav { padding-bottom: 0; }
}

/* ---------- Type ---------- */

h1, h2, h3 {
  line-height: 1.2;
  letter-spacing: -0.022em;
  color: var(--ink);
  margin: 0 0 0.5em;
  font-weight: 650;
  text-wrap: balance;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3.2vw, 2rem); margin-top: 0; }
h3 { font-size: 1.16rem; letter-spacing: -0.01em; }

p { margin: 0 0 1.1em; max-width: var(--measure); }

.lede {
  font-size: clamp(1.1rem, 2.2vw, 1.32rem);
  line-height: 1.56;
  color: var(--ink-soft);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--violet-deep);
  margin: 0 0 14px;
}

.small { font-size: 15px; color: var(--ink-soft); }

/* ---------- Sections ---------- */

section { padding: 64px 0; }
section.tight { padding: 44px 0; }
section + section { border-top: 1px solid var(--rule); }
section.on-forest, section.on-warm { border-top: none; }

.on-warm { background: var(--paper-2); border-top: 1px solid var(--rule); }

/* The dark feature panel — black, lit by the ring gradient */
.on-forest {
  background:
    radial-gradient(110% 140% at 10% 0%, rgba(143, 28, 194, 0.50) 0%, rgba(143, 28, 194, 0) 62%),
    radial-gradient(70% 100% at 82% 6%, rgba(250, 83, 189, 0.16) 0%, rgba(250, 83, 189, 0) 60%),
    radial-gradient(90% 120% at 94% 100%, rgba(33, 114, 255, 0.26) 0%, rgba(33, 114, 255, 0) 60%),
    var(--black);
  color: var(--on-black-soft);
}
.on-forest h1, .on-forest h2, .on-forest h3 { color: #FFFFFF; }
.on-forest a { color: var(--lilac); }
.on-forest strong { color: #FFFFFF; }

/* ---------- Hero (black) ---------- */

.hero {
  background:
    radial-gradient(58% 78% at 74% 14%, rgba(250, 83, 189, 0.20) 0%, rgba(250, 83, 189, 0) 62%),
    radial-gradient(72% 92% at 88% 62%, rgba(143, 28, 194, 0.30) 0%, rgba(143, 28, 194, 0) 60%),
    radial-gradient(80% 100% at 4% 88%, rgba(33, 114, 255, 0.24) 0%, rgba(33, 114, 255, 0) 58%),
    var(--black);
  color: var(--on-black-soft);
  padding: 84px 0 76px;
}
.hero h1, .hero h2 { color: #FFFFFF; }
.hero h1 { max-width: 17ch; }
.hero .lede { color: var(--on-black-soft); max-width: 56ch; }
.hero .eyebrow { color: var(--lilac); }
.hero a { color: var(--lilac); }

.hero-grid {
  display: grid;
  gap: 44px;
  align-items: center;
}
@media (min-width: 880px) {
  .hero-grid { grid-template-columns: 1.25fr 0.75fr; gap: 56px; }
}

/* ---------- Onboarding carousel ----------
   The app's real onboarding screens, in the order the app shows them
   (HealthQuizView tags 1–32, assuming yes to GLP-1, calorie tracking and
   fasting), ending where BuildingPlanView takes over. Fixed size, no
   controls: it plays, it does not respond.
   Sep 2: 7s per slide, 1.05s crossfade, at her request;
   the Building slide's own timings still mirror BuildingPlanView.swift. */

.onboard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.onboard-phone {
  position: relative;
  width: 300px;
  aspect-ratio: 520 / 947;
  border-radius: 34px;
  overflow: hidden;
  background: var(--black);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6),
              0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.onboard-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1050ms ease;
}
.onboard-frame.is-on { opacity: 1; }

.onboard-dots {
  display: flex;
  gap: 5px;
}
.onboard-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  transition: background 400ms ease;
}
.onboard-dots span.is-on { background: var(--brand-pink); }

/* The closing frame: BuildingPlanView, rebuilt in CSS so it actually plays.
   Values scaled from the Swift view (393pt screen → 300px phone, ×0.76):
   bar gradient, 25pt bars, 2.3125s fills staggered 2.5s, complete at 10.4s. */

.onboard-build {
  background: #0B0B0D;          /* Color(0.043, 0.043, 0.051) */
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 26px 20px 20px;
}
.ob-logo { width: 54px; height: 54px; margin-bottom: 11px; }
.ob-title {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.28;
  color: #FFFFFF;
  margin: 0 0 24px;
  max-width: none;
}
.ob-steps { width: 100%; display: flex; flex-direction: column; gap: 17px; }
.ob-step span {
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 6px;
}
.ob-bar {
  height: 19px;
  border-radius: 6px;
  background: linear-gradient(90deg, #3C1D8E, #9B6DD6, #4A90D9);
  opacity: 0.2;
  position: relative;
}
.ob-bar-fill {
  position: absolute;
  inset: 0;
  width: 0;
  border-radius: 6px;
  background: linear-gradient(90deg, #3C1D8E, #9B6DD6, #4A90D9);
}
/* the track is the dim layer; the fill rides above it at full strength */
.ob-step .ob-bar { opacity: 1; background: none; }
.ob-step .ob-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background: linear-gradient(90deg, #3C1D8E, #9B6DD6, #4A90D9);
  opacity: 0.2;
}

@keyframes obFill { to { width: 100%; } }
.onboard-build.play .ob-step:nth-child(1) .ob-bar-fill { animation: obFill 2.3125s ease-in-out 0s    forwards; }
.onboard-build.play .ob-step:nth-child(2) .ob-bar-fill { animation: obFill 2.3125s ease-in-out 2.5s  forwards; }
.onboard-build.play .ob-step:nth-child(3) .ob-bar-fill { animation: obFill 2.3125s ease-in-out 5s    forwards; }
.onboard-build.play .ob-step:nth-child(4) .ob-bar-fill { animation: obFill 2.3125s ease-in-out 7.5s  forwards; }

.ob-done { opacity: 0; transform: translateY(12px); margin-top: 18px; }
@keyframes obDone { to { opacity: 1; transform: translateY(0); } }
.onboard-build.play .ob-done { animation: obDone 0.4s ease-in-out 10.4s forwards; }
.ob-done-a { font-size: 15px; font-weight: 600; color: #FFFFFF; margin: 0; line-height: 1.3; }
.ob-done-b { font-size: 12px; font-weight: 300; color: rgba(255,255,255,0.8); margin: 6px 0 0; }

.ob-confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.ob-confetti i {
  position: absolute;
  top: -14px;
  width: 7px;
  height: 11px;
  border-radius: 2px;
  opacity: 0;
}
@keyframes obFall {
  0%   { opacity: 0; transform: translateY(0) rotate(0deg); }
  10%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(560px) rotate(var(--r, 180deg)); }
}
.onboard-build.play .ob-confetti i { animation: obFall 2s linear forwards; }

@media (prefers-reduced-motion: reduce) {
  .onboard-frame { transition: none; }
  .onboard-build .ob-bar-fill { width: 100%; }
  .onboard-build .ob-done { opacity: 1; transform: none; }
  .onboard-build .ob-confetti { display: none; }
}

/* The studio lockup, anchored top-left of the home hero */
.hero-logo {
  width: clamp(230px, 34vw, 400px);
  margin: 0 0 34px -14px;   /* optical: the crescent's own margin sits inside the art */
}

/* Longevity Food Lab wordmark, used in place of a typeset H1 */
.logo-h1 { margin: 0 0 22px; }
.logo-h1 img { width: 100%; max-width: 420px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  background: linear-gradient(100deg, var(--brand-blue) -10%, var(--brand-violet) 55%, var(--brand-pink) 130%);
  color: #FFFFFF;
  font-weight: 650;
  font-size: 16px;
  text-decoration: none;
  padding: 13px 24px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.btn:hover { filter: brightness(1.12); color: #FFFFFF; }

.btn.ghost {
  background: transparent;
  color: var(--on-black);
  border-color: var(--stroke-firm);
}
.btn.ghost:hover { background: rgba(255,255,255,0.08); color: #FFFFFF; filter: none; }

.btn.dark {
  background: linear-gradient(100deg, var(--brand-blue) -10%, var(--brand-violet) 55%, var(--brand-pink) 130%);
  color: #FFFFFF;
}

/* On the lit violet panel, invert so the button doesn't fight the ground */
.on-forest .btn {
  background: #FFFFFF;
  color: #16091F;
}
.on-forest .btn:hover { background: #EDE7FB; color: #16091F; filter: none; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

/* ---------- Cards ---------- */

.grid { display: grid; gap: 20px; }
.grid.two   { grid-template-columns: 1fr; }
.grid.three { grid-template-columns: 1fr; }
@media (min-width: 700px) {
  .grid.two   { grid-template-columns: repeat(2, 1fr); }
  .grid.three { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .grid.three { grid-template-columns: repeat(3, 1fr); }
}

.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 26px 24px;
}
.card h3 { margin-bottom: 8px; }
.card p { color: var(--ink-soft); }
.card p:last-child { margin-bottom: 0; }
.card .icon { font-size: 22px; line-height: 1; margin-bottom: 12px; display: block; }
.card .mark { width: 40px; height: 40px; display: block; margin-bottom: 14px; }

.on-forest .card {
  background: rgba(0, 0, 0, 0.4);
  border-color: var(--stroke-firm);
}
.on-forest .card p { color: var(--on-black-soft); }

/* Feature list rows */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li {
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
  display: grid;
  gap: 4px 22px;
}
.rows li:first-child { border-top: 1px solid var(--rule); }
.rows strong { color: var(--ink); font-weight: 650; }
.rows span { color: var(--ink-soft); }
@media (min-width: 760px) {
  .rows li { grid-template-columns: 15rem 1fr; align-items: baseline; }
}

/* Product callout on home */
.product-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 34px;
  display: grid;
  gap: 30px;
  align-items: center;
}
@media (min-width: 820px) {
  .product-card { grid-template-columns: 200px 1fr; }
}

/* The real app icon, masked to the iOS corner radius */
.app-icon {
  width: 100%;
  max-width: 180px;
  border-radius: 22.4%;
  box-shadow: 0 6px 24px rgba(27, 25, 34, 0.18);
}

.badge {
  display: inline-block;
  background: rgba(129, 68, 242, 0.10);
  color: var(--violet-deep);
  border: 1px solid rgba(129, 68, 242, 0.24);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.01em;
}
.hero .badge, .on-forest .badge {
  background: rgba(185, 160, 247, 0.14);
  color: var(--lilac);
  border-color: rgba(185, 160, 247, 0.32);
}

/* Notes / callouts inside long documents */
.note {
  background: var(--paper-2);
  border-left: 3px solid var(--violet);
  border-radius: 0 10px 10px 0;
  padding: 18px 22px;
  margin: 26px 0;
}
.note p:last-child { margin-bottom: 0; }

/* Legal / long-form document pages */
.doc h2 {
  margin-top: 46px;
  padding-top: 6px;
  font-size: 1.42rem;
}
.doc h2:first-of-type { margin-top: 0; }
.doc h3 { margin-top: 30px; color: var(--violet-deep); }
.doc ul { max-width: var(--measure); padding-left: 22px; }
.doc li { margin-bottom: 8px; }
.doc li::marker { color: var(--violet); }
.doc dl { max-width: var(--measure); margin: 0 0 1.2em; }
.doc dt { font-weight: 650; color: var(--ink); margin-top: 16px; }
.doc dd { margin: 4px 0 0; color: var(--ink-soft); }

.updated {
  font-size: 14.5px;
  color: var(--ink-faint);
  margin: 0 0 8px;
}
.hero .updated { color: var(--on-black-faint); }

/* Contact block */
.contact-line {
  font-size: clamp(1.15rem, 3vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  word-break: break-word;
}

/* ---------- Footer (black) ---------- */

.site-footer {
  background: var(--black);
  color: var(--on-black-faint);
  padding: 46px 0 40px;
  font-size: 15px;
}
.site-footer a { color: var(--on-black-soft); text-decoration: none; }
.site-footer a:hover { color: #FFFFFF; text-decoration: underline; }
.site-footer .cols {
  display: grid;
  gap: 26px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--stroke);
}
@media (min-width: 760px) {
  .site-footer .cols { grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; }
}
.site-footer .legal-name { color: #FFFFFF; font-weight: 600; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer .foot-head {
  color: var(--on-black-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 11.5px;
  font-weight: 700;
  margin-bottom: 12px;
}
.site-footer .fine { padding-top: 22px; font-size: 14px; }
.site-footer p { max-width: 46ch; }

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