/* Buddy — early-access page.
   Tokens are css/tokens.css verbatim (revision 3, "rose & sky"); the page is
   self-contained so the folder deploys on its own. Cream paper, one rose
   accent, apricot warmth, plum ink. No gradients beyond the two soft glows. */
@font-face { font-family: "Fredoka"; font-weight: 300 700; font-display: swap; src: url("fonts/Fredoka.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 200 800; font-display: swap; src: url("fonts/PlusJakartaSans.woff2") format("woff2"); }

:root {
  --paper: #FFFBFC; --paper-dim: #FDF2F6; --ink: #2E2430; --ink-soft: #6F6472; --line: #F2E0E8;
  --rose: #C9407D; --rose-soft: #FCE7F1; --rose-line: #F5C6DC; --rose-deep: #A62E63;
  --teal: #147787; --teal-soft: #DDF1F4; --teal-line: #BFE2E9; --teal-deep: #0F6373;
  --amber: #C57A14; --amber-soft: #FDF0D8; --amber-deep: #8A5A0B;
  --apricot: #F6B57B; --taupe: #9E93A0;
  --coral: var(--rose); --sage: var(--teal);
  --display: "Fredoka", system-ui, -apple-system, sans-serif;
  --body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --gutter: 16px;
  --brand-h: 60px;   /* header row */
  --cta-h: 92px;     /* the tagline-and-button row */
  --foot-h: 0px;     /* the footer may sit below the fold; the button may not */
  --ar: 1.7778;      /* the loaded video's own ratio; landing.js sets it from the file */
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--paper); }
body {
  min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; }
button { font: inherit; }
input, textarea { font: inherit; }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 12px; z-index: 50; }
.skip:focus { left: 8px; }

/* the two glows the app's video shares — warmth, not decoration */
.glow { position: fixed; border-radius: 50%; pointer-events: none; z-index: 0; }
.glow-a { width: 70vmax; height: 70vmax; right: -28vmax; top: -30vmax; background: radial-gradient(circle, rgba(246,181,123,0.50) 0%, rgba(246,181,123,0.16) 42%, rgba(246,181,123,0) 70%); }
.glow-b { width: 60vmax; height: 60vmax; left: -26vmax; bottom: -30vmax; background: radial-gradient(circle, rgba(201,64,125,0.24) 0%, rgba(201,64,125,0.08) 42%, rgba(201,64,125,0) 70%); }

/* ---- the page: logo → video → button, all inside one viewport ---- */
.page {
  position: relative; z-index: 1; flex: 1;
  display: flex; flex-direction: column;
  padding: 0 var(--gutter);
}
/* Logo, video, tagline, button as one block, centred in whatever height the
   screen has — on a tall phone it floats to the middle instead of hanging at
   the top with a cream void below it; on a short laptop it simply starts at the
   top and the page scrolls a little. */
.stack { margin: auto 0; width: 100%; display: flex; flex-direction: column; align-items: center; padding: 4px 0; }
.page-center { justify-content: center; text-align: center; gap: 14px; }
.brand { height: var(--brand-h); display: flex; align-items: center; gap: 12px; }
.brand img { width: 38px; height: 38px; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 30px; letter-spacing: -0.02em; line-height: 1; }

.video-wrap {
  position: relative; margin: 0;
  /* As wide as the screen allows. Ideally the whole page fits one viewport, so
     the height is what the screen leaves after logo, tagline, button and footer
     — but the video never shrinks below ~62% of the width for that: on a short
     laptop window it stays big and the small print scrolls instead. The ratio
     follows the file that actually loaded (16:9 or the 4:5 phone cut). */
  width: min(100%, 1440px, max(calc((100dvh - var(--brand-h) - var(--cta-h) - var(--foot-h) - 20px) * var(--ar)), 62vw));
  aspect-ratio: var(--ar);
  border-radius: 24px; overflow: hidden;
  background: var(--paper-dim) url("media/buddy-demo-poster.jpg?v=a931d45b") center / cover no-repeat;
  border: 2px solid var(--line);
  box-shadow: 0 24px 60px rgba(46, 36, 48, 0.16), 0 2px 6px rgba(46, 36, 48, 0.06);
}
.video-wrap video { display: block; width: 100%; height: 100%; object-fit: contain; background: var(--paper-dim); }
.video-wrap video::cue { font-family: var(--body); font-size: 0.9em; }

/* Shown while nothing has played yet, when autoplay was refused, and at the
   end. Never on hover — it is a button you can see and press. */
