/* Stick Figure Storytime — site styles. Colours match lib/theme/palette.dart. */

@font-face {
  font-family: 'Permanent Marker';
  src: url('/fonts/permanent-marker.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Patrick Hand';
  src: url('/fonts/patrick-hand.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Nunito';
  src: url('/fonts/nunito.woff2') format('woff2');
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --paper: #fbf6ec;
  --paper-deep: #f2e8d5;
  --card: #fffdf8;
  --ink: #1d1a2f;
  --ink-soft: #5b5670;
  --rule: #cfe0ee;
  --margin: #f2a39b;
  --note: #fff3c4;

  --tomato: #ff5a4e;
  --sky: #2e9bff;
  --lime: #4cb82e;
  --grape: #7b4af2;
  --amber: #f2a100;
  --bubblegum: #ff5fa8;

  --house: #2a2342;
  --velvet: #b3202c;
  --gold: #f2b33d;
  --chalk: #26332f;
  --chalk-lime: #bdf28a;

  --marker: 'Permanent Marker', 'Marker Felt', cursive;
  --hand: 'Patrick Hand', 'Chalkboard SE', 'Comic Sans MS', cursive;
  --body: 'Nunito', ui-rounded, system-ui, -apple-system, sans-serif;

  --gutter: 24px;
  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--paper);
  background-image: radial-gradient(rgba(46, 111, 168, 0.09) 1.4px, transparent 1.6px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.6;
  overflow-x: clip;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--tomato);
}

:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 3px;
  border-radius: 6px;
}

h1,
h2,
h3 {
  font-family: var(--marker);
  font-weight: 400;
  line-height: 1.12;
  margin: 0 0 0.4em;
  letter-spacing: 0.01em;
}

h1 {
  font-size: clamp(2.6rem, 6.4vw, 4.6rem);
}

h2 {
  font-size: clamp(2.1rem, 4.6vw, 3.3rem);
}

h3 {
  font-size: 1.45rem;
}

p {
  margin: 0 0 1em;
}

.wrap {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 10;
  background: var(--card);
  padding: 8px 14px;
  border: 3px solid var(--ink);
  border-radius: 12px;
}

.kicker {
  font-family: var(--hand);
  font-size: 1.35rem;
  line-height: 1.3;
  margin: 0 0 0.35em;
  color: var(--ink-soft);
}

.lede {
  font-size: 1.2rem;
  max-width: 34em;
}

/* ---------- Header & footer ---------- */

.site-header {
  padding: 18px 0;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--marker);
  font-size: 1.3rem;
  line-height: 1.1;
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  border: 2.5px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}

.site-nav {
  display: flex;
  gap: 22px;
  font-weight: 800;
  font-size: 1rem;
}

.site-nav a {
  text-decoration: none;
}

.site-nav a:hover {
  text-decoration: underline wavy var(--tomato) 2px;
}

.site-footer {
  background: var(--ink);
  color: #e9e5f5;
  padding: 44px 0 52px;
  font-size: 0.95rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 32px;
}

.site-footer .brand img {
  box-shadow: 3px 3px 0 var(--tomato);
  border-color: var(--card);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-weight: 800;
}

.site-footer a {
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--gold);
}

.site-footer small {
  display: block;
  width: 100%;
  color: #a9a3bf;
  font-size: 0.85rem;
}

/* ---------- Sketchy building blocks ---------- */

.sketch {
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: 6px 6px 0 var(--ink);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 1.2em 0 0;
  list-style: none;
}

.chips li {
  background: var(--card);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  padding: 3px 14px;
  font-size: 0.95rem;
  font-weight: 800;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: var(--ink);
  color: #fff;
  border: 3px solid var(--ink);
  border-radius: 16px;
  min-width: 256px;
  padding: 10px 22px 10px 16px;
  box-shadow: 5px 5px 0 var(--tomato);
  text-decoration: none;
  line-height: 1.15;
}

a.store-badge:hover {
  color: #fff;
  transform: translate(-1px, -1px);
  box-shadow: 6px 6px 0 var(--tomato);
}

.store-badge svg {
  width: 30px;
  height: 30px;
  flex: none;
}

.store-badge small {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
}

.store-badge strong {
  display: block;
  font-size: 1.25rem;
  font-weight: 900;
}

/* Phone and tablet frames, drawn like the App Store screenshots. */
.device {
  position: relative;
  background: var(--card);
  border: 4px solid var(--ink);
  padding: 9px;
  box-shadow: 12px 12px 0 var(--ink);
}

