/* JokeBlitz — demo product made with 9orb.
   Fonts: Bricolage Grotesque 600/800 (SIL Open Font License 1.1, see fonts/OFL-LICENSE.txt).
   Images (banner, logo, mascot) are AI-generated. */
@font-face {
  font-family: "Bricolage";
  src: url("fonts/bricolage-800.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: "Bricolage";
  src: url("fonts/bricolage-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

:root {
  /* Token names shared with 9orb's accessibility pack (high-contrast swaps them). */
  --bg: #0e0620;
  --bg-2: #150a2e;
  --surface: #1b0e3b;
  --text: #f7f1ff;
  --muted: #cdc1ea;
  --border: rgba(255, 255, 255, 0.14);
  --primary: #ff3fa4;
  --accent: #ffd23f;
  --on-primary: #1a0631;
  --pink: #ff3fa4;
  --pink-deep: #df1f80;
  --sun: #ffd23f;
  --violet: #8b5cff;
  --violet-deep: #8a35e8;
  --cyan: #2ee6ff;
  --ink: #1a0631;
  --radius: 24px;
  --display: "Bricolage", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --glow-pink: 0 0 4px #fff, 0 0 14px var(--pink), 0 0 34px var(--pink), 0 0 70px rgba(255, 63, 164, 0.55);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}
body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}
a {
  color: var(--sun);
}
:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 3px;
}
h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
}
h2 {
  font-size: clamp(2rem, 4.2vw, 3.1rem);
}
h3 {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0;
}
p {
  margin: 0 0 1em;
}
.container {
  width: min(1180px, 100% - 48px);
  margin-inline: auto;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip-link {
  position: absolute;
  inset-inline-start: 12px;
  top: -80px;
  background: var(--sun);
  color: var(--ink);
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 10px;
  z-index: 100;
}
.skip-link:focus {
  top: 12px;
}
.eyebrow {
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sun);
  margin: 0 0 0.8rem;
}

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.1;
  letter-spacing: 0.005em;
  text-decoration: none;
  color: #fff;
  background: var(--btn-bg);
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.4rem;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.3, 1.6, 0.6, 1), box-shadow 0.25s ease, filter 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover {
  transform: translateY(-2px) scale(1.02);
}
.btn:active {
  transform: translateY(1px) scale(0.98);
}
.btn-small {
  font-size: 0.95rem;
  padding: 0.6rem 1.05rem;
}
.btn-large {
  font-size: 1.14rem;
  padding: 1rem 1.7rem;
}
.btn-hot {
  background: linear-gradient(120deg, var(--pink-deep), var(--violet-deep));
  box-shadow: 0 10px 30px -10px rgba(255, 63, 164, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-hot:hover {
  box-shadow: 0 14px 40px -8px rgba(255, 63, 164, 0.95), 0 0 0 4px rgba(255, 63, 164, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn-sun {
  background: var(--sun);
  color: var(--ink);
  box-shadow: 0 10px 28px -12px rgba(255, 210, 63, 0.9);
}
.btn-glass {
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.btn-glass:hover {
  background: rgba(255, 255, 255, 0.14);
}
.link-btn {
  font: inherit;
  font-size: 0.9rem;
  color: var(--muted);
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 0.3rem;
}
.link-btn:hover {
  color: #fff;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(14, 6, 32, 0.72);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: #fff;
}
.brand-logo {
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 4px 10px rgba(255, 63, 164, 0.45));
  transition: transform 0.4s cubic-bezier(0.3, 1.8, 0.5, 1);
}
.brand:hover .brand-logo {
  transform: rotate(-12deg) scale(1.1);
}
.brand-word {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}
.brand-word span {
  color: var(--sun);
}
.demo-pill {
  display: inline-block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--cyan);
  border-radius: 999px;
  padding: 0.22rem 0.6rem;
  line-height: 1.2;
}
.demo-pill-sm {
  font-size: 0.66rem;
  vertical-align: 0.1em;
}
.main-nav {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.97rem;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}
.nav-link:hover,
.nav-link[aria-current="page"] {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: clamp(560px, calc(100vh - 68px), 720px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 0 112px;
}
.hero-media {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: #0b0418;
}
.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% 45%;
  transform-origin: 62% 48%;
  animation: kenburns 28s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes kenburns {
  from {
    transform: scale(1.02);
  }
  to {
    transform: scale(1.15) translate(-1.2%, -1%);
  }
}
.hero-beam {
  position: absolute;
  top: -12%;
  left: var(--mic-x, 58%);
  width: min(50vw, 640px);
  height: 125%;
  margin-left: calc(min(50vw, 640px) / -2);
  background: linear-gradient(to bottom, rgba(255, 236, 196, 0.75), rgba(255, 220, 170, 0.18) 55%, rgba(255, 220, 170, 0) 88%);
  clip-path: polygon(45% 0, 55% 0, 100% 100%, 0 100%);
  mix-blend-mode: screen;
  opacity: 0.32;
  filter: blur(8px);
  transform-origin: 50% 0;
  animation: beam 9s ease-in-out infinite alternate;
}
@keyframes beam {
  from {
    transform: rotate(-11deg);
  }
  to {
    transform: rotate(9deg);
  }
}
.hero-spot {
  position: absolute;
  width: 70vmax;
  height: 70vmax;
  left: -20vmax;
  top: -25vmax;
  background: radial-gradient(closest-side, rgba(255, 63, 164, 0.32), rgba(139, 92, 255, 0.12) 55%, transparent);
  mix-blend-mode: screen;
  animation: roam 16s ease-in-out infinite alternate;
}
@keyframes roam {
  0% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(45vw, 18vh);
  }
  100% {
    transform: translate(85vw, -4vh);
  }
}
.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, var(--bg) 0%, rgba(14, 6, 32, 0) 32%),
    linear-gradient(90deg, rgba(14, 6, 32, 0.94) 0%, rgba(14, 6, 32, 0.8) 32%, rgba(14, 6, 32, 0.25) 58%, rgba(14, 6, 32, 0) 75%);
}
.hero-confetti {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.hero-inner {
  position: relative;
}
.hero-copy {
  max-width: 740px;
}
.eyebrow-hero {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  letter-spacing: 0.1em;
}
.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 0 rgba(46, 230, 255, 0.7);
  animation: ping 1.8s ease-out infinite;
}
@keyframes ping {
  0% {
    box-shadow: 0 0 0 0 rgba(46, 230, 255, 0.7);
  }
  100% {
    box-shadow: 0 0 0 12px rgba(46, 230, 255, 0);
  }
}
.hero h1 {
  font-size: clamp(2.5rem, 5.3vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin: 0.35em 0 0.34em;
  color: #fff;
}
.h1-line {
  display: block;
}
.neon {
  color: #ffe8f5;
  text-shadow: var(--glow-pink);
  animation: flicker-on 1.8s 0.35s both;
}
.nw {
  white-space: nowrap;
}
.flick {
  animation: buzz 7s 2.4s infinite;
}
@keyframes flicker-on {
  0% { opacity: 0.18; text-shadow: none; }
  8% { opacity: 1; text-shadow: var(--glow-pink); }
  11% { opacity: 0.25; text-shadow: none; }
  20% { opacity: 1; text-shadow: var(--glow-pink); }
  23% { opacity: 0.4; text-shadow: none; }
  34% { opacity: 1; text-shadow: var(--glow-pink); }
  100% { opacity: 1; text-shadow: var(--glow-pink); }
}
@keyframes buzz {
  0%, 88%, 91%, 94%, 100% { opacity: 1; }
  89%, 92.5% { opacity: 0.3; }
}
.lede {
  font-size: clamp(1.08rem, 1.5vw, 1.25rem);
  color: #efe7ff;
  max-width: 34em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}
.lede strong {
  color: var(--sun);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.6rem;
}
.hero-credit {
  position: absolute;
  inset-inline-end: 16px;
  bottom: 68px;
  margin: 0;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(14, 6, 32, 0.55);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

/* Marquee ticker (pure CSS, pauses on hover / focus) */
.ticker {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  overflow: hidden;
  background: rgba(14, 6, 32, 0.78);
  border-top: 1px solid rgba(255, 63, 164, 0.5);
  border-bottom: 1px solid rgba(139, 92, 255, 0.35);
  box-shadow: 0 -10px 40px -10px rgba(255, 63, 164, 0.35);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.ticker:focus-visible {
  outline-offset: -3px;
}
.ticker-track {
  display: flex;
  flex-shrink: 0;
  min-width: 100%;
  justify-content: space-around;
  list-style: none;
  margin: 0;
  padding: 0.85rem 0;
  animation: marquee 42s linear infinite;
}
.ticker:hover .ticker-track,
.ticker:focus .ticker-track,
.ticker:focus-within .ticker-track {
  animation-play-state: paused;
}
.ticker li {
  white-space: nowrap;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.02rem;
  padding: 0 1.3rem;
  color: #fff;
}
.ticker li::after {
  content: "★";
  color: var(--sun);
  margin-inline-start: 2.6rem;
  text-shadow: 0 0 10px rgba(255, 210, 63, 0.8);
}
.ticker b {
  color: var(--pink);
  text-shadow: 0 0 10px rgba(255, 63, 164, 0.8);
}
@keyframes marquee {
  to {
    transform: translateX(-100%);
  }
}

/* ---------- Reveal on scroll (only hidden when JS runs) ---------- */
html.js .reveal {
  opacity: 0;
  translate: 0 28px;
  transition: opacity 0.7s ease, translate 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
html.js .reveal.in {
  opacity: 1;
  translate: 0 0;
}

/* ---------- Generator ---------- */
.generator {
  position: relative;
  padding: 64px 0 56px;
  background:
    radial-gradient(60% 50% at 15% 10%, rgba(139, 92, 255, 0.22), transparent 70%),
    radial-gradient(50% 45% at 90% 40%, rgba(255, 63, 164, 0.16), transparent 70%);
}
.machine {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  border-radius: 30px;
  border: 2px solid transparent;
  background:
    linear-gradient(160deg, #1d0f40, #120828) padding-box,
    conic-gradient(from var(--angle), var(--pink), var(--sun), var(--cyan), var(--violet), var(--pink)) border-box;
  box-shadow: 0 40px 90px -40px rgba(255, 63, 164, 0.6), 0 0 140px -50px rgba(139, 92, 255, 0.8);
  animation: spin-border 7s linear infinite;
}
@keyframes spin-border {
  to {
    --angle: 360deg;
  }
}
.machine-input {
  padding: clamp(24px, 4vw, 44px);
  min-width: 0;
}
.machine-input h2 {
  margin-bottom: 0.3em;
}
.machine-intro {
  color: var(--muted);
  margin-bottom: 1.3rem;
}
.starters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.4rem;
}
.starters-label {
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 600;
}
.starter {
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: #ffeaa6;
  background: rgba(255, 210, 63, 0.08);
  border: 1.5px dashed rgba(255, 210, 63, 0.55);
  border-radius: 999px;
  padding: 0.38rem 0.8rem;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.3, 1.8, 0.5, 1), background 0.2s;
}
.starter:hover {
  transform: translateY(-2px) rotate(-2deg);
  background: rgba(255, 210, 63, 0.18);
}
.input-label {
  display: block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 0.45rem;
}
.input-wrap {
  position: relative;
}
.joke-input {
  display: block;
  width: 100%;
  min-height: 132px;
  resize: vertical;
  font: inherit;
  font-size: 1.18rem;
  line-height: 1.45;
  color: #fff;
  background: rgba(7, 2, 18, 0.65);
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  padding: 16px 18px 32px;
  box-shadow: 0 0 0 0 rgba(255, 63, 164, 0), 0 0 50px -18px rgba(255, 63, 164, 0.6);
  transition: border-color 0.25s, box-shadow 0.3s;
  animation: field-glow 3.6s ease-in-out infinite alternate;
}
@keyframes field-glow {
  from {
    box-shadow: 0 0 50px -24px rgba(255, 63, 164, 0.45);
  }
  to {
    box-shadow: 0 0 60px -14px rgba(139, 92, 255, 0.7);
  }
}
.joke-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}
.joke-input:focus {
  outline: none;
  border-color: var(--pink);
  animation: none;
  box-shadow: 0 0 0 4px rgba(255, 63, 164, 0.28), 0 0 60px -10px rgba(255, 63, 164, 0.75);
}
.joke-input.flash {
  animation: flash 0.9s ease;
}
@keyframes flash {
  0%, 100% {
    border-color: rgba(255, 255, 255, 0.18);
  }
  30% {
    border-color: var(--sun);
    box-shadow: 0 0 0 6px rgba(255, 210, 63, 0.35), 0 0 60px rgba(255, 210, 63, 0.5);
  }
}
.char-count {
  position: absolute;
  inset-inline-end: 16px;
  bottom: 9px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.6);
  pointer-events: none;
}
.input-hint {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0.5rem 0 0;
}
.styles {
  border: 0;
  margin: 1.3rem 0 1.5rem;
  padding: 0;
  min-width: 0;
}
.styles legend {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
  padding: 0;
  margin-bottom: 0.55rem;
}
.style-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.style-chip {
  position: relative;
  cursor: pointer;
}
.style-chip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}
.style-chip span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  transition: transform 0.25s cubic-bezier(0.3, 1.8, 0.5, 1), background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.style-chip:hover span {
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}
.style-chip input:checked + span {
  background: linear-gradient(120deg, var(--pink-deep), var(--violet-deep));
  border-color: transparent;
  box-shadow: 0 8px 22px -8px rgba(255, 63, 164, 0.9);
  transform: scale(1.05);
}
.style-chip input:focus-visible + span {
  outline: 3px solid var(--sun);
  outline-offset: 2px;
}
.btn-generate {
  position: relative;
  width: 100%;
  overflow: hidden;
  font-size: 1.22rem;
  padding: 1.1rem 1.5rem;
}
.btn-generate::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: shine 3.8s ease-in-out infinite;
}
@keyframes shine {
  0%, 55% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(120%);
  }
}
.btn-bolt {
  display: inline-block;
  transition: transform 0.3s;
}
.btn-generate:hover .btn-bolt {
  transform: rotate(14deg) scale(1.25);
}
.btn-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.btn-generate.loading,
.btn-generate:disabled {
  cursor: progress;
  filter: saturate(0.85);
  transform: none;
}
.btn-generate.loading .btn-spinner {
  display: inline-block;
}
.btn-generate.loading .btn-bolt {
  display: none;
}