.video-cover {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(46, 36, 48, 0.10); border: 0; cursor: pointer; padding: 0;
  transition: opacity 180ms ease-out, visibility 0s linear 0s;
}
.video-cover[hidden] { display: none; }
.video-cover:focus-visible { outline: 3px solid var(--sage); outline-offset: -4px; }
.play-pill {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 64px; padding: 0 30px; border-radius: 999px;
  background: var(--paper); color: var(--ink); font-weight: 700; font-size: 20px;
  box-shadow: 0 12px 34px rgba(46, 36, 48, 0.28);
}
.video-cover:hover .play-pill { background: #fff; }

.sound-pill {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 0;
  background: var(--paper); color: var(--ink); font-family: var(--body); font-weight: 700; font-size: 15px; cursor: pointer;
  box-shadow: 0 8px 24px rgba(46, 36, 48, 0.24);
}
.sound-pill[hidden] { display: none; }
.sound-pill:hover { background: #fff; }
.sound-pill:focus-visible { outline: 3px solid var(--sage); outline-offset: 2px; }

/* ---- the one call to action ---- */
.cta { width: min(100%, 1440px); min-height: var(--cta-h); display: flex; align-items: center; justify-content: space-between; gap: 16px 28px; flex-wrap: wrap; padding: 14px 4px 6px; }
.cta-words { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tagline { margin: 0; font-family: var(--display); font-weight: 600; font-size: clamp(22px, 2.2vw, 30px); line-height: 1.2; color: var(--ink); letter-spacing: -0.01em; }
.tagline span { color: var(--rose); }
.cta-line { margin: 0; font-size: 14px; color: var(--ink-soft); }

.btn {
  font-family: var(--body); font-weight: 600; font-size: 15px; padding: 10px 20px; border-radius: 20px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-sizing: border-box; line-height: 1.2; min-height: 44px; border: none; white-space: nowrap;
}
.btn-primary { background: var(--rose); color: #fff; border: 1px solid transparent; }
.btn-primary:hover { background: var(--rose-deep); }
.btn-primary:disabled { background: var(--taupe); cursor: default; }
.btn-secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-secondary:hover { border-color: var(--sage); color: var(--sage); }
.btn:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; }
.btn-big { font-size: 19px; min-height: 60px; padding: 0 34px; border-radius: 999px; box-shadow: 0 10px 28px rgba(201, 64, 125, 0.28); }
.btn-big:hover { transform: translateY(-1px); }

.foot { position: relative; z-index: 1; display: flex; justify-content: center; align-items: center; gap: 10px; height: var(--foot-h); padding: 0 var(--gutter); font-size: 13px; color: var(--ink-soft); }
.linkish { background: none; border: 0; padding: 0; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: inherit; min-height: 44px; }
.consent .linkish { min-height: 0; }
.linkish:hover { color: var(--rose-deep); }
.linkish:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; border-radius: 6px; }

/* ---- the sheet (dialog) ---- */
.sheet {
  border: 0; padding: 0; margin: auto; background: var(--paper); color: var(--ink);
  width: min(560px, calc(100vw - 32px)); max-height: min(92dvh, 900px);
  border-radius: 28px; box-shadow: 0 30px 90px rgba(46, 36, 48, 0.30);
}
.sheet::backdrop { background: rgba(46, 36, 48, 0.38); }
.sheet[open] { animation: rise 220ms ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.sheet-body { padding: 24px 24px 22px; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sheet-head h2 { font-size: 26px; line-height: 1.2; }
.close { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); color: var(--ink-soft); font-size: 18px; cursor: pointer; flex: none; margin: -6px -8px 0 0; }
.close:hover { border-color: var(--coral); color: var(--coral); }
.close:focus-visible { outline: 3px solid var(--sky, #2A72C4); outline-offset: 2px; }
.sheet-lead { margin: 6px 0 0; font-size: 16px; color: var(--ink-soft); }
.sheet-sub { margin: 10px 0 0; font-size: 15px; color: var(--ink-soft); max-width: 46ch; }
.say-stack { display: flex; flex-direction: column; gap: 7px; margin-top: 14px; }
.say-stack p { margin: 0; font-size: 15px; line-height: 1.55; max-width: 60ch; }

/* a form with more than two questions is numbered, one question per step */
.steps { list-style: none; counter-reset: step; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.step { position: relative; padding-left: 40px; counter-increment: step; }
.step::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 28px; height: 28px; border-radius: 50%; background: var(--rose-soft); color: var(--rose-deep);
  font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center;
}
.field-label { display: block; font-size: 14px; font-weight: 700; color: var(--ink); margin: 3px 0 6px; }
.field-label .opt { font-weight: 500; color: var(--ink-soft); margin-left: 6px; }
.field-input {
  width: 100%; display: block; padding: 11px 14px; border-radius: 14px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-size: 16px; min-height: 44px;
}
textarea.field-input { resize: vertical; min-height: 64px; line-height: 1.45; }
.field-input::placeholder { color: var(--taupe); }
.field-input:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal); }
.field-input[aria-invalid="true"] { border-color: var(--coral); }
.field-error { margin: 6px 0 0; color: var(--coral); font-weight: 700; font-size: 14px; }
.field-error[hidden] { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip { min-height: 32px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper-dim); color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; }
.chip:hover { border-color: var(--sage); color: var(--sage); }
.chip.on { background: var(--teal-soft); border-color: var(--teal-line); color: var(--teal-deep); }
.chip:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; font-size: 14px; color: var(--ink-soft); line-height: 1.5; cursor: pointer; }
.consent input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--rose); flex: none; }

.cta-group { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.action-error { margin: 10px 0 0; color: var(--coral); font-weight: 700; font-size: 14px; flex-basis: 100%; }
.done .sheet-lead { color: var(--ink); font-size: 17px; }

/* Phones and portrait tablets get the 4:5 cut (see the <source media> in index.html). */
@media (max-width: 700px), (orientation: portrait) and (max-width: 1024px) {
  .video-wrap { background-image: url("media/buddy-demo-poster-mobile.jpg?v=a931d45b"); }
}
@media (max-width: 700px) {
  :root { --gutter: 12px; --cta-h: 176px; }
  .cta { flex-direction: column; justify-content: center; text-align: center; gap: 10px; padding-top: 16px; }
  .cta-words { align-items: center; }
  .steps { gap: 12px; margin-top: 14px; }
  textarea.field-input { min-height: 48px; }
  .sheet-lead { font-size: 15px; }
  .consent { margin-top: 14px; }
  .cta-group { margin-top: 16px; }
}
@media (max-width: 560px) {
  .brand-name { font-size: 30px; }
  .video-wrap { border-radius: 18px; }
  .btn-big { width: 100%; }
  .cta-group { flex-direction: column; }
  .cta-group .btn { width: 100%; }
  .sheet { width: calc(100vw - 20px); border-radius: 22px; }
  .sheet-body { padding: 20px 18px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .btn-big:hover { transform: none; }
}
