/* Dimension War's website.
   The site wears the emblem's colours: its navy for the sky, its orange for
   anything to press, its teal for anything to notice. Inside the Dimensions
   section colour means a dimension, as it does in the game: violet is open
   space, amber heavy gravity, cyan the null field, red the fire world. The
   hexagon is the shape of a rift and of the emblem, and the only ornament. */

@font-face { font-family: "Chakra Petch"; font-weight: 600; font-display: swap; src: url("/fonts/chakra-petch-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Chakra Petch"; font-weight: 700; font-display: swap; src: url("/fonts/chakra-petch-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 400; font-display: swap; src: url("/fonts/manrope-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 600; font-display: swap; src: url("/fonts/manrope-latin-600-normal.woff2") format("woff2"); }

:root {
  --void: #06141d;
  --deep: #0a202d;
  --panel: #0f2c3b;
  --panel-2: #16404f;
  --star: #f3f8fb;
  --dust: #a7bcc9;
  --brand: #f47b33;
  --brand-light: #ffb070;
  --navy: #2a5c72;
  --open: #b873ff;
  --gravity: #ffa82e;
  --null: #40e6f2;
  --fire: #ff5d43;
  --line: rgba(150, 205, 225, 0.17);
  --display: "Chakra Petch", "Avenir Next Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --width: 1180px;
  --edge: clamp(20px, 5vw, 48px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--star); font: 400 1.0625rem/1.65 var(--body);
  background:
    radial-gradient(1100px 620px at 78% -8%, rgba(42, 92, 114, 0.62), transparent 62%),
    radial-gradient(900px 560px at -6% 22%, rgba(244, 123, 51, 0.11), transparent 60%),
    url("/stars.svg") 0 0 / 1200px 900px,
    var(--void);
}
a { color: inherit; text-underline-offset: 0.2em; }
a:focus-visible, summary:focus-visible { outline: 3px solid var(--null); outline-offset: 3px; border-radius: 4px; }
p { margin: 0 0 1em; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.9rem, 7vw, 5.4rem); line-height: 1; text-transform: uppercase; }
h2 { font-size: clamp(1.9rem, 3.8vw, 2.9rem); line-height: 1.08; }
h3 { font-size: 1.3rem; line-height: 1.2; }
.defs { position: absolute; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--star); color: var(--void); padding: 8px 14px; z-index: 30; border-radius: 6px; }
.skip:focus { left: 8px; }

