/* ==========================================================================
   RUG PATROL — site.css
   Nav, hero, and every landing-page section.
   ========================================================================== */

/* ============================ nav ============================ */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(7, 11, 16, 0.72);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.nav.is-stuck {
  border-bottom-color: var(--line-soft);
  background: rgba(7, 11, 16, 0.9);
}

.nav__in {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 62px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  margin-right: auto;
}
.brand__mark {
  width: 26px; height: 26px;
  image-rendering: pixelated;
  flex: none;
}
.brand__txt {
  font-family: var(--f-pixel);
  font-size: 14px;
  letter-spacing: 0.02em;
}
.brand__txt span { color: var(--green); }

.nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav__link {
  padding: 8px 12px;
  border-radius: var(--r);
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--txt-dim);
  transition: color 0.16s var(--ease), background 0.16s var(--ease);
}
.nav__link:hover { color: var(--txt); background: var(--bg-2); }
.nav__link.is-active { color: var(--green); }

.nav__burger {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 8px 10px;
  cursor: pointer;
  color: var(--txt);
}

@media (max-width: 880px) {
  .nav__burger { display: block; }
  .nav__links {
    position: absolute;
    top: 62px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--gut) 18px;
    background: var(--bg-1);
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav.is-open .nav__links { display: flex; }
  .nav__link { padding: 13px 4px; border-bottom: 1px solid var(--line-soft); }
}

/* ---- connect button ---- */

.connect { flex: none; }
.connect .btn { min-width: 152px; }
.connect .btn.is-connected {
  --btn-bg: var(--bg-2);
  --btn-fg: var(--green);
  --btn-bd: var(--green-dim);
  font-family: var(--f-mono);
  text-transform: none;
  letter-spacing: 0;
}
.connect .btn.is-wrong-net {
  --btn-bg: rgba(255,77,94,0.08);
  --btn-fg: var(--red);
  --btn-bd: var(--red-dim);
}

@media (max-width: 560px) {
  .connect .btn { min-width: 0; padding: 10px 12px; font-size: 10px; }
  .brand__txt { display: none; }
}

/* ============================ hero ============================ */

.hero {
  position: relative;
  padding-top: 128px;
  padding-bottom: clamp(56px, 8vw, 96px);
  overflow: hidden;
}

/* cold gradient wash + faint lamp glow, echoing the night-town reference */
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 620px;
  background:
    radial-gradient(60% 70% at 22% 12%, rgba(255,180,84,0.10), transparent 68%),
    radial-gradient(70% 80% at 78% 0%, rgba(0,224,90,0.09), transparent 70%),
    radial-gradient(90% 60% at 50% 100%, rgba(20,40,66,0.55), transparent 72%);
  pointer-events: none;
}

.hero__snow {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  opacity: 0.55;
}

.hero__in { position: relative; z-index: 1; }

.hero__kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 22px;
}

.hero h1 {
  font-size: clamp(38px, 7.4vw, 84px);
  max-width: 16ch;
  text-transform: uppercase;
}
.hero h1 em {
  font-style: normal;
  color: var(--green);
}

.hero__sub {
  margin-top: 22px;
  max-width: 56ch;
  color: var(--txt-dim);
  font-size: clamp(16px, 1.8vw, 19px);
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.hero__strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--txt-faint);
}
.hero__strip b { color: var(--txt); font-weight: 500; }

/* ============================ 01 · the game ============================ */

.game-wrap {
  display: grid;
  gap: 18px;
}

.game-stage {
  position: relative;
  background: #05080C;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  /* On a narrow screen 16:9 collapses to ~190px tall, which leaves no room
     for the dialogue box, the creator or the touch pad. Below that we stop
     obeying the ratio and letterbox the canvas instead. */
  min-height: min(68vh, 520px);
  /* ...and the width has to be pinned, or aspect-ratio turns that
     min-height back into a 924px minimum width on a phone. */
  width: 100%;
}

/* Direct child only. As a descendant selector this also caught the dialogue
   portrait, the creator preview and the minimap, stretching each of them to
   fill the whole stage. */
