/* m2-web: one self-contained stylesheet (no external fonts, images or scripts). */
:root {
  --bg: #0b0d14;
  --bg-2: #11141f;
  --panel: #151927;
  --panel-2: #1b2032;
  --line: #262c42;
  --text: #e7e4dc;
  --muted: #a3a7b8;
  --gold: #f0c36a;
  --gold-2: #d9a441;
  --rift: #a873ff;
  --rift-2: #6a4bd8;
  --ok: #5fd39a;
  --warn: #f0b04a;
  --bad: #ff6b6b;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(168, 115, 255, .12), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(240, 195, 106, .06), transparent 60%);
  color: var(--text);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1 0 auto; }
img { max-width: 100%; display: block; }
a { color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #ffd98f; }
code { font-family: var(--mono); background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: .1em .4em; font-size: .92em; }
code.big { font-size: 1.15em; color: var(--gold); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: .01em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0 0 1rem; }
h3 { font-size: 1.25rem; margin: 0 0 .4rem; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; z-index: 99; background: var(--panel); padding: .5rem 1rem; }

/* header */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem clamp(1rem, 4vw, 3rem);
  background: rgba(11, 13, 20, .82);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none; font: 700 1.35rem/1 var(--serif); letter-spacing: .06em; text-transform: uppercase; }
.brand small { font: 500 .78rem/1 var(--sans); letter-spacing: .12em; color: var(--muted); text-transform: none; margin-left: .2rem; padding-left: .6rem; border-left: 1px solid var(--line); }
.brand-mark {
  width: 22px; height: 28px;
  background: linear-gradient(160deg, var(--gold), var(--rift));
  clip-path: polygon(62% 0, 34% 44%, 60% 52%, 30% 100%, 44% 58%, 18% 50%);
  filter: drop-shadow(0 0 6px rgba(168, 115, 255, .6));
}
.top nav { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; justify-content: flex-end; }
.top nav a { color: var(--muted); text-decoration: none; padding: .45rem .75rem; border-radius: 999px; font-size: .95rem; }
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--text); background: rgba(255, 255, 255, .06); }
.top nav .nav-cta { color: #1a1406; background: linear-gradient(180deg, var(--gold), var(--gold-2)); font-weight: 600; }
.top nav .nav-cta:hover, .top nav .nav-cta.active { color: #1a1406; background: linear-gradient(180deg, #ffd78a, var(--gold)); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.4rem; border-radius: 999px; border: 1px solid transparent;
  font: 600 1rem/1.2 var(--sans); text-decoration: none; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn.primary { color: #1a1406; background: linear-gradient(180deg, var(--gold), var(--gold-2)); box-shadow: 0 8px 28px rgba(240, 195, 106, .25); }
.btn.primary:hover { color: #1a1406; transform: translateY(-1px); box-shadow: 0 12px 34px rgba(240, 195, 106, .35); }
.btn.ghost { color: var(--text); border-color: rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .04); }
.btn.ghost:hover { color: var(--text); border-color: var(--gold); }
.btn.disabled { color: var(--muted); border-color: var(--line); cursor: default; }
.btn.wide { width: 100%; margin-top: .5rem; }

/* hero */
.hero {
  position: relative; overflow: hidden;
  min-height: min(88vh, 820px);
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr); align-items: end; gap: 2rem;
  padding: clamp(5rem, 12vh, 9rem) clamp(1rem, 5vw, 4rem) clamp(2.5rem, 6vh, 4rem);
}
.hero-bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(11, 13, 20, .2) 0%, rgba(11, 13, 20, .55) 55%, var(--bg) 100%),
    linear-gradient(90deg, rgba(11, 13, 20, .85) 0%, rgba(11, 13, 20, .2) 65%),
    url("/static/img/hero.jpg") center 35% / cover no-repeat;
}
.hero-bg::after {
  content: ""; position: absolute; inset: -10% 30% -10% auto; width: 3px;
  background: linear-gradient(180deg, transparent, var(--rift), #fff, var(--rift), transparent);
  transform: rotate(14deg); filter: blur(1px) drop-shadow(0 0 18px var(--rift)); opacity: .55;
}
.eyebrow { text-transform: uppercase; letter-spacing: .22em; font-size: .78rem; color: var(--gold); margin: 0 0 .8rem; font-weight: 600; }
.hero h1 { margin: 0; font-size: clamp(3rem, 9vw, 6.5rem); letter-spacing: .05em; text-transform: uppercase; line-height: .95; text-shadow: 0 6px 40px rgba(0, 0, 0, .6); }
.hero h1 span { display: block; font-size: .42em; letter-spacing: .18em; color: var(--gold); margin-top: .5rem; text-transform: none; font-style: italic; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); max-width: 38rem; color: #d6d3cb; margin: 1.4rem 0 2rem; }
.actions { display: flex; flex-wrap: wrap; gap: .8rem; }

/* status */
.status-card {
  background: rgba(21, 25, 39, .78); border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--radius); padding: 1.3rem 1.4rem; box-shadow: var(--shadow);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.status-head { display: flex; align-items: center; gap: .7rem; }
.status-head h2 { font: 600 1.15rem/1.2 var(--sans); margin: 0; }
.status-head strong.up { color: var(--ok); }
.status-head strong.down { color: var(--bad); }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.dot.up { background: var(--ok); box-shadow: 0 0 0 4px rgba(95, 211, 154, .18), 0 0 14px var(--ok); }
.dot.down { background: var(--bad); box-shadow: 0 0 0 4px rgba(255, 107, 107, .15); }
.players { margin: .7rem 0; color: var(--muted); }
.players .num { font: 700 1.9rem/1 var(--serif); color: var(--text); margin-right: .25rem; vertical-align: -.15em; }
.channels { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .5rem; }
.ch { display: flex; justify-content: space-between; gap: .5rem; padding: .45rem .7rem; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); font-size: .9rem; }
.ch-state { font-weight: 600; }
.ch.up .ch-state { color: var(--ok); }
.ch.busy .ch-state { color: var(--warn); }
.ch.full .ch-state { color: var(--bad); }
.ch.down .ch-state { color: var(--muted); }
.hint { margin: .8rem 0 0; font-size: .78rem; color: var(--muted); }

