:root {
  --paper: #fff9e8;
  --paper-2: #fff5d1;
  --paper-3: #ffe7ad;
  --ink: #1a1a2e;
  --ink-2: #344b5a;
  --ink-3: #5c6d7a;
  --rule: rgba(26, 26, 46, 0.14);
  --rule-soft: rgba(26, 26, 46, 0.08);
  --amber: #f4a261;
  --blue: #2a9d8f;
  --green: #06d6a0;
  --coral: #ef476f;
  --violet: #9b5de5;
  --sky: #a8dadc;
  --shadow: 0 24px 80px rgba(26, 26, 46, 0.18);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font: "Comic Neue", "Permanent Marker", Georgia, ui-serif, "Times New Roman", serif;
  --display: "Permanent Marker", "Comic Neue", cursive, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--paper); color: var(--ink); font-family: var(--font); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 90% 0%, rgba(168, 218, 220, 0.26), transparent 28rem),
    radial-gradient(circle at 0% 20%, rgba(244, 162, 97, 0.22), transparent 24rem),
    var(--paper);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
body.panel-open { overflow: hidden; }

a { color: inherit; }
img, svg, video { max-width: 100%; height: auto; display: block; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; border-radius: 14px; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 50;
  transform: translateY(-160%);
  background: var(--blue);
  color: var(--paper);
  padding: 0.75rem 1rem;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3.5rem);
  border-bottom: 3px solid var(--ink);
  background: rgba(255, 249, 232, 0.88);
  backdrop-filter: blur(18px);
}
.site-header.compact { background: rgba(255, 249, 232, 0.92); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  min-height: 44px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: var(--paper-2);
  color: var(--ink);
  font-family: var(--display);
  font-size: 1rem;
  transform: rotate(-6deg);
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 0.95rem; }
.brand small { color: var(--ink-3); font-size: 0.72rem; margin-top: 0.12rem; }

.nav {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 2vw, 1.1rem);
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  transition: color 180ms var(--ease), background 180ms var(--ease);
}
.nav a:hover { color: var(--ink); background: rgba(26, 26, 46, 0.08); }

.hero-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.75fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  padding: clamp(4rem, 12vw, 10rem) clamp(1.25rem, 5vw, 6rem) clamp(5rem, 10vw, 9rem);
  overflow: hidden;
}
.hero-sky {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    repeating-linear-gradient(90deg, rgba(26, 26, 46, 0.08) 0 2px, transparent 2px 32px),
    repeating-linear-gradient(0deg, rgba(26, 26, 46, 0.04) 0 1px, transparent 1px 24px),
    linear-gradient(180deg, var(--paper), var(--paper-2));
}
.hero-comic, .hero-copy, .hero-figure { position: relative; z-index: 1; }
.hero-figure { transform: rotate(1deg); background: var(--paper-2); border: 3px solid var(--ink); border-radius: 28px; padding: 0.8rem; box-shadow: var(--shadow); }
.hero-svg { width: 100%; height: auto; }
.hero-figure figcaption { margin-top: 0.6rem; font-size: 0.88rem; color: var(--ink-2); font-style: italic; }

.panel-bubble {
  position: relative;
  display: inline-block;
  background: var(--paper-2);
  border: 3px solid var(--ink);
  border-radius: 26px;
  padding: clamp(1.4rem, 4vw, 2.2rem);
  box-shadow: var(--shadow);
}
.bubble-tail {
  position: absolute;
  left: 22px;
  bottom: -18px;
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 20px solid var(--ink);
  filter: drop-shadow(0 2px 0 var(--paper-2));
}
.hero-bubble { margin-bottom: 1.4rem; }
.eyebrow, .section-kicker {
  color: var(--blue);
  font-family: var(--display);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-block-start: 0; }
h1 {
  max-width: 15ch;
  margin-block-end: 1.1rem;
  font-family: var(--display);
  font-size: clamp(3.2rem, 7.2vw, 7rem);
  line-height: 0.94;
  letter-spacing: -0.035em;
}
h2.section-title {
  font-family: var(--display);
  font-size: clamp(2.3rem, 4.4vw, 4.6rem);
  line-height: 0.96;
  letter-spacing: -0.03em;
  max-width: 18ch;
  margin-block-end: 0.9rem;
}
h3 { font-size: clamp(1.15rem, 1.9vw, 1.45rem); line-height: 1.08; margin-block-end: 0.6rem; }

.lede, .section-lede {
  max-width: 64ch;
  color: var(--ink-2);
  font-size: clamp(1.05rem, 1.5vw, 1.26rem);
  line-height: 1.55;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 1.6rem; }

.button, .ghost-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.85rem 1.05rem;
  font-family: var(--display);
  font-weight: 800;
  text-decoration: none;
  transition: transform 180ms var(--ease), background 180ms var(--ease), color 180ms var(--ease), border-color 180ms var(--ease);
}
.button:hover, .ghost-button:hover { transform: translateY(-2px); }
.button.primary { background: var(--blue); color: var(--paper); box-shadow: 0 10px 30px rgba(42, 157, 143, 0.28); border: 2px solid var(--ink); }
.button.secondary, .ghost-button { border: 3px solid var(--ink); color: var(--ink); background: var(--paper-2); box-shadow: 0 10px 20px rgba(26, 26, 46, 0.12); }
.ghost-button.full { width: 100%; justify-content: center; }