/* Stage (result side) */
.machine-stage {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: clamp(22px, 3.4vw, 40px);
  border-radius: 0 28px 28px 0;
  border-inline-start: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(70% 45% at 50% 0%, rgba(255, 226, 170, 0.18), transparent 70%),
    radial-gradient(80% 60% at 50% 100%, rgba(139, 92, 255, 0.2), transparent 70%),
    #0b0419;
  overflow: hidden;
}
.stage-light {
  position: absolute;
  top: -8%;
  left: 50%;
  width: 120%;
  height: 80%;
  margin-left: -60%;
  background: linear-gradient(to bottom, rgba(255, 236, 196, 0.32), rgba(255, 236, 196, 0) 85%);
  clip-path: polygon(44% 0, 56% 0, 88% 100%, 12% 100%);
  pointer-events: none;
  transform-origin: 50% 0;
  animation: beam 8s ease-in-out infinite alternate;
  opacity: 0.6;
}
.mascot {
  position: relative;
  width: 190px;
  margin: 0 auto 0.6rem;
  animation: bob 3.4s ease-in-out infinite;
  z-index: 2;
}
.mascot-img {
  width: 190px;
  height: 190px;
  filter: drop-shadow(0 16px 22px rgba(0, 0, 0, 0.55));
  transform-origin: 50% 90%;
}
@keyframes bob {
  0%, 100% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(-10px) rotate(2deg);
  }
}
.mascot-bubble {
  position: absolute;
  bottom: 74%;
  inset-inline-end: 72%;
  margin: 0;
  white-space: nowrap;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  background: #fff;
  border-radius: 16px 16px 4px 16px;
  padding: 0.4rem 0.75rem;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.6);
  transform: rotate(-5deg);
  animation: bubble-pop 0.45s cubic-bezier(0.3, 1.8, 0.5, 1);
}
@keyframes bubble-pop {
  from {
    transform: rotate(-5deg) scale(0.4);
    opacity: 0;
  }
}
.mascot.is-thinking .mascot-img {
  animation: think 1s ease-in-out infinite;
}
.mascot.is-laughing .mascot-img {
  animation: laugh 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) 3;
}
.mascot.is-sad .mascot-img {
  transform: rotate(-10deg) translateY(8px);
  filter: drop-shadow(0 16px 22px rgba(0, 0, 0, 0.55)) saturate(0.55);
  transition: transform 0.4s, filter 0.4s;
}
@keyframes think {
  0%, 100% {
    transform: rotate(-7deg);
  }
  50% {
    transform: rotate(7deg);
  }
}
@keyframes laugh {
  0% {
    transform: translateY(0) scale(1, 1) rotate(0);
  }
  30% {
    transform: translateY(-26px) scale(0.94, 1.08) rotate(-8deg);
  }
  60% {
    transform: translateY(0) scale(1.08, 0.92) rotate(6deg);
  }
  100% {
    transform: translateY(0) scale(1, 1) rotate(0);
  }
}
.result-area {
  position: relative;
  z-index: 1;
  flex: 1;
  display: grid;
  align-content: center;
  gap: 1rem;
}
.stage-idle {
  text-align: center;
  color: var(--muted);
  border: 2px dashed rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  padding: 1.4rem 1rem;
}
.stage-idle p {
  margin: 0;
}
.stage-idle-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.3rem;
  color: #fff;
}
.writing[hidden],
.stage-idle[hidden] {
  display: none;
}
.writing {
  text-align: center;
}
.writing-line {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.15rem;
  margin-bottom: 0.8rem;
}
.drum {
  display: inline-block;
  animation: drumroll 0.16s linear infinite alternate;
}
@keyframes drumroll {
  from {
    transform: rotate(-9deg) translateY(1px);
  }
  to {
    transform: rotate(9deg) translateY(-1px);
  }
}
.dots {
  display: inline-flex;
  gap: 4px;
  margin-inline-start: 4px;
  vertical-align: middle;
}
.dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sun);
  animation: dot 1s ease-in-out infinite;
}
.dots i:nth-child(2) {
  animation-delay: 0.15s;
  background: var(--pink);
}
.dots i:nth-child(3) {
  animation-delay: 0.3s;
  background: var(--cyan);
}
@keyframes dot {
  0%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-8px);
  }
}
.idea-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
}
.idea-chip {
  display: inline-block;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
  background: var(--sun);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  animation: chip-pop 0.5s cubic-bezier(0.3, 1.8, 0.5, 1) both, chip-float 2.2s ease-in-out 0.5s infinite alternate;
}
.idea-chip:nth-child(3n + 2) {
  background: var(--pink);
}
.idea-chip:nth-child(3n + 3) {
  background: var(--cyan);
}
@keyframes chip-pop {
  from {
    transform: scale(0.2) rotate(-14deg);
    opacity: 0;
  }
}
@keyframes chip-float {
  to {
    transform: translateY(-5px) rotate(2deg);
  }
}
.result-card {
  display: none;
  position: relative;
  background: linear-gradient(160deg, rgba(255, 63, 164, 0.16), rgba(139, 92, 255, 0.16));
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 22px;
  padding: 22px 24px 20px;
  box-shadow: 0 20px 50px -24px rgba(255, 63, 164, 0.7);
}
.result-card.active {
  display: block;
  animation: land 0.6s cubic-bezier(0.25, 1.5, 0.5, 1);
}
@keyframes land {
  from {
    transform: translateY(18px) scale(0.96);
  }
}
.result-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sun);
  margin-bottom: 0.5rem;
}
.badum {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--ink);
  background: var(--cyan);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  animation: chip-pop 0.5s cubic-bezier(0.3, 1.8, 0.5, 1) both;
  animation-delay: var(--badum, 1s);
}
.joke-text {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.25rem, 2.1vw, 1.6rem);
  line-height: 1.35;
  color: #fff;
  margin: 0 0 1.1rem;
  overflow-wrap: anywhere;
}
.joke-text .w {
  display: inline-block;
  animation: word-in 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) both;
  animation-delay: var(--d, 0s);
}
.joke-text .w.punch {
  color: var(--sun);
  text-shadow: 0 0 18px rgba(255, 210, 63, 0.55);
  animation-name: punch-in;
  animation-duration: 0.55s;
}
@keyframes word-in {
  from {
    opacity: 0;
    transform: translateY(0.5em);
    filter: blur(4px);
  }
}
@keyframes punch-in {
  from {
    opacity: 0;
    transform: scale(1.8) rotate(-6deg);
  }
}
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.meter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.18);
}
.meter-label {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--muted);
  margin-inline-end: 0.2rem;
}
.meter-btn {
  width: 46px;
  height: 46px;
  font-size: 1.45rem;
  line-height: 1;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.3, 1.8, 0.5, 1), background 0.2s, border-color 0.2s;
}
.meter-btn:hover {
  transform: scale(1.18) rotate(-6deg);
}
.meter-btn[aria-pressed="true"] {
  background: rgba(255, 210, 63, 0.25);
  border-color: var(--sun);
  box-shadow: 0 0 0 3px rgba(255, 210, 63, 0.25);
  animation: jiggle 0.5s ease;
}
@keyframes jiggle {
  25% {
    transform: scale(1.3) rotate(-12deg);
  }
  60% {
    transform: scale(0.95) rotate(8deg);
  }
}
.meter-note {
  font-size: 0.85rem;
  color: var(--muted);
}
.burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}
.bit {
  position: absolute;
  left: 50%;
  top: 30%;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  opacity: 0;
  animation: bit 1.25s cubic-bezier(0.15, 0.7, 0.4, 1) forwards;
}
@keyframes bit {
  0% {
    opacity: 1;
    transform: translate(0, 0) rotate(0) scale(0.6);
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(1);
  }
}
.error-card {
  display: none;
  background: rgba(255, 70, 110, 0.12);
  border: 1.5px solid rgba(255, 120, 150, 0.6);
  border-radius: 20px;
  padding: 20px 22px;
}
.error-card.active {
  display: block;
  animation: shake 0.45s ease;
}
@keyframes shake {
  20%, 60% {
    transform: translateX(-6px);
  }
  40%, 80% {
    transform: translateX(6px);
  }
}
.error-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.2rem;
  margin-bottom: 0.35rem;
}
.error-text {
  color: #ffe3ec;
  margin-bottom: 0.9rem;
}