.device img {
  border: 2px solid var(--ink);
  width: 100%;
}

.phone {
  width: min(300px, 74vw);
  border-radius: 46px;
}

.phone img {
  border-radius: 36px;
}

.tablet {
  width: min(520px, 100%);
  border-radius: 34px;
}

.tablet img {
  border-radius: 24px;
}

.tilt-left {
  transform: rotate(-2.2deg);
}

.tilt-right {
  transform: rotate(2deg);
}

/* ---------- Hero ---------- */

.hero {
  padding: 28px 0 90px;
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: 48px;
}

.hero h1 .accent {
  color: var(--tomato);
  text-shadow: 3px 3px 0 var(--ink);
}

.hero .squiggle {
  display: block;
  width: 260px;
  max-width: 70%;
  height: 18px;
  margin: -0.2em 0 0.9em;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 22px;
}

.hero .badges {
  margin-top: 1.8em;
}

.hero .chips li {
  font-size: 0.85rem;
  border-width: 2px;
  padding: 2px 12px;
}

.hero-art {
  position: relative;
  display: flex;
  justify-content: flex-end;
  padding: 10px 28px 0 0;
}

.jumper {
  position: absolute;
  left: -24px;
  bottom: 4%;
  width: 160px;
  z-index: 2;
}

.bubble {
  position: absolute;
  left: -40px;
  bottom: calc(4% + 222px);
  z-index: 2;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 18px;
  padding: 6px 14px;
  font-family: var(--hand);
  font-size: 1.3rem;
  line-height: 1.2;
  box-shadow: 4px 4px 0 var(--ink);
  transform: rotate(-4deg);
}

.bubble::after {
  content: '';
  position: absolute;
  left: 52px;
  bottom: -13px;
  width: 18px;
  height: 18px;
  background: var(--card);
  border-right: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  transform: rotate(45deg) skew(10deg, 10deg);
}

.doodle-star {
  position: absolute;
  width: 46px;
  height: 46px;
}

.hero .star-a {
  right: 2%;
  top: 0;
  transform: rotate(12deg);
}

.hero .star-b {
  right: -8px;
  bottom: 18%;
  width: 30px;
  height: 30px;
}

.jumper .body {
  animation: jump 1.6s cubic-bezier(0.3, 0, 0.3, 1) infinite;
  transform-origin: 100px 230px;
  transform-box: view-box;
}

.jumper .shadow {
  animation: shadow 1.6s cubic-bezier(0.3, 0, 0.3, 1) infinite;
  transform-origin: 100px 236px;
  transform-box: view-box;
}

@keyframes jump {
  0%,
  100% {
    transform: translateY(0) scale(1.06, 0.92);
  }
  12% {
    transform: translateY(0) scale(1, 1);
  }
  45% {
    transform: translateY(-26px) scale(0.97, 1.04);
  }
  80% {
    transform: translateY(0) scale(1, 1);
  }
}

@keyframes shadow {
  0%,
  12%,
  80%,
  100% {
    transform: scaleX(1);
    opacity: 0.18;
  }
  45% {
    transform: scaleX(0.7);
    opacity: 0.09;
  }
}

/* ---------- How it works ---------- */

.how {
  padding: 40px 0 100px;
}

.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 44px;
}

.notebook {
  position: relative;
  max-width: 900px;
  margin: 0 auto 56px;
  padding: 34px 34px 34px 84px;
  background-image: linear-gradient(to right, transparent 60px, var(--margin) 60px, var(--margin) 62px, transparent 62px);
}

.sentence {
  font-family: var(--hand);
  font-size: clamp(1.8rem, 5vw, 3.3rem);
  line-height: 1.25;
  margin: 0;
}

.anno mark {
  line-height: 1.1;
  padding: 2px 6px;
}

.anno {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: top;
}

.anno small {
  font-size: 1.2rem;
  line-height: 1.15;
  margin-top: 6px;
  text-align: center;
  max-width: 9em;
}

.anno small::before {
  content: '\2191';
  display: block;
  font-family: var(--body);
  font-weight: 900;
}

.hl-tomato {
  background: rgba(255, 90, 78, 0.24);
  color: #c6362c;
}

.hl-sky {
  background: rgba(46, 155, 255, 0.24);
  color: #1f6fbf;
}

mark {
  color: inherit;
  padding: 0 4px;
  border-radius: 4px;
}