/* sections */
main > section { padding: clamp(3rem, 8vw, 6rem) clamp(1rem, 5vw, 4rem); max-width: 1240px; margin: 0 auto; }
main > section.hero { max-width: none; }
.story { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.story-text p { color: #d2cfc7; max-width: 40rem; }
.story-text strong { color: var(--text); }
.story-pic img, .gallery img { border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid rgba(255, 255, 255, .06); width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.story-pic { margin: 0; position: relative; }
.story-pic::before { content: ""; position: absolute; inset: -14px; border-radius: 22px; background: radial-gradient(closest-side, rgba(168, 115, 255, .25), transparent); z-index: -1; }

.peoples h2, .gallery h2, .play h2 { text-align: center; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2rem; margin-top: 2rem; }
.card { position: relative; background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem 1.5rem 1.4rem; overflow: hidden; }
.card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; }
.card.realm::before { background: linear-gradient(90deg, #e05d5d, #e3c35b, #4f8de0); }
.card.east::before { background: linear-gradient(90deg, #d7432f, var(--gold)); }
.card.west::before { background: linear-gradient(90deg, #4f8de0, var(--rift)); }
.card h3 { font-size: 1.5rem; }
.card .origin { margin: 0 0 .8rem; color: var(--gold); font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; }
.card p { color: #cfccc4; margin: 0; }
.features { list-style: none; padding: 0; margin: 2rem auto 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem 1.4rem; max-width: 980px; }
.features li { padding: .8rem 1rem .8rem 2.4rem; position: relative; background: rgba(255, 255, 255, .025); border: 1px solid var(--line); border-radius: 12px; color: #cfccc4; }
.features li::before { content: ""; position: absolute; left: 1rem; top: 1.25rem; width: 8px; height: 8px; transform: rotate(45deg); background: var(--gold); box-shadow: 0 0 10px rgba(240, 195, 106, .6); }
.features strong { color: var(--text); }

.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-top: 2rem; }
.grid figure { margin: 0; }
.grid figure:nth-child(1) { grid-column: span 2; grid-row: span 2; }
.grid a { display: block; border-radius: var(--radius); overflow: hidden; }
.grid img { transition: transform .4s ease, filter .4s ease; filter: saturate(.95); }
.grid a:hover img { transform: scale(1.03); filter: saturate(1.1); }
.grid figure:nth-child(1) img { aspect-ratio: auto; height: 100%; }
.grid figure:nth-child(1) a { height: calc(100% - 2rem); }
figcaption { font-size: .85rem; color: var(--muted); padding: .45rem .2rem 0; }

.steps { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; counter-reset: step; }
.steps li { counter-increment: step; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.3rem; position: relative; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; margin-bottom: .8rem; font: 700 1rem/1 var(--serif); color: #1a1406; background: linear-gradient(180deg, var(--gold), var(--gold-2)); }
.steps p { color: #cfccc4; margin: 0; }
.steps p + p { margin-top: .6rem; }

/* panels and forms */
.panel { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
main > section.panel { margin: clamp(2rem, 6vw, 4rem) auto; padding: clamp(1.4rem, 4vw, 2.6rem); }
main > section.narrow { max-width: 640px; }
main > section.legal { max-width: 820px; }
.legal h2 { font-size: 1.3rem; margin-top: 1.8rem; }
.legal p { color: #d2cfc7; }
.todo { border: 1px dashed var(--warn); background: rgba(240, 176, 74, .08); color: #f5d9a8 !important; padding: .8rem 1rem; border-radius: 10px; }
.form-panel { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(1.5rem, 4vw, 3rem); max-width: 1100px; }
.form-intro h1, .panel h1 { margin: 0 0 .6rem; font-size: clamp(1.8rem, 4vw, 2.5rem); }
.form-intro > p { color: #cfccc4; }
.note { margin-top: 1.4rem; background: rgba(168, 115, 255, .07); border: 1px solid rgba(168, 115, 255, .25); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.note h2 { font: 600 .82rem/1 var(--sans); text-transform: uppercase; letter-spacing: .14em; color: var(--rift); margin: 0 0 .8rem; }
.note ul { margin: 0; padding-left: 1.1rem; }
.note li { margin-bottom: .6rem; color: #cfccc4; font-size: .95rem; }
.note li:last-child { margin-bottom: 0; }
.form { display: flex; flex-direction: column; gap: 1rem; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: .35rem; }
label { font-weight: 600; font-size: .92rem; }
.opt { color: var(--muted); font-weight: 400; }
input[type="text"], input[type="password"], input[type="email"] {
  width: 100%; padding: .75rem .9rem; border-radius: 10px;
  border: 1px solid var(--line); background: #0e111b; color: var(--text);
  font: 1rem/1.3 var(--sans); transition: border-color .15s ease, box-shadow .15s ease;
}
input:hover { border-color: #39405c; }
input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(240, 195, 106, .2); }
input[aria-invalid="true"] { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(255, 107, 107, .15); }
.help { margin: 0; font-size: .82rem; color: var(--muted); }
.err { margin: 0; font-size: .86rem; color: #ff9a9a; }
.err::before { content: "! "; font-weight: 700; }
.alert { background: rgba(255, 107, 107, .1); border: 1px solid rgba(255, 107, 107, .35); border-radius: 10px; padding: .7rem 1rem; color: #ffd0d0; }
.alert p { margin: .2rem 0; }
.fine { font-size: .8rem; color: var(--muted); margin: 0; }
.hp { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.success h1 { color: var(--text); }
.success .eyebrow { color: var(--ok); }
.next { padding-left: 1.2rem; color: #d2cfc7; }
.next li { margin: .35rem 0; }

/* downloads (/download) */
main > section.downloads { max-width: 1100px; }
.dl-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.dl-head p { margin: 0; color: var(--muted); }
.dl-head form { margin: 0; }
.btn.small { padding: .4rem .9rem; font-size: .88rem; }
.private { margin: 1.4rem 0 1.8rem; background: rgba(240, 176, 74, .07); border: 1px solid rgba(240, 176, 74, .35); border-radius: var(--radius); padding: 1rem 1.2rem; }
.private h2 { font: 600 .82rem/1 var(--sans); text-transform: uppercase; letter-spacing: .14em; color: var(--warn); margin: 0 0 .6rem; }
.private p { margin: 0; color: #e6d9bf; font-size: .95rem; }
.dl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
.dl-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.4rem 1.2rem; display: flex; flex-direction: column; gap: .8rem; }
.dl-card h2 { font-size: 1.5rem; margin: 0; }
.dl-meta { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: .9rem; }
.dl-meta strong { color: var(--text); font-weight: 600; }
.dl-card .btn { align-self: flex-start; }
.dl-card ol { margin: 0; padding-left: 1.2rem; color: #d2cfc7; font-size: .93rem; }
.dl-card ol li { margin: .3rem 0; }
.dl-card ol li em { color: var(--text); font-style: normal; font-weight: 600; }
.sha { font: .72rem/1.4 var(--mono); color: var(--muted); word-break: break-all; margin: 0; }
.dl-none { color: var(--muted); margin: 0; }
.downloads > .fine { margin-top: 1rem; }
.tokens { width: 100%; border-collapse: collapse; font-size: .92rem; margin-top: .6rem; }
.tokens th, .tokens td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
.tokens th { color: var(--muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; }
.tokens form { margin: 0; }
.launchers { margin-top: 2rem; }
.launchers h2 { font-size: 1.3rem; margin-bottom: .3rem; }
.launchers > p { color: var(--muted); margin: 0; font-size: .92rem; }
.ok-msg { background: rgba(95, 211, 154, .08); border: 1px solid rgba(95, 211, 154, .3); border-radius: 10px; padding: .6rem 1rem; color: #c9f2dc; margin: 0 0 1rem; }

/* footer */
.foot { border-top: 1px solid rgba(255, 255, 255, .06); background: #090b11; margin-top: 2rem; }
.foot-inner { max-width: 1240px; margin: 0 auto; padding: 2.2rem clamp(1rem, 5vw, 4rem) 2.6rem; }
.foot-brand { font: 700 1.1rem/1 var(--serif); letter-spacing: .08em; text-transform: uppercase; margin: 0 0 .8rem; }
.foot-brand span { color: var(--muted); text-transform: none; letter-spacing: .04em; font-weight: 400; }
.disclaimer { color: var(--muted); font-size: .85rem; max-width: 60rem; margin: 0 0 1rem; }
.foot-links { font-size: .9rem; color: var(--muted); margin: 0; }
.foot-links a { color: var(--muted); }
.foot-links a:hover { color: var(--gold); }

/* small screens */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; align-items: start; min-height: 0; }
  .story { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid figure:nth-child(1) { grid-column: span 2; grid-row: auto; }
  .grid figure:nth-child(1) img { aspect-ratio: 16 / 9; height: auto; }
  .grid figure:nth-child(1) a { height: auto; }
  .form-panel { grid-template-columns: 1fr; }
  .dl-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .top { flex-direction: column; align-items: flex-start; gap: .5rem; }
  .top nav { justify-content: flex-start; margin-left: -.6rem; }
  .top nav a { padding: .35rem .6rem; font-size: .9rem; }
  .brand small { display: none; }
  .features, .steps, .row { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .grid figure:nth-child(1) { grid-column: auto; }
  .actions .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
