/* storyzapp.tv — "Night sky": the app's own purple and golden lightning. */
@font-face {
  font-family: "Fredoka";
  src: url("/site/fonts/fredoka.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --night: #231a4a;
  --dusk: #4b3a8f;
  --deep: #170f33;
  --zap: #ffd84a;
  --zap-deep: #f2a93b;
  --page: #fff6df;
  --ink: #241a45;
  --mint: #7be0a8;
  --soft: rgba(255, 255, 255, 0.78);
  --line: rgba(255, 255, 255, 0.16);
  --round: "Fredoka", ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: min(1120px, 100% - 40px);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0;
  color: #fff;
  font: 17px/1.6 var(--body);
  background:
    radial-gradient(900px 600px at 12% -10%, #5a46a8 0%, transparent 60%),
    radial-gradient(700px 500px at 100% 30%, rgba(75, 58, 143, 0.55) 0%, transparent 70%),
    var(--night);
  background-attachment: scroll;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--zap); }
h1, h2, h3 { font-family: var(--round); font-weight: 600; line-height: 1.12; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: clamp(30px, 4.2vw, 44px); }
h3 { font-size: 21px; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--zap); outline-offset: 3px; border-radius: 6px; }

/* sparse "stars", one fixed layer */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 8% 22%, #fff9 50%, transparent 51%),
    radial-gradient(1px 1px at 31% 8%, #fff7 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 57% 15%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 76% 6%, #fff6 50%, transparent 51%),
    radial-gradient(2px 2px at 92% 18%, #ffd84a99 50%, transparent 51%),
    radial-gradient(1px 1px at 18% 64%, #fff5 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 88% 72%, #fff6 50%, transparent 51%),
    radial-gradient(1px 1px at 45% 88%, #fff5 50%, transparent 51%);
}

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 26px;
  border: 0; border-radius: 999px;
  background: var(--zap); color: var(--night);
  font: 600 18px/1 var(--round); text-decoration: none; cursor: pointer;
  box-shadow: 0 4px 0 var(--zap-deep);
  transition: transform .12s ease, box-shadow .12s ease;
}
.button:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--zap-deep); }
.button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--zap-deep); }
.button:disabled { opacity: .6; cursor: progress; }

/* ---- top bar ---- */
.bar {
  width: var(--wrap); margin: 0 auto; padding: 18px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font: 600 22px/1 var(--round); }
