/* Before We Dream: shared design system (v2)
   Palette "The Nightlight": Midnight, Dusk, Lamplight, Ivory.
   Type: upright Baskerville for every heading, wordmark and cover title,
   one weight and style per title, from start to finish. */

:root {
  --midnight: #150b22;
  --night: #1d1030;
  --sky: #261431;
  --dusk: #33203f;
  --plum: #4a2c5e;
  --violet: #7a4f99;
  --lilac: #c9b0dc;
  --mist: #e6d8ef;
  --lamplight: #f6bf78;
  --lamp-hot: #ffd99c;
  --ember: #e58f58;
  --ivory: #fff1db;
  --rose: #ef8571;
  --ink: #1b0f2a;

  --serif: Baskerville, "Baskerville Old Face", Georgia, serif;
  --sans: "Avenir Next", Avenir, "Trebuchet MS", system-ui, sans-serif;

  --wrap: min(100% - clamp(2.5rem, 7vw, 7rem), 78rem);
  --radius: 1.1rem;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-soft: cubic-bezier(.45, 0, .2, 1);
  --header-h: 4.6rem;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--midnight); }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: clip; }
body {
  margin: 0;
  min-height: 100svh;
  color: var(--ivory);
  background: transparent;
  font: 500 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
img, svg, canvas, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: #f6bf7855; color: #fff; }
:focus-visible { outline: 2px solid var(--lamp-hot); outline-offset: 3px; border-radius: .3rem; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; z-index: 200; top: .8rem; left: .8rem;
  padding: .7rem 1rem; border-radius: 999px;
  background: var(--ivory); color: var(--ink); font-weight: 600; text-decoration: none;
  transform: translateY(-160%); transition: transform .3s var(--ease-out);
}
.skip-link:focus { transform: none; }

/* ---------- Type ---------- */
h1, h2, h3, .display, .title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-style: normal;
  letter-spacing: -.012em;
  line-height: 1.04;
  text-wrap: balance;
  font-kerning: normal;
}
.display { font-size: clamp(2.7rem, 6.1vw, 5.6rem); }
.title { font-size: clamp(2.3rem, 4.6vw, 4.1rem); }
.title-sm { font-size: clamp(1.7rem, 2.6vw, 2.3rem); }
.glow-word { color: var(--lamp-hot); text-shadow: 0 0 1.4rem #f6bf7840; }
.kicker {
  display: flex; width: fit-content; align-items: center; gap: .6rem;
  margin: 0 0 1.1rem;
  color: var(--lamplight);
  font: 600 .74rem/1.2 var(--sans);
  letter-spacing: .24em;
  text-transform: uppercase;
}
.kicker::before {
  content: ""; width: .7rem; height: .7rem; flex: none;
  background: currentColor;
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
}
.lede { margin: 1.3rem 0 0; max-width: 34rem; color: var(--mist); font-size: clamp(1.06rem, 1.25vw, 1.22rem); line-height: 1.6; }
.small-print { color: #cdb9d8; font-size: .82rem; }
.small-print.center { text-align: center; margin-top: 2rem; }
p { text-wrap: pretty; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: linear-gradient(180deg, #ffd796, #f2b066);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 3.2rem;
  padding: .85rem 1.55rem;
  overflow: hidden;
  border: 0; border-radius: 999px;
  background: var(--btn-bg);
  color: #2a1530;
  font: 650 1rem/1 var(--sans);
  letter-spacing: .01em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  isolation: isolate;
  box-shadow: 0 .1rem 0 #fff3 inset, 0 -.18rem 0 #c07a3c55 inset, 0 .8rem 2rem -.6rem #f6a94f90, 0 .2rem .5rem #0005;
  transition: transform .45s var(--ease-out), box-shadow .45s var(--ease-out);
}
.btn::after {
  content: ""; position: absolute; inset: -20% auto -20% -60%; z-index: -1; width: 45%;
  background: linear-gradient(100deg, transparent, #fffbe9cc, transparent);
  transform: skewX(-18deg) translateX(-120%);
  transition: transform .9s var(--ease-out);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 .1rem 0 #fff4 inset, 0 -.18rem 0 #c07a3c55 inset, 0 1.1rem 2.6rem -.5rem #f6a94fb0, 0 .25rem .6rem #0006; }
.btn:hover::after { transform: skewX(-18deg) translateX(520%); }
.btn:active { transform: translateY(0) scale(.98); }
.btn .star-ico { width: .95rem; height: .95rem; flex: none; }
.btn--ghost {
  --btn-bg: transparent;
  color: var(--ivory);
  box-shadow: inset 0 0 0 1.5px #fff1db66;
  backdrop-filter: blur(6px);
}
.btn--ghost::after { background: linear-gradient(100deg, transparent, #fff1db33, transparent); }
.btn--ghost:hover { box-shadow: inset 0 0 0 1.5px #fff1dbcc, 0 .8rem 2rem -1rem #000; }
.btn--small { min-height: 2.6rem; padding: .6rem 1.1rem; font-size: .9rem; }
.text-link {
  color: var(--ivory); font-weight: 600; text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  padding-bottom: .15rem;
  transition: background-size .4s var(--ease-out), color .3s;
}
.text-link:hover { color: var(--lamp-hot); background-size: 0 1px; background-position: 100% 100%; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem 1.2rem; margin-top: 2rem; }

/* ---------- Sky (one continuous night behind every section) ---------- */
.sky {
  position: fixed; inset: 0; z-index: -3; pointer-events: none;
  background:
    radial-gradient(120% 70% at 85% -10%, #5a2f6e66, transparent 60%),
    radial-gradient(90% 60% at 10% 110%, #f6bf7814, transparent 60%),
    linear-gradient(180deg, #1c0f2b 0%, #261431 55%, #1d0f2a 100%);
}
.sky canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.grain {
  position: fixed; inset: -50%; z-index: 150; pointer-events: none;
  background: url("../assets/grain.webp") 0 0 / 168px 168px;
  opacity: .085; mix-blend-mode: overlay;
}

/* ---------- Logo ---------- */
.logo { display: inline-flex; flex: none; align-items: center; text-decoration: none; color: var(--ivory); }
.logo svg { height: 2.5rem; width: auto; overflow: visible; }
.logo .bwd-star { transform-box: fill-box; transform-origin: center; }
html[data-motion="on"] .site-header .logo .bwd-star { animation: star-idle 9s var(--ease-out) 3s infinite; }
.logo:hover .bwd-star, html[data-motion="on"] .site-header .logo:hover .bwd-star { animation: star-twinkle 1.1s var(--ease-out); }
@keyframes star-idle { 0%, 88% { transform: none; } 93% { transform: scale(1.4) rotate(45deg); } 100% { transform: scale(1) rotate(90deg); } }
@keyframes star-twinkle { 0% { transform: scale(1) rotate(0); } 45% { transform: scale(1.45) rotate(45deg); } 100% { transform: scale(1) rotate(90deg); } }

/* ---------- Header ---------- */
.site-header {
  position: fixed; z-index: 100; inset: 0 0 auto;
  height: var(--header-h);
  display: flex; align-items: center;
  transition: transform .6s var(--ease-out);
}
.site-header::before {
  /* Frosted night behind the header once the page moves, fading out at its lower edge so it never draws a line */
  content: ""; position: absolute; inset: 0 0 -1.4rem;
  background: linear-gradient(180deg, #170c25ee, #170c25cc 66%, #170c2500);
  -webkit-backdrop-filter: blur(14px) saturate(1.15); backdrop-filter: blur(14px) saturate(1.15);
  -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent);
  opacity: 0; transition: opacity .5s;
  pointer-events: none;
}
.site-header.is-scrolled::before { opacity: 1; }
.site-header.is-hidden { transform: translateY(-110%); }
.header-inner { position: relative; width: var(--wrap); margin-inline: auto; display: flex; align-items: center; gap: 1.5rem; }
.site-nav { display: flex; align-items: center; gap: .3rem; margin-left: auto; }
.site-nav a:not(.btn) {
  position: relative; padding: .55rem .85rem; border-radius: 999px;
  color: #eadcf2; font-size: .93rem; font-weight: 600; text-decoration: none;
  transition: color .3s, background .3s;
}
.site-nav a:not(.btn):hover { color: #fff; background: #ffffff10; }
.site-nav .btn { margin-left: .5rem; }
.motion-toggle {
  display: inline-flex; align-items: center; gap: .45rem;
  min-height: 2.4rem; padding: .45rem .8rem;
  border: 0; border-radius: 999px; background: #ffffff0d;
  color: #d9c6e4; font-size: .78rem; font-weight: 600; cursor: pointer;
  transition: background .3s, color .3s;
}
.motion-toggle:hover { background: #ffffff1a; color: #fff; }
.motion-toggle i { width: .55rem; height: .55rem; border-radius: 50%; background: #7ee0a1; box-shadow: 0 0 .5rem #7ee0a1; }
html[data-motion="off"] .motion-toggle i { background: #9b8aa6; box-shadow: none; }

/* ---------- Common section scaffolding ---------- */
.wrap { width: var(--wrap); margin-inline: auto; }
.scene { position: relative; isolation: isolate; }
.cover-stage {
  /* A 16:9 box that always covers its parent, so layered art never stretches. */
  position: absolute; top: 50%; left: var(--stage-x, 50%);
  width: max(100%, 177.78vh); height: max(100%, 56.25vw);
  aspect-ratio: 16 / 9;
  transform: translate(calc(var(--stage-x, 50%) * -1), -50%);
}
@supports (height: 100svh) { .cover-stage { width: max(100%, 177.78svh); } }
.cover-stage > * { position: absolute; }
.fill { inset: 0; width: 100%; height: 100%; object-fit: cover; }
.feather-b { -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.feather-y { -webkit-mask-image: linear-gradient(transparent, #000 18%, #000 78%, transparent); mask-image: linear-gradient(transparent, #000 18%, #000 78%, transparent); }

/* Paper-cut sparkle used as a bullet, divider and burst particle */
.sparkle { display: inline-block; width: 1em; height: 1em; background: currentColor; clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); }


/* ---------- Shared sections: heads, questions ---------- */
.section-head { text-align: center; max-width: 40rem; margin: 0 auto 3.5rem; }
.section-head .kicker { justify-content: center; }
.cta-row--center { justify-content: center; margin-top: 3.4rem; }
.grownups { padding: clamp(4rem, 10svh, 7rem) 0; }
.grownups-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.faq { display: grid; gap: .7rem; }
.faq details { border-radius: 1rem; background: #ffffff09; box-shadow: inset 0 0 0 1px #ffffff12; transition: background .3s, box-shadow .3s; }
.faq details[open] { background: #ffffff10; box-shadow: inset 0 0 0 1px #f6bf7840; }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.15rem 1.3rem; cursor: pointer; list-style: none; font: 400 1.25rem/1.25 var(--serif); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; width: .8rem; height: .8rem; flex: none; background: var(--lamplight); clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); transition: transform .5s var(--ease-out); }
.faq details[open] summary::after { transform: rotate(135deg) scale(1.2); }
.faq-body { overflow: hidden; }
.faq-body p { margin: 0; padding: 0 1.3rem 1.2rem; color: #e2d3ea; max-width: 38rem; }


/* ---------- Footer ---------- */
.site-footer { position: relative; padding: 4.5rem 0 2.6rem; }
.footer-inner { width: var(--wrap); margin-inline: auto; display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 2rem 3rem; align-items: start; }
.footer-inner .logo svg { height: 2.9rem; }
.footer-tag { margin: 1rem 0 0; color: #d8c5e3; max-width: 22rem; }
.footer-col h4 { margin: .4rem 0 .8rem; color: var(--lamplight); font: 600 .74rem/1.2 var(--sans); letter-spacing: .2em; text-transform: uppercase; }
.footer-col a { display: block; padding: .25rem 0; color: #eadcf2; text-decoration: none; }
.footer-col a:hover { color: #fff; }
.footer-base { width: var(--wrap); margin: 3rem auto 0; padding-top: 1.4rem; border-top: 1px solid #ffffff14; display: flex; justify-content: space-between; gap: 1rem; color: #a995b6; font-size: .8rem; }
/* The seller's details in the footer, and the gold note shown where a detail is still to be filled in */
.footer-legal { width: var(--wrap); margin: 2.4rem auto 0; color: #c4b0d1; font-size: .86rem; line-height: 1.6; }
.footer-legal p { margin: 0; max-width: 60rem; }
.footer-legal a { color: inherit; }
.footer-legal + .footer-base { margin-top: 1.2rem; }
mark.to-add { padding: .05em .4em; border: 1px dashed #f6bf78aa; border-radius: .35rem; background: #f6bf781f; color: var(--lamp-hot); font-weight: 600; font-size: .92em; }

/* Christmas or after-Christmas wording: <html data-season> picks one (see christmas_order_by in src/business.json) */
html:not([data-season="after"]) .season-after, html[data-season="after"] .season-christmas { display: none !important; }

/* ---------- Cookie choice (only on the page once a Meta Pixel ID is set) ---------- */
.footer-cookies { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }
.cookie-banner {
  position: fixed; z-index: 120; left: max(1rem, env(safe-area-inset-left)); bottom: calc(1rem + env(safe-area-inset-bottom));
  width: min(26rem, calc(100% - 2rem)); padding: 1.3rem 1.4rem 1.2rem;
  border-radius: var(--radius); background: linear-gradient(160deg, #33203ff5, #1d1030f7);
  box-shadow: inset 0 0 0 1px #f6bf7840, 0 1.4rem 3rem -1rem #000c;
  color: var(--mist); font-size: .9rem; line-height: 1.5;
  backdrop-filter: blur(10px);
}
.cookie-banner[hidden] { display: none; }
.cookie-banner h2 { display: flex; align-items: center; gap: .55rem; margin: 0 0 .45rem; color: var(--lamp-hot); font-size: 1.3rem; line-height: 1.2; }
.cookie-banner h2::before { content: ""; flex: none; width: .85rem; height: .85rem; background: var(--lamp-hot); clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); }
.cookie-banner p { margin: 0; }
.cookie-banner a { color: var(--ivory); }
.cookie-choices { display: flex; gap: .6rem; margin-top: 1rem; }
.cookie-choices .btn { flex: 1; white-space: normal; line-height: 1.2; text-align: center; }
.cookie-banner .cookie-more { margin-top: .75rem; font-size: .82rem; }
@media (max-width: 560px) {
  .cookie-banner { left: .6rem; width: calc(100% - 1.2rem); bottom: calc(.6rem + env(safe-area-inset-bottom)); }
}

/* ---------- Intro ident: "Before We Dream presents" ---------- */
.ident {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center;
  background: radial-gradient(70% 60% at 50% 55%, #2c1640, #12091d 70%);
  cursor: pointer;
}
.ident[hidden] { display: none; }
.ident-inner { display: grid; justify-items: center; gap: 1.1rem; text-align: center; transform: translateY(-2vh); }
.ident-mark { width: min(46vw, 19rem); overflow: visible; }
/* GSAP sets SVG transform origins itself, so these parts keep the default view-box origin. */
.ident-word { font: 400 clamp(2rem, 5.4vw, 3.6rem)/1 var(--serif); letter-spacing: -.005em; }
.ident-word span { display: inline-block; white-space: pre; }
.ident-presents { color: var(--lamplight); font: 600 .78rem/1 var(--sans); letter-spacing: .5em; text-transform: uppercase; padding-left: .5em; }
.ident-skip { position: absolute; right: 1.4rem; bottom: 1.2rem; border: 0; background: none; color: #bba6c9; font-size: .8rem; cursor: pointer; padding: .6rem; }
.ident-curtain { position: fixed; inset: 0; z-index: 299; pointer-events: none; }
.ident-curtain img { position: absolute; width: 120%; max-width: none; left: -10%; }

html.st-measuring *, html.st-measuring *::before, html.st-measuring *::after { transition: none !important; }

/* First paint: the night sky shows straight away; the page itself waits (at most a few
   seconds) until its entrance animation is ready, so nothing flashes and then jumps. */
html.is-preload main, html.is-preload .header-inner { opacity: 0; animation: preload-failsafe .01s 3.5s forwards; }
@keyframes preload-failsafe { to { opacity: 1; } }
html.ident-on .ident[hidden] { display: grid; }
html.ident-on .ident-inner { visibility: hidden; }
html.ident-on .ident { animation: ident-failsafe .01s 9s forwards; }
@keyframes ident-failsafe { to { visibility: hidden; opacity: 0; } }

/* ---------- Motion off / reduced motion ---------- */
html[data-motion="off"] *, html[data-motion="off"] *::before, html[data-motion="off"] *::after { animation-duration: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0s !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0s !important; scroll-behavior: auto !important; }
}

@media (max-width: 900px) {
  :root { --header-h: 4rem; }
  .grownups-grid { grid-template-columns: minmax(0, 1fr); }
  .site-nav a:not(.btn) { display: none; }
  .logo svg { height: 2.15rem; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-inner > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .motion-toggle span { display: none; }
  .header-inner { gap: .6rem; }
  .logo svg { height: 1.85rem; }
  .footer-inner .logo svg { height: 2.4rem; }
  .site-nav .btn { margin-left: 0; padding-inline: .95rem; }
  /* A shorter label keeps the full logo readable on phones */
  .nav-cta[data-short] { font-size: 0; }
  .nav-cta[data-short]::before { content: attr(data-short); font-size: .9rem; }
}
@media (max-width: 380px) {
  .logo svg { height: 1.6rem; }
  .footer-base { flex-direction: column; }
}
