/* css/dream.css — the dream rebuild.
 * Warm editorial system per rebuild-brief §4: cream, espresso, taupe,
 * one dusty red. Fraunces display over quiet Inter. No gradients,
 * no shadows doing design work, no boxes-in-boxes.
 */

/* Self-hosted, latin subset, variable weight 400–600 (SIL Open Font License).
   Preloaded from the page head so the first paint is in them. */
@font-face { font-family: 'Fraunces'; src: url('../fonts/fraunces.woff2') format('woff2'); font-weight: 400 600; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/inter.woff2') format('woff2'); font-weight: 400 600; font-display: swap; }

:root {
  --cream: #1F2228;
  --cream-2: #2B2F36;
  --espresso: #ECEEF2;
  --espresso-2: #B4B9C2;
  --taupe: #8B919C;
  --taupe-2: #3E434C;
  --red: #9DBAF7;
  --radius: 28px;
  --page: min(1100px, 92vw);
  --measure: 650px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* drifting smoke (js/smoke.js) sits behind everything */
.smoke { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--espresso);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; }

a { color: inherit; }

::selection { background: var(--taupe-2); }

/* ---------- header ---------- */

.site-head {
  width: var(--page);
  margin: 0 auto;
  padding: 22px 0 6px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-head .brand { display: inline-flex; }
.site-head .brand img { display: block; height: 22px; width: auto; }

.site-nav {
  margin-left: auto;
  display: flex;
  gap: 26px;
  font-size: 14px;
}

.site-nav a {
  text-decoration: none;
  color: var(--espresso-2);
}
.site-nav a:hover { color: var(--espresso); text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 760px) {
  .site-nav { display: none; }
  .site-head .btn { margin-left: auto; }
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  background: var(--espresso);
  color: var(--cream);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  padding: 14px 30px;
  border-radius: 999px;
  transition: transform .35s var(--ease), background .35s var(--ease);
}
.btn:hover { transform: translateY(-2px); background: #C4D6FB; }
.btn-small { padding: 9px 20px; font-size: 14px; }
.btn-light { background: var(--cream); color: var(--espresso); }
.btn-light:hover { background: #FFFFFF; }

/* ---------- type helpers ---------- */

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--taupe);
  margin: 0 0 18px;
}
.eyebrow-red { color: var(--red); }

.section-title, .band-title {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  font-size: clamp(34px, 4.6vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 20px;
}

.section-lede, .band-lede {
  max-width: var(--measure);
  color: var(--espresso-2);
  font-size: 17px;
  margin: 0 0 8px;
}

/* staggered line reveal (hero + test-drive band) */
.line { display: block; overflow: hidden; }
.line-in {
  display: block;
  transform: translateY(0);
}
html.js .line-in {
  transform: translateY(110%);
  transition: transform 1s var(--ease);
}
html.js body.is-loaded .line-in { transform: translateY(0); }
html.js body.is-loaded .hero-title .line:nth-child(2) .line-in { transition-delay: .12s; }
html.js body.is-loaded .hero-title .line:nth-child(3) .line-in { transition-delay: .24s; }
html.js [data-reveal].is-in .band-title .line:nth-child(2) .line-in { transition-delay: .12s; }
html.js [data-reveal].is-in .band-title .line:nth-child(3) .line-in { transition-delay: .24s; }

/* scroll reveal */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
html.js [data-reveal].is-in {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- hero ---------- */

.hero {
  width: var(--page);
  margin: 14px auto 0;
}

.hero-media {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
  aspect-ratio: 16 / 7;
  background: var(--cream-2);
}

.hero-video {
  position: absolute;
  left: 0;
  right: 0;
  top: -6%; /* the 12% oversize is split top/bottom so drift never bares an edge */
  width: 100%;
  height: 112%;
  object-fit: contain; /* Buddy's video is square — contain keeps all of him in the wide frame; his own cream backdrop blends with the frame */
  will-change: transform;
  /* The clip is composed for the wave: standing, Buddy's body sits at 37% of
     its width, and his raised arm reaches the right edge. In the wide frame
     the clip is height-limited (about 0.506 of the frame's width), so the
     13% of the clip that centres his body is 6.6% of this element, and the
     wave still has the whole right half of the frame to itself. dream.js
     writes --drift; the X stays here. */
  --buddy-x: 6.6%;
  transform: translate3d(var(--buddy-x), var(--drift, 0px), 0);
}

.hero-content {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 52px 16px 30px;
  text-align: center;
}

.hero-content .eyebrow { margin-bottom: 22px; }

.hero-title {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  font-size: clamp(44px, 7vw, 76px);
  line-height: 1;
  letter-spacing: -0.01em;
  margin: 0 0 26px;
}

.lede {
  font-size: 18px;
  line-height: 1.55;
  color: var(--espresso-2);
  text-wrap: pretty;
  margin: 0 auto 30px;
  max-width: 540px;
}

.hero-cta { margin: 0 0 14px; }

.hero-note {
  font-size: 13.5px;
  color: var(--taupe);
  margin: 0;
}

/* the contained clip sits in the middle of the wide frame; fade its two edges into the frame colour.
   An overlay, not a mask on the video: Safari drops masked, transformed video. */
@media (min-width: 641px) {
  .hero-media::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(to right,
      var(--cream-2) 0, var(--cream-2) 31%, transparent 36%,
      transparent 76%, var(--cream-2) 81.5%, var(--cream-2) 100%);
  }
  .hero-pause { z-index: 2; }
}

@media (max-width: 640px) {
  .hero-media { aspect-ratio: 4 / 3; border-radius: 20px 20px 0 0; }
  .hero-video { object-fit: cover; --buddy-x: 0px; }
  .hero-content { padding-top: 38px; }
}

/* ---------- the pause control ----------
 * Buddy waves on a loop, so there is a way to stop him: the one control a
 * moving picture owes a visitor who did not ask for it. */
.hero-pause {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--taupe-2);
  background: var(--cream);
  color: var(--espresso);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  opacity: .85;
  transition: opacity .3s var(--ease);
}
.hero-pause:hover { opacity: 1; }
.hero-pause:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.hero-pause .ic-play { display: none; }
.hero-pause[aria-pressed="true"] .ic-pause { display: none; }
.hero-pause[aria-pressed="true"] .ic-play { display: block; }
html:not(.js) .hero-pause { display: none; }

/* ---------- sections ---------- */

.section {
  width: var(--page);
  margin: 0 auto;
  padding: 96px 0 30px;
}

.section-alt {
  width: auto;
  max-width: none;
  background: rgba(31, 34, 40, .62); /* lets the smoke show through */
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  padding-left: max(4vw, calc((100vw - 1100px) / 2));
  padding-right: max(4vw, calc((100vw - 1100px) / 2));
  margin-top: 96px;
  padding-bottom: 96px;
}

.section-cta { margin-top: 40px; }

/* numbered program rows (builds + packages) */
.program {
  list-style: none;
  margin: 44px 0 0;
  padding: 0;
}

.program-row {
  display: grid;
  grid-template-columns: 170px 1fr auto;
  gap: 28px;
  align-items: baseline;
  padding: 30px 0;
  border-top: 1px solid var(--taupe-2);
}
.program-row:last-child { border-bottom: 1px solid var(--taupe-2); }

.program-no {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--taupe);
  white-space: nowrap;
}

.program-body h3 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  font-size: 26px;
  line-height: 1.15;
  margin: 0 0 8px;
}