.brand img { width: 40px; height: 40px; border-radius: 11px; }
.bar-join { color: var(--zap); font: 500 16px/1 var(--round); text-decoration: none; padding: 10px 2px; }
.bar-join:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---- hero ---- */
.hero {
  width: var(--wrap); margin: 0 auto; padding: 32px 0 72px;
  display: grid; grid-template-columns: 1fr 1.05fr; gap: 56px; align-items: center;
}
.made {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  background: rgba(255, 216, 74, 0.14); color: var(--zap);
  font: 500 15px/1.2 var(--round); margin-bottom: 18px;
}
.hero h1 { font-size: clamp(38px, 5.4vw, 62px); font-weight: 700; }
.hero h1 em { font-style: normal; color: var(--zap); display: block; }
.lead { margin-top: 22px; font-size: 19px; color: var(--soft); max-width: 34em; }
.sig { margin-top: 16px; font: 500 20px/1.3 var(--round); color: var(--zap); }
.hero-actions { margin-top: 30px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.watch {
  display: inline-flex; align-items: center; gap: 10px;
  background: none; border: 0; padding: 8px 0; cursor: pointer;
  color: #fff; font: 500 18px/1 var(--round);
}
.watch-dot {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  display: grid; place-items: center;
}
.watch-dot::before { content: ""; border-left: 13px solid #fff; border-top: 8px solid transparent; border-bottom: 8px solid transparent; margin-left: 4px; }
.watch:hover .watch-dot { background: rgba(255, 255, 255, 0.24); }
.watch-len { color: rgba(255, 255, 255, 0.55); font-size: 15px; }

/* the TV: the page's one bold thing */
.tv { margin: 0; position: relative; }
.tv-screen {
  display: block; position: relative; width: 100%; padding: 0; cursor: pointer;
  border: 14px solid #120b2a; border-radius: 22px; overflow: hidden;
  background: #000;
  box-shadow: 0 0 0 2px #3a2d73, 0 30px 70px rgba(0, 0, 0, 0.55), 0 0 120px rgba(255, 216, 74, 0.12);
  transform: rotate(-1.2deg);
}
.tv-screen img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.tv-feet { display: block; width: 34%; height: 14px; margin: -2px auto 0; border-radius: 0 0 14px 14px; background: #120b2a; transform: rotate(-1.2deg); }
.tv figcaption { margin-top: 16px; text-align: center; color: rgba(255, 255, 255, 0.6); font: 400 15px/1.4 var(--round); }

/* the caption, like the app's: a yellow box; each word lights up in turn as it's "read" */
.caption {
  position: absolute; left: 4%; top: 5%; max-width: 72%;
  padding: 8px 12px; text-align: left;
  background: #fff3a6; color: #111; border: 3px solid #111; border-radius: 4px;
  box-shadow: 3px 3px 0 #111;
  font: 600 clamp(13px, 1.9vw, 21px)/1.25 var(--round);
}
.caption span { border-radius: 3px; padding: 0 1px; animation: read 7s infinite; }
.caption span:nth-child(1) { animation-delay: 0s; }
.caption span:nth-child(2) { animation-delay: .55s; }
.caption span:nth-child(3) { animation-delay: 1.1s; }
.caption span:nth-child(4) { animation-delay: 1.65s; }
.caption span:nth-child(5) { animation-delay: 2.2s; }
.caption span:nth-child(6) { animation-delay: 2.75s; }
.caption span:nth-child(7) { animation-delay: 3.3s; }
@keyframes read {
  0%, 7.8% { color: #c0392b; text-decoration: underline 3px; text-underline-offset: 3px; }
  8%, 100% { color: #111; text-decoration: none; }
}
.tv-play {
  position: absolute; right: 5%; bottom: 7%;
  width: 74px; height: 74px; border-radius: 50%;
  background: var(--zap); box-shadow: 0 6px 0 var(--zap-deep), 0 10px 30px rgba(0, 0, 0, 0.4);
  display: grid; place-items: center;
  transition: transform .15s ease;
}
.tv-play::before { content: ""; border-left: 24px solid var(--night); border-top: 15px solid transparent; border-bottom: 15px solid transparent; margin-left: 7px; }
.tv-screen:hover .tv-play { transform: scale(1.06); }

/* ---- sections ---- */
main > section:not(.hero) { width: var(--wrap); margin: 0 auto; padding: 72px 0; }
.section-lead { margin-top: 12px; color: var(--soft); font-size: 19px; max-width: 36em; }

/* what changed: one cream notebook page, not a card grid */
.changed {
  position: relative;
  background: var(--page); color: var(--ink);
  border-radius: 28px;
  padding: 56px clamp(24px, 5vw, 64px) !important;
  background-image: repeating-linear-gradient(transparent 0 35px, rgba(75, 58, 143, 0.09) 35px 36px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.changed h2 { color: var(--dusk); }
.notes { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 30px 48px; }
.notes h3 { color: var(--ink); font-size: 23px; }
.notes p { margin-top: 6px; color: #4a3f6b; }
.notes li { padding-left: 22px; border-left: 4px solid var(--zap); }

/* how it works: a real sequence, so numbered */
.steps { list-style: none; margin: 34px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; counter-reset: step; }
.steps li { counter-increment: step; }
.steps img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 16px; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35); }
.steps h3 { margin-top: 18px; display: flex; align-items: center; gap: 12px; }
.steps h3::before {
  content: counter(step);
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: var(--zap); color: var(--night);
  display: grid; place-items: center; font-size: 18px; font-weight: 700;
}
.steps p { margin-top: 8px; color: var(--soft); }

/* gentle */
.gentle { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 48px; align-items: start; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.checks li { position: relative; padding-left: 40px; font-size: 18px; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 3px;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(123, 224, 168, 0.18);
}
.checks li::after {
  content: ""; position: absolute; left: 8px; top: 8px;
  width: 10px; height: 6px; border-left: 3px solid var(--mint); border-bottom: 3px solid var(--mint);
  transform: rotate(-45deg);
}

/* will it work */
.chips { list-style: none; margin: 26px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.chips li { padding: 9px 16px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); font: 500 16px/1.2 var(--round); }
.chips li.no { background: none; border: 1.5px dashed rgba(255, 255, 255, 0.28); color: rgba(255, 255, 255, 0.55); }
.chips li.no span { font-size: 14px; }

/* the form */
.join {
  border-top: 1px solid var(--line);
}
#join-form, .done { margin-top: 30px; max-width: 620px; }
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field label { font: 500 16px/1.2 var(--round); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
input, select {
  width: 100%; min-height: 52px; padding: 0 16px;
  border: 1.5px solid rgba(255, 255, 255, 0.3); border-radius: 14px;
  background: rgba(255, 255, 255, 0.08); color: #fff;
  font: 17px var(--body);
}
input::placeholder { color: rgba(255, 255, 255, 0.45); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #fff 50%), linear-gradient(135deg, #fff 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
select option { color: var(--ink); background: #fff; }
input:focus, select:focus { border-color: var(--zap); outline: none; box-shadow: 0 0 0 3px rgba(255, 216, 74, 0.35); }
[aria-invalid="true"] { border-color: #ff9a8a; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.tv-note { margin: 0 0 18px; padding: 12px 16px; border-radius: 12px; background: rgba(255, 216, 74, 0.12); color: #ffe9a3; font-size: 16px; }
.status { margin-top: 14px; min-height: 1.6em; color: var(--soft); }
.status[data-kind="error"] { color: #ffb4a8; }
.done { padding: 32px; border-radius: 22px; background: rgba(255, 216, 74, 0.1); }
.done:focus { outline: none; }
.done-big { font: 700 30px/1.2 var(--round); color: var(--zap); margin-bottom: 8px; }

/* footer */
.foot {
  width: var(--wrap); margin: 0 auto; padding: 32px 0 48px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
  color: rgba(255, 255, 255, 0.55); font-size: 15px; border-top: 1px solid var(--line);
}
.foot a { color: rgba(255, 255, 255, 0.8); }

/* the video player */
.player {
  width: min(1100px, 94vw); padding: 0; border: 0; border-radius: 18px; overflow: visible;
  background: #000; color: #fff;
}
.player::backdrop { background: rgba(10, 6, 25, 0.86); }
.player video { width: 100%; display: block; border-radius: 18px; aspect-ratio: 16 / 9; background: #000; }
.video-close {
  position: absolute; top: -52px; right: 0;
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, 0.16); color: #fff; font-size: 20px;
}
.video-close:hover { background: rgba(255, 255, 255, 0.28); }
.video-error { padding: 80px 24px; text-align: center; font: 500 20px/1.4 var(--round); }

/* privacy page */
.prose { width: min(720px, 100% - 40px); margin: 0 auto; padding: 24px 0 72px; }
.prose h1 { font-size: clamp(34px, 5vw, 48px); margin-bottom: 18px; }
.prose h2 { font-size: 24px; margin: 36px 0 10px; }
.prose p, .prose li { color: var(--soft); }
.prose p + p { margin-top: 12px; }
.prose ul { padding-left: 22px; }

/* ---- phones ---- */
@media (max-width: 860px) {
  body { font-size: 16px; }
  .hero { grid-template-columns: 1fr; gap: 40px; padding: 16px 0 56px; }
  .tv-screen { border-width: 9px; border-radius: 16px; }
  .tv-play { width: 58px; height: 58px; }
  .tv-play::before { border-left-width: 19px; border-top-width: 12px; border-bottom-width: 12px; margin-left: 5px; }
  .lead, .section-lead { font-size: 17px; }
  main > section:not(.hero) { padding: 56px 0; }
  .notes, .gentle { grid-template-columns: 1fr; gap: 26px; }
  .steps { grid-template-columns: 1fr; gap: 34px; }
  .pair { grid-template-columns: 1fr; }
  .bar-join { display: none; }
  .video-close { top: -50px; }
}
@media (max-width: 860px) and (min-width: 560px) {
  .steps { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .caption span { animation: none; }
  .button, .tv-play { transition: none; }
  html { scroll-behavior: auto; }
}