/* The bar across the top stays in view. */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 24px;
  padding: 14px max(var(--edge), calc((100vw - var(--width)) / 2));
  background: rgba(6, 20, 29, 0.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.name { display: inline-flex; align-items: center; gap: 10px; font: 700 1.3rem/1 var(--display); text-decoration: none; text-transform: uppercase; letter-spacing: 0.02em; white-space: nowrap; }
.topbar nav { display: flex; gap: clamp(14px, 2.4vw, 32px); margin-left: auto; }
.topbar nav a { color: var(--dust); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.topbar nav a:hover { color: var(--star); }
.badge { font: 600 0.85rem/1 var(--display); letter-spacing: 0.04em; padding: 9px 14px; border: 1px solid var(--brand); color: var(--brand-light); border-radius: 999px; white-space: nowrap; }

.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 54px; padding: 0 28px;
  font: 700 1.05rem/1 var(--display); letter-spacing: 0.02em; text-decoration: none; color: #1d0d02;
  background: linear-gradient(135deg, var(--brand-light), var(--brand)); border-radius: 12px;
  box-shadow: 0 10px 34px rgba(244, 123, 51, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
a.button:hover { filter: brightness(1.08); }
.button.small { min-height: 40px; padding: 0 18px; font-size: 0.92rem; border-radius: 10px; }
.button.ghost { background: rgba(255, 255, 255, 0.04); color: var(--star); border: 1px solid var(--line); box-shadow: none; }
.button.ghost:hover { border-color: var(--null); filter: none; }
.button.waiting { background: var(--panel-2); color: var(--star); border: 1px solid rgba(244, 123, 51, 0.65); box-shadow: 0 10px 34px rgba(244, 123, 51, 0.18); }
.actions { display: flex; flex-wrap: wrap; gap: 14px; }

section { padding: clamp(56px, 8vw, 112px) max(var(--edge), calc((100vw - var(--width)) / 2)); }
.heading { max-width: 720px; margin-bottom: clamp(28px, 4vw, 48px); }
.heading p { color: var(--dust); font-size: 1.15rem; margin: 12px 0 0; }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); align-items: center; gap: clamp(16px, 4vw, 56px); padding-top: clamp(36px, 6vw, 72px); padding-bottom: clamp(36px, 5vw, 64px); }
.kicker { font: 600 1rem/1.3 var(--display); color: var(--null); letter-spacing: 0.06em; margin-bottom: 18px; }
.lead { font-size: clamp(1.1rem, 1.5vw, 1.28rem); color: var(--dust); margin: 22px 0 30px; max-width: 34em; }
.platforms { color: var(--dust); font-size: 0.95rem; margin: 20px 0 0; }
.scene { width: 100%; height: auto; overflow: visible; }
.spin { transform-origin: center; transform-box: fill-box; }
.spin-a { animation: turn 70s linear infinite; }
.spin-b { animation: turn 46s linear infinite reverse; }
.spin-c { animation: turn 30s linear infinite; }
.ribbon { fill: none; stroke-linecap: round; }
.flight { animation: drift 7s ease-in-out infinite alternate; }
@keyframes turn { to { transform: rotate(360deg); } }
@keyframes drift { to { transform: translate(10px, -8px); } }

/* The game in numbers */
.facts { padding-top: 0; padding-bottom: clamp(40px, 6vw, 72px); }
.facts dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border: 1px solid var(--line); border-radius: 18px; background: rgba(15, 44, 59, 0.74); overflow: hidden; }
.facts div { padding: 26px 24px; border-left: 1px solid var(--line); }
.facts div:first-child { border-left: 0; }
.facts dt { font: 700 clamp(2.2rem, 4.4vw, 3.4rem)/1 var(--display); background: linear-gradient(135deg, #ffd3ab, var(--brand)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.facts dd { margin: 8px 0 0; color: var(--dust); }

/* A match is a sequence, so its steps are numbered. */
.match { background: linear-gradient(180deg, rgba(10, 32, 45, 0.0), rgba(10, 32, 45, 0.9) 12%, rgba(10, 32, 45, 0.9) 88%, rgba(10, 32, 45, 0)); }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.steps li { counter-increment: step; position: relative; padding: 68px 20px 22px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; }
.steps li::before {
  content: counter(step); position: absolute; top: 18px; left: 20px; width: 38px; height: 38px; display: grid; place-items: center;
  font: 700 1.05rem/1 var(--display); color: #032229; background: linear-gradient(135deg, #a9f5f9, var(--null));
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.steps h3 { margin-bottom: 8px; }
.steps p { color: var(--dust); font-size: 0.97rem; margin: 0; }
.funnel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 28px 0 0; }
.funnel span { display: flex; align-items: baseline; gap: 12px; padding: 16px 20px; border-radius: 14px; border: 1px solid var(--line); color: var(--dust); }
.funnel b { font: 700 2.2rem/1 var(--display); color: var(--star); }
.funnel .win { border-color: var(--brand); background: rgba(244, 123, 51, 0.13); color: var(--star); }
.funnel .win b { color: var(--brand-light); }

/* The worlds, each in its rift's colour. */
.worlds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.world { --tone: var(--open); position: relative; padding: 26px 22px 24px; border-radius: 18px; border: 1px solid color-mix(in srgb, var(--tone) 45%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--tone) 20%, var(--panel)), var(--panel) 62%); overflow: hidden; }
.world::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--tone); }
.world.gravity { --tone: var(--gravity); }
.world.null { --tone: var(--null); }
.world.fire { --tone: var(--fire); }
.world svg { width: 56px; height: 56px; color: var(--tone); margin-bottom: 18px; }
.world h3 { font-size: 1.5rem; }
.world .rule { color: var(--tone); font: 600 1.05rem/1.3 var(--display); margin: 8px 0 12px; }
.world p:last-child { color: var(--dust); font-size: 0.97rem; margin: 0; }

