:root {
  --paper: #fffefb;
  --paper-soft: #f4f0ea;
  --ink: #050505;
  --lime: #b7ff00;
  --lime-soft: #a6f05b;
  --grey: #cfcac1;
  --shadow: #050505;
  --font-display: "Darumadrop One", "Gaegu", "Comic Sans MS", system-ui, sans-serif;
  --font-body: "Gaegu", "Comic Sans MS", system-ui, sans-serif;
  --radius-xl: 28px 38px 24px 34px / 34px 24px 38px 28px;
  --radius-lg: 20px 28px 18px 25px / 26px 18px 30px 22px;
  --border: 5px solid var(--ink);
  --border-thin: 3px solid var(--ink);
  --max: 1060px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 18px 18px, rgba(0,0,0,.03) 1.5px, transparent 1.5px) 0 0 / 42px 42px,
    linear-gradient(180deg, #fff 0%, var(--paper) 60%, #fff 100%);
  font-family: var(--font-body);
  font-weight: 800;
  letter-spacing: 0;
  overflow-x: hidden;
}

body::selection {
  background: var(--lime);
  color: var(--ink);
}

body.no-motion *,
body.no-motion *::before,
body.no-motion *::after {
  animation: none !important;
  transition: none !important;
}

img, svg, canvas {
  display: block;
  max-width: 100%;
}

button,
a,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  color: inherit;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(8px, 1.7vw, 22px);
  width: min(100%, 1420px);
  margin: 0 auto;
  padding: 14px clamp(14px, 3.4vw, 48px) 8px;
  background: rgba(255,255,255,.93);
  backdrop-filter: blur(10px);
  border-bottom: 4px solid rgba(0,0,0,.05);
}

.mini-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  line-height: 1;
  text-transform: lowercase;
}

.mini-brand svg {
  width: 45px;
  height: 45px;
  transform: rotate(-8deg);
}

.mini-brand img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  transform: rotate(-8deg);
}

.ca-strip {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 8px 10px;
  text-align: left;
  border-radius: 18px;
}

.ca-strip:hover {
  background: #f3f0ea;
}

.ca-strip:focus-visible,
.social-link:focus-visible,
.btn:focus-visible,
.sound-toggle:focus-visible,
.trait-control button:focus-visible,
.gallery-tools input:focus-visible,
.name-field input:focus-visible {
  outline: 5px solid var(--lime);
  outline-offset: 4px;
}

.ca-icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
}

.ca-strip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(12px, 1.6vw, 16px);
}

.ca-strip strong {
  font-weight: 950;
}

.social-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(8px, 1.6vw, 22px);
}

.social-link {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  transform: rotate(var(--r, 0deg));
  transition: transform .18s ease, background .18s ease;
}

.social-link:nth-child(1) { --r: -8deg; }
.social-link:nth-child(2) { --r: 9deg; }
.social-link:nth-child(3) { --r: -5deg; }
.social-link:nth-child(4) { --r: 3deg; }
.social-link:nth-child(5) { --r: 12deg; }

.social-link:hover {
  background: var(--lime);
  transform: translateY(-4px) rotate(var(--r));
}

.social-link svg,
.social-link img {
  width: 31px;
  height: 31px;
  object-fit: contain;
  display: block;
}

main,
.site-footer {
  position: relative;
  z-index: 1;
}

.hero {
  position: relative;
  width: min(100% - 32px, 1500px);
  min-height: min(640px, calc(100vh - 68px));
  margin: 0 auto;
  display: grid;
  place-items: center;
  padding: clamp(44px, 7vw, 84px) 0 clamp(30px, 5vw, 52px);
}

.hero-copy {
  width: min(100%, 860px);
  text-align: center;
}

.hero-side-hoody {
  position: absolute;
  top: 48%;
  z-index: 0;
  width: clamp(150px, 18vw, 285px);
  height: auto;
  object-fit: contain;
  pointer-events: none;
  filter: saturate(1.08) contrast(1.04);
}

.hero-side-hoody-left {
  left: clamp(8px, 4vw, 72px);
  transform: translateY(-50%) rotate(-8deg);
}

.hero-side-hoody-right {
  right: clamp(8px, 4vw, 72px);
  transform: translateY(-50%) rotate(7deg) scaleX(-1);
}

.eyebrow {
  display: inline-flex;
  border: var(--border-thin);
  border-radius: 999px;
  padding: 10px 16px;
  background: #fff;
  box-shadow: 5px 5px 0 var(--shadow);
  margin: 0 0 22px;
  font-size: clamp(14px, 1.6vw, 18px);
}

.hero h1 {
  margin: 0;
  font-size: clamp(70px, 12vw, 148px);
  letter-spacing: 0;
  line-height: .82;
  text-transform: lowercase;
  font-weight: 950;
  transform: rotate(-1.1deg);
}

