:root {
  --ink: #1f2328;
  --ink-soft: #4a4f57;
  --paper: #f4ecdd;
  --paper-2: #ebe0cb;
  --card: #fffaf0;
  --ochre: #c98a3c;
  --hat: #f5c518;
  --brick: #b5532f;
  --green: #4f7a3a;
  --line: rgba(31, 35, 40, .12);
  --shadow: 0 18px 40px -18px rgba(31, 35, 40, .45);
  --radius: 22px;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "DM Sans", system-ui, sans-serif;
  --hand: "Caveat", cursive;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.6 var(--body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { text-wrap: balance; font-family: var(--display); line-height: 1.05; margin: 0; letter-spacing: -.02em; }
h1 { font-size: clamp(2.6rem, 6.5vw, 5rem); font-weight: 800; }
h2 { font-size: clamp(2rem, 4.5vw, 3.2rem); font-weight: 800; }
h3 { font-size: 1.35rem; font-weight: 800; }
p { margin: 0; }

.eyebrow {
  font: 700 .78rem/1 var(--body);
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--brick);
  margin-bottom: 14px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font: 700 .95rem var(--body);
  text-decoration: none;
  background: var(--hat);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 12px 22px;
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-small { padding: 8px 18px; }
.btn-ghost { background: transparent; }

.stores { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.stores-center { justify-content: center; }
.store {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 190px;
  padding: 11px 22px 11px 16px;
  background: var(--ink);
  color: #fff;
  border-radius: 16px;
  text-decoration: none;
  font: 700 1.2rem/1.05 var(--display);
  box-shadow: 4px 4px 0 var(--hat);
  transition: transform .15s, box-shadow .15s;
}
.store:hover { transform: translate(-2px, -3px) rotate(-1deg); box-shadow: 6px 7px 0 var(--hat); }
.store svg { width: 30px; height: 30px; fill: currentColor; flex: none; }
.store > span { white-space: nowrap; }
.store small { display: block; font: 500 .72rem var(--body); opacity: .75; letter-spacing: .04em; }
.store.soon { opacity: .55; pointer-events: none; }
.fine { margin-top: 14px; font-size: .85rem; color: var(--ink-soft); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(244, 236, 221, .85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
  font: 800 1rem/1 var(--display);
  text-transform: uppercase;
  letter-spacing: .02em;
}
.brand-mark { width: 40px; height: 40px; transform: rotate(-6deg); transition: transform .3s; }
.brand:hover .brand-mark { transform: rotate(6deg) scale(1.08); }
.nav-links { display: flex; gap: 28px; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.lang {
  appearance: none; -webkit-appearance: none;
  min-width: 52px; height: 38px;
  padding: 0 22px 0 12px;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 8px center;
  border: 2px solid var(--ink);
  border-radius: 999px;
  color: inherit;
  font: 800 .85rem var(--display);
  letter-spacing: .06em;
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.lang:hover { background-color: var(--card); transform: rotate(-4deg); }
.lang option { color: #1f2328; }
body.is-night .lang { border-color: #eef1f7; }
.nav-links a { text-decoration: none; font-weight: 500; position: relative; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -4px;
  height: 3px; background: var(--hat); transition: right .25s;
}
.nav-links a:hover::after { right: 0; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
  padding: clamp(40px, 7vw, 96px) clamp(16px, 6vw, 96px) clamp(56px, 7vw, 96px);
  max-width: 1320px;
  margin: 0 auto;
}
.sky { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.clouds {
  position: absolute; left: 0; width: 200%; height: 220px;
  background: url("assets/img/clouds.webp") repeat-x 0 0 / auto 100%;
  opacity: .22;
  animation: drift 120s linear infinite;
}
.clouds-a { top: 2%; }
.clouds-b { top: 48%; height: 140px; opacity: .14; animation-duration: 180s; animation-direction: reverse; }
@keyframes drift { to { transform: translateX(-50%); } }

.hero-copy, .hero-art { position: relative; z-index: 1; }
.hl {
  background: linear-gradient(transparent 58%, var(--hat) 58% 90%, transparent 90%);
  padding: 0 .08em;
}
.lead { margin-top: 22px; font-size: 1.15rem; max-width: 34ch; color: var(--ink-soft); }
.lead strong { color: var(--ink); }

.hero-art { justify-self: center; width: min(100%, 400px); }
.building {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: 28px;
  overflow: hidden;
  border: 3px solid var(--ink);
  box-shadow: 10px 10px 0 var(--ink);
  transform: rotate(2deg);
  transition: transform .4s;
  background: var(--ink);
}
.building:hover { transform: rotate(0deg) scale(1.01); }
.building img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .8s ease; }
.building .night { opacity: 0; }
body.is-night .building .night { opacity: 1; }
.sticky-note {
  position: absolute; top: 18px; left: 18px;
  padding: 8px 14px 6px;
  background: var(--hat);
  font: 600 1.6rem/1 var(--hand);
  transform: rotate(-7deg);
  box-shadow: 0 6px 12px rgba(0, 0, 0, .3);
}
.toggle {
  display: flex; align-items: center; gap: 8px;
  margin: 26px auto 0;
  padding: 8px 18px 8px 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  font: 700 .9rem var(--body);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
}
.toggle .sun, .toggle .moon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; transition: background .3s; }
.toggle .sun { background: var(--hat); }
body.is-night .toggle .sun { background: transparent; }
body.is-night .toggle .moon { background: #2c3550; }

/* night mode recolors the hero for fun */
body { transition: background .8s, color .8s; }
body.is-night { --paper: #1b2030; --ink-soft: #b8bfd0; --card: #262c3f; --line: rgba(255,255,255,.12); color: #eef1f7; }
body.is-night .nav { background: rgba(27, 32, 48, .85); }
body.is-night .lead strong, body.is-night .toggle { color: #eef1f7; }
body.is-night .btn { color: var(--ink); }
body.is-night .clouds { filter: invert(1); opacity: .08; }
body.is-night .card, body.is-night .feature { color: var(--ink); }
body.is-night .card { --card: #fffaf0; }

/* ---------- tape ---------- */
.tape {
  background: repeating-linear-gradient(-45deg, var(--hat) 0 28px, var(--ink) 28px 56px);
  padding: 7px 0;
  transform: rotate(-1.5deg);
  margin: 0 -20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.tape-track {
  display: flex; gap: 48px; width: max-content;
  background: var(--hat);
  padding: 10px 0;
  animation: tape 40s linear infinite;
}
.tape-track span {
  font: 800 1rem var(--display);
  letter-spacing: .08em;
  color: var(--ink);
  white-space: nowrap;
}
.tape-track span::before { content: "▲"; margin-right: 48px; color: var(--brick); }
@keyframes tape { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
.section { max-width: 1200px; margin: 0 auto; padding: clamp(72px, 10vw, 128px) clamp(16px, 5vw, 48px) 0; }
.section-head { max-width: 640px; margin-bottom: 48px; }
.sub { margin-top: 14px; color: var(--ink-soft); }

/* steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.step {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 6px 6px 0 var(--ink);
  transition: transform .25s;
}
.step:nth-child(2) { transform: translateY(28px); }
.step:hover { transform: translateY(-6px) rotate(-.5deg); }
.step-img { aspect-ratio: 4 / 3; overflow: hidden; border-bottom: 2px solid var(--ink); }
.step-img img { width: 100%; height: 100%; object-fit: cover; object-position: center 40%; transition: transform .6s; }
.step:hover .step-img img { transform: scale(1.06); }
.step-body { padding: 22px 24px 26px; }
.step-no {
  display: inline-block;
  font: 600 1.5rem/1 var(--hand);
  color: var(--brick);
  margin-bottom: 6px;
}
.step-body p { margin-top: 8px; color: var(--ink-soft); }
body.is-night .step-body p { color: var(--ink-soft); }

/* residents */
.residents .section-head { margin-bottom: 28px; }
.vote-meter { max-width: 560px; margin-bottom: 36px; }
.vote-bar {
  position: relative;
  height: 22px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  overflow: hidden;
}
.vote-fill {
  height: 100%; width: 0;
  background: repeating-linear-gradient(-45deg, var(--green) 0 10px, #5d8c45 10px 20px);
  transition: width .45s cubic-bezier(.3, 1.6, .5, 1);
}
.vote-fill.won { background: repeating-linear-gradient(-45deg, var(--hat) 0 10px, #ffd84a 10px 20px); }
.vote-goal { position: absolute; top: -2px; bottom: -2px; left: 70%; border-left: 3px dashed var(--brick); }
.vote-text { margin-top: 10px; font-weight: 500; }
.vote-text b { font: 800 1.4rem var(--display); }

.cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; }
.card {
  --tilt: 0deg;
  position: relative;
  display: flex; flex-direction: column;
  padding: 0;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 18px;
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--ink);
  overflow: hidden;
  transform: rotate(var(--tilt));
  transition: transform .25s, box-shadow .25s;
}
.card:hover { transform: rotate(0) translateY(-6px); box-shadow: 6px 8px 0 var(--ink); }
.card:focus-visible { outline: 3px solid var(--brick); outline-offset: 3px; }
.card-pic {
  aspect-ratio: 1;
  background: radial-gradient(circle at 50% 65%, #f1d9a8, var(--paper-2) 70%);
  overflow: hidden;
}
.card-pic img { width: 100%; height: 115%; object-fit: cover; object-position: top center; transition: transform .4s; }
.card:hover .card-pic img { transform: scale(1.05); }
.card-body { padding: 12px 14px 16px; }
.card-name { font: 800 1.05rem/1.1 var(--display); }
.card-age { font-size: .82rem; color: #6b6f76; }
.need {
  display: inline-block; margin-top: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--paper-2);
  font-size: .75rem; font-weight: 700;
}
.bubble {
  position: absolute; left: 10px; right: 10px; bottom: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 14px 14px 14px 4px;
  font-size: .82rem; line-height: 1.35;
  opacity: 0; transform: translateY(10px);
  transition: opacity .25s, transform .25s;
  pointer-events: none;
}
.card:hover .bubble, .card:focus-visible .bubble { opacity: 1; transform: none; }
.card.yes .bubble { opacity: 0; }
.stamp {
  position: absolute; top: 14px; right: 10px;
  padding: 4px 12px;
  border: 3px solid var(--green);
  border-radius: 8px;
  color: var(--green);
  font: 800 1.25rem var(--display);
  letter-spacing: .06em;
  background: rgba(255, 250, 240, .85);
  transform: rotate(14deg) scale(2.4);
  opacity: 0;
  transition: transform .3s cubic-bezier(.3, 1.8, .5, 1), opacity .2s;
}
.card.yes .stamp { opacity: 1; transform: rotate(14deg) scale(1); }
.card.yes { box-shadow: 4px 4px 0 var(--green); }
.card.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: rotate(-3deg); } 75% { transform: rotate(3deg); } }
.reset { display: block; margin: 32px auto 0; }
.reset[hidden] { display: none; }

/* features */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature {
  padding: 28px 26px;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  transition: transform .2s, box-shadow .2s, background .2s;
}
.feature:hover { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--ink); background: #fff3cf; }
.f-icon {
  display: grid; place-items: center;
  width: 54px; height: 54px;
  margin-bottom: 16px;
  font-size: 1.6rem;
  background: var(--paper-2);
  border-radius: 16px;
}
.feature:nth-child(odd) .f-icon { transform: rotate(-6deg); }
.feature:nth-child(even) .f-icon { transform: rotate(5deg); }
.feature p { margin-top: 8px; color: #555a62; }

/* download */
.download {
  position: relative;
  margin-top: clamp(80px, 10vw, 140px);
  padding: clamp(80px, 12vw, 160px) 16px;
  background:
    linear-gradient(rgba(20, 24, 36, .55), rgba(20, 24, 36, .85)),
    url("assets/img/apartment_night.webp") center 35% / cover;
  color: #fff;
  text-align: center;
  border-top: 3px solid var(--ink);
}
.download .eyebrow { color: var(--hat); }
.download h2 { font-size: clamp(2.2rem, 5.5vw, 4rem); }
.download .store { background: #fff; color: var(--ink); }

/* footer */
.footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  padding: 26px clamp(16px, 5vw, 48px);
  background: var(--ink);
  color: #c9cdd4;
  font-size: .9rem;
}
.footer nav { display: flex; gap: 22px; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--hat); }

/* reveal on scroll */
.reveal { opacity: 0; translate: 0 30px; transition: opacity .7s ease, translate .7s ease; }
.reveal.in { opacity: 1; translate: 0 0; }

/* confetti */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 100; overflow: hidden; }
.confetti i {
  position: absolute; top: -20px;
  width: 10px; height: 16px;
  animation: fall linear forwards;
}
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .cards { grid-template-columns: repeat(4, 1fr); }
  .features { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .nav-links { display: none; }
  .hero { grid-template-columns: 1fr; text-align: center; }
  .lead { margin-left: auto; margin-right: auto; }
  .hero .stores { justify-content: center; }
  .hero-art { width: min(78%, 340px); }
  .steps { grid-template-columns: 1fr; max-width: 480px; margin: 0 auto; }
  .step:nth-child(2) { transform: none; }
  .cards { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .cards { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .features { grid-template-columns: 1fr; }
  .store { min-width: 0; flex: 1 1 140px; justify-content: center; padding: 10px 14px; font-size: 1.05rem; gap: 10px; }
  .store svg { width: 24px; height: 24px; }
  .footer { justify-content: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; translate: 0 0; }
}
