@font-face {
  font-family: Zofia Hand;
  src: url("/assets/comic-hand.woff2") format("woff2");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #111410;
  --panel: #1b2019;
  --card: #1e241c;
  --text: #f3f5ea;
  --muted: #bec7b7;
  --line: #566450;
  --control: #8d9b85;
  --accent: #c6ff3d;
  --ink: #17220a;
  --focus: #c6ff3d;
  --outgoing: #314325;
  --max: 76rem;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --bg: #f6f7ed;
    --panel: #e9eee2;
    --card: #fbfcf5;
    --text: #192219;
    --muted: #4a5647;
    --line: #697961;
    --control: #647459;
    --focus: #395d11;
    --outgoing: #dfeccd;
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f7ed;
  --panel: #e9eee2;
  --card: #fbfcf5;
  --text: #192219;
  --muted: #4a5647;
  --line: #697961;
  --control: #647459;
  --focus: #395d11;
  --outgoing: #dfeccd;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.6 system-ui, sans-serif;
  overflow-wrap: anywhere;
}
a { color: inherit; text-underline-offset: .24em; }
button, input { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
h1, h2, h3, p, figure, blockquote { margin: 0; }
h1, h2, h3 { line-height: 1.05; letter-spacing: -.055em; text-wrap: balance; }
h1 { font-size: clamp(3rem, 7vw, 7.25rem); }
h2 { font-size: clamp(2.05rem, 4.65vw, 4.35rem); font-weight: 690; }
h3 { font-size: clamp(1.7rem, 3vw, 2.45rem); font-weight: 680; }
p + p { margin-top: .75rem; }
[id] { scroll-margin-block-start: 1.5rem; }
.wrap { width: min(var(--max), calc(100% - clamp(2.25rem, 10vw, 10rem))); margin-inline: auto; }
.skip {
  position: absolute;
  z-index: 1;
  inset: .5rem auto auto .5rem;
  translate: 0 -160%;
  background: var(--accent);
  color: var(--ink);
  padding: .6rem 1rem;
}
.skip:focus { translate: 0; }

.site-header { border-bottom: 1px solid var(--line); }
.header-inner { min-height: 4.75rem; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem clamp(.8rem, 3vw, 2.5rem); }
.wordmark { text-decoration: none; font-size: 1.12rem; font-weight: 800; letter-spacing: -.04em; margin-inline-end: auto; display: inline-flex; gap: .6rem; align-items: center; min-height: 44px; }
.wordmark::before {
  content: "";
  width: .87rem;
  height: .87rem;
  border: 1px solid #587b1a;
  border-radius: 45% 57% 43% 23%;
  background: var(--accent);
  transform: rotate(-15deg);
}
.site-nav, .themes { display: flex; flex-wrap: wrap; align-items: center; }
.site-nav { gap: 0 clamp(.85rem, 2vw, 1.65rem); }
.site-nav a, .footer-links a, .text-action, .portrait-controls button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.site-nav a { text-decoration-color: transparent; font-weight: 650; }
.site-nav a:hover, .wordmark:hover, .site-nav a[aria-current] { text-decoration: underline; }
.themes { border: 1px solid var(--control); border-radius: 2rem; }
.themes button {
  padding: .25rem .8rem;
  min-height: 44px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  font-size: .9rem;
  font-weight: 680;
}
.themes [aria-pressed="true"], .action.primary { background: var(--accent); color: var(--ink); }
.themes button:hover:not([aria-pressed="true"]) { background: var(--card); }
.action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 48px;
  border: 1px solid #587b1a;
  border-radius: .42rem;
  padding: .65rem 1.23rem;
  font-weight: 760;
  text-decoration: none;
  line-height: 1.25;
}
.action.primary:hover { background: #d6ff72; }
.action.outline { color: var(--text); border-color: var(--control); }
.action.outline:hover { background: var(--panel); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.13fr) minmax(0, .87fr);
  align-items: center;
  gap: clamp(.85rem, 3vw, 2rem) clamp(2.2rem, 8vw, 8.5rem);
  padding-block: clamp(2.4rem, 4.8vw, 4.8rem) 1.55rem;
}
.hero h1 {
  font-size: clamp(4.1rem, 10.1vw, 10rem);
  line-height: .96;
  letter-spacing: -.085em;
  text-wrap: initial;
}
.hero-line {
  margin-top: 1.2rem;
  font-size: clamp(1.45rem, 2.7vw, 2.55rem);
  line-height: 1.2;
  font-weight: 560;
  letter-spacing: -.043em;
  text-wrap: balance;
}
.hero-copy .hero-line { max-width: 24ch; }
.hero blockquote {
  max-width: 28rem;
  margin-top: clamp(1.2rem, 3vw, 2.15rem);
  border-inline-start: 2px solid var(--focus);
  padding-inline-start: .9rem;
  color: var(--muted);
  font: clamp(1.22rem, 2.05vw, 1.6rem)/1.27 "Zofia Hand", cursive;
}
.hero-copy .action { margin-top: clamp(1.2rem, 2.6vw, 2rem); }
.hero-film {
  position: relative;
  isolation: isolate;
  width: min(100%, 22rem);
  justify-self: center;
}
.hero-film::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -.65rem -.6rem 3.3rem .6rem;
  border: 1px solid var(--focus);
  border-radius: .6rem;
  rotate: 2.5deg;
}
.hero-film video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 9/16;
  border: 1px solid var(--line);
  border-radius: .6rem;
  background: #10150e;
}
.hero-film figcaption { margin-top: .68rem; padding-inline: .1rem; color: var(--muted); font-size: .875rem; line-height: 1.42; }
.transcript { grid-column: 1 / -1; width: 100%; border-top: 1px solid var(--line); padding-top: .2rem; }
.transcript summary { min-height: 44px; font-weight: 660; padding: .55rem 0; line-height: 1.6; }
.transcript p { color: var(--muted); max-width: 67ch; }

