/* Spireward website. Colours come from the game's UITheme tokens; fonts are the brand's (Baloo 2, Nunito), self-hosted. */

@font-face { font-family: "Baloo 2"; src: url("../fonts/baloo2-extrabold.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("../fonts/nunito-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("../fonts/nunito-extrabold.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --bg: #0e1322;
  --bg-2: #121829;          /* UITheme.Background */
  --surface: #1a2239;
  --surface-2: #1e2742;     /* UITheme.Panel */
  --surface-3: #2b3660;     /* UITheme.PanelRaised */
  --line: rgb(179 188 221 / .14);
  --line-strong: rgb(179 188 221 / .28);
  --primary: #2c66f2;       /* Guardian Blue */
  --primary-hi: #4a7df5;
  --secondary: #46558c;
  --accent: #ffe866;        /* the Lantern */
  --gold: #ffbe33;
  --text: #f5f7ff;
  --text-2: #b3bcdd;
  --text-3: #8a94b8;
  --ink: #1b1633;
  --radius-s: 12px;
  --radius: 18px;
  --radius-l: 28px;
  --max: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --shadow: 0 18px 50px rgb(0 0 0 / .45);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 700 1.0625rem/1.65 "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, .display { font-family: "Baloo 2", "Nunito", system-ui, sans-serif; font-weight: 800; line-height: 1.08; letter-spacing: -.01em; margin: 0 0 .45em; }
h1 { font-size: clamp(2.75rem, 6.5vw, 5rem); }
h2 { font-size: clamp(2rem, 4.2vw, 3rem); }
h3 { font-size: 1.35rem; line-height: 1.2; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { color: #fff3a8; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.muted { color: var(--text-2); }
.small { font-size: .9rem; }

.wrap { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 10px; background: var(--accent); color: var(--ink); padding: 8px 14px; border-radius: 10px; z-index: 50; }
.skip:focus { left: 10px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font: 800 .8rem/1 "Nunito", sans-serif; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 16px;
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: currentColor; border-radius: 2px; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgb(14 19 34 / .82);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 20px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 800 1.45rem/1 "Baloo 2", sans-serif; }
.brand img { width: 34px; height: 34px; border-radius: 9px; box-shadow: 0 0 0 1px var(--line); }
.brand:hover { color: var(--text); }
.site-nav { display: flex; align-items: center; gap: 4px 22px; margin-left: auto; flex-wrap: wrap; }
.site-nav a { color: var(--text-2); text-decoration: none; font-weight: 800; font-size: .98rem; padding: 6px 0; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }
.site-nav .nav-cta { color: #fff; background: var(--primary); padding: 9px 16px; border-radius: 999px; }
.site-nav .nav-cta:hover { background: var(--primary-hi); color: #fff; }
@media (max-width: 760px) {
  .site-header .wrap { flex-wrap: wrap; gap: 6px 16px; padding: 10px 0; }
  .site-nav { width: 100%; margin-left: 0; gap: 4px 18px; }
  .site-nav .nav-cta { display: none; }
}

/* ---------------------------------------------------------------- buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 10px 22px 10px 18px; border-radius: 14px;
  background: var(--primary); color: #fff; text-decoration: none;
  font: 800 1.05rem/1.15 "Baloo 2", "Nunito", sans-serif;
  box-shadow: 0 8px 24px rgb(44 102 242 / .35);
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { background: var(--primary-hi); color: #fff; transform: translateY(-1px); }
.btn small { display: block; font: 700 .76rem/1.2 "Nunito", sans-serif; opacity: .85; letter-spacing: .02em; }
.btn .glyph { width: 26px; height: 26px; flex: none; }
.btn.ghost { background: rgb(255 255 255 / .06); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn.ghost:hover { background: rgb(255 255 255 / .1); }
.btn.soon { background: rgb(255 255 255 / .05); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line); cursor: default; }
.btn.soon:hover { transform: none; }

/* ---------------------------------------------------------------- hero */
.hero { position: relative; overflow: hidden; isolation: isolate; }
.hero-art { position: absolute; inset: 0; z-index: -2; background: var(--bg-2) url("../img/hero-1200.jpg") center 40% / cover no-repeat; }
@media (min-width: 900px) { .hero-art { background-image: url("../img/hero-2400.jpg"); } }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgb(14 19 34 / .92) 0%, rgb(14 19 34 / .72) 38%, rgb(14 19 34 / .15) 70%),
    linear-gradient(180deg, rgb(14 19 34 / 0) 55%, var(--bg) 100%);
}
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; padding: clamp(72px, 11vw, 140px) 0 clamp(64px, 9vw, 120px); }
.hero-copy { max-width: 560px; }
.hero-title { display: flex; align-items: center; gap: 18px; margin-bottom: 8px; }
.hero-title img { width: clamp(64px, 8vw, 92px); height: auto; border-radius: 22%; box-shadow: 0 10px 30px rgb(0 0 0 / .5), 0 0 0 1px var(--line); }
.hero h1 { margin: 0; text-shadow: 0 3px 0 var(--ink), 0 10px 30px rgb(0 0 0 / .5); }
.tagline { font: 800 clamp(1.35rem, 2.6vw, 1.85rem)/1.2 "Baloo 2", sans-serif; color: var(--accent); margin: 10px 0 18px; }
.lead { font-size: clamp(1.08rem, 1.6vw, 1.22rem); color: #dfe4f7; }
.hero .actions { margin-top: 28px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 26px 0 0; padding: 0; list-style: none; }
.badges li { font-size: .9rem; color: var(--text-2); padding: 6px 12px; border-radius: 999px; background: rgb(255 255 255 / .05); box-shadow: inset 0 0 0 1px var(--line); }
.badges li::before { content: "✓ "; color: var(--accent); }

/* A landscape phone drawn in CSS, holding a real screenshot. */
.device {
  position: relative; justify-self: end; width: min(100%, 620px);
  padding: 14px 16px; border-radius: 34px;
  background: linear-gradient(145deg, #2c3456, #12172a);
  box-shadow: var(--shadow), inset 0 0 0 2px rgb(255 255 255 / .08), 0 0 80px rgb(255 232 102 / .12);
  transform: rotate(-2deg);
}
.device::before { content: ""; position: absolute; left: 6px; top: 50%; width: 5px; height: 46px; margin-top: -23px; border-radius: 3px; background: #0b0f1c; }
.device img { border-radius: 20px; aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 40px; }
  .device { justify-self: center; transform: none; }
  .hero::before { background: linear-gradient(180deg, rgb(14 19 34 / .55) 0%, rgb(14 19 34 / .85) 45%, var(--bg) 100%); }
}

/* ---------------------------------------------------------------- facts strip */
.facts { border-block: 1px solid var(--line); background: var(--bg-2); }
.facts ul { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; padding: 0; list-style: none; }
.facts li { padding: 26px 20px; text-align: center; border-left: 1px solid var(--line); }
.facts li:first-child { border-left: 0; }
.facts strong { display: block; font: 800 clamp(1.8rem, 3.4vw, 2.5rem)/1 "Baloo 2", sans-serif; color: var(--text); }
.facts span { color: var(--text-2); font-size: .95rem; }
@media (max-width: 700px) {
  .facts ul { grid-template-columns: repeat(2, 1fr); }
  .facts li:nth-child(3) { border-left: 0; }
  .facts li:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* ---------------------------------------------------------------- sections */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section.tint { background: linear-gradient(180deg, var(--bg-2), var(--bg)); }
.section-head { max-width: 680px; margin-bottom: clamp(32px, 4vw, 52px); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .eyebrow { justify-content: center; }
.section-head p { color: var(--text-2); font-size: 1.12rem; }

/* Five-card rows (towers, worlds, bosses) wrap with flex, so a short last line is centered, not left over */
.towers, .worlds, .bosses { --cols: 5; --gap: 16px; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--gap); }
.towers > *, .worlds > *, .bosses > * { flex: 0 0 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols)); min-width: 0; }

/* Towers */
.tower {
  text-align: center; padding: 22px 14px 20px; border-radius: var(--radius);
  background: radial-gradient(120% 80% at 50% 0%, var(--surface-3) 0%, var(--surface) 70%);
  box-shadow: inset 0 0 0 1px var(--line);
}
.tower img { width: 132px; height: 132px; margin: 0 auto 10px; filter: drop-shadow(0 10px 14px rgb(0 0 0 / .45)); }
.tower h3 { margin-bottom: .2em; }
.tower p { color: var(--text-2); font-size: .95rem; margin: 0; line-height: 1.45; }
@media (max-width: 1000px) { .towers { --cols: 3; } }
@media (max-width: 560px) { .towers { --cols: 2; } }

/* Worlds */
.worlds { --gap: 18px; }
.world { border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.world img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
.world div { padding: 14px 16px 18px; }
.world .num { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 800; }
.world h3 { margin: 4px 0 6px; font-size: 1.2rem; }
.world p { margin: 0; color: var(--text-2); font-size: .93rem; line-height: 1.5; }
@media (max-width: 1100px) { .worlds { --cols: 3; } }
@media (max-width: 680px) { .worlds { --cols: 2; } }
@media (max-width: 440px) { .worlds { --cols: 1; } }

/* Feature rows: a picture and copy, alternating sides */
.rows { display: grid; gap: clamp(56px, 8vw, 96px); }
.row { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.row:nth-child(even) .row-media { order: 2; }
.row-media img { border-radius: var(--radius); box-shadow: var(--shadow), 0 0 0 1px var(--line); aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.row-copy p { color: var(--text-2); }
.checks { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.checks li { position: relative; padding-left: 30px; }
.checks li::before { content: ""; position: absolute; left: 0; top: .32em; width: 18px; height: 18px; border-radius: 50%; background: rgb(255 232 102 / .16); box-shadow: inset 0 0 0 2px var(--accent); }
@media (max-width: 860px) { .row { grid-template-columns: 1fr; } .row:nth-child(even) .row-media { order: 0; } }

/* Bosses */
.boss { text-align: center; padding: 18px 12px 20px; border-radius: var(--radius); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.boss img { width: 140px; height: 140px; margin: 0 auto 8px; filter: drop-shadow(0 8px 12px rgb(0 0 0 / .5)); }
.boss .num { display: block; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 800; }
.boss h3 { font-size: 1.15rem; margin: 4px 0 4px; }
.boss p { color: var(--text-2); font-size: .9rem; margin: 0; line-height: 1.45; }
@media (max-width: 1000px) { .bosses { --cols: 3; } }
@media (max-width: 560px) { .bosses { --cols: 2; } }

/* Gallery: thumbnails that open the full image (no script) */
.gallery { display: grid; gap: 16px; grid-template-columns: repeat(4, 1fr); }
.gallery a { display: block; border-radius: var(--radius-s); overflow: hidden; box-shadow: 0 0 0 1px var(--line); transition: transform .15s ease, box-shadow .15s ease; }
.gallery a:hover { transform: translateY(-2px); box-shadow: 0 0 0 2px var(--accent); }
.gallery img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.gallery figure { margin: 0; }
.gallery figcaption { color: var(--text-2); font-size: .9rem; margin-top: 8px; }
@media (max-width: 980px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .gallery { grid-template-columns: 1fr; } }

/* Cards */
.cards { display: grid; gap: 18px; grid-template-columns: repeat(3, 1fr); }
.card { padding: 26px; border-radius: var(--radius); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.card .icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgb(255 232 102 / .12); color: var(--accent); font: 800 1.3rem/1 "Baloo 2", sans-serif; margin-bottom: 14px; }
.card h3 { margin-bottom: .35em; }
.card p { color: var(--text-2); margin: 0; }
@media (max-width: 900px) { .cards { grid-template-columns: 1fr; } }

/* Call to action */
.cta {
  position: relative; overflow: hidden; border-radius: var(--radius-l); padding: clamp(36px, 6vw, 64px);
  background: linear-gradient(120deg, rgb(14 19 34 / .92), rgb(14 19 34 / .6)), url("../img/world-4.jpg") center / cover;
  box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow);
  display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center;
}
.cta h2 { margin-bottom: .2em; }
.cta p { color: var(--text-2); margin: 0; }
@media (max-width: 860px) { .cta { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- inner pages */
.page-head { padding: clamp(56px, 8vw, 96px) 0 clamp(28px, 4vw, 44px); background: radial-gradient(90% 140% at 0% 0%, rgb(44 102 242 / .22), transparent 60%), var(--bg-2); border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); margin-bottom: .15em; }
.page-head p { color: var(--text-2); max-width: 640px; margin: 0; font-size: 1.1rem; }
.crumbs { font-size: .9rem; color: var(--text-3); margin-bottom: 12px; }
.crumbs a { color: var(--text-2); }

.doc { padding: clamp(40px, 6vw, 72px) 0 clamp(64px, 8vw, 100px); }
.doc-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 56px; align-items: start; }
.doc-grid.single { grid-template-columns: minmax(0, 780px); justify-content: center; }
.doc-aside { position: sticky; top: 96px; }
.doc-aside .toc { margin: 0; }
.prose { max-width: 760px; }
.prose h2 { font-size: 1.7rem; margin: 1.8em 0 .5em; scroll-margin-top: 90px; }
.prose h3 { margin: 1.4em 0 .4em; scroll-margin-top: 90px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .3em 0; }
.prose address { font-style: normal; }
.prose .meta { color: var(--text-2); }
.prose > :first-child { margin-top: 0; }
.summary { background: var(--surface); border-radius: var(--radius); padding: 20px 24px; margin: 24px 0; box-shadow: inset 0 0 0 1px var(--line); }
.summary h2 { margin-top: 0; font-size: 1.4rem; }
.toc { background: var(--surface); border-radius: var(--radius); padding: 18px 20px; box-shadow: inset 0 0 0 1px var(--line); font-size: .95rem; }
.toc p { margin: 0 0 .5em; font-weight: 800; color: var(--text); letter-spacing: .08em; text-transform: uppercase; font-size: .78rem; }
.toc ol { margin: 0; padding-left: 1.2em; }
.toc li { margin: .3em 0; }
.toc a { color: var(--text-2); text-decoration: none; }
.toc a:hover { color: var(--accent); }
.ui { font-weight: 800; color: var(--text); }
@media (max-width: 960px) {
  .doc-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .doc-aside { position: static; }
}

.contact-panel { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; padding: 24px; border-radius: var(--radius); background: linear-gradient(135deg, rgb(44 102 242 / .25), rgb(44 102 242 / .08)); box-shadow: inset 0 0 0 1px rgb(44 102 242 / .5); margin: 0 0 36px; }
.contact-panel .icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--primary); font: 800 1.5rem/1 "Baloo 2", sans-serif; color: #fff; }
.contact-panel p { margin: 0; color: var(--text-2); }
.contact-panel strong { color: var(--text); font-size: 1.15rem; }
.faq details { border-radius: var(--radius-s); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); margin: 10px 0; }
.faq summary { cursor: pointer; list-style: none; padding: 16px 52px 16px 20px; font-weight: 800; position: relative; min-height: 52px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font: 800 1.4rem/1 "Baloo 2", sans-serif; color: var(--accent); }
.faq details[open] summary::after { content: "–"; }
.faq details > :not(summary) { padding: 0 20px; color: var(--text-2); }
.faq details > :last-child { padding-bottom: 16px; }
.faq details ul { padding-left: 40px; }

.facts-table { width: 100%; border-collapse: collapse; margin: 8px 0 28px; }
.facts-table th, .facts-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.facts-table th { width: 34%; color: var(--text-2); font-weight: 800; }
.downloads { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); margin: 14px 0 28px; }
.download { display: block; text-decoration: none; color: var(--text); border-radius: var(--radius-s); overflow: hidden; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.download:hover { color: var(--text); box-shadow: inset 0 0 0 2px var(--accent); }
.download img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; background: var(--bg-2); }
.download img.contain { object-fit: contain; padding: 14px; }
.download span { display: block; padding: 10px 14px 12px; font-size: .92rem; }
.download small { display: block; color: var(--text-3); font-weight: 700; }

/* ---------------------------------------------------------------- footer */
.site-footer { background: var(--bg-2); border-top: 1px solid var(--line); padding: 56px 0 32px; color: var(--text-2); font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; }
.footer-grid h4 { margin: 0 0 12px; color: var(--text); font: 800 .8rem/1 "Nunito", sans-serif; letter-spacing: .14em; text-transform: uppercase; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-grid a { color: var(--text-2); text-decoration: none; }
.footer-grid a:hover { color: var(--text); }
.footer-brand p { margin: 12px 0 0; max-width: 34ch; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); font-size: .85rem; color: var(--text-3); }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