.verb {
  text-decoration: underline wavy;
  text-decoration-thickness: 2px;
  text-underline-offset: 7px;
}

.verb.t {
  text-decoration-color: var(--tomato);
}

.anno .tc {
  color: #c6362c;
}

.anno .sc {
  color: #1f6fbf;
}

.anno .ic {
  color: var(--ink-soft);
}

.pow {
  display: inline-block;
  font-family: var(--marker);
  color: var(--amber);
  text-shadow: 2px 2px 0 var(--ink);
  transform: rotate(-6deg);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  padding: 0;
  margin: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding: 30px 26px 22px;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  top: -20px;
  left: 22px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  font-family: var(--marker);
  font-size: 1.3rem;
  color: #fff;
  background: var(--tomato);
  border: 3px solid var(--ink);
  border-radius: 50%;
  box-shadow: 3px 3px 0 var(--ink);
}

.steps li:nth-child(2)::before {
  background: var(--sky);
}

.steps li:nth-child(3)::before {
  background: var(--lime);
}

.steps p {
  margin: 0;
  font-size: 1.02rem;
}

/* ---------- Coloured feature bands ---------- */

.band {
  position: relative;
  padding: 96px 0;
}

.band .wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 60px;
}

.band.flip .copy {
  order: 2;
}

.band .art {
  display: flex;
  justify-content: center;
}

.band h2 {
  color: #fff;
  text-shadow: 4px 4px 0 var(--ink);
}

.band .kicker {
  color: inherit;
  opacity: 0.9;
}

.band p {
  font-size: 1.12rem;
}

.theater {
  background: var(--house);
  color: #f1edfb;
  padding-top: 120px;
}

.theater::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 44px;
  background:
    radial-gradient(circle at 50% 0, var(--velvet) 23px, var(--ink) 24px, var(--ink) 26.5px, transparent 27px) 0 18px / 52px 26px repeat-x,
    linear-gradient(var(--velvet) 0 20px, var(--ink) 20px 23px, transparent 23px);
}

.theater h2 {
  color: var(--gold);
}

.theater .device {
  box-shadow: 12px 12px 0 #0d0b18;
  border-color: #0d0b18;
}

.party {
  background: var(--sky);
}

.party .device,
.cast .device {
  box-shadow: 12px 12px 0 var(--ink);
}

.chalkband {
  background-color: var(--chalk);
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1.4px, transparent 1.6px);
  background-size: 22px 22px;
  color: #e6efe9;
}

.chalkband h2 {
  color: var(--chalk-lime);
}

.chalkband .device {
  box-shadow: 12px 12px 0 #0f1614;
  border-color: #0f1614;
}

.chalkband .chips li {
  background: transparent;
  color: var(--chalk-lime);
  border-color: var(--chalk-lime);
  border-style: dashed;
}

.cast {
  background: var(--grape);
  color: #fff;
}

/* ---------- Privacy ---------- */

.privacy {
  padding: 100px 0;
}

.privacy .wrap {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 60px;
  align-items: center;
}

.promises {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 1.6em 0;
  padding: 0;
  list-style: none;
}

.promises li {
  padding: 16px 18px;
  border-radius: 16px;
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 0.98rem;
  line-height: 1.45;
}

.promises strong {
  display: block;
  font-family: var(--marker);
  font-weight: 400;
  font-size: 1.15rem;
  margin-bottom: 2px;
}

.promises li:nth-child(1) strong {
  color: #d23a2f;
}
.promises li:nth-child(2) strong {
  color: #1f6fbf;
}
.promises li:nth-child(3) strong {
  color: #2f7d18;
}
.promises li:nth-child(4) strong {
  color: #6a3be0;
}

.text-link {
  font-weight: 800;
}

/* ---------- Audience sticky notes ---------- */

.audience {
  padding: 30px 0 110px;
}

.notes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.notes li {
  padding: 22px 20px 20px;
  border: 3px solid var(--ink);
  border-radius: 6px 6px 22px 6px;
  box-shadow: 5px 5px 0 var(--ink);
  font-size: 1rem;
  line-height: 1.45;
}

.notes li:nth-child(1) {
  background: var(--note);
  transform: rotate(-1.6deg);
}
.notes li:nth-child(2) {
  background: #ffe1dd;
  transform: rotate(1.2deg);
}
.notes li:nth-child(3) {
  background: #dcefff;
  transform: rotate(-0.8deg);
}
.notes li:nth-child(4) {
  background: #e3f5da;
  transform: rotate(1.6deg);
}

