@font-face {
  font-family: "Fredoka";
  src: url("/assets/fonts/Fredoka-Variable.ttf") format("truetype");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("/assets/fonts/Nunito-Variable.ttf") format("truetype");
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --night: #1B1830;
  --night-2: #232038;
  --roof: #2A2833;
  --ink: #0E0D12;
  --ginger: #F09A3E;
  --ginger-dark: #B85E16;
  --lamp: #F5D547;
  --paper: #F4EFE7;
  --muted: #ABA6B8;
  --line: #3E3B4A;
  --blurple: #5865F2;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--night);
  color: var(--paper);
  font: 400 1.0625rem/1.6 "Nunito", system-ui, sans-serif;
  overflow-x: hidden;
}

img { max-width: 100%; }

a { color: var(--lamp); text-underline-offset: 3px; }
a:hover { color: var(--paper); }

:focus-visible { outline: 3px solid var(--lamp); outline-offset: 3px; border-radius: 4px; }

code {
  font: 600 .92em/1 "Nunito", system-ui, sans-serif;
  background: rgba(244, 239, 231, .1);
  color: var(--paper);
  padding: .15em .4em;
  border-radius: 6px;
  white-space: nowrap;
}

h1, h2, h3 {
  font-family: "Fredoka", "Nunito", system-ui, sans-serif;
  font-weight: 600;
  margin: 0;
  text-wrap: balance;
}

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 10;
  background: var(--lamp); color: var(--ink);
  padding: 8px 14px; border-radius: 8px; font-weight: 700;
}
.skip:focus { top: 12px; }

/* ---------- top bar ---------- */
.top {
  max-width: 1160px; margin: 0 auto;
  padding: 20px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--paper); text-decoration: none;
  font: 600 1.35rem/1 "Fredoka", sans-serif;
}
.brand img { border-radius: 50%; }
.top nav { display: flex; gap: 22px; }
.top nav a { color: var(--muted); font-weight: 700; font-size: .95rem; }
.top nav a:hover { color: var(--paper); }