.game-stage > canvas {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
  touch-action: none;
  /* contain, not stretch — a squashed pixel grid is worse than black bars.
     Pinned to the top so the letterbox lands under the game, where the
     touch pad and dialogue box already live. */
  object-fit: contain;
  object-position: 50% 0;
}

.game-stage:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* legend under the stage */
.game-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--txt-dim);
}
.game-legend kbd {
  display: inline-block;
  min-width: 22px;
  padding: 2px 6px;
  margin-right: 6px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 3px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--txt);
  text-align: center;
}

/* ============================ 02 · the cast ============================ */

.cast {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(228px, 1fr));
  gap: 16px;
}

.cast__card {
  padding: 22px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.cast__card:hover { border-color: var(--bg-3); transform: translateY(-3px); }

.cast__art {
  align-self: flex-start;
  width: 96px;
  height: 96px;
  image-rendering: pixelated;
  background:
    linear-gradient(180deg, var(--bg-2), var(--bg));
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
}

.cast__name { font-size: 21px; }
.cast__role {
  font-family: var(--f-pixel);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.cast__card[data-side="ally"]  .cast__role { color: var(--green); }
.cast__card[data-side="law"]   .cast__role { color: var(--ice); }
.cast__card[data-side="chaos"] .cast__role { color: var(--red); }

.cast__desc { color: var(--txt-dim); font-size: 14px; line-height: 1.55; }

/* ============================ 03 · the loop ============================ */

.loop {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.loop__step {
  background: var(--bg);
  padding: 30px 26px 34px;
}
.loop__n {
  font-family: var(--f-pixel);
  font-size: 12px;
  color: var(--green);
  margin-bottom: 16px;
}
.loop__step h3 { font-size: 19px; margin-bottom: 10px; }
.loop__step p { color: var(--txt-dim); font-size: 14.5px; }

/* ============================ 04 · token ============================ */

.tok {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 18px;
  align-items: start;
}
@media (max-width: 860px) { .tok { grid-template-columns: 1fr; } }

.util { display: grid; gap: 1px; background: var(--line-soft); border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line-soft); }
.util__row {
  background: var(--bg);
  padding: 22px 24px;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 16px;
  align-items: start;
}
.util__ico {
  width: 34px; height: 34px;
  image-rendering: pixelated;
  border-radius: var(--r);
}
.util__row h3 { font-size: 17px; margin-bottom: 6px; }
.util__row p { color: var(--txt-dim); font-size: 14px; }

/* supply table */
.supply { padding: 24px; }
.supply h3 { font-size: 17px; margin-bottom: 4px; }
.supply__total {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--txt-faint);
  margin-bottom: 20px;
}
.bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; margin-bottom: 20px; background: var(--bg-2); }
.bar span { height: 100%; }

.alloc { display: grid; gap: 11px; }
.alloc__row {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 11px;
  font-size: 13.5px;
}
.alloc__sw { width: 10px; height: 10px; border-radius: 2px; }
.alloc__pct { font-family: var(--f-mono); color: var(--txt-dim); font-size: 12.5px; }

/* contract address box */
.ca {
  margin-top: 22px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.ca__label {
  font-family: var(--f-pixel);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--txt-faint);
  text-transform: uppercase;
}
.ca__val {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--green);
  word-break: break-all;
  flex: 1 1 260px;
}

/* ============================ 05 · staking ============================ */

