/* ==========================================================================
   Homepage: Dexel core look, step 1 (dexel/docs/design/MODULE_REVAMP.md "Dexel core")
   Base: black, white and green. On top: fine pixel art and each module's own colour.
   Press Start 2P for headings, labels and numbers; Inter for everything you read.
   Every class is prefixed `hm-`. Motion is stepped and lively, and all of it stops under reduced motion.
   Scenes are drawn by js/pages/home-scene.js; reveals, counters and the nav logo by js/pages/home.js.
   ========================================================================== */

.hm-body {
  --hm-bg: #FFFFFF;
  --hm-ink: #0B0B0B;
  --hm-text: #3D3D3D;
  --hm-mute: #5C5C5C;
  --hm-line: #E4E4E4;
  --hm-card: #F6F6F4;
  --hm-pixel: var(--font-pixel, 'Press Start 2P', ui-monospace, monospace);
  --hm-step: steps(4, end);
  background: var(--hm-bg);
  color: var(--hm-text);
  font-family: var(--font-sans);
  overflow-x: hidden;
}
[data-theme="dark"] .hm-body {
  --hm-bg: #0A0A0A;
  --hm-ink: #FFFFFF;
  --hm-text: #CFCFCF;
  --hm-mute: #A8A8A8;
  --hm-line: #222222;
  --hm-card: #121212;
}
.hm-body .nav-bar { background-color: var(--hm-bg); border-bottom-color: var(--hm-line); }
.hm-body .brand-logo, .hm-body .polar-footer-brand-logo { image-rendering: pixelated; border-radius: 4px; }

.hm { display: block; }
.hm-wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.hm img { image-rendering: pixelated; }
.hm a:focus-visible, .hm-btn:focus-visible { outline: 3px solid var(--dx-green); outline-offset: 3px; border-radius: 4px; }
.hm-center { text-align: center; margin-left: auto; margin-right: auto; }