/* Recent jokes */
.recent {
  margin-top: 28px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 20px 24px;
}
.recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.recent-head h3 {
  margin: 0;
  font-size: 1.1rem;
}
.recent-list {
  list-style: none;
  margin: 0.8rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.recent-list:empty {
  display: none;
}
.recent-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
  align-items: start;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  padding: 0.65rem 0.85rem;
  animation: chip-pop 0.4s ease both;
}
.recent-rate {
  font-size: 1.35rem;
  line-height: 1.2;
}
.recent-joke {
  margin: 0;
  font-size: 0.97rem;
}
.recent-ideas {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.recent-empty {
  margin: 0.6rem 0 0;
  font-size: 0.92rem;
  color: var(--muted);
}
.recent-empty[hidden] {
  display: none;
}
.demo-notice {
  margin: 22px 0 0;
  text-align: center;
  font-size: 0.92rem;
  color: var(--muted);
}

/* ---------- Section heads ---------- */
.section-head {
  max-width: 720px;
  margin-bottom: 2.4rem;
}
.section-sub {
  color: var(--muted);
  font-size: 1.1rem;
}

/* ---------- How it works ---------- */
.how {
  padding: 96px 0;
  position: relative;
}
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  position: relative;
}
.step {
  position: relative;
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px 26px;
}
.step:nth-child(2) {
  transition-delay: 0.12s;
}
.step:nth-child(3) {
  transition-delay: 0.24s;
}
.step p {
  color: var(--muted);
  margin: 0;
}
.step-num {
  position: absolute;
  top: -16px;
  inset-inline-start: 22px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
  color: var(--ink);
  background: var(--sun);
  border-radius: 50%;
  box-shadow: 0 0 0 5px var(--bg), 0 0 24px rgba(255, 210, 63, 0.6);
}
.step-scene {
  position: relative;
  height: 130px;
  border-radius: 18px;
  margin: 8px 0 18px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(80% 90% at 50% 100%, rgba(139, 92, 255, 0.35), transparent 70%), #0b0419;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.mini-box {
  display: inline-block;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.95rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 63, 164, 0.7);
  border-radius: 12px;
  padding: 0.55rem 0.8rem;
  box-shadow: 0 0 26px -6px rgba(255, 63, 164, 0.7);
}
.mini-typed {
  display: inline-block;
  vertical-align: bottom;
  width: 20ch;
  overflow: hidden;
  white-space: nowrap;
  border-inline-end: 2px solid var(--sun);
  animation: typing 5s steps(20) infinite, caret 0.7s step-end infinite;
}
@keyframes typing {
  0% {
    width: 0;
  }
  45%, 85% {
    width: 20ch;
  }
  100% {
    width: 0;
  }
}
@keyframes caret {
  50% {
    border-color: transparent;
  }
}
.mini-lines {
  display: grid;
  gap: 9px;
  width: 58%;
}
.mini-lines i {
  display: block;
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--pink), var(--violet));
  transform-origin: left;
  animation: write 3.2s ease-in-out infinite;
}
.mini-lines i:nth-child(2) {
  width: 82%;
  animation-delay: 0.35s;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
}
.mini-lines i:nth-child(3) {
  width: 64%;
  animation-delay: 0.7s;
  background: linear-gradient(90deg, var(--sun), var(--pink));
}
@keyframes write {
  0% {
    transform: scaleX(0);
  }
  40%, 80% {
    transform: scaleX(1);
  }
  100% {
    transform: scaleX(0);
    opacity: 0.3;
  }
}
.spark {
  position: absolute;
  color: var(--sun);
  font-size: 1.3rem;
  text-shadow: 0 0 12px var(--sun);
  animation: twinkle 1.8s ease-in-out infinite;
}
.spark.s1 {
  top: 16%;
  left: 14%;
}
.spark.s2 {
  top: 60%;
  right: 12%;
  animation-delay: 0.6s;
  color: var(--cyan);
  text-shadow: 0 0 12px var(--cyan);
}
.spark.s3 {
  bottom: 12%;
  left: 26%;
  animation-delay: 1.2s;
  color: var(--pink);
  text-shadow: 0 0 12px var(--pink);
}
@keyframes twinkle {
  0%, 100% {
    transform: scale(0.6) rotate(0);
    opacity: 0.4;
  }
  50% {
    transform: scale(1.25) rotate(90deg);
    opacity: 1;
  }
}
.laugh-face {
  font-size: 3.6rem;
  line-height: 1;
  animation: giggle 1.1s ease-in-out infinite;
}
@keyframes giggle {
  0%, 100% {
    transform: rotate(-8deg) translateY(0);
  }
  25% {
    transform: rotate(8deg) translateY(-6px);
  }
  50% {
    transform: rotate(-6deg) translateY(0);
  }
  75% {
    transform: rotate(6deg) translateY(-4px);
  }
}
.ha {
  position: absolute;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--pink);
  text-shadow: 0 0 12px rgba(255, 63, 164, 0.8);
  animation: ha 2.2s ease-out infinite;
}
.ha1 {
  top: 18%;
  left: 22%;
}
.ha2 {
  top: 26%;
  right: 20%;
  color: var(--cyan);
  text-shadow: 0 0 12px rgba(46, 230, 255, 0.8);
  animation-delay: 1.1s;
}
@keyframes ha {
  0% {
    transform: translateY(16px) scale(0.6);
    opacity: 0;
  }
  30% {
    opacity: 1;
    transform: translateY(0) scale(1.1);
  }
  100% {
    transform: translateY(-22px) scale(1);
    opacity: 0;
  }
}

