:root {
  color-scheme: dark;
  --void: #07060f;
  --void-2: #0e0c1b;
  --glass: rgba(15, 12, 28, 0.66);
  --glass-strong: rgba(20, 16, 38, 0.9);
  --line: rgba(184, 158, 255, 0.14);
  --line-hover: rgba(232, 194, 116, 0.38);
  --text: #f5f2fa;
  --muted: #9a91b0;
  --violet: #b99aff;
  --gold: #e8c274;
  --gold-deep: #c9943f;
  --online: #5ee6a8;
  --offline: #e58d8d;
  --gutter: clamp(20px, 5vw, 72px);
  --font-display: Georgia, "Times New Roman", serif;
  --font-sans: "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "Cascadia Code", "Consolas", ui-monospace, monospace;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--void);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--void);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
a { color: inherit; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.mono { font-family: var(--font-mono); }

.shell {
  width: min(100%, 1320px);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Header */
.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(7, 6, 15, 0.64);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.header-row {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  white-space: nowrap;
}
.brand-mark { color: var(--gold); flex-shrink: 0; }
.brand-name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text);
}
nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 36px);
}
nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.18s ease;
}
nav a:hover { color: var(--text); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.header-cta:hover {
  border-color: var(--line-hover);
  background: rgba(255, 255, 255, 0.07);
}
.header-cta.gold-outline {
  border-color: rgba(232, 194, 116, 0.42);
  color: var(--gold);
}
.user-chip { max-width: 210px; }
.user-chip span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--online);
  flex-shrink: 0;
}