.label {
  width: max-content;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  margin-bottom: 0.9rem;
  font-family: var(--display);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 2px solid var(--ink);
}
.real-label { background: var(--green); color: var(--paper); }
.concept-label { background: var(--coral); color: var(--paper); }
.built-label { background: var(--amber); color: var(--paper); }

.comic-floor, .characters-floor, .closing {
  padding: clamp(4.5rem, 9vw, 8rem) clamp(1.25rem, 5vw, 6rem);
  border-top: 4px solid var(--ink);
}
.closing {
  background: var(--paper-2);
  border-top: 3px solid var(--ink);
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(280px, 0.6fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}

.comic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.1rem, 2.4vw, 1.8rem);
}
.comic-panel {
  background: var(--paper-2);
  border: 3px solid var(--ink);
  border-radius: 24px;
  padding: clamp(1.1rem, 2vw, 1.4rem);
  transition: transform 220ms var(--ease), border-color 220ms var(--ease), box-shadow 220ms var(--ease);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.comic-panel:hover { transform: translateY(-5px) rotate(-0.4deg); border-color: var(--blue); box-shadow: 0 20px 50px rgba(42, 157, 143, 0.18); }
.comic-panel.accent-panel { background: var(--ink); color: var(--paper); }
.comic-panel.accent-panel .label { border-color: var(--paper); }

.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.panel-number { font-family: var(--display); font-size: 0.9rem; letter-spacing: 0.1em; color: var(--ink-3); }
.panel-frame {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 18px;
  overflow: hidden;
}
.panel-svg { width: 100%; height: auto; display: block; }
.panel-prose { display: grid; gap: 0.6rem; }
.panel-prose p { color: var(--ink-2); line-height: 1.6; margin: 0; }

.speak-button {
  align-self: flex-start;
  min-height: 42px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--paper-2);
  padding: 0.55rem 1rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--ink);
  transition: transform 180ms var(--ease), background 180ms var(--ease);
}
.speak-button:hover { background: var(--paper-3); transform: translateY(-2px); }

.speech-text { margin-top: 0.6rem; padding: 0.9rem 1rem; background: var(--paper-3); border: 3px solid var(--ink); border-radius: 16px; }
.speech-text p { margin: 0; color: var(--ink-2); line-height: 1.6; font-size: 0.92rem; }

.character-bar { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.2rem; }
.character-chip {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--paper-2);
  padding: 0.5rem 1rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  color: var(--ink);
  transition: transform 180ms var(--ease), background 180ms var(--ease);
}
.character-chip:hover { background: var(--paper-3); transform: translateY(-2px); }
.chip-avatar { font-size: 1.25rem; line-height: 1; }

.speech-bubble-stage { margin-top: 1.2rem; }
.speech-bubble-stage[hidden] { display: none; }
.stage-bubble {
  position: relative;
  display: inline-block;
  background: var(--paper-2);
  border: 3px solid var(--ink);
  border-radius: 26px;
  padding: 1.2rem 1.4rem;
  max-width: 72ch;
  box-shadow: var(--shadow);
}
.stage-bubble .bubble-tail::after {
  content: "";
  position: absolute;
  top: 8px;
  left: -18px;
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-right: 18px solid var(--paper-2);
}
#stage-text { margin: 0; font-size: 1.08rem; line-height: 1.55; }

.footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-top: 4px solid var(--ink);
  padding: 1.4rem clamp(1.25rem, 5vw, 6rem);
  color: var(--ink-3);
  background: var(--paper-2);
}
.footer p { margin: 0; }

.guide-main { padding: clamp(3rem, 7vw, 6rem) clamp(1rem, 5vw, 6rem); }
.guide-article { width: min(960px, 100%); margin: 0 auto; }
.guide-body { background: var(--paper); }
.guide-article h1 { max-width: 14ch; font-size: clamp(3rem, 8vw, 7rem); }
.guide-article section { border-top: 3px solid var(--ink); padding-top: 2rem; margin-top: 2rem; }
.guide-article code { background: var(--paper-3); color: var(--blue); padding: 0.1rem 0.3rem; border-radius: 8px; border: 2px solid var(--rule); }
.guide-card { background: var(--paper-2); border: 3px solid var(--ink); border-radius: 20px; padding: 1.1rem; }
.guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.2rem; }
.guide-card h3 { text-align: left; }
.guide-card p { color: var(--ink-2); line-height: 1.6; margin: 0; }
.guide-intro, .guide-note { color: var(--ink-2); line-height: 1.7; }
.pass-list { color: var(--ink-2); line-height: 1.75; }
.pass-list li { margin-top: 0.6rem; }

@media (max-width: 980px) {
  .hero-panel, .closing, .split-heading { grid-template-columns: 1fr; }
  .comic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .site-header { align-items: flex-start; flex-direction: column; }
  .nav { justify-content: flex-start; }
  .hero-panel { padding-top: 3.2rem; }
  h1 { font-size: clamp(3rem, 17vw, 4.6rem); }
  .comic-grid { grid-template-columns: 1fr; }
  .hero-actions .button { width: 100%; }
  .character-bar { gap: 0.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