/* Safety explanation */
.safe {
  margin-top: 48px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 24px;
  padding: clamp(22px, 4vw, 36px);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(46, 230, 255, 0.1), rgba(139, 92, 255, 0.12));
  border: 1px solid rgba(46, 230, 255, 0.4);
}
.safe h3 {
  font-size: clamp(1.25rem, 2.2vw, 1.55rem);
  font-weight: 800;
}
.safe-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  color: var(--cyan);
  border-radius: 20px;
  background: rgba(46, 230, 255, 0.1);
  box-shadow: 0 0 30px -6px rgba(46, 230, 255, 0.6);
}
.safe-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}
.safe-list li {
  position: relative;
  padding-inline-start: 1.7rem;
  color: #e9e1ff;
}
.safe-list li::before {
  content: "✓";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  font-weight: 800;
  color: var(--cyan);
}
.safe-list strong {
  color: #fff;
}

/* ---------- Ideas: sticky notes ---------- */
.ideas {
  padding: 96px 0;
  background:
    radial-gradient(50% 60% at 85% 20%, rgba(255, 210, 63, 0.1), transparent 70%),
    radial-gradient(50% 60% at 10% 90%, rgba(46, 230, 255, 0.1), transparent 70%);
}
.notes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 30px 26px;
}
.note {
  --tilt: -2.5deg;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  min-height: 178px;
  padding: 26px 20px 18px;
  font: inherit;
  text-align: start;
  color: var(--ink);
  background: #ffe27a;
  border: 0;
  border-radius: 6px 6px 18px 6px;
  box-shadow: 0 22px 34px -16px rgba(0, 0, 0, 0.75), inset 0 -18px 30px -24px rgba(0, 0, 0, 0.35);
  transform: rotate(var(--tilt));
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.3, 1.6, 0.5, 1), box-shadow 0.3s;
}
.note::before {
  content: "";
  position: absolute;
  top: -11px;
  left: 50%;
  width: 84px;
  height: 24px;
  margin-left: -42px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.5);
  transform: rotate(-3deg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.note:nth-child(2n) {
  --tilt: 2deg;
}
.note:nth-child(3n) {
  --tilt: -1deg;
}
.note:nth-child(4n) {
  --tilt: 3deg;
}
.note-pink {
  background: #ffa3d2;
}
.note-cyan {
  background: #93f0ff;
}
.note-violet {
  background: #cdb8ff;
}
.note:hover,
.note:focus-visible {
  transform: rotate(0deg) scale(1.05);
  box-shadow: 0 30px 44px -18px rgba(0, 0, 0, 0.8), 0 0 40px -8px rgba(255, 255, 255, 0.35);
  z-index: 2;
}
.note:hover .note-emoji,
.note:focus-visible .note-emoji {
  animation: wiggle 0.5s ease-in-out 2;
}
.note:hover {
  animation: note-wiggle 0.55s ease-in-out;
}
@keyframes note-wiggle {
  25% {
    transform: rotate(-4deg) scale(1.05);
  }
  55% {
    transform: rotate(3deg) scale(1.05);
  }
  80% {
    transform: rotate(-1deg) scale(1.05);
  }
}
@keyframes wiggle {
  25% {
    transform: rotate(-16deg) scale(1.15);
  }
  75% {
    transform: rotate(14deg) scale(1.15);
  }
}
.note-emoji {
  font-size: 2.1rem;
  line-height: 1;
  display: inline-block;
}
.note-ideas {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.18rem;
  line-height: 1.25;
}
.note-tag {
  margin-top: auto;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--ink);
  border-radius: 999px;
  padding: 0.22rem 0.65rem;
}
.note.reveal:nth-child(4n + 2) {
  transition-delay: 0.08s;
}
.note.reveal:nth-child(4n + 3) {
  transition-delay: 0.16s;
}
.note.reveal:nth-child(4n + 4) {
  transition-delay: 0.24s;
}

