/* Cubby website. Day world tokens from the design handoff (website-designs/README.md). */
:root {
  --canvas: #FAF3E6;
  --card: #FFFDF8;
  --ink: #4A3728;
  --ink-soft: #8A7460;
  --honey: #E8A33D;
  --on-honey: #4A3728;
  --fill-subtle: rgba(74, 55, 40, .08);
  --hairline: rgba(74, 55, 40, .15);
  --cream: #FFFDF8;
  --store: #1B1714;
  /* Hero text shadows are tinted with the dusk ink so they deepen the plum sky and the
     wind-down ground behind the cream text rather than greying it. */
  --hero-shadow: 0 1px 2px rgba(30, 20, 48, .45), 0 1px 14px rgba(30, 20, 48, .4);
  --hero-shadow-soft: 0 1px 2px rgba(30, 20, 48, .45), 0 1px 12px rgba(30, 20, 48, .4);
  --shadow-card: 0 6px 28px rgba(0, 0, 0, .06);
  --ease: cubic-bezier(.4, 0, .2, 1);
  --dur: 250ms;
  --font: 'Nunito', ui-rounded, system-ui, sans-serif;
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 150%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
a:hover { opacity: .88; }
a, button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--honey); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3, p, ol, ul { margin: 0; }
svg { display: block; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 10;
  background: var(--card); color: var(--ink); padding: 10px 16px; border-radius: 12px;
  font-weight: 700; box-shadow: var(--shadow-card);
}
.skip:focus { top: 12px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.press { transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease); }
.press:active { transform: scale(.98); }

.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: 1.5px; line-height: 100%;
  text-transform: uppercase; color: var(--ink-soft);
}