.notes strong {
  display: block;
  font-family: var(--hand);
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.15;
  margin-bottom: 6px;
}

/* ---------- Final call to action ---------- */

.finale {
  background: var(--tomato);
  padding: 90px 0 100px;
  text-align: center;
}

.finale h2 {
  color: #fff;
  text-shadow: 4px 4px 0 var(--ink);
}

.finale p {
  font-size: 1.15rem;
}

.finale .badges {
  justify-content: center;
  margin-top: 0.8em;
}

.finale .store-badge {
  box-shadow: 5px 5px 0 var(--card);
}

.finale .doodle-star {
  position: static;
  display: inline-block;
  vertical-align: middle;
  margin: 0 8px;
}

/* ---------- Document pages (privacy, support, 404) ---------- */

.doc {
  padding: 24px 0 100px;
}

.doc .sheet {
  max-width: 780px;
  margin: 0 auto;
  padding: 48px 56px 40px;
}

.doc h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
}

.doc h2 {
  font-size: 1.6rem;
  margin-top: 1.6em;
}

.doc .updated {
  font-family: var(--hand);
  font-size: 1.2rem;
  color: var(--ink-soft);
}

.doc .summary {
  background: var(--note);
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  padding: 14px 18px;
  font-weight: 700;
}

.faq details {
  border-top: 2px dashed var(--rule);
  padding: 14px 0;
}

.faq details:last-of-type {
  border-bottom: 2px dashed var(--rule);
}

.faq summary {
  cursor: pointer;
  font-weight: 900;
  font-size: 1.1rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '+';
  font-family: var(--marker);
  color: var(--tomato);
  font-size: 1.4rem;
  line-height: 1;
}

.faq details[open] summary::after {
  content: '\2013';
}

.faq details p {
  margin: 10px 0 4px;
}

.contact-card {
  margin-top: 36px;
  padding: 22px 24px;
  background: #dcefff;
  border: 2.5px solid var(--ink);
  border-radius: 16px;
  box-shadow: 4px 4px 0 var(--ink);
}

.contact-card h2 {
  margin-top: 0;
}

.lost {
  text-align: center;
}

.lost svg {
  width: 220px;
  margin: 0 auto 10px;
}

/* ---------- Responsive ---------- */

@media (max-width: 940px) {
  .hero .wrap,
  .band .wrap,
  .privacy .wrap {
    grid-template-columns: 1fr;
    gap: 56px;
  }

  .band.flip .copy {
    order: 0;
  }

  .hero {
    padding-bottom: 70px;
  }

  .hero-art {
    justify-content: center;
    padding-right: 0;
  }

  .jumper {
    left: max(-10px, calc(50% - 310px));
  }

  .bubble {
    left: max(-6px, calc(50% - 326px));
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 34px;
    max-width: 560px;
    margin: 0 auto;
  }

  .notes {
    grid-template-columns: 1fr 1fr;
  }

  .band,
  .privacy {
    padding: 80px 0;
  }

  .theater {
    padding-top: 110px;
  }
}

@media (max-width: 720px) {
  :root {
    --gutter: 16px;
  }

  body {
    font-size: 17px;
  }

  .site-nav .wide {
    display: none;
  }

  .site-nav {
    gap: 16px;
  }

  .brand {
    font-size: 1.05rem;
  }

  .brand img {
    width: 38px;
    height: 38px;
  }

  .hero-art {
    justify-content: flex-end;
    padding-right: 12px;
  }

  .hero .phone {
    width: 68vw;
  }

  .jumper {
    width: 112px;
    left: -10px;
  }

  .bubble {
    left: -6px;
    bottom: calc(4% + 156px);
    font-size: 1.1rem;
    padding: 4px 10px;
  }

  .bubble::after {
    left: 34px;
  }

  .notebook {
    padding: 24px 18px 24px 44px;
    background-image: linear-gradient(to right, transparent 28px, var(--margin) 28px, var(--margin) 30px, transparent 30px);
  }

  .anno small {
    font-size: 0.9rem;
  }

  .promises,
  .notes {
    grid-template-columns: 1fr;
  }

  .doc .sheet {
    padding: 32px 22px 28px;
  }

  .device {
    box-shadow: 8px 8px 0 var(--ink);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .jumper .body,
  .jumper .shadow {
    animation: none;
  }

  .wobble {
    filter: none;
  }
}