/* ---------- How it was made ---------- */
.made {
  padding: 40px 0 96px;
}
.made-band {
  position: relative;
  overflow: hidden;
  border-radius: 32px;
  padding: clamp(26px, 5vw, 52px);
  background:
    radial-gradient(40% 70% at 0% 0%, rgba(255, 63, 164, 0.35), transparent 70%),
    radial-gradient(45% 70% at 100% 100%, rgba(46, 230, 255, 0.22), transparent 70%),
    linear-gradient(120deg, #2a0b4d, #3b0d55 50%, #1b0b3e);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.made-head h2 {
  margin-bottom: 1.6rem;
}
.made-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.35fr);
  align-items: center;
  gap: 18px;
}
.made-card {
  background: rgba(14, 6, 32, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  padding: 22px 24px;
  height: 100%;
}
.made-card p:last-child {
  margin: 0;
  color: #ece4ff;
}
.made-card-pro {
  border-color: rgba(255, 210, 63, 0.55);
  box-shadow: 0 0 50px -20px rgba(255, 210, 63, 0.6);
}
.made-step {
  display: inline-block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 0.4rem;
}
.made-card-pro .made-step {
  color: var(--sun);
}
.made-big {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.4rem, 4.5vw, 3.4rem);
  line-height: 1;
  margin: 0.2rem 0 0.8rem;
  color: #fff;
  text-shadow: 0 0 22px rgba(46, 230, 255, 0.6);
}
.made-arrow {
  color: var(--sun);
}
.made-arrow path:first-child {
  stroke-dasharray: 6 8;
  animation: dash 1.2s linear infinite;
}
@keyframes dash {
  to {
    stroke-dashoffset: -28;
  }
}
.made-upgrades {
  list-style: none;
  margin: 0.3rem 0 1rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.made-upgrades li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.92rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 0.35rem 0.75rem 0.35rem 0.35rem;
}
.made-upgrades img,
.up-a11y {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
}
.made-upgrades .up-logo {
  object-fit: contain;
  background: rgba(255, 255, 255, 0.08);
  padding: 3px;
}
.up-a11y {
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--violet-deep), var(--pink-deep));
}
.made-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.2rem;
  margin-top: 1.8rem;
}
.made-more {
  color: #fff;
  font-weight: 700;
  text-underline-offset: 4px;
}