.band { background: var(--panel); border-block: 1px solid var(--line); }
.story {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.25rem, 3.5vw, 3.4rem);
  padding-block: clamp(2.35rem, 6vw, 4.6rem);
}
.story > div { border-top: 2px solid var(--control); padding-top: 1.1rem; }
.story h2 { font-size: clamp(1.45rem, 2.4vw, 2.45rem); margin-bottom: .85rem; text-wrap: initial; }
.story p, .terms p, .plan-notes, .about-team p { color: var(--muted); max-width: 63ch; }

.section { padding-block: clamp(2.65rem, 6.3vw, 5.35rem); }
.section-intro { display: grid; align-items: end; grid-template-columns: 1.08fr 1fr; gap: 1.35rem 3rem; margin-bottom: 2rem; }
.section-intro h2 { text-wrap: initial; }
.section-intro p { color: var(--muted); max-width: 46ch; }
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; }
.plan {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: .5rem;
  padding: clamp(1.12rem, 2.65vw, 2rem);
}
.plan-chat { border-color: var(--focus); }
.plan-state { margin-bottom: .85rem; font-weight: 700; font-size: .9rem; color: var(--muted); }
.plan-chat .plan-state { color: var(--focus); }
.plan h3, .plan h2 { text-wrap: initial; }
.plan h2 { font-size: clamp(1.8rem, 3.3vw, 3.1rem); }
.price { margin-top: .75rem; line-height: 1.25; }
.price strong { display: block; font-size: clamp(1.5rem, 3vw, 2.4rem); letter-spacing: -.045em; }
.price span { color: var(--muted); }
.plan-specs { margin: 1.05rem 0 1.35rem; padding-inline-start: 1.15rem; }
.plan:not(.plan-chat) .plan-specs { margin-bottom: .25rem; }
.plan .action { width: 100%; margin-top: auto; }
#plans .plan-notes { margin-top: 1.3rem; }

.home-about, .about-hero, .about-team, .chat-hero, .chat-plan, .terms { display: grid; align-items: center; gap: clamp(1.45rem, 6vw, 6rem); }
.home-about, .about-hero, .about-team { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
.home-about h2 { max-width: 12ch; }
.about-motto { margin-top: .9rem; font-size: clamp(1.22rem, 2.4vw, 2.1rem); line-height: 1.2; letter-spacing: -.025em; }
.text-action { margin-top: .45rem; font-weight: 680; }
.portrait { position: relative; min-width: 0; width: min(100%, 26rem); justify-self: center; }
.portrait-frame { position: relative; isolation: isolate; aspect-ratio: 1; }
.portrait-frame::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -.48rem .7rem .75rem -.45rem;
  border: 1px solid var(--focus);
  border-radius: 6% 33% 7% 7% / 8% 30% 6% 6%;
  rotate: -1.6deg;
}
.portrait-frame img, .portrait-frame video, .about-portrait img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 5% 31% 5% 5% / 5% 28% 5% 5%;
}
.portrait-frame[data-interactive] { cursor: pointer; }
.portrait-controls { display: flex; flex-wrap: wrap; column-gap: 1rem; justify-content: flex-end; margin-top: .4rem; }
.portrait-controls button { border: 0; background: transparent; padding: .2rem .25rem; text-decoration: underline; text-underline-offset: .24em; font-weight: 650; }
.about-portrait figcaption { margin-top: .6rem; color: var(--muted); }
.about-hero h1 { max-width: 10ch; }
.inline-actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.8rem; }
.about-team h2 { font-size: clamp(1.9rem, 3.5vw, 3.4rem); }
.about-team p { font-size: clamp(1.08rem, 1.65vw, 1.4rem); }