.byline {
  margin: 14px 0 clamp(30px, 5.5vw, 56px);
  font-size: clamp(21px, 2.4vw, 32px);
  transform: rotate(1.5deg);
}

.hero-actions,
.footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: center;
}

.btn {
  --btn-bg: #fff;
  --btn-fg: var(--ink);
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 18px;
  border: var(--border);
  border-radius: 20px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  box-shadow: none;
  cursor: pointer;
  line-height: 1;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translate(-2px, -2px) rotate(-1deg);
  box-shadow: none;
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.btn svg {
  width: 27px;
  height: 27px;
}

.btn-black {
  --btn-bg: var(--ink);
  --btn-fg: #fff;
}

.btn-white {
  --btn-bg: #fff;
  --btn-fg: var(--ink);
}

.hero-leap {
  min-width: min(100%, 440px);
  min-height: clamp(62px, 7vw, 78px);
  border-radius: 28px 20px 30px 24px / 22px 30px 24px 28px;
  font-size: clamp(26px, 4vw, 44px);
  box-shadow: none;
  transform: rotate(-.7deg);
}

.btn-slim {
  min-height: 42px;
  border-width: 4px;
  border-radius: 18px;
  box-shadow: none;
  padding-inline: 18px;
  background: #fff;
}

.hero-mascot-card {
  justify-self: center;
  width: min(560px, 88vw);
  border: var(--border);
  border-radius: 44px;
  background: var(--paper-soft);
  box-shadow: 13px 13px 0 var(--shadow);
  padding: clamp(8px, 1.6vw, 24px);
  transform: rotate(2deg);
  animation: mascotBreathe 3.4s ease-in-out infinite;
}

.hero-mascot-card img {
  width: 100%;
  filter: saturate(1.08) contrast(1.02);
}

@keyframes mascotBreathe {
  0%, 100% { transform: translateY(0) rotate(2deg); }
  50% { transform: translateY(-11px) rotate(-1deg); }
}

.panel {
  border: var(--border);
  border-radius: var(--radius-xl);
  background: #fff;
  box-shadow: none;
}

.panel-small {
  padding: 18px 20px;
  max-width: 320px;
}

.hero-note {
  grid-column: 1 / 2;
  max-width: 360px;
  transform: rotate(2deg);
}

.hero-note strong,
.hero-note span {
  display: block;
}

.available {
  width: min(100% - 32px, 1000px);
  margin: 0 auto clamp(38px, 6vw, 72px);
  display: grid;
  place-items: center;
  gap: 18px;
}

.available h2,
.section-heading h2,
.final-card h2 {
  margin: 0;
  font-size: clamp(36px, 5.8vw, 74px);
  line-height: .95;
  letter-spacing: 0;
  text-align: center;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.badge {
  border: var(--border-thin);
  border-radius: 999px;
  min-width: 96px;
  padding: 9px 15px;
  text-align: center;
  background: #fff;
  box-shadow: none;
  transform: rotate(var(--badge-tilt, -1deg));
}

.badge:nth-child(even) { --badge-tilt: 2deg; }
.badge:hover { background: var(--lime); }

.generator-section,
.lore-section,
.gallery-section {
  width: min(100% - 32px, var(--max));
  margin: 0 auto clamp(44px, 6vw, 78px);
  scroll-margin-top: 92px;
}

.section-heading {
  text-align: center;
  margin-bottom: clamp(18px, 3.6vw, 32px);
}

.section-heading p {
  margin: 8px 0 0;
  font-size: clamp(21px, 3vw, 32px);
  line-height: 1.1;
}

.section-heading.compact p {
  font-size: clamp(18px, 2vw, 26px);
}

.generator-layout {
  display: grid;
  grid-template-columns: minmax(660px, 860px) minmax(230px, 300px);
  gap: clamp(14px, 2.4vw, 24px);
  align-items: start;
  justify-content: center;
}

.side-card {
  padding: 18px 18px 20px;
  position: relative;
  top: auto;
}

.side-card h3,
.comic-panel h3 {
  margin: 8px 0 10px;
  font-size: clamp(22px, 2.1vw, 28px);
  line-height: 1.05;
}

.side-card h4 {
  font-size: 25px;
  margin: 12px 0 0;
}

.side-card p,
.comic-panel p,
.final-card p {
  margin: 0 0 11px;
  font-size: 16px;
  line-height: 1.33;
}

.left-card {
  transform: rotate(-1.8deg);
}

.right-card {
  transform: rotate(1.4deg);
}

.sticker {
  display: inline-flex;
  border: var(--border-thin);
  border-radius: 999px;
  background: var(--lime);
  padding: 6px 12px;
  box-shadow: none;
  text-transform: uppercase;
  font-size: 14px;
}

.sticker-tilt {
  transform: rotate(6deg);
  background: #fff;
}

.check-list {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
}

.check-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  font-size: 15px;
}

.check-list li::before {
  content: "✓";
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--lime);
  line-height: 1;
}

