:root {
  --sky: #63b3f2;
  --sky-deep: #2f86de;
  --chute: #2f6b3f;
  --chute-light: #e9f1e4;
  --paper: #f6f1e7;
  --ink: #1b1b1b;
  --white: #ffffff;
  --gold: #ffcc33;
  --rare: #8a4fff;
  --radius: 22px;
  --shadow: 0 6px 0 var(--ink);
  --display: "Luckiest Guy", system-ui, sans-serif;
  --body: "Nunito", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  font-weight: 800;
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky-deep) 0%, var(--sky) 45%, #a9d7fb 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, .logo, .ticker, .sign, .step-n { font-family: var(--display); font-weight: 400; }

/* ---------- clouds ---------- */
.clouds { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.cloud {
  position: absolute;
  width: 160px; height: 52px;
  background: var(--white);
  border-radius: 60px;
  opacity: .9;
  animation: drift linear infinite;
}
.cloud::before, .cloud::after {
  content: ""; position: absolute; background: var(--white); border-radius: 50%;
}
.cloud::before { width: 70px; height: 70px; top: -34px; left: 26px; }
.cloud::after { width: 90px; height: 90px; top: -50px; left: 64px; }
.c1 { top: 14%; animation-duration: 70s; animation-delay: -10s; }
.c2 { top: 42%; transform: scale(.7); animation-duration: 90s; animation-delay: -50s; }
.c3 { top: 70%; transform: scale(1.2); animation-duration: 110s; animation-delay: -30s; }
.c4 { top: 88%; transform: scale(.8); animation-duration: 80s; animation-delay: -65s; }
@keyframes drift {
  from { left: -220px; }
  to { left: 110%; }
}

/* ---------- nav ---------- */
.nav {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1160px; margin: 0 auto; padding: 18px 16px;
}
.logo {
  font-size: 34px; color: var(--white); text-decoration: none;
  text-shadow: 3px 3px 0 var(--ink);
}
.nav-left { display: flex; align-items: center; gap: 16px; min-width: 0; }

/* ---------- petition ---------- */
.petition {
  position: relative; display: flex; flex-direction: column; gap: 5px; width: 300px; padding: 8px 12px;
  font: inherit; color: var(--ink); text-align: left; cursor: pointer;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 14px; box-shadow: 0 4px 0 var(--ink);
  transition: transform .1s, box-shadow .1s;
}
.petition:hover { transform: translateY(-2px) rotate(-1deg); box-shadow: 0 6px 0 var(--ink); }
.petition.signed { cursor: default; transform: none; box-shadow: 0 4px 0 var(--ink); }
.petition-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.petition-title { font-family: var(--display); font-size: 15px; white-space: nowrap; }
.petition-cta {
  font-size: 11px; white-space: nowrap; background: var(--chute); color: var(--white);
  border-radius: 999px; padding: 2px 8px; animation: pulse-cta 1.6s ease-in-out infinite;
}
.petition.signed .petition-cta { background: var(--white); color: var(--ink); border: 2px solid var(--ink); animation: none; }
@keyframes pulse-cta { 50% { transform: scale(1.08); } }
.petition-bar { height: 12px; background: var(--white); border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; }
.petition-fill {
  display: block; height: 100%; width: 0;
  background: repeating-linear-gradient(45deg, var(--chute) 0 8px, #3f8c55 8px 16px);
  transition: width .6s cubic-bezier(.3, 1.4, .5, 1);
}
.petition-count { font-size: 12px; }
.petition-plus {
  position: absolute; right: 10px; bottom: 6px; font-family: var(--display); font-size: 20px; color: var(--chute);
  opacity: 0; pointer-events: none;
}
.petition-plus.pop { animation: plus-one 1s ease-out; }
@keyframes plus-one {
  0% { opacity: 1; transform: translateY(0) scale(.8); }
  100% { opacity: 0; transform: translateY(-34px) scale(1.3); }
}
.nav nav { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.nav nav a {
  color: var(--ink); background: var(--white); text-decoration: none;
  padding: 8px 14px; border: 3px solid var(--ink); border-radius: 999px; font-size: 14px;
  box-shadow: 0 3px 0 var(--ink);
}
.nav nav a:hover { transform: translateY(-2px); }

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

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center;
  max-width: 1160px; margin: 0 auto; padding: 24px 16px 64px;
}
.ticker {
  display: inline-block; font-size: 22px; color: var(--white);
  background: var(--chute); padding: 6px 16px; border: 3px solid var(--ink); border-radius: 12px;
  box-shadow: 0 4px 0 var(--ink); transform: rotate(-3deg);
}
.hero h1 {
  font-size: clamp(64px, 11vw, 136px); line-height: .9; margin: 18px 0 16px;
  color: var(--white);
  text-shadow: 5px 5px 0 var(--ink);
  -webkit-text-stroke: 3px var(--ink);
}
.lede { font-size: 20px; line-height: 1.45; max-width: 30ch; color: var(--ink); margin: 0 0 24px; }

.ca {
  display: inline-flex; align-items: center; gap: 10px; max-width: 100%;
  background: var(--white); border: 3px solid var(--ink); border-radius: 14px;
  padding: 8px 8px 8px 14px; box-shadow: 0 4px 0 var(--ink);
}
.ca-label { font-family: var(--display); }
.ca code { font-family: ui-monospace, Consolas, monospace; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ca-copy {
  font: inherit; font-size: 14px; cursor: pointer;
  background: var(--chute); color: var(--white); border: 2px solid var(--ink); border-radius: 10px; padding: 6px 12px;
}
.ca-copy:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- maker ---------- */
.maker { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.dog-frame {
  position: relative; display: block; padding: 0; cursor: pointer;
  width: min(420px, 100%); aspect-ratio: 1;
  background: var(--white); border: 5px solid var(--ink); border-radius: var(--radius);
  box-shadow: 0 10px 0 var(--ink); overflow: hidden;
  animation: bob 4s ease-in-out infinite;
  transition: transform .15s;
}
.dog-frame:hover { transform: translateY(-4px) rotate(-1deg); }
.dog-frame:active { transform: translateY(2px); }
.dog-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.dog-frame:disabled { cursor: progress; }
.loading {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: rgba(255, 255, 255, .6); backdrop-filter: blur(6px);
  font-size: 18px; text-align: center; padding: 16px;
}
.loading[hidden] { display: none; }
.chute { font-size: 64px; animation: float 1.6s ease-in-out infinite; }
@keyframes float {
  0%, 100% { transform: translateY(-8px) rotate(-6deg); }
  50% { transform: translateY(8px) rotate(6deg); }
}
.error {
  margin: 0; width: min(420px, 100%); text-align: center;
  background: #ffe1e1; border: 3px solid var(--ink); border-radius: 14px; padding: 10px 14px;
}
.error[data-kind="notice"] { background: #fff4c2; }
.error[hidden] { display: none; }
.btn:disabled { opacity: .5; cursor: progress; }
.dog-frame.dropping { animation: drop .55s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes bob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -10px; }
}
@keyframes drop {
  0% { translate: 0 -40px; rotate: -4deg; }
  60% { translate: 0 6px; rotate: 2deg; }
  100% { translate: 0 0; rotate: 0deg; }
}
.hint {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  background: var(--ink); color: var(--white); padding: 8px 16px; border-radius: 999px;
  font-size: 16px; white-space: nowrap;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 50% { transform: translateX(-50%) scale(1.08); } }

.result {
  width: min(420px, 100%); text-align: center;
  background: var(--paper); border: 4px solid var(--ink); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
.result[hidden] { display: none; }
.dog-name { margin: 0; font-family: var(--display); font-size: 26px; display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }
.rarity {
  font-family: var(--body); font-size: 13px; text-transform: uppercase; letter-spacing: .06em;
  padding: 4px 10px; border-radius: 999px; border: 2px solid var(--ink); background: var(--white);
}
.rarity[data-tier="Rare"] { background: var(--sky-deep); color: var(--white); }
.rarity[data-tier="Epic"] { background: var(--rare); color: var(--white); }
.rarity[data-tier="Legendary"] { background: var(--gold); box-shadow: 0 0 14px var(--gold); }
.dog-trait { margin: 6px 0 14px; font-size: 18px; }
.actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn {
  font: inherit; font-size: 15px; cursor: pointer; text-decoration: none; color: var(--ink);
  background: var(--white); border: 3px solid var(--ink); border-radius: 12px; padding: 10px 16px;
  box-shadow: 0 4px 0 var(--ink); transition: transform .1s, box-shadow .1s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn-primary { background: var(--chute); color: var(--white); }
.btn-generate {
  width: min(420px, 100%); margin-top: 8px; padding: 16px 20px;
  font-family: var(--display); font-size: 26px; letter-spacing: .02em;
  border-width: 4px; border-radius: 16px; box-shadow: 0 6px 0 var(--ink);
}
.btn-generate:hover { box-shadow: 0 8px 0 var(--ink); }
.btn-generate:not(:disabled) { animation: nudge 2.6s ease-in-out infinite; }
@keyframes nudge {
  0%, 85%, 100% { transform: translateY(0); }
  90% { transform: translateY(-4px) rotate(-1deg); }
  95% { transform: translateY(0) rotate(1deg); }
}

/* ---------- rarity frames ---------- */
:root {
  --tier-common: #ffffff;
  --tier-rare: #2f86de;
  --tier-epic: #8a4fff;
  --tier-legendary: #ffcc33;
}
.dog-frame[data-tier="Rare"] { box-shadow: 0 0 0 6px var(--tier-rare), 0 10px 0 6px var(--ink); }
.dog-frame[data-tier="Epic"] { box-shadow: 0 0 0 6px var(--tier-epic), 0 0 34px 10px var(--tier-epic), 0 10px 0 6px var(--ink); }
.dog-frame[data-tier="Legendary"] { box-shadow: 0 0 0 6px var(--tier-legendary), 0 0 44px 16px var(--tier-legendary), 0 10px 0 6px var(--ink); }

/* ---------- hall of fame callouts ---------- */
.nav nav a.nav-hall { background: var(--gold); display: inline-flex; align-items: center; gap: 6px; }
.nav-count {
  font-size: 11px; background: var(--ink); color: var(--gold); border-radius: 999px; padding: 2px 7px;
}
.nav-count[hidden] { display: none; }

.hall-teaser {
  width: min(420px, 100%); display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; text-decoration: none; color: var(--ink); text-align: left;
  background: linear-gradient(135deg, #fff6b0, var(--gold)); border: 4px solid var(--ink); border-radius: 16px;
  box-shadow: 0 5px 0 var(--ink); transition: transform .1s, box-shadow .1s;
}
.hall-teaser:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--ink); }
.teaser-thumbs { display: flex; flex-shrink: 0; }
.teaser-thumbs:empty { display: none; }
.teaser-thumbs img {
  width: 40px; height: 40px; object-fit: cover; border-radius: 50%; border: 3px solid var(--ink); background: var(--white);
}
.teaser-thumbs img + img { margin-left: -12px; }
.teaser-thumbs img[data-tier="Rare"] { border-color: var(--tier-rare); }
.teaser-thumbs img[data-tier="Epic"] { border-color: var(--tier-epic); }
.teaser-thumbs img[data-tier="Legendary"] { box-shadow: 0 0 0 2px var(--ink), 0 0 10px var(--tier-legendary); border-color: var(--tier-legendary); }
.teaser-text { flex: 1; display: flex; flex-direction: column; min-width: 0; font-size: 14px; }
.teaser-text strong { font-family: var(--display); font-weight: 400; font-size: 20px; }
.teaser-arrow { font-size: 26px; font-family: var(--display); }

/* ---------- claim ---------- */
.claim {
  margin-top: 16px; padding: 14px; text-align: left;
  background: linear-gradient(135deg, #fff6b0, var(--gold)); border: 3px solid var(--ink); border-radius: 16px;
}
.claim[hidden] { display: none; }
.claim label { display: block; font-family: var(--display); font-size: 20px; margin-bottom: 4px; }
.claim-pitch { margin: 0 0 10px; font-size: 14px; line-height: 1.4; }
.claim-row { display: flex; gap: 8px; }
.claim-row input {
  flex: 1; min-width: 0; font: inherit; font-size: 14px; font-family: ui-monospace, Consolas, monospace;
  padding: 10px 12px; border: 3px solid var(--ink); border-radius: 12px; background: var(--white); color: var(--ink);
}
.claim-warn { font-size: 12px; margin: 8px 0 0; opacity: .75; line-height: 1.4; }
.claim-error {
  margin: 10px 0 0; font-size: 14px; background: #ffe1e1; border: 2px solid var(--ink); border-radius: 10px; padding: 8px 10px;
}
.claim-error[hidden], .claimed[hidden] { display: none; }
.claimed { margin: 14px 0 0; font-size: 15px; background: #e2f6e4; border: 2px solid var(--ink); border-radius: 10px; padding: 10px; }

/* ---------- hall of fame ---------- */
.hall { max-width: 1160px; margin: 0 auto; padding: 96px 16px 32px; text-align: center; }
.hall h2 {
  font-size: clamp(40px, 6vw, 64px); margin: 0 0 12px; color: var(--white);
  text-shadow: 4px 4px 0 var(--ink); -webkit-text-stroke: 2px var(--ink);
}
.hall-count {
  display: inline-block; margin: 0 0 10px; font-size: 18px;
  background: var(--white); border: 3px solid var(--ink); border-radius: 999px; padding: 6px 16px; box-shadow: 0 4px 0 var(--ink);
}
.hall-sub { margin: 0 auto 32px; max-width: 40ch; font-size: 17px; }
.hall-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px; text-align: left; }
.hall-empty { grid-column: 1 / -1; text-align: center; font-size: 18px; opacity: .8; }

@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.hall-card {
  position: relative; margin: 0; padding: 10px; border: 4px solid var(--ink); border-radius: var(--radius);
  background: var(--tier-common); box-shadow: var(--shadow);
}
.hall-card[data-tier="Rare"] { background: linear-gradient(160deg, #7cc0ff, var(--tier-rare)); }
.hall-card[data-tier="Epic"] { background: linear-gradient(160deg, #c3a2ff, var(--tier-epic)); box-shadow: var(--shadow), 0 0 26px var(--tier-epic); }
.hall-card[data-tier="Legendary"] {
  background: conic-gradient(from var(--spin), #ffcc33, #fff6b0, #ff9f1c, #fff6b0, #ffcc33);
  box-shadow: var(--shadow), 0 0 32px var(--tier-legendary);
  animation: spin 4s linear infinite;
}
@keyframes spin { to { --spin: 360deg; } }
.hall-card img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border: 3px solid var(--ink); border-radius: 14px; background: var(--white); }
.tier-tag {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%); z-index: 1;
  font-size: 12px; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap;
  background: var(--white); border: 3px solid var(--ink); border-radius: 999px; padding: 3px 12px;
}
.hall-card[data-tier="Rare"] .tier-tag { background: var(--tier-rare); color: var(--white); }
.hall-card[data-tier="Epic"] .tier-tag { background: var(--tier-epic); color: var(--white); }
.hall-card[data-tier="Legendary"] .tier-tag { background: var(--tier-legendary); }
.hall-card figcaption {
  display: flex; flex-direction: column; gap: 2px; margin-top: 10px; padding: 8px 10px;
  background: var(--white); border: 3px solid var(--ink); border-radius: 12px;
}
.hall-card strong { font-family: var(--display); font-weight: 400; font-size: 20px; }
.hall-card figcaption span { font-size: 14px; }
.addr { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--ink); opacity: .8; }
.addr:hover { opacity: 1; }

/* ---------- marquee (parachute stripes) ---------- */
.marquee {
  overflow: hidden; border-block: 5px solid var(--ink);
  background: repeating-linear-gradient(90deg, var(--chute) 0 120px, var(--chute-light) 120px 240px);
  transform: rotate(-1.5deg); margin: 0 -20px;
}
.marquee-track { display: flex; width: max-content; animation: scroll 30s linear infinite; }
.marquee span {
  font-family: var(--display); font-size: 34px; padding: 14px 28px; color: var(--white);
  text-shadow: 3px 3px 0 var(--ink); -webkit-text-stroke: 1.5px var(--ink);
}
@keyframes scroll { to { transform: translateX(-50%); } }

/* ---------- thesis ---------- */
.thesis, .join { max-width: 900px; margin: 0 auto; padding: 96px 16px 32px; text-align: center; }
.thesis h2, .join h2 {
  font-size: clamp(40px, 6vw, 64px); margin: 0 0 20px; color: var(--white);
  text-shadow: 4px 4px 0 var(--ink); -webkit-text-stroke: 2px var(--ink);
}
.thesis p { font-size: 20px; line-height: 1.5; margin: 0 auto 16px; max-width: 34ch; }
.thesis .big { font-size: clamp(24px, 3.4vw, 34px); max-width: 24ch; }
.sign {
  display: inline-block; font-size: clamp(44px, 8vw, 84px); margin: 12px 0 28px !important; max-width: none !important;
  background: var(--paper); padding: 12px 36px 4px; border: 4px solid var(--ink); border-radius: 8px;
  box-shadow: var(--shadow); transform: rotate(-2deg);
}

/* ---------- join ---------- */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; text-align: left; }
.steps li {
  position: relative; background: var(--white); border: 4px solid var(--ink); border-radius: var(--radius);
  padding: 28px 20px 20px; box-shadow: var(--shadow);
}
.steps li:nth-child(2) { transform: rotate(1.5deg); }
.steps li:nth-child(3) { transform: rotate(-1deg); }
.step-n {
  position: absolute; top: -22px; left: 18px; width: 44px; height: 44px; display: grid; place-items: center;
  background: var(--chute); color: var(--white); font-size: 24px; border: 3px solid var(--ink); border-radius: 50%;
}
.steps h3 { font-size: 26px; margin: 4px 0 8px; }
.steps p { margin: 0; font-size: 16px; line-height: 1.45; }

/* ---------- footer ---------- */
.footer { max-width: 900px; margin: 0 auto; padding: 64px 16px 40px; text-align: center; }
.socials { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 20px; }
.socials a {
  color: var(--ink); background: var(--white); text-decoration: none; padding: 10px 18px;
  border: 3px solid var(--ink); border-radius: 999px; box-shadow: 0 4px 0 var(--ink);
}
.disclaimer { font-size: 13px; line-height: 1.5; opacity: .8; max-width: 60ch; margin: 0 auto; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); text-align: center; gap: 32px; }
  .hero > * { min-width: 0; }
  .lede { margin-inline: auto; }
  .steps { grid-template-columns: 1fr; gap: 32px; }
  .steps li { transform: none !important; }
}
@media (max-width: 700px) {
  .nav { flex-wrap: wrap; row-gap: 12px; }
  .nav-left { display: contents; }
  .petition { order: 3; width: 100%; }
}
@media (max-width: 520px) {
  .nav nav a { padding: 6px 10px; font-size: 12px; }
  .nav nav a:not(:first-child):not(.nav-hall) { display: none; }
  .logo { font-size: 28px; }
  .marquee span { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