/* ---------- hero ---------- */
.hero-wrap {
  position: relative;
  background: linear-gradient(var(--night) 40%, var(--night-2));
}
.hero {
  max-width: 1160px; margin: 0 auto;
  padding: 40px 24px 0;
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center;
}
.hero h1 {
  font-size: clamp(2.6rem, 2rem + 3.6vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -.01em;
  max-width: 11ch;
}
.lede { font-size: 1.15rem; color: var(--muted); max-width: 34rem; margin: 22px 0 0; }
.ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.note { margin: 14px 0 0; font-size: .95rem; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 26px;
  border-radius: 999px;
  font: 600 1.1rem/1 "Fredoka", sans-serif;
  text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn-primary {
  background: var(--ginger); color: var(--ink);
  box-shadow: 0 5px 0 var(--ginger-dark);
}
.btn-primary:hover { color: var(--ink); transform: translateY(2px); box-shadow: 0 3px 0 var(--ginger-dark); }
.btn-primary:active { transform: translateY(5px); box-shadow: 0 0 0 var(--ginger-dark); }
.btn-ghost { color: var(--paper); border: 2px solid rgba(244, 239, 231, .35); }
.btn-ghost:hover { border-color: var(--paper); }

/* Discord chat mock */
.chat {
  margin: 0;
  background: #313338;
  border-radius: 12px;
  padding: 18px 18px 20px;
  font-family: "Nunito", system-ui, sans-serif;
  font-size: .98rem; line-height: 1.45;
  color: #DBDEE1;
  box-shadow: 0 24px 60px rgba(8, 6, 20, .55);
  transform: rotate(1.2deg);
}
.chat p { margin: 0; }
.msg { display: grid; grid-template-columns: 40px 1fr; gap: 14px; }
.msg + .msg { margin-top: 14px; }
.msg-user { align-items: center; font-size: .9rem; }
.av { width: 40px; height: 40px; border-radius: 50%; }
.av-user { display: block; width: 24px; height: 24px; margin-left: 16px; background: #8E8D99; }
.muted { color: #949BA4; }
.who b { color: var(--ginger); }
.app {
  font-size: .62rem; font-weight: 800; letter-spacing: .02em;
  background: var(--blurple); color: #fff;
  padding: 1px 5px; border-radius: 4px; vertical-align: 2px;
}
.embed {
  margin-top: 6px;
  background: #2B2D31;
  border-left: 4px solid var(--ginger);
  border-radius: 4px;
  padding: 12px 14px;
  display: grid; gap: 10px;
}
.embed img { vertical-align: -4px; }
.stats { display: flex; flex-wrap: wrap; gap: 6px 14px; font-weight: 700; color: var(--paper); }
.stat { display: inline-flex; align-items: center; gap: 5px; }
.goal { color: #B5BAC1; font-size: .9rem; }
.dbtns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.dbtn { background: #4E5058; color: #fff; font-weight: 700; font-size: .88rem; padding: 6px 14px; border-radius: 4px; }
.dbtn-primary { background: var(--blurple); }

/* skyline */
.skyline { display: block; width: 100%; height: clamp(170px, 24vw, 300px); margin: 24px 0 -1px; }
.skyline .win { fill: #3A3746; animation: lamp-on .5s ease-out forwards; }
.skyline .win:nth-of-type(1) { animation-delay: 1100ms; }
.skyline .win:nth-of-type(2) { animation-delay: 1880ms; }
.skyline .win:nth-of-type(3) { animation-delay: 710ms; }
.skyline .win:nth-of-type(4) { animation-delay: 1490ms; }
.skyline .win:nth-of-type(5) { animation-delay: 450ms; }
.skyline .win:nth-of-type(6) { animation-delay: 2140ms; }
.skyline .win:nth-of-type(7) { animation-delay: 1230ms; }
.skyline .win:nth-of-type(8) { animation-delay: 1750ms; }
.skyline .win:nth-of-type(9) { animation-delay: 840ms; }
.skyline .win:nth-of-type(10) { animation-delay: 2270ms; }
.skyline .win:nth-of-type(11) { animation-delay: 580ms; }
.skyline .win:nth-of-type(12) { animation-delay: 1620ms; }
.skyline .win:nth-of-type(13) { animation-delay: 970ms; }
.skyline .win:nth-of-type(14) { animation-delay: 2010ms; }
.skyline .win:nth-of-type(15) { animation-delay: 1360ms; }
@keyframes lamp-on { to { fill: var(--lamp); } }
@media (prefers-reduced-motion: reduce) {
  .skyline .win { animation: none; fill: var(--lamp); }
  .btn { transition: none; }
}

/* ---------- sections below the rooftops ---------- */
.below { background: var(--roof); }
.band { max-width: 1160px; margin: 0 auto; padding: 72px 24px; }
.band + .band { border-top: 2px dashed var(--line); }
.band h2 { font-size: clamp(1.9rem, 1.5rem + 1.8vw, 2.7rem); line-height: 1.1; }
.band p { max-width: 38rem; }
.sub { color: var(--muted); margin: 12px 0 0; }

.lives { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; padding-top: 24px; }
.lives-copy p { color: var(--muted); }
.lives-copy p:first-of-type { margin-top: 18px; }
.lives-row { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; max-width: 470px; justify-self: end; }
.lives-row img { width: 100%; height: auto; }
.lives-row .lost { filter: grayscale(1) brightness(.6); opacity: .55; transform: rotate(-12deg) scale(.88); }

.days { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-top: 36px; }
.day h3 { font-size: 1.4rem; margin: 14px 0 8px; color: var(--ginger); }
.day p { margin: 0; color: var(--muted); }
.day p code { white-space: normal; }

.fair ul { list-style: none; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 22px 48px; }
.fair li { position: relative; padding-left: 30px; color: var(--muted); max-width: 32rem; }
.fair li::before {
  content: ""; position: absolute; left: 0; top: .45em;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--lamp); box-shadow: 0 0 0 4px rgba(245, 213, 71, .18);
}
.fair li b { color: var(--paper); }

.cities { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; margin-top: 36px; }
.city h3 { font-size: 1.5rem; }
.street { list-style: none; padding: 0; margin: 16px 0 0; }
.street li {
  display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.tier {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--night); color: var(--lamp);
  font: 600 .95rem/1 "Fredoka", sans-serif;
}
.street li:last-child .tier { background: var(--lamp); color: var(--ink); }
.place { font-weight: 700; }
.rk { color: var(--muted); font-size: .9rem; }

.end { text-align: center; padding-bottom: 96px; }
.end p { margin: 14px auto 28px; color: var(--muted); }

/* ---------- footer ---------- */
.foot { background: var(--night); border-top: 1px solid var(--line); }
.foot-in {
  max-width: 1160px; margin: 0 auto; padding: 36px 24px 44px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px;
}
.foot-brand { display: flex; align-items: center; gap: 10px; margin: 0; font: 600 1.15rem/1 "Fredoka", sans-serif; }
.foot-brand img { border-radius: 50%; }
.foot nav { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.foot nav a { color: var(--paper); font-weight: 700; text-decoration: none; }
.foot nav a:hover { color: var(--lamp); text-decoration: underline; }
.foot-small { flex-basis: 100%; margin: 0; color: var(--muted); font-size: .9rem; }

/* ---------- legal pages ---------- */
.legal { max-width: 780px; margin: 0 auto; padding: 24px 24px 80px; }
.legal h1 { font-size: clamp(2.2rem, 1.8rem + 2vw, 3.2rem); margin-top: 28px; }
.legal .lede { color: var(--paper); font-size: 1.2rem; max-width: none; }
.legal h2 { font-size: 1.55rem; margin: 48px 0 12px; color: var(--ginger); }
.legal p, .legal li { color: #DCD7E2; }
.legal li + li { margin-top: 6px; }
.legal li::marker { color: var(--muted); }
.eff { color: var(--muted); font-size: .95rem; }
.draft {
  margin: 8px 0 0;
  padding: 12px 16px;
  border: 2px solid var(--lamp); border-radius: 10px;
  background: rgba(245, 213, 71, .08);
  color: var(--paper);
}
.table { overflow-x: auto; margin: 18px 0; border: 1px solid var(--line); border-radius: 10px; }
.table table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.legal .table table, .table.wide table { min-width: 560px; }
.table th, .table td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.table th { background: var(--roof); font-family: "Fredoka", sans-serif; font-weight: 600; color: var(--paper); }
.table tr:last-child td { border-bottom: 0; }
mark.todo {
  background: var(--lamp); color: var(--ink);
  border-radius: 4px; padding: 0 .25em;
  font-weight: 700;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

/* ---------- guide ---------- */
.more { margin: 36px 0 0; font-weight: 700; }
.guide-head { max-width: 1160px; margin: 0 auto; padding: 32px 24px 8px; }
.guide-head h1 { font-size: clamp(2.6rem, 2rem + 3vw, 4.2rem); line-height: 1.02; }
.guide-head .lede { color: var(--paper); font-size: 1.2rem; }
.rollout {
  max-width: 44rem; margin: 22px 0 0;
  padding: 12px 16px; border-radius: 10px;
  background: var(--roof); color: var(--muted); font-size: .95rem;
}
.guide-body {
  max-width: 1160px; margin: 0 auto; padding: 32px 24px 72px;
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; align-items: start;
}
.toc { position: sticky; top: 24px; }
.toc-title { margin: 0 0 10px; font: 600 1rem/1.2 "Fredoka", sans-serif; color: var(--paper); }
.toc ul, .toc-m ul { list-style: none; margin: 0; padding: 0; }
.toc li a { display: block; padding: 5px 0 5px 12px; border-left: 2px solid var(--line); color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem; }
.toc li a:hover { color: var(--paper); border-left-color: var(--ginger); }
.toc-m { display: none; }
.guide-main { max-width: 800px; }
.gsec { scroll-margin-top: 24px; }
.gsec + .gsec { border-top: 2px dashed var(--line); margin-top: 48px; padding-top: 40px; }
.gsec h2 { display: flex; align-items: center; gap: 14px; font-size: clamp(1.6rem, 1.4rem + 1vw, 2.1rem); line-height: 1.15; color: var(--paper); margin-bottom: 16px; }
.gsec h2 img { flex: none; width: 44px; height: 44px; }
.gsec h3 { font-size: 1.15rem; color: var(--ginger); margin: 28px 0 0; }
.gsec p, .gsec li { color: #DCD7E2; }
.gsec ul { padding-left: 1.2em; }
.gsec li + li { margin-top: 8px; }
.gsec li::marker { color: var(--ginger); }
.gsec td code { white-space: nowrap; }
.gsec .table td:first-child { color: var(--paper); font-weight: 700; }
.gsec .rk { color: var(--muted); font-size: .88rem; white-space: nowrap; }
.ii { width: 20px; height: 20px; vertical-align: -4px; margin-right: 2px; }
.tip {
  margin: 20px 0 0; padding: 14px 18px;
  border-left: 4px solid var(--lamp); border-radius: 0 10px 10px 0;
  background: rgba(245, 213, 71, .08);
}

/* ---------- 404 ---------- */
.nf { min-height: calc(100vh - 160px); display: flex; flex-direction: column; justify-content: space-between; }
.nf-main { max-width: 1160px; width: 100%; margin: 0 auto; padding: 64px 24px 0; }
.nf-main h1 { font-size: clamp(2.4rem, 2rem + 3vw, 4rem); max-width: 12ch; line-height: 1.05; }
.nf-main .lede { margin-bottom: 28px; }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 24px; }
  .chat { transform: none; }
  .lives { grid-template-columns: 1fr; gap: 28px; }
  .lives-row { justify-self: start; }
  .days { grid-template-columns: 1fr; gap: 32px; }
  .fair ul { grid-template-columns: 1fr; }
  .cities { grid-template-columns: 1fr; gap: 36px; }
  .guide-body { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 16px; }
  .toc { display: none; }
  .toc-m { display: block; background: var(--roof); border-radius: 10px; padding: 12px 16px; }
  .toc-m summary { cursor: pointer; font: 600 1rem/1.4 "Fredoka", sans-serif; }
  .toc-m ul { margin-top: 8px; columns: 2; column-gap: 20px; }
  .toc-m li a { display: block; padding: 4px 0; color: var(--muted); font-weight: 600; font-size: .95rem; text-decoration: none; }
}
@media (max-width: 520px) {
  .top, .hero, .band, .legal, .nf-main, .foot-in, .guide-head, .guide-body { padding-left: 16px; padding-right: 16px; }
  .top nav { gap: 14px; }
  .toc-m ul { columns: 1; }
  .band { padding-top: 56px; padding-bottom: 56px; }
  .ctas .btn { width: 100%; }
  .chat { padding: 14px; }
  .msg { grid-template-columns: 32px 1fr; gap: 10px; }
  .av { width: 32px; height: 32px; }
  .av-user { margin-left: 8px; }
  .top nav a { font-size: .85rem; }
}

/* guide tables become stacked cards on phones */
@media (max-width: 600px) {
  .gsec .table:not(.cmds) { border: 0; overflow: visible; }
  .gsec .table:not(.cmds) table, .gsec .table:not(.cmds).wide table { min-width: 0; }
  .gsec .table:not(.cmds) table, .gsec .table:not(.cmds) tbody, .gsec .table:not(.cmds) tr, .gsec .table:not(.cmds) td { display: block; width: auto; }
  .gsec .table:not(.cmds) thead { display: none; }
  .gsec .table:not(.cmds) tr { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--roof); }
  .gsec .table:not(.cmds) tr + tr { margin-top: 10px; }
  .gsec .table:not(.cmds) td { border: 0; padding: 2px 0; }
  .gsec .table:not(.cmds) td + td { margin-top: 6px; }
  .gsec .table:not(.cmds) td[data-label]:not(:first-child)::before {
    content: attr(data-label); display: block;
    font-size: .8rem; font-weight: 700; color: var(--muted);
  }
}

@media (max-width: 600px) {
  .gsec .cmds td { padding: 8px 10px; }
  .gsec .cmds td:first-child { width: 1%; }
}