.chat-hero { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); }
.chat-intro h1 { font-size: clamp(3.2rem, 7.2vw, 7.5rem); line-height: .99; }
.chat-intro .hero-line { max-width: 27ch; font-size: clamp(1.18rem, 2.3vw, 1.85rem); }
.chat-area { min-width: 0; }
.demo-notice {
  color: var(--muted);
  border-inline-start: 2px solid var(--focus);
  padding-inline-start: .78rem;
  margin: 0 0 .85rem;
  line-height: 1.45;
}
.chat-panel {
  border: 1px solid var(--control);
  border-radius: .72rem;
  background: var(--card);
  padding: clamp(.8rem, 2.4vw, 1.35rem);
}
.chat-log {
  block-size: clamp(15rem, 34vh, 20rem);
  overflow: auto;
  overscroll-behavior: contain;
  padding: .25rem .3rem .4rem;
  scrollbar-gutter: stable;
}
.message {
  width: fit-content;
  max-width: min(92%, 41ch);
  padding: .65rem .84rem;
  border-radius: .75rem .75rem .75rem .12rem;
  background: var(--panel);
  border: 1px solid var(--control);
  line-height: 1.45;
}
.message + .message { margin-top: .65rem; }
.message strong { display: block; margin-bottom: .22rem; font-size: .9rem; }
.message p { white-space: pre-wrap; }
.message-you { margin-inline-start: auto; border-radius: .75rem .75rem .12rem .75rem; background: var(--outgoing); }
#chat-form { border-top: 1px solid var(--line); padding-top: .75rem; margin-top: .65rem; }
#chat-form label { display: block; font-weight: 670; margin-bottom: .3rem; }
.composer { display: flex; flex-wrap: wrap; gap: .55rem; }
.composer input {
  flex: 1 1 8rem;
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--control);
  border-radius: .4rem;
  background: var(--bg);
  padding-inline: .75rem;
}
.composer button[aria-disabled] { cursor: progress; }
.input-note { color: var(--muted); margin-top: .4rem; font-size: .875rem; }
.chat-noscript { padding-top: .75rem; color: var(--muted); }
.chat-plan { grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr); }
.terms { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: start; }
.terms h2 { font-size: clamp(1.9rem, 3.4vw, 3.15rem); margin-bottom: .85rem; text-wrap: initial; }

.site-footer { background: var(--panel); border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem 1.4rem; padding-block: 1rem; }
.footer-brand { font-size: 1.08rem; font-weight: 750; padding-block: .6rem; }
.footer-inner p { color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 0 1.05rem; margin-inline-start: auto; }

@media (max-width: 52rem) {
  .hero { grid-template-columns: 1fr 1fr; column-gap: 2rem; }
  .hero h1 { font-size: clamp(3.5rem, 9.5vw, 5.8rem); }
  .story { gap: 1.35rem; }
  .chat-hero { gap: 1.65rem; }
  .footer-links { margin-inline-start: 0; }
}

@media (max-width: 42rem) {
  .header-inner { min-height: 0; padding-block: .3rem .45rem; }
  .wordmark { flex-basis: 100%; }
  .site-nav { flex: 1; }
  .themes button { padding-inline: .6rem; }
  .hero, .story, .section-intro, .plan-grid, .home-about, .about-hero,
  .about-team, .chat-hero, .chat-plan, .terms { grid-template-columns: 1fr; }
  .hero { row-gap: 1.35rem; padding-block: 1.7rem .9rem; }
  .hero h1 { font-size: clamp(3.45rem, 13vw, 5.5rem); }
  .hero-line { margin-top: .6rem; }
  .hero blockquote { margin-top: 1.1rem; }
  .hero-copy .action { margin-top: 1.05rem; }
  .hero-film { width: min(100%, 14.75rem); }
  .section-intro { gap: .65rem; margin-bottom: 1.35rem; }
  .plan { padding: 1.2rem; }
  .home-about .portrait { width: min(100%, 21rem); }
  .about-hero .portrait { width: min(100%, 21rem); }
  .chat-hero { padding-top: 2rem; }
  .chat-intro h1 { font-size: clamp(2.65rem, 10.4vw, 4.25rem); }
  .chat-log { block-size: 19.25rem; }
}

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