.program-body p {
  margin: 0;
  color: var(--espresso-2);
  max-width: 520px;
}

.program-status, .program-price {
  font-family: "Fraunces", Georgia, serif;
  font-size: 19px;
  white-space: nowrap;
}
.program-status { color: var(--taupe); font-style: italic; }
.program-row.is-open .program-status { color: var(--red); font-style: normal; }
.program-status a, .program-price a { text-decoration: none; }
.program-price a:hover { color: var(--red); }
.program-status a:hover { text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 700px) {
  .program-row { grid-template-columns: 1fr; gap: 8px; }
}

/* steps */
.steps {
  list-style: none;
  margin: 44px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 44px;
}

.step { border-top: 1px solid var(--taupe-2); padding-top: 24px; }

.step-no {
  font-family: "Fraunces", Georgia, serif;
  font-size: 40px;
  line-height: 1;
  color: var(--taupe);
  display: block;
  margin-bottom: 16px;
}

.step h3 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  font-size: 24px;
  margin: 0 0 10px;
}

.step p { margin: 0; color: var(--espresso-2); }

@media (max-width: 820px) {
  .steps { grid-template-columns: 1fr; gap: 34px; }
}

/* test-drive band */
.testdrive {
  width: var(--page);
  margin: 96px auto 0;
  background: #1B2A6B;
  color: #ECEEF2;
  border-radius: var(--radius);
  padding: 84px 6vw;
  text-align: center;
}

.testdrive .band-title { margin-bottom: 24px; }
.testdrive .eyebrow { color: #9DB0FF; }
.testdrive .btn-light { background: #ECEEF2; color: #0F1218; }
.testdrive .band-lede {
  color: #C3CCEB;
  margin: 0 auto 36px;
}

/* spec sheet */
.specs {
  margin: 44px 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 56px;
}

.spec {
  border-top: 1px solid var(--taupe-2);
  padding: 24px 0;
}

.spec dt {
  font-family: "Fraunces", Georgia, serif;
  font-size: 21px;
  margin-bottom: 6px;
}

.spec dd { margin: 0; color: var(--espresso-2); }

@media (max-width: 700px) {
  .specs { grid-template-columns: 1fr; }
}

/* founder */
.founder {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 60px;
  align-items: center;
}

.founder-media {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--cream-2);
}
.founder-media img { display: block; width: 100%; height: auto; }

.founder-name {
  font-weight: 600;
  font-size: 15px;
  margin: 0 0 14px;
}

.founder-body p:last-child {
  color: var(--espresso-2);
  font-size: 17px;
  max-width: 560px;
  margin: 0;
}

.founder-body p.founder-more { margin: 22px 0 0; font-size: 15px; }
.founder-more a {
  color: var(--espresso);
  text-decoration: none;
  border-bottom: 1px solid var(--taupe);
  padding-bottom: 2px;
}
.founder-more a:hover { color: var(--red); border-color: var(--red); }

@media (max-width: 820px) {
  .founder { grid-template-columns: 1fr; gap: 34px; }
  .founder-media { max-width: 420px; }
}

/* handover */
.handover { padding-bottom: 110px; }

/* ---------- footer ---------- */

.site-foot {
  border-top: 1px solid var(--taupe-2);
  width: var(--page);
  margin: 0 auto;
  padding: 44px 0 54px;
  text-align: center;
}

.site-foot img { height: 22px; width: auto; }

.foot-line {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-size: 18px;
  color: var(--espresso-2);
  margin: 18px 0 10px;
}

.foot-links {
  font-size: 14px;
  color: var(--espresso-2);
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}
.foot-links a { text-decoration: none; }
.foot-links a:hover { text-decoration: underline; text-underline-offset: 4px; }

.foot-small { font-size: 13px; color: var(--taupe); margin: 0; }

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .line-in,
  html.js [data-reveal] {
    transform: none;
    opacity: 1;
    transition: none;
  }
  .btn { transition: none; }
  .btn:hover { transform: none; }
}