/* Hero */
.hero {
  position: relative;
  background-color: var(--void);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: background-image 0.35s ease;
}
.hero[data-bg="sunwell-citadel"] {
  background-image:
    linear-gradient(90deg, rgba(7, 6, 15, 0.88) 0%, rgba(7, 6, 15, 0.52) 38%, rgba(7, 6, 15, 0.12) 72%, rgba(7, 6, 15, 0.08) 100%),
    linear-gradient(0deg, #07060f 0%, rgba(7, 6, 15, 0.44) 26%, transparent 62%),
    url("/assets/sunwell-citadel.jpg");
}
.hero[data-bg="northgate-arch"] {
  background-image:
    linear-gradient(90deg, rgba(7, 6, 15, 0.86) 0%, rgba(7, 6, 15, 0.48) 38%, rgba(7, 6, 15, 0.12) 72%, rgba(7, 6, 15, 0.08) 100%),
    linear-gradient(0deg, #07060f 0%, rgba(7, 6, 15, 0.44) 26%, transparent 62%),
    url("/assets/northgate-arch.jpg");
}
.hero[data-bg="voidstorm-eclipse"] {
  background-image:
    linear-gradient(90deg, rgba(7, 6, 15, 0.84) 0%, rgba(7, 6, 15, 0.45) 38%, rgba(7, 6, 15, 0.1) 72%, rgba(7, 6, 15, 0.08) 100%),
    linear-gradient(0deg, #07060f 0%, rgba(7, 6, 15, 0.44) 26%, transparent 62%),
    url("/assets/voidstorm-eclipse.jpg");
}

.hero-inner {
  position: relative;
  min-height: clamp(460px, 64svh, 660px);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-block: 64px clamp(84px, 11vh, 118px);
}
.hero-copy { max-width: 540px; }

.edition {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}
.edition-line {
  width: 24px;
  height: 1px;
  background: currentColor;
}

h1 {
  margin: 0;
  color: var(--text);
  font: 400 clamp(52px, 8vw, 108px) / 0.92 var(--font-display);
  letter-spacing: -0.04em;
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.65);
}
.hero-subtitle {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(14px, 1.5vw, 16px);
  letter-spacing: 0.02em;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.btn-gold {
  border: 0;
  background: linear-gradient(180deg, #efd08c 0%, #d4a14c 100%);
  color: #151008;
  box-shadow: 0 8px 28px rgba(212, 161, 76, 0.28), inset 0 1px 0 rgba(255, 248, 226, 0.65);
}
.btn-gold:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
}
.btn-gold:active { transform: translateY(0); }
.btn-ghost {
  border: 1px solid var(--line);
  background: rgba(15, 12, 28, 0.52);
  color: var(--text);
  backdrop-filter: blur(12px);
}
.btn-ghost:hover:not(:disabled) {
  border-color: var(--line-hover);
  background: rgba(24, 19, 44, 0.68);
}

/* Backdrop switcher */
.bg-switcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(7, 6, 15, 0.52);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.bg-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(184, 158, 255, 0.35);
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}
.bg-dot:hover { background: rgba(232, 194, 116, 0.7); }
.bg-dot[aria-pressed="true"] {
  background: var(--gold);
  transform: scale(1.25);
}

/* Bento Telemetry Strip */
.bento {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: -40px;
  padding-bottom: 64px;
}
.card {
  min-width: 0;
  padding: 22px 24px;
  border-radius: 14px;
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  scroll-margin-top: 84px;
  transition: border-color 0.2s ease;
}
.card:hover { border-color: var(--line-hover); }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.card h2 {
  margin: 0;
  color: var(--muted);
  font: 600 11px / 1 var(--font-sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.card-icon { color: var(--gold); opacity: 0.85; }
.card-value {
  margin: 0;
  color: var(--text);
  font: 400 clamp(20px, 2.2vw, 24px) / 1.2 var(--font-display);
  overflow-wrap: anywhere;
}
.card-value.mono {
  font-family: var(--font-mono);
  font-size: clamp(18px, 1.9vw, 22px);
}
.card-meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
}
.status-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8b83a1;
}
.status-pill[data-state="online"] { color: var(--text); }
.status-pill[data-state="online"]::before {
  background: var(--online);
  box-shadow: 0 0 8px rgba(94, 230, 168, 0.6);
}
.status-pill[data-state="offline"]::before,
.status-pill[data-state="error"]::before { background: var(--offline); }

.download-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.download-link {
  margin-top: 14px;
  min-height: 38px;
  padding: 0 16px;
  font-size: 12px;
}

.retry {
  grid-column: 1 / -1;
  justify-self: start;
}
.noscript-note {
  color: var(--muted);
  font-size: 13px;
  padding-bottom: 24px;
}

/* Footer */
.site-footer {
  padding-block: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Dialogs */
dialog {
  width: min(440px, calc(100% - 32px));
  padding: 24px 26px 26px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--glass-strong);
  backdrop-filter: blur(22px);
  color: var(--text);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.78);
}
dialog::backdrop { background: rgba(4, 3, 10, 0.8); }
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.dialog-head h2 {
  margin: 0;
  font: 400 22px / 1.2 var(--font-display);
}
.dialog-tabs { display: flex; gap: 18px; }
.dialog-tab {
  position: relative;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.dialog-tab[aria-selected="true"] { color: var(--text); }
.dialog-tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -13px;
  height: 1.5px;
  background: var(--gold);
}
.dialog-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  padding: 4px 6px;
}
.dialog-close:hover { color: var(--text); }

.dialog-form {
  display: flex;
  flex-direction: column;
}
.field-label {
  margin: 14px 0 6px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.dialog-form .field-label:first-child { margin-top: 4px; }
.dialog-form input {
  min-height: 42px;
  padding: 9px 13px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(7, 6, 15, 0.78);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.dialog-form input:focus-visible { border-color: var(--line-hover); }
.dialog-feedback {
  margin: 12px 0 0;
  min-height: 18px;
  font-size: 12px;
  color: var(--gold);
}
.dialog-feedback[data-state="error"] { color: #f2b8b8; }
.dialog-feedback:empty { display: none; }
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.dialog-actions.between { justify-content: space-between; }

.account-meta {
  margin: 0 0 18px;
}
.account-meta div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.account-meta dt { color: var(--muted); }
.account-meta dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }

@media (max-width: 860px) {
  .bento {
    grid-template-columns: minmax(0, 1fr);
    margin-top: -20px;
  }
  .hero-inner {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    min-height: 430px;
    padding-bottom: 56px;
  }
}
@media (max-width: 560px) {
  nav { display: none; }
}