/* ---------- Final CTA ---------- */
.cta {
  padding: 0 0 96px;
}
.cta-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  border: 2px dashed rgba(255, 210, 63, 0.55);
  border-radius: 30px;
  padding: 24px 34px;
  background: rgba(255, 210, 63, 0.05);
}
.cta-mascot {
  width: 110px;
  height: 110px;
  flex-shrink: 0;
  animation: bob 3s ease-in-out infinite;
}
.cta-copy {
  flex: 1;
}
.cta-copy h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 0.2em;
}
.cta-copy p {
  margin: 0;
  color: var(--muted);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #09031a;
  padding: 40px 0 104px;
}
.footer-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px 32px;
  align-items: center;
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.footer-brand .brand-logo {
  width: 34px;
  height: 34px;
}
.footer-brand .brand-word {
  font-size: 1.2rem;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.3rem;
  justify-content: flex-end;
}
.footer-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}
.footer-nav a:hover {
  color: #fff;
  text-decoration: underline;
}
.demo-note {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  max-width: 62em;
}

/* ---------- Inner pages (about, accessibility) ---------- */
.page-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 88px 0 64px;
}
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(14, 6, 32, 0.95) 20%, rgba(14, 6, 32, 0.55) 70%, rgba(14, 6, 32, 0.35)),
    linear-gradient(to top, var(--bg), transparent 40%),
    url("images/stage.webp") 70% 40% / cover no-repeat;
}
.page-hero h1 {
  font-size: clamp(2.4rem, 5.6vw, 4.4rem);
  letter-spacing: -0.03em;
  margin: 0.2em 0 0.4em;
}
.page-hero .lede {
  max-width: 36em;
}
.narrow {
  width: min(780px, 100% - 48px);
  margin-inline: auto;
}
.prose-section {
  padding: 24px 0 88px;
}
.prose h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-top: 2.2em;
}
.prose h2:first-child {
  margin-top: 0;
}
.prose p,
.prose li {
  color: #e6ddfb;
}
.prose ul,
.prose ol {
  padding-inline-start: 1.3rem;
}
.prose li {
  margin-bottom: 0.45rem;
}
.prose li::marker {
  color: var(--pink);
}
.prose .muted {
  color: var(--muted);
  font-size: 0.92rem;
}
.flow {
  list-style: none;
  padding: 0 !important;
  display: grid;
  gap: 14px;
  counter-reset: flow;
}
.flow li {
  counter-increment: flow;
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px 18px 16px 64px;
  margin: 0;
}
.flow li::before {
  content: counter(flow);
  position: absolute;
  inset-inline-start: 16px;
  top: 14px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
  color: var(--ink);
  background: var(--sun);
  border-radius: 50%;
}
.callout {
  margin: 2rem 0;
  padding: 22px 24px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255, 63, 164, 0.14), rgba(139, 92, 255, 0.14));
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.callout p:last-child {
  margin: 0;
}
.about-mascot {
  float: right;
  width: 170px;
  margin: 0 0 12px 18px;
  animation: bob 3.4s ease-in-out infinite;
}
.figure-note {
  font-size: 0.8rem;
  color: var(--muted);
}
.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