.tiers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.tier { padding: 24px 22px 26px; display: flex; flex-direction: column; gap: 12px; }
.tier__name { font-family: var(--f-pixel); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.tier__req { font-size: 26px; letter-spacing: -0.03em; }
.tier__req small { font-size: 13px; color: var(--txt-faint); font-weight: 400; letter-spacing: 0; }
.tier ul { margin: 0; padding-left: 18px; color: var(--txt-dim); font-size: 14px; display: grid; gap: 7px; }
.tier[data-t="1"] .tier__name { color: var(--txt-dim); }
.tier[data-t="2"] .tier__name { color: var(--ice); }
.tier[data-t="3"] .tier__name { color: var(--amber); }
.tier[data-t="4"] .tier__name { color: var(--green); }
.tier[data-t="4"] { border-color: var(--green-dim); }

/* ============================ 06 · report ============================ */

.report {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  counter-reset: rep;
}
.report__step {
  padding: 24px 22px;
  position: relative;
}
.report__step::before {
  counter-increment: rep;
  content: counter(rep, decimal-leading-zero);
  font-family: var(--f-pixel);
  font-size: 26px;
  color: var(--bg-3);
  display: block;
  margin-bottom: 12px;
}
.report__step h3 { font-size: 17px; margin-bottom: 8px; }
.report__step p { color: var(--txt-dim); font-size: 14px; }

.report-note {
  margin-top: 18px;
  padding: 18px 20px;
  border-left: 2px solid var(--red-dim);
  background: rgba(255,77,94,0.045);
  border-radius: 0 var(--r) var(--r) 0;
  color: var(--txt-dim);
  font-size: 14px;
}
.report-note b { color: var(--red); }

/* ============================ 07 · roadmap ============================ */

.road { display: grid; gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--r-lg); overflow: hidden; }

.phase {
  background: var(--bg);
  display: grid;
  grid-template-columns: 150px 1fr 120px;
  gap: 24px;
  padding: 26px 26px;
  align-items: start;
  transition: background 0.2s var(--ease);
}
.phase:hover { background: var(--bg-1); }
@media (max-width: 760px) {
  .phase { grid-template-columns: 1fr; gap: 12px; }
}

.phase__id { font-family: var(--f-pixel); font-size: 12px; color: var(--txt-faint); letter-spacing: 0.06em; }
.phase__id b { display: block; color: var(--txt); font-size: 15px; margin-top: 6px; letter-spacing: 0; }
.phase ul { margin: 0; padding-left: 18px; display: grid; gap: 8px; color: var(--txt-dim); font-size: 14.5px; }
.phase__status { justify-self: start; }
@media (min-width: 761px) { .phase__status { justify-self: end; } }

/* ============================ 08 · faq ============================ */

.faq { display: grid; gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--r-lg); overflow: hidden; }
.faq details { background: var(--bg); }
.faq summary {
  padding: 20px 24px;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  font-size: 16px;
  font-weight: 600;
  transition: color 0.16s var(--ease);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--green); }
.faq summary::after {
  content: "+";
  font-family: var(--f-mono);
  color: var(--txt-faint);
  flex: none;
  font-size: 19px;
  line-height: 1;
}
.faq details[open] summary::after { content: "\2212"; color: var(--green); }
.faq details p { padding: 0 24px 22px; color: var(--txt-dim); font-size: 14.5px; max-width: 78ch; }

/* ============================ footer ============================ */

.foot {
  border-top: 1px solid var(--line-soft);
  padding-block: 54px 40px;
  background: var(--bg-1);
}
.foot__grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, minmax(120px, 1fr));
  gap: 32px;
}
@media (max-width: 760px) { .foot__grid { grid-template-columns: 1fr 1fr; } }

.foot h4 {
  font-family: var(--f-pixel);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--txt-faint);
  margin-bottom: 14px;
}
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.foot a { color: var(--txt-dim); font-size: 14px; transition: color 0.16s var(--ease); }
.foot a:hover { color: var(--green); }

.foot__blurb { color: var(--txt-dim); font-size: 14px; max-width: 34ch; margin-top: 12px; }

.foot__base {
  margin-top: 42px;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--txt-faint);
}

.disclaimer {
  margin-top: 18px;
  font-size: 12px;
  line-height: 1.65;
  color: var(--txt-faint);
  max-width: 90ch;
}

/* ============================ toast ============================ */

.toasts {
  position: fixed;
  bottom: 18px; right: 18px;
  z-index: 300;
  display: grid;
  gap: 8px;
  justify-items: end;
  pointer-events: none;
}
.toast {
  padding: 12px 16px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-left: 2px solid var(--green);
  border-radius: var(--r);
  font-family: var(--f-mono);
  font-size: 13px;
  max-width: 340px;
  animation: toast-in 0.28s var(--ease);
}
.toast--err { border-left-color: var(--red); }
.toast--warn { border-left-color: var(--amber); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