.maker-card {
  width: min(100%, 860px);
  justify-self: center;
  display: grid;
  grid-template-columns: minmax(320px, 460px) minmax(250px, 330px);
  gap: clamp(14px, 2vw, 20px);
  align-items: start;
}

.canvas-frame {
  width: 100%;
  max-width: 460px;
  justify-self: center;
  aspect-ratio: 1 / 1;
  border: var(--border);
  border-radius: 28px 22px 30px 24px / 23px 31px 24px 29px;
  background: var(--paper-soft);
  overflow: hidden;
  box-shadow: none;
  transform: none;
}

.canvas-frame canvas {
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  max-width: none;
  margin: -1px;
  border-radius: inherit;
}

.control-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.name-field {
  display: block;
  margin: 0;
}

.name-field input,
.gallery-tools input {
  width: 100%;
  min-height: 52px;
  border: var(--border);
  border-radius: 20px;
  background: #fff;
  color: var(--ink);
  padding: 0 20px;
  font-size: clamp(16px, 2.4vw, 21px);
  box-shadow: none;
}

.name-field input::placeholder,
.gallery-tools input::placeholder {
  color: rgba(0,0,0,.35);
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 0;
}

.button-row .btn {
  width: 100%;
  min-width: 0;
}

.button-row-slim {
  margin-top: 0;
  gap: 14px;
}

.trait-stack {
  display: grid;
  gap: 12px;
  margin-top: 0;
}

.trait-control {
  min-height: 52px;
  display: grid;
  grid-template-columns: 54px 1fr 54px;
  align-items: center;
  border: var(--border);
  border-radius: 18px 24px 16px 22px / 22px 16px 24px 18px;
  background: #fff;
  overflow: hidden;
}

.trait-control strong {
  text-align: center;
  font-size: clamp(16px, 2vw, 20px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-inline: 8px;
}

.trait-control button {
  height: 100%;
  border: 0;
  background: transparent;
  font-size: 30px;
  cursor: pointer;
  line-height: 1;
}

.trait-control button:hover {
  background: var(--lime);
}

.note-column {
  display: grid;
  gap: 18px;
  align-self: start;
}

.lore-section {
  padding-top: 10px;
}

.comic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(14px, 2.4vw, 22px);
}

.comic-panel {
  position: relative;
  min-height: 185px;
  padding: 22px 18px 20px;
  background: #fff;
}

.comic-panel:nth-child(1) { transform: rotate(-1.5deg); }
.comic-panel:nth-child(2) { transform: rotate(1deg); }
.comic-panel:nth-child(3) { transform: rotate(-.5deg); }

.panel-number {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: var(--border-thin);
  border-radius: 50%;
  background: var(--lime);
  box-shadow: none;
}

.ticker-section {
  display: grid;
  gap: 8px;
  margin: clamp(42px, 6vw, 76px) 0;
  overflow: hidden;
}

.ticker {
  border-block: 5px solid var(--ink);
  background: #fff;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  font-size: clamp(20px, 3.2vw, 42px);
  line-height: 1.08;
  text-transform: uppercase;
}

.ticker span {
  display: inline-block;
  padding: 8px 0;
  animation: marquee 20s linear infinite;
  min-width: max-content;
}

.ticker-b {
  background: var(--ink);
  color: #fff;
  transform: rotate(-1deg) scaleX(1.02);
}

.ticker-b span { animation-duration: 24s; animation-direction: reverse; }
.ticker-c span { animation-duration: 18s; }
.ticker-d { transform: rotate(1deg) scaleX(1.02); }
.ticker-d span { animation-duration: 26s; animation-direction: reverse; }

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.gallery-grid {
  column-count: 2;
  column-gap: clamp(28px, 4vw, 46px);
  width: min(100%, 980px);
  margin: 0 auto;
}

.local-gallery:empty {
  display: none;
}

.gallery-card {
  position: relative;
  display: inline-block;
  width: 100%;
  border: 0;
  border-radius: 20px 16px 18px 22px / 18px 22px 16px 20px;
  background: transparent;
  box-shadow: none;
  break-inside: avoid;
  overflow: hidden;
  margin: 0 0 clamp(28px, 4vw, 46px);
  padding: 0;
  transform: rotate(var(--tilt, 0deg)) scale(.97);
  transition: transform .15s ease, box-shadow .15s ease;
}

.gallery-card::before {
  content: none;
}

.gallery-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border: var(--border);
  border-radius: inherit;
  box-sizing: border-box;
  pointer-events: none;
}