/* ---------- Nav ---------- */
.nav {
  position: relative; z-index: 2;
  height: 72px; padding: 0 48px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-brand { font-size: 22px; font-weight: 900; line-height: 1; }
.nav-links { display: flex; align-items: center; gap: 28px; font-size: 15px; font-weight: 600; }
.nav-links a[aria-current="page"] { color: var(--honey); }
.nav-cta {
  height: 44px; padding: 0 20px; border-radius: 22px;
  background: var(--honey); color: var(--on-honey);
  font-weight: 700; display: flex; align-items: center;
}

/* Home: the nav sits over the hero. */
.nav--over .nav-brand,
.nav--over .nav-links a:not(.nav-cta) { color: var(--cream); }
.nav--over .nav-brand { text-shadow: var(--hero-shadow); }
.nav--over .nav-links { font-weight: 700; }
.nav--over .nav-links a:not(.nav-cta) { text-shadow: var(--hero-shadow-soft); }
.nav--over .nav-cta {
  background: var(--cream); color: var(--ink); font-weight: 800;
  box-shadow: 0 6px 28px rgba(0, 0, 0, .1);
}

/* ---------- Footer ---------- */
.footer {
  padding: 36px 48px 40px;
  display: flex; justify-content: space-between; align-items: flex-start;
  box-shadow: inset 0 1px 0 var(--hairline);
}
.footer-brand { display: flex; flex-direction: column; gap: 8px; }
.footer-name { font-size: 18px; font-weight: 900; line-height: 1; }
.footer-tag { font-size: 14px; line-height: 150%; color: var(--ink-soft); }
.footer-copy { font-size: 13px; line-height: 150%; color: var(--ink-soft); }
.footer-brand .footer-copy { margin-top: 8px; }
.footer-cols { display: flex; gap: 64px; }
.footer-links, .footer-contact { display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 150%; }
.footer-links { font-weight: 600; }
.footer-contact a { font-weight: 600; }
.footer-contact .eyebrow { line-height: 150%; }
.footer-note { color: var(--ink-soft); }
.footer > .footer-copy { display: none; }

/* ---------- Home hero ---------- */
/* Scene crop (focal point, not bottom anchoring). The art box keeps the artboard's
   aspect and covers the hero's width (trimming a few art px of edge seam each side)
   and height. It is then moved vertically so the mound's crest lands a little above
   Cubby's feet, and never so far up that the art's bottom edge shows. When that
   leaves a gap at the top, the hero background is the wind-down sky's top colour, so the
   sky just continues. hero.js hands the same box to Rive, so PNG and Rive match.
   Inputs: --aw/--ah artboard size, --crest the crest's height as a fraction of the
   artboard, --bw bear width, --feet where the bear's feet land. cq units are the
   hero's box (container-type: size). */
.hero {
  --aw: 1353; --ah: 947; --crest: .69; --trim: 6;
  --bw: clamp(240px, 31cqh, 310px);
  --feet: 89cqh;
  --crest-y: calc(var(--feet) - var(--bw) * .24);
  --art-w: max(100cqw * var(--aw) / (var(--aw) - 2 * var(--trim)), 100cqh * var(--aw) / var(--ah));
  --art-h: calc(var(--art-w) * var(--ah) / var(--aw));
  --art-y: max(var(--crest-y) - var(--art-h) * var(--crest), 100cqh - var(--art-h));
  position: relative; height: clamp(760px, 44vw + 200px, 980px); overflow: hidden;
  container-type: size;
  background: #5d58af; /* top row of the wind-down sky, read from the render */
}
.hero-art, .hero-art > *, .hero-art picture > img { position: absolute; }
.hero-art > picture { position: static; }
.hero-art { inset: 0; }
.hero-scene-img {
  left: calc(50% - var(--art-w) / 2); top: var(--art-y);
  width: var(--art-w); height: var(--art-h);
}
.hero-scene-canvas { inset: 0; width: 100%; height: 100%; }

/* The bear, placed from the same variables so it always sits on the crest. The PNG
   is cropped to the bear; the Rive artboard (1420:1237) has the bear in a 989x1165
   box centred at 47.8% across, feet at 96.9% down, so the canvas is sized to make
   the drawn bear match the PNG: canvas width = bear width / 0.6965. */
.hero-bear-img, .hero-bear-canvas { filter: drop-shadow(0 12px 26px rgba(20, 40, 36, .28)); }
.hero-bear-img {
  width: var(--bw); height: auto;
  left: calc(50% - var(--bw) / 2); top: calc(var(--feet) - var(--bw) * 1158 / 989);
}
.hero-bear-canvas {
  --cw: calc(var(--bw) / .6965);
  width: var(--cw); height: calc(var(--cw) * 1237 / 1420);
  left: calc(50% - var(--cw) * .478);
  top: calc(var(--feet) - var(--cw) * 1237 / 1420 * .969);
}
.hero-ground {
  width: calc(var(--bw) * .72); height: calc(var(--bw) * .088); border-radius: 50%;
  background: rgba(20, 40, 36, .18);
  left: calc(50% - var(--bw) * .36); top: calc(var(--feet) - var(--bw) * .05);
}

/* Rive layers stay invisible until the scene is bound and settled (hero.js). */
.hero-scene-canvas, .hero-bear-canvas { opacity: 0; transition: opacity 400ms var(--ease); }
.hero-bear-img { transition: opacity 400ms var(--ease); }
.hero.is-live .hero-scene-canvas, .hero.is-live .hero-bear-canvas { opacity: 1; }
.hero.is-live .hero-bear-img { opacity: 0; }
.hero:not(.is-live) .hero-scene-canvas, .hero:not(.is-live) .hero-bear-canvas { visibility: hidden; }

.hero-text {
  position: absolute; left: 0; right: 0; top: 108px; z-index: 1;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  color: var(--cream);
}
.hero-title {
  font-size: 72px; font-weight: 900; line-height: 1; letter-spacing: .5px;
  text-shadow: 0 2px 24px rgba(30, 20, 48, .35);
}
.hero-tag { font-size: 22px; font-weight: 700; line-height: 1.2; margin-top: 14px; text-shadow: var(--hero-shadow); }
.hero-line { font-size: 16px; font-weight: 600; line-height: 1.3; margin-top: 10px; opacity: .95; text-shadow: var(--hero-shadow); }
.hero-cta { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 26px; }
.hero-note { font-size: 13px; font-weight: 600; line-height: 1.2; opacity: .9; text-shadow: var(--hero-shadow-soft); }

.store-btn {
  height: 56px; padding: 0 22px 0 18px; border-radius: 14px;
  background: var(--store); color: var(--cream);
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 6px 28px rgba(0, 0, 0, .14);
}
.store-btn svg { width: 28px; height: 28px; flex-shrink: 0; }
.store-label { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; }
.store-small { font-size: 11px; font-weight: 600; line-height: 1; }
.store-big { font-size: 21px; font-weight: 700; line-height: 1; }

/* ---------- Three parts ---------- */
.parts { padding: 72px 48px 64px; display: flex; flex-direction: column; align-items: center; gap: 36px; }
.parts-title { font-size: 28px; font-weight: 900; line-height: 1; text-align: center; }
.parts-grid {
  list-style: none; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px;
  width: 100%; max-width: 1040px;
}
.part {
  background: var(--card); border-radius: 24px; box-shadow: var(--shadow-card);
  padding: 24px; display: flex; flex-direction: column; gap: 12px;
}
.part-icon { width: 30px; height: 30px; color: var(--ink); flex-shrink: 0; }
.part-body { display: flex; flex-direction: column; gap: 12px; }
.part-title { font-size: 20px; font-weight: 600; line-height: 120%; }
.part-text { font-size: 15px; line-height: 150%; color: var(--ink-soft); }
.parts-close { font-size: 15px; line-height: 150%; color: var(--ink-soft); text-align: center; max-width: 560px; }
.only-mobile { display: none; }

/* ---------- Support ---------- */
.page { max-width: 1040px; margin: 0 auto; padding: 48px 48px 72px; box-sizing: content-box; display: flex; flex-direction: column; gap: 40px; }
.page-head { display: flex; flex-direction: column; gap: 14px; max-width: 640px; }
.page-title { font-size: 44px; font-weight: 900; line-height: 1; }
.page-intro { font-size: 17px; line-height: 150%; color: var(--ink-soft); }
.page-intro a, .doc a, .faq-a a { color: var(--ink); font-weight: 600; }
.doc a, .faq-a a { text-decoration: underline; text-decoration-color: var(--hairline); text-underline-offset: 3px; }

.faq-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 48px; align-items: start; }
.faq-toc { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 4px; }
.faq-toc a {
  font-size: 15px; font-weight: 600; line-height: 150%; padding: 8px 12px; border-radius: 12px; color: var(--ink-soft);
  transition: background-color var(--dur) var(--ease);
}
.faq-toc a:hover { opacity: 1; background: var(--fill-subtle); }
.faq-sections { display: flex; flex-direction: column; gap: 36px; }
.faq-section { display: flex; flex-direction: column; gap: 10px; scroll-margin-top: 24px; }
.faq-section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.faq-section-head .rule { flex: 1; height: 1px; background: var(--hairline); }
.faq-item { background: var(--card); border-radius: 20px; box-shadow: var(--shadow-card); scroll-margin-top: 24px; }
.faq-item h3 { font: inherit; }
.faq-q {
  width: 100%; min-height: 62px; padding: 20px 22px; margin: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: none; border: 0; border-radius: 20px; cursor: pointer; text-align: left;
  font: 600 17px/120% var(--font); color: var(--ink);
}
.faq-q svg {
  width: 18px; height: 18px; flex-shrink: 0; color: var(--ink-soft);
  transition: transform var(--dur) var(--ease);
}
.faq-item.is-open .faq-q svg { transform: rotate(180deg); }
.faq-a { display: grid; grid-template-rows: 1fr; transition: grid-template-rows var(--dur) var(--ease), visibility var(--dur); }
.faq-a-inner { overflow: hidden; min-height: 0; }
.faq-a-inner > * { max-width: 680px; }
.faq-a-inner { display: flex; flex-direction: column; gap: 10px; padding: 0 22px 22px; }
.js .faq-item:not(.is-open) .faq-a { grid-template-rows: 0fr; visibility: hidden; }
.js .faq-item:not(.is-open) .faq-a-inner { padding-bottom: 0; }
.faq-a-inner { transition: padding-bottom var(--dur) var(--ease); }
.faq-a p, .faq-a li { font-size: 15px; line-height: 150%; }
.faq-a ol { padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }

/* ---------- Privacy and terms ---------- */
.doc { max-width: 720px; margin: 0 auto; padding: 48px 48px 80px; box-sizing: content-box; display: flex; flex-direction: column; gap: 36px; }
.doc-head { display: flex; flex-direction: column; gap: 14px; }
.doc-date { font-size: 15px; line-height: 150%; color: var(--ink-soft); }
.doc section { display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 24px; }
.doc h2 { font-size: 22px; font-weight: 700; line-height: 120%; }
.doc section p, .doc section li { font-size: 16px; line-height: 160%; }
.doc section ul { padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.doc strong { font-weight: 700; }

/* ---------- Mobile ---------- */
@media (max-width: 719px) {
  .nav { height: 56px; padding: 0 24px; }
  .nav-brand { font-size: 20px; }
  .nav-links { gap: 20px; font-size: 14px; font-weight: 700; }
  .nav-links a:not(.nav-cta) { display: none; }
  .nav-cta { height: 36px; padding: 0 16px; border-radius: 18px; font-weight: 700; }
  .nav--over .nav-links a.nav-mobile-keep { display: flex; }
  .nav--over .nav-cta { display: none; }

  .footer { padding: 28px 24px 44px; flex-direction: column; gap: 18px; }
  .footer-brand { gap: 6px; }
  .footer-brand .footer-copy { display: none; }
  .footer > .footer-copy { display: block; }
  .footer-cols { flex-direction: column; gap: 18px; }
  .footer-links { flex-direction: row; flex-wrap: wrap; gap: 10px 20px; }
  .footer-contact .eyebrow, .footer-note { display: none; }

  /* SplashTall art. The text block and button sit in the ground under the bear, so the
     feet land a text block's height above the bottom and the crest just above them:
     the green below the crest is only as tall as the words and the button need. */
  .hero {
    --aw: 1058; --ah: 2567; --crest: .488;
    --bw: 170px;
    --feet: calc(100cqh - var(--text-h));
    --text-h: 252px;
    height: 660px; height: clamp(580px, 76svh, 660px);
  }
  .hero-bear-img, .hero-bear-canvas { filter: drop-shadow(0 10px 22px rgba(20, 40, 36, .28)); }

  .hero-text { top: calc(var(--feet) + 18px); bottom: 26px; left: 24px; right: 24px; }
  .hero-title { font-size: 50px; text-shadow: 0 2px 20px rgba(30, 20, 48, .35); }
  .hero-tag { font-size: 16px; margin-top: 8px; }
  .hero-line { font-size: 14px; margin-top: 6px; }
  .hero-cta { margin-top: auto; gap: 10px; align-self: stretch; }
  .hero-note { font-size: 12px; }
  .store-btn { align-self: stretch; justify-content: center; padding: 0 18px; }
  .store-btn svg { width: 26px; height: 26px; }
  .store-big { font-size: 20px; }

  .parts { padding: 44px 24px 40px; gap: 16px; align-items: stretch; }
  .parts-title { font-size: 24px; line-height: 1.1; margin-bottom: 8px; }
  .parts-grid { grid-template-columns: minmax(0, 1fr); }
  .part { border-radius: 20px; padding: 18px; flex-direction: row; gap: 14px; align-items: flex-start; }
  .part-icon { width: 26px; height: 26px; }
  .part-body { gap: 6px; }
  .part-title { font-size: 17px; }
  .part-text { font-size: 14px; }
  .parts-close, .only-desktop { display: none; }
  .only-mobile { display: inline; }

  .page { padding: 0 0 32px; gap: 0; }
  .page-head { padding: 20px 24px 12px; gap: 10px; }
  .page-title { font-size: 34px; }
  .page-intro { font-size: 15px; }
  .faq-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .faq-toc {
    position: static; flex-direction: row; gap: 8px; overflow-x: auto; scrollbar-width: none;
    padding: 8px 24px 4px;
  }
  .faq-toc::-webkit-scrollbar { display: none; }
  .faq-toc a {
    flex-shrink: 0; height: 32px; padding: 0 14px; border-radius: 14px; background: var(--fill-subtle);
    font-size: 13px; display: flex; align-items: center; white-space: nowrap;
  }
  .faq-sections { padding: 16px 24px 0; gap: 28px; }
  .faq-section-head { margin-bottom: 2px; }
  .faq-item { border-radius: 18px; }
  .faq-q { padding: 17px 16px; gap: 12px; font-size: 16px; border-radius: 18px; }
  .faq-q svg { width: 16px; height: 16px; }
  .faq-a-inner { padding: 0 16px 18px; }
  .faq-a ol { padding-left: 20px; }

  .doc { padding: 20px 24px 40px; gap: 28px; }
  .doc-head { gap: 10px; }
  .doc-date { font-size: 14px; }
  .doc .page-intro { font-size: 15px; }
  .doc section { gap: 10px; }
  .doc h2 { font-size: 20px; }
  .doc section p, .doc section li { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; scroll-behavior: auto !important; }
}