/* --- type ------------------------------------------------------------------------------------------ */
.hm-title, .hm-h2 {
  font-family: var(--hm-pixel);
  font-weight: 400;
  color: var(--hm-ink);
  letter-spacing: 0;
  text-wrap: balance;
}
.hm-h2 { font-size: clamp(18px, 2.3vw, 26px); line-height: 1.45; margin: 0 0 16px; }
.hm-text { font-size: 17px; line-height: 1.65; margin: 0 0 18px; max-width: 52ch; }
.hm-text.hm-center { margin-left: auto; margin-right: auto; }
.hm-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font-family: var(--hm-pixel);
  font-size: 12px;
  line-height: 1;
  text-transform: uppercase;
  color: var(--mod-text, var(--dx-green-text));
}
.hm-label img { width: 24px; height: 24px; }
.hm-label-gold { color: #FFCC33; }
.hm-more {
  font-weight: 500;
  color: var(--mod-text, var(--dx-green-text));
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}
.hm-more:hover { text-decoration-style: dotted; }

/* --- buttons: flat colour, a hard pixel shadow, pressed in when clicked ------------------------------ */
.hm-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 120ms var(--hm-step), box-shadow 120ms var(--hm-step);
}
.hm-btn-primary { background: var(--dx-green); color: var(--dx-on-green); box-shadow: 0 4px 0 #23803A; }
.hm-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #23803A; }
.hm-btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 #23803A; }
.hm-btn-ghost { color: var(--hm-ink); border: 2px solid currentColor; }
.hm-btn-ghost:hover { transform: translateY(-2px); }
.hm-btn-ghost:active { transform: translateY(2px); }

/* --- hero: the rooftop party fills it, words top left ------------------------------------------------ */
.hm-hero {
  position: relative;
  min-height: clamp(640px, 90vh, 860px);
  display: flex;
  align-items: flex-start;
  overflow: hidden;
  background: #07070C;
}
[data-theme="light"] .hm-hero { background: #7CC8FF; }
.hm-hero-scene { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.hm-hero-inner { position: relative; width: 100%; pointer-events: none; padding-top: clamp(48px, 9vh, 96px); padding-bottom: 48px; }
.hm-hero-inner a, .hm-hero-inner p, .hm-hero-inner h1 { pointer-events: auto; }
.hm-hero-logo { width: 56px; height: 56px; border-radius: 6px; margin-bottom: 26px; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18); }
.hm-title { font-size: clamp(22px, 3.4vw, 40px); line-height: 1.4; margin: 0 0 22px; max-width: 17ch; color: #FFFFFF; text-shadow: 3px 3px 0 #000000; }
.hm-lede { font-size: 18px; line-height: 1.6; margin: 0 0 30px; max-width: 44ch; color: #E2E2E8; }
.hm-hero .hm-btn-ghost { color: #FFFFFF; }
[data-theme="light"] .hm-title { color: #0B0B0B; text-shadow: 3px 3px 0 rgba(255, 255, 255, 0.85); }
[data-theme="light"] .hm-lede { color: #0E2340; }
[data-theme="light"] .hm-hero .hm-btn-ghost { color: #0B0B0B; }

/* --- live numbers ----------------------------------------------------------------------------------- */
.hm-numbers { border-bottom: 1px solid var(--hm-line); }
.hm-numbers-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding-top: 34px; padding-bottom: 34px; }
.hm-num { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.hm-num-value { font-family: var(--hm-pixel); font-size: clamp(18px, 2.6vw, 28px); color: var(--hm-ink); font-variant-numeric: tabular-nums; }
.hm-num-label { font-size: 15px; color: var(--hm-mute); }

/* --- show rows: one per module, each in its own colour --------------------------------------------- */
.hm-mod-ai { --mod: var(--mod-ai); --mod-text: var(--mod-ai-text); }
.hm-mod-music { --mod: var(--mod-music); --mod-text: var(--mod-music-text); }
.hm-mod-giveaways { --mod: var(--mod-giveaways); --mod-text: var(--mod-giveaways-text); }
.hm-mod-tournaments { --mod: var(--mod-tournaments); --mod-text: var(--mod-tournaments-text); }
.hm-mod-tickets { --mod: var(--mod-tickets); --mod-text: var(--mod-tickets-text); }

.hm-row { padding: 88px 0; border-bottom: 1px solid var(--hm-line); }
.hm-row-inner { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 48px; align-items: center; }
.hm-row-flip .hm-row-inner { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); }
.hm-row-flip .hm-row-copy { order: 2; }
.hm-points { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 10px; }
.hm-points li { position: relative; padding-left: 22px; font-size: 16px; line-height: 1.5; color: var(--hm-text); }
.hm-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 8px;
  height: 8px;
  background: var(--mod);
  box-shadow: 2px 2px 0 var(--hm-ink);
}
.hm-row-art { position: relative; }
.hm-discord {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 480 / 300;
  border: 3px solid #0B0B0B;
  border-radius: 6px;
  box-shadow: 8px 8px 0 var(--mod);
  transition: transform 160ms var(--hm-step), box-shadow 160ms var(--hm-step);
}
.hm-row:hover .hm-discord { transform: translate(-3px, -3px); box-shadow: 11px 11px 0 var(--mod); }

/* --- and more -------------------------------------------------------------------------------------- */
.hm-section { padding: 96px 0; border-bottom: 1px solid var(--hm-line); }
.hm-grid {
  list-style: none;
  margin: 40px 0 32px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.hm-tile {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 14px;
  row-gap: 4px;
  align-items: center;
  padding: 16px;
  background: var(--hm-card);
  border: 2px solid var(--hm-line);
  border-radius: 6px;
  transition: border-color 120ms var(--hm-step), transform 120ms var(--hm-step);
}
.hm-tile img { grid-row: 1 / span 2; width: 32px; height: 32px; }
.hm-tile-name { font-weight: 600; font-size: 15px; color: var(--hm-ink); }
.hm-tile-text { font-size: 14px; line-height: 1.4; color: var(--hm-mute); }
.hm-tile:hover { border-color: var(--dx-green); transform: translateY(-2px); }
.hm-tile:hover img { animation: hm-hop 360ms steps(3, end); }
.hm-grid li { display: flex; }
.hm-grid .hm-tile { flex: 1; text-decoration: none; color: inherit; }
.hm-grid .hm-tile:active { transform: translate(2px, 2px); }
.hm-tile:hover .hm-tile-name { color: var(--dx-green-text); }

/* --- questions (FAQ) ------------------------------------------------------------------------------- */
.hm-faq { max-width: 760px; margin: 40px auto 0; display: grid; gap: 12px; }
.hm-faq details { background: var(--hm-card); border: 2px solid var(--hm-line); border-radius: 6px; }
.hm-faq details[open] { border-color: var(--dx-green); box-shadow: 4px 4px 0 var(--dx-green); }
.hm-faq summary {
  cursor: pointer; list-style: none; padding: 18px 20px; display: flex; justify-content: space-between; gap: 16px;
  font-weight: 600; font-size: 16px; color: var(--hm-ink);
}
.hm-faq summary::-webkit-details-marker { display: none; }
.hm-faq summary::after { content: "+"; font-family: var(--hm-pixel); font-size: 14px; color: var(--dx-green-text); }
.hm-faq details[open] summary::after { content: "-"; }
.hm-faq summary:focus-visible { outline: 3px solid var(--dx-green); outline-offset: 3px; }
.hm-faq details p { margin: 0; padding: 0 20px 18px; font-size: 15px; line-height: 1.65; color: var(--hm-text); }
.hm-faq details a { color: var(--dx-green-text); }
@keyframes hm-hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* --- quotes ---------------------------------------------------------------------------------------- */
.hm-quote-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 40px; }
.hm-quote {
  margin: 0;
  padding: 24px;
  background: var(--hm-card);
  border: 2px solid var(--hm-line);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}
.hm-quote-big { grid-column: 1 / -1; }
.hm-quote blockquote { margin: 0; font-size: 16px; line-height: 1.6; color: var(--hm-ink); }
.hm-quote-big blockquote { font-size: clamp(18px, 2vw, 22px); }
.hm-quote figcaption { display: flex; align-items: center; gap: 12px; font-size: 14px; line-height: 1.4; color: var(--hm-mute); }
.hm-quote figcaption b { color: var(--hm-ink); font-weight: 600; }
.hm-avatar {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--dx-green);
  color: var(--dx-on-green);
  font-family: var(--hm-pixel);
  font-size: 10px;
  border-radius: 4px;
  box-shadow: 3px 3px 0 var(--hm-ink);
}

/* --- Premium teaser (always the Big night card) ------------------------------------------------------ */
.hm-premium {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  padding: 36px;
  background: #0A0A0A;
  border: 2px solid #FFCC33;
  border-radius: 8px;
  box-shadow: 8px 8px 0 #B8862B;
}
.hm-premium .hm-h2 { color: #FFFFFF; }
.hm-premium .hm-text { color: #CFCFCF; }
.hm-premium-art canvas { display: block; width: 100%; height: auto; aspect-ratio: 240 / 150; image-rendering: pixelated; border-radius: 4px; }

/* --- final call ------------------------------------------------------------------------------------ */
.hm-final { padding-top: 96px; }
.hm-final-copy { display: flex; flex-direction: column; align-items: center; gap: 28px; text-align: center; margin-bottom: 48px; }
.hm-final-copy .hm-h2 { margin: 0; }
.hm-final-strip { position: relative; height: clamp(170px, 22vw, 280px); overflow: hidden; background: #07070C; }
[data-theme="light"] .hm-final-strip { background: #7CC8FF; }
.hm-final-strip canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.hm-final-word {
  position: absolute;
  right: clamp(16px, 3vw, 40px);
  bottom: clamp(14px, 2.4vw, 30px);
  font-family: var(--hm-pixel);
  font-size: clamp(34px, 7.5vw, 96px);
  line-height: 1;
  color: #FFFFFF;
  text-shadow: 4px 4px 0 #000000;
  cursor: pointer;
  user-select: none;
}
.hm-final-word span { display: inline-block; }
.hm-final-word:hover span { animation: hm-hop 420ms steps(3, end); }
.hm-final-word:hover span:nth-child(2) { animation-delay: 60ms; }
.hm-final-word:hover span:nth-child(3) { animation-delay: 120ms; }
.hm-final-word:hover span:nth-child(4) { animation-delay: 180ms; }
.hm-final-word:hover span:nth-child(5) { animation-delay: 240ms; }

/* --- reveal: a stepped wipe the first time a block scrolls in (only when JS runs) ------------------- */
/* A cover in the page colour sits over each block and wipes down out of the way in steps. The block itself is never
   clipped, so the IntersectionObserver in home.js can see it. */
.hm-js .hm-reveal { position: relative; }
.hm-js .hm-reveal::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  background: var(--hm-bg);
  pointer-events: none;
  transform-origin: bottom;
}
.hm-js .hm-reveal.is-in::after { animation: hm-wipe 420ms steps(6, end) forwards; }
@keyframes hm-wipe { from { transform: scaleY(1); } to { transform: scaleY(0); } }
.hm-num-value.is-counting { color: var(--dx-green-text); }

/* --- small screens ---------------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .hm-row { padding: 64px 0; }
  .hm-row-inner { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .hm-row-flip .hm-row-copy { order: 0; }
  .hm-row-flip .hm-row-inner { grid-template-columns: minmax(0, 1fr); }
  .hm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-quote-grid { grid-template-columns: minmax(0, 1fr); }
  .hm-premium { grid-template-columns: minmax(0, 1fr); padding: 24px; }
  .hm-section { padding: 72px 0; }
}
@media (max-width: 520px) {
  .hm-wrap { padding: 0 16px; }
  .hm-hero { min-height: 700px; }
  .hm-lede { font-size: 16px; }
  .hm-grid { grid-template-columns: minmax(0, 1fr); }
  .hm-numbers-row { gap: 8px; }
  .hm-num-label { font-size: 13px; }
  .hm-discord { box-shadow: 5px 5px 0 var(--mod); }
  .hm-row:hover .hm-discord { box-shadow: 5px 5px 0 var(--mod); transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hm-btn, .hm-discord, .hm-tile { transition: none; }
  .hm-btn:hover, .hm-btn:active, .hm-tile:hover, .hm-row:hover .hm-discord { transform: none; }
  .hm-tile:hover img, .hm-final-word:hover span { animation: none; }
  .hm-js .hm-reveal::after { display: none; }
}