.gallery-card:nth-child(6n+1) { --tilt: -.5deg; }
.gallery-card:nth-child(6n+2) { --tilt: .45deg; }
.gallery-card:nth-child(6n+3) { --tilt: -.25deg; }
.gallery-card:nth-child(6n+4) { --tilt: .55deg; }
.gallery-card:nth-child(6n+5) { --tilt: -.35deg; }
.gallery-card:nth-child(6n+6) { --tilt: .25deg; }

.gallery-card:hover {
  transform: translateY(-4px) rotate(var(--tilt)) scale(.97);
}

.gallery-image-frame {
  width: 100%;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  border-radius: inherit;
  overflow: hidden;
}

.gallery-image-frame:empty {
  aspect-ratio: 1 / 1;
  background: #fff;
}

.gallery-image-frame img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.gallery-meta strong {
  display: block;
  font-size: 16px;
  margin-bottom: 6px;
}

.gallery-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gallery-tags span {
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 11px;
  background: var(--lime);
}

.final-card {
  width: min(100% - 32px, 780px);
  margin: 0 auto clamp(42px, 6vw, 72px);
  padding: clamp(20px, 3vw, 34px);
  text-align: center;
  transform: rotate(-.5deg);
}

.final-card p {
  max-width: 720px;
  margin: 18px auto 24px;
  font-size: clamp(17px, 2vw, 22px);
}

.footer-actions {
  justify-content: center;
}

.site-footer {
  width: min(100% - 32px, var(--max));
  margin: 0 auto;
  padding: 30px 0 44px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  border-top: 5px solid var(--ink);
}

.sound-toggle {
  position: fixed;
  right: clamp(18px, 3vw, 36px);
  bottom: clamp(18px, 3vw, 36px);
  z-index: 30;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  animation: pulseSpeaker 2.2s ease-in-out infinite;
}

.sound-toggle svg {
  width: 54px;
  height: 54px;
}

@keyframes pulseSpeaker {
  0%,100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.06) rotate(-3deg); }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  z-index: 40;
  transform: translate(-50%, 130%);
  border: var(--border-thin);
  border-radius: 999px;
  padding: 12px 22px;
  background: var(--lime);
  color: var(--ink);
  box-shadow: 5px 5px 0 var(--shadow);
  opacity: 0;
  transition: transform .18s ease, opacity .18s ease;
}

.toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.click-pop {
  position: fixed;
  z-index: 50;
  left: 0;
  top: 0;
  pointer-events: none;
  font-size: 22px;
  color: var(--ink);
  transform: translate(-50%, -50%);
  animation: clickPop .75s ease-out forwards;
}

@keyframes clickPop {
  from { opacity: 1; transform: translate(-50%, -50%) scale(.7) rotate(-9deg); }
  to { opacity: 0; transform: translate(-50%, -110%) scale(1.4) rotate(10deg); }
}

@media (max-width: 1060px) {
  .generator-layout {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
  }

  .side-card {
    position: static;
    width: auto;
  }

  .maker-card {
    order: 1;
  }

  .note-column {
    order: 2;
    width: min(100%, 860px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .left-card,
  .right-card {
    transform: rotate(0deg);
  }

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

  .gallery-grid { column-count: 2; }
}

@media (max-width: 820px) {
  .topbar {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 12px 14px 8px;
  }

  .ca-strip {
    width: 100%;
    justify-content: center;
  }

  .social-nav {
    justify-content: center;
    gap: 8px;
  }

  .hero { min-height: auto; padding-top: 46px; }

  .hero-copy { text-align: center; transform: none; }

  .hero-actions {
    justify-content: center;
  }

  .maker-card {
    grid-template-columns: 1fr;
    width: min(100%, 520px);
  }

  .note-column {
    grid-template-columns: 1fr;
    width: min(100%, 530px);
  }

  .hero-note {
    grid-column: auto;
    justify-self: center;
  }

  .gallery-tools {
    grid-template-columns: 1fr;
  }

  .gallery-grid { column-count: 1; }

  .hero-side-hoody {
    display: none;
  }
}

@media (max-width: 560px) {
  :root {
    --border: 5px solid var(--ink);
    --border-thin: 3px solid var(--ink);
  }

  .hero h1 {
    font-size: clamp(62px, 22vw, 110px);
  }

  .button-row {
    grid-template-columns: 1fr;
  }

  .trait-control {
    grid-template-columns: 52px 1fr 52px;
    min-height: 58px;
  }

  .trait-control button {
    font-size: 31px;
  }

  .sound-toggle {
    width: 58px;
    height: 58px;
  }

  .sound-toggle svg {
    width: 54px;
    height: 54px;
  }

  .hero-leap { font-size: clamp(25px, 10vw, 40px); }
}