/* The ships */
.hangar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.ship { padding: 24px 22px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; }
.ship svg { display: block; width: 104px; height: 104px; margin: 0 auto 14px; fill: var(--star); filter: drop-shadow(0 0 18px rgba(64, 230, 242, 0.55)); }
.ship h3 { font-size: 1.45rem; }
.ship > p { color: var(--dust); font-size: 0.97rem; min-height: 3.2em; margin: 8px 0 16px; }
.bars { margin: 0; display: grid; gap: 8px; }
.bars div { display: grid; grid-template-columns: 5.4rem 1fr; align-items: center; gap: 10px; }
.bars dt { font-size: 0.85rem; color: var(--dust); }
.bars dd { margin: 0; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.09); overflow: hidden; }
.bar { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #1f9fb4, var(--null)); }
.b2 { width: 40%; } .b3 { width: 60%; } .b5 { width: 100%; }

/* Features */
.more { background: linear-gradient(180deg, rgba(10, 32, 45, 0), rgba(10, 32, 45, 0.9) 14%, rgba(10, 32, 45, 0.9) 86%, rgba(10, 32, 45, 0)); }
.features { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 36px; }
.features li { padding-left: 20px; border-left: 2px solid var(--brand); }
.features li:nth-child(3n+2) { border-color: var(--null); }
.features li:nth-child(3n) { border-color: var(--navy); }
.features h3 { font-size: 1.2rem; margin-bottom: 6px; }
.features p { color: var(--dust); font-size: 0.98rem; margin: 0; }

/* Questions */
.faq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; align-items: start; }
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 0 20px; }
.faq details[open] { border-color: rgba(64, 230, 242, 0.55); }
.faq summary { cursor: pointer; padding: 18px 0; font: 600 1.08rem/1.3 var(--display); }
.faq details p { color: var(--dust); margin: 0; padding-bottom: 18px; }

/* The last word */
.closing { text-align: center; position: relative; overflow: hidden; }
.closing h2 { font-size: clamp(2rem, 5vw, 3.6rem); text-transform: uppercase; max-width: 16em; margin: 0 auto 28px; position: relative; }
.closing .actions { justify-content: center; position: relative; }
.closing-rift { position: absolute; left: 50%; top: 50%; width: min(760px, 120vw); transform: translate(-50%, -50%); opacity: 0.35; }

.foot { border-top: 1px solid var(--line); background: rgba(6, 20, 29, 0.93); padding: 48px max(var(--edge), calc((100vw - var(--width)) / 2)) 36px; color: var(--dust); font-size: 0.97rem; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
.foot-name { display: flex; align-items: center; gap: 10px; font: 700 1.2rem/1 var(--display); text-transform: uppercase; color: var(--star); margin-bottom: 12px; }
.foot nav { display: grid; gap: 9px; align-content: start; }
.foot nav h2 { font: 600 0.95rem/1 var(--display); color: var(--star); margin-bottom: 6px; }
.foot nav a { text-decoration: none; }
.foot nav a:hover { color: var(--star); text-decoration: underline; }
.fine { margin: 36px 0 0; padding-top: 20px; border-top: 1px solid var(--line); font-size: 0.88rem; }

/* Legal pages: one calm column, made to be read. */
.paper { max-width: 860px; margin: 0 auto; padding: clamp(36px, 6vw, 72px) var(--edge) clamp(56px, 8vw, 96px); }
.paper h1 { font-size: clamp(2.1rem, 5vw, 3.3rem); text-transform: none; line-height: 1.08; margin-bottom: 10px; }
.crumb { margin: 0 0 14px; color: var(--dust); }
.stamp { color: var(--dust); margin-bottom: 28px; }
.prose { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: clamp(22px, 4vw, 44px); line-height: 1.75; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 1.5rem; margin: 2em 0 0.5em; scroll-margin-top: 90px; }
.prose h3 { font-size: 1.2rem; margin: 1.5em 0 0.4em; }
.prose ul { padding-left: 1.2em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.45em; }
.prose a { color: var(--null); }
.doclist { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; }
.doclist li { padding: 18px 22px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; justify-content: space-between; }
.doclist a { font: 600 1.2rem/1.3 var(--display); text-decoration: none; }
.doclist a:hover { color: var(--null); }
.doclist span { color: var(--dust); font-size: 0.95rem; }

@media (max-width: 1020px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .worlds, .hangar, .funnel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: 10px 16px; }
  .topbar nav { order: 3; width: 100%; margin-left: 0; justify-content: space-between; gap: 8px; }
  .topbar .badge, .topbar .button { margin-left: auto; }
  html { scroll-padding-top: 120px; }
  .hero { grid-template-columns: 1fr; }
  .scene { order: -1; max-width: 360px; margin: 0 auto -10px; }
  .facts dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts div:nth-child(3) { border-left: 0; }
  .facts div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .steps, .worlds, .hangar, .funnel, .features, .faq, .foot-grid { grid-template-columns: 1fr; }
  .ship > p { min-height: 0; }
  .actions .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .spin, .flight { animation: none; }
}
@media print {
  body { background: #fff; color: #000; }
  .topbar, .skip, .foot nav { display: none; }
  .prose { background: none; border: 0; padding: 0; }
  .prose a { color: #000; }
}