/* ---------- Accessibility menu (9orb accessibility pack, JokeBlitz colours) ---------- */
.a11y{position:fixed;inset-block-end:1.1rem;inset-inline-start:1.1rem;z-index:60;font-size:16px}
.a11y-toggle{width:3rem;height:3rem;border-radius:999px;border:2px solid var(--bg);background:linear-gradient(135deg,#7a2fe0,#d81f7c);color:#fff;display:grid;place-items:center;cursor:pointer;box-shadow:0 10px 25px -8px rgba(0,0,0,.6),0 0 22px -4px rgba(255,63,164,.6)}
.a11y-toggle:focus-visible,.a11y-opt:focus-visible,.a11y-reset:focus-visible{outline:3px solid #ffd23f;outline-offset:2px}
.a11y-panel{position:absolute;inset-block-end:3.6rem;inset-inline-start:0;width:15rem;background:#170b33;color:var(--text);border:1px solid var(--border);border-radius:14px;padding:.8rem;box-shadow:0 20px 40px -12px rgba(0,0,0,.6);display:grid;gap:.4rem}
.a11y-panel[hidden]{display:none}
.a11y-title{font-weight:700;margin:0 0 .2rem}
.a11y-opt,.a11y-reset{font:inherit;text-align:start;padding:.55rem .7rem;border-radius:10px;border:1px solid var(--border);background:transparent;color:inherit;cursor:pointer}
.a11y-opt[aria-pressed="true"]{background:#d81f7c;color:#fff;border-color:#d81f7c}
.a11y-row{display:flex;justify-content:space-between;align-items:center;gap:.5rem;margin-top:.2rem}
.a11y-link{font-size:.85rem;text-decoration:underline;color:inherit}
html.a11y-text-1{font-size:112.5%}
html.a11y-text-2{font-size:125%}
html.a11y-text-3{font-size:140%}
html.a11y-contrast{--bg:#000;--text:#fff;--muted:#e5e5e5;--border:#fff;--surface:#000;--section:#000;--primary:#ffeb3b;--accent:#ffeb3b;--on-primary:#000}
html.a11y-contrast img,html.a11y-contrast .art{filter:contrast(1.15)}
html.a11y-links a{text-decoration:underline !important;text-underline-offset:3px;outline:2px dashed currentColor;outline-offset:2px}
html.a11y-font body,html.a11y-font h1,html.a11y-font h2,html.a11y-font h3{font-family:Arial,Helvetica,"Segoe UI",sans-serif !important;letter-spacing:.01em;line-height:1.7}
html.a11y-motion *,html.a11y-motion *::before,html.a11y-motion *::after{animation:none !important;transition:none !important;scroll-behavior:auto !important}
@media print{.a11y{display:none}}

/* High contrast: JokeBlitz-specific surfaces */
html.a11y-contrast body,
html.a11y-contrast .site-header,
html.a11y-contrast .site-footer,
html.a11y-contrast .a11y-panel {
  background: #000;
}
html.a11y-contrast * {
  text-shadow: none !important;
}
html.a11y-contrast .hero-shade {
  background: rgba(0, 0, 0, 0.84);
}
html.a11y-contrast .hero-beam,
html.a11y-contrast .hero-spot,
html.a11y-contrast .stage-light,
html.a11y-contrast .hero-confetti {
  display: none;
}
html.a11y-contrast .machine,
html.a11y-contrast .machine-stage,
html.a11y-contrast .result-card,
html.a11y-contrast .error-card,
html.a11y-contrast .recent,
html.a11y-contrast .step,
html.a11y-contrast .step-scene,
html.a11y-contrast .safe,
html.a11y-contrast .made-band,
html.a11y-contrast .made-card,
html.a11y-contrast .cta-inner,
html.a11y-contrast .ticker,
html.a11y-contrast .joke-input,
html.a11y-contrast .flow li,
html.a11y-contrast .callout {
  background: #000 !important;
  border: 2px solid #fff !important;
  box-shadow: none !important;
}
html.a11y-contrast .neon,
html.a11y-contrast .joke-text .w.punch,
html.a11y-contrast .eyebrow,
html.a11y-contrast .brand-word span,
html.a11y-contrast .ticker b {
  color: #ffeb3b;
}
html.a11y-contrast .nav-link,
html.a11y-contrast .lede,
html.a11y-contrast .safe-list li,
html.a11y-contrast .prose p,
html.a11y-contrast .prose li {
  color: #fff;
}
html.a11y-contrast .btn-hot,
html.a11y-contrast .style-chip input:checked + span,
html.a11y-contrast .btn-sun {
  background: #ffeb3b;
  color: #000;
  border-color: #ffeb3b;
}
html.a11y-contrast .btn-glass,
html.a11y-contrast .starter,
html.a11y-contrast .style-chip span,
html.a11y-contrast .meter-btn {
  background: #000;
  color: #fff;
  border: 2px solid #fff;
}
html.a11y-contrast .note {
  background: #000;
  color: #fff;
  border: 2px solid #fff;
}
html.a11y-contrast .note-tag {
  background: #ffeb3b;
  color: #000;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .machine {
    grid-template-columns: minmax(0, 1fr);
  }
  .machine-stage {
    border-radius: 0 0 28px 28px;
    border-inline-start: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 380px;
  }
  .steps {
    grid-template-columns: minmax(0, 1fr);
    gap: 34px;
  }
  .made-flow {
    grid-template-columns: minmax(0, 1fr);
  }
  .made-arrow {
    justify-self: center;
    transform: rotate(90deg);
  }
}
@media (max-width: 760px) {
  .container,
  .narrow {
    width: calc(100% - 32px);
  }
  .nav-link {
    display: none;
  }
  .brand-logo {
    width: 36px;
    height: 36px;
  }
  .brand-word {
    font-size: 1.25rem;
  }
  .header-inner {
    min-height: 60px;
    gap: 0.5rem;
  }
  .hero {
    min-height: 0;
    padding: 56px 0 124px;
    justify-content: flex-end;
  }
  .hero-img {
    object-position: 66% 50%;
  }
  .hero-beam {
    --mic-x: 62%;
    width: 90vw;
    margin-left: -45vw;
  }
  .hero-shade {
    background:
      linear-gradient(to top, var(--bg) 0%, rgba(14, 6, 32, 0) 28%),
      linear-gradient(180deg, rgba(14, 6, 32, 0.45) 0%, rgba(14, 6, 32, 0.78) 45%, rgba(14, 6, 32, 0.9) 100%);
  }
  .hero h1 {
    font-size: clamp(2.3rem, 11vw, 3.3rem);
  }
  .hero-actions .btn {
    flex: 1 1 auto;
  }
  .hero-credit {
    bottom: 62px;
    font-size: 0.68rem;
  }
  .ticker li {
    font-size: 0.95rem;
  }
  .generator {
    padding-top: 44px;
  }
  .machine {
    border-radius: 26px;
  }
  .machine-stage {
    border-radius: 0 0 24px 24px;
    padding-top: 26px;
  }
  .mascot {
    width: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
  }
  .mascot-img {
    width: 112px;
    height: 112px;
    flex-shrink: 0;
  }
  .mascot-bubble {
    position: relative;
    bottom: auto;
    inset-inline-end: auto;
    order: 2;
    white-space: normal;
    max-width: 11rem;
    font-size: 0.85rem;
    border-radius: 16px 16px 16px 4px;
  }
  .meter-label {
    flex-basis: 100%;
  }
  .recent {
    padding: 18px;
  }
  .how,
  .ideas {
    padding: 72px 0;
  }
  .safe {
    grid-template-columns: minmax(0, 1fr);
  }
  .notes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 16px;
  }
  .note {
    min-height: 160px;
    padding: 24px 14px 14px;
  }
  .note-ideas {
    font-size: 1.02rem;
  }
  .cta-inner {
    flex-direction: column;
    text-align: center;
    padding: 24px 20px;
  }
  .footer-inner {
    grid-template-columns: minmax(0, 1fr);
  }
  .footer-nav {
    justify-content: flex-start;
  }
  .about-mascot {
    width: 120px;
  }
}
@media (max-width: 400px) {
  .demo-pill {
    font-size: 0.66rem;
    padding: 0.2rem 0.5rem;
  }
  .header-inner .btn-small {
    font-size: 0.88rem;
    padding: 0.55rem 0.85rem;
  }
}
@media (max-width: 350px) {
  .notes {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Reduced motion: everything visible, nothing moves ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  html.js .reveal {
    opacity: 1;
    translate: none;
  }
  .hero-confetti {
    display: none;
  }
}
html.a11y-motion .reveal {
  opacity: 1 !important;
  translate: none !important;
}
html.a11y-motion .hero-confetti {
  display: none;
}
.statement {
  padding-top: 72px;
}
html.a11y-contrast .a11y-opt[aria-pressed="true"] {
  background: #ffeb3b;
  color: #000;
  border-color: #ffeb3b;
}
