:root {
  --bg: #080a0e;
  --bg-elev: #12161d;
  --bg-soft: #161b24;
  --ink: #f4eee4;
  --muted: #9e9588;
  --line: rgba(244, 238, 228, 0.1);
  --ember: #e07a3a;
  --ember-deep: #a04d22;
  --copper: #d0a05a;
  --steel: #7d8b9a;
  --ok: #6fbf7a;
  --down: #c45c5c;
  --font-display: "Cinzel", "Times New Roman", serif;
  --font-body: "Sora", "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --radius-sm: 0.35rem;
  --shadow-glow: 0 0 40px rgba(224, 122, 58, 0.12);
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  letter-spacing: 0.01em;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(224, 122, 58, 0.08), transparent 55%),
    radial-gradient(900px 500px at 100% 20%, rgba(125, 139, 154, 0.06), transparent 50%),
    var(--bg);
  overflow-x: clip;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video, canvas, svg {
  max-width: 100%;
  height: auto;
}

main {
  min-width: 0;
  overflow-x: clip;
}

#embers {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  opacity: 0.55;
}

.top {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding:
    calc(0.75rem + env(safe-area-inset-top, 0px))
    clamp(1rem, 4vw, 3rem)
    0.75rem;
  background: rgba(8, 10, 14, 0.88);
  border-bottom: 1px solid rgba(244, 238, 228, 0.07);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35);
}

/* Blur on a pseudo so it does not trap position:fixed descendants */
.top::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  background: rgba(8, 10, 14, 0.55);
  pointer-events: none;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
  z-index: 52;
  transition: color 0.25s ease, opacity 0.25s ease;
}

.logo-mark {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.4rem;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(208, 160, 90, 0.25), var(--shadow-glow);
}

.logo-text { line-height: 1; }

.logo:hover { color: var(--copper); }
.logo:hover .logo-mark { box-shadow: 0 0 0 1px rgba(224, 122, 58, 0.45), 0 0 24px rgba(224, 122, 58, 0.2); }

.nav-toggle {
  display: none;
  position: relative;
  z-index: 52;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  background: rgba(18, 22, 29, 0.72);
  color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
}

.nav-toggle-bars {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.15rem;
  height: 2px;
  margin: 0;
  background: var(--ink);
  transform: translate(-50%, -50%);
  transition: background 0.2s ease;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--ink);
  transition: transform 0.25s var(--ease-out);
}

.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }

body.nav-open .nav-toggle-bars { background: transparent; }
body.nav-open .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
body.nav-open .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

.nav-scrim {
  display: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  min-width: 0;
}

@media (min-width: 901px) {
  .nav-scrim { display: none !important; }
  .site-nav {
    position: fixed;
    top: 0;
    right: clamp(1rem, 4vw, 3rem);
    left: auto;
    bottom: auto;
    z-index: 51;
    height: calc(0.75rem + env(safe-area-inset-top, 0px) + 2.75rem + 0.75rem);
    width: auto;
    flex-direction: row;
    align-items: center;
    padding: calc(0.75rem + env(safe-area-inset-top, 0px)) 0 0.75rem;
    background: transparent;
    border: 0;
    box-shadow: none;
    transform: none;
    overflow: visible;
  }
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  transition: color 0.25s ease;
  white-space: nowrap;
}

.site-nav a:hover { color: var(--ink); }

.site-nav .nav-cta {
  padding: 0.45rem 0.9rem;
  border: 1px solid rgba(224, 122, 58, 0.45);
  border-radius: var(--radius-sm);
  color: var(--copper);
  background: rgba(224, 122, 58, 0.08);
}

.site-nav .nav-cta:hover {
  color: var(--ink);
  border-color: var(--ember);
  background: rgba(224, 122, 58, 0.16);
}

.lang-chip-text { display: none; }

/* —— Hero welcome slider (KO cinematic) —— */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  align-items: end;
  isolation: isolate;
  overflow: hidden;
}

.hero-slides {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.1s var(--ease-out), visibility 1.1s;
}

.hero-slide.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}

.hero-scene {
  position: absolute;
  inset: -3%;
  background:
    radial-gradient(ellipse 70% 50% at 72% 42%, rgba(224, 122, 58, 0.22), transparent 58%),
    var(--scene) center / cover no-repeat,
    #0a0c10;
  transform: scale(1.04);
  transition: transform 7s var(--ease-out);
  will-change: transform;
}

.hero-slide.is-active .hero-scene {
  transform: scale(1.1) translate3d(-1.2%, -0.6%, 0);
  animation: heroKen 14s var(--ease-out) infinite alternate;
}

.hero-slide[data-theme="karus"] .hero-scene {
  background:
    radial-gradient(ellipse 60% 45% at 75% 30%, rgba(196, 92, 92, 0.28), transparent 55%),
    var(--scene) center / cover no-repeat,
    #120a0e;
}

.hero-slide[data-theme="elmorad"] .hero-scene {
  background:
    radial-gradient(ellipse 55% 50% at 70% 40%, rgba(208, 160, 90, 0.28), transparent 58%),
    var(--scene) center / cover no-repeat,
    #0c1218;
}

.hero-slide[data-theme="moradon"] .hero-scene {
  background:
    radial-gradient(ellipse 65% 55% at 68% 55%, rgba(224, 122, 58, 0.32), transparent 60%),
    var(--scene) center / cover no-repeat,
    #120e0a;
}

.hero-slide[data-theme="war"] .hero-scene {
  background:
    radial-gradient(ellipse 70% 45% at 60% 35%, rgba(160, 60, 50, 0.3), transparent 55%),
    var(--scene) center / cover no-repeat,
    #140c0e;
}

.hero-embers {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(2px 2px at 18% 72%, rgba(224, 122, 58, 0.85), transparent 60%),
    radial-gradient(1.5px 1.5px at 42% 58%, rgba(255, 180, 90, 0.7), transparent 60%),
    radial-gradient(2px 2px at 66% 80%, rgba(224, 122, 58, 0.75), transparent 60%),
    radial-gradient(1px 1px at 82% 48%, rgba(255, 200, 120, 0.65), transparent 60%),
    radial-gradient(1.5px 1.5px at 55% 36%, rgba(224, 122, 58, 0.55), transparent 60%);
  animation: emberTwinkle 4.5s ease-in-out infinite alternate;
  opacity: 0.75;
  mix-blend-mode: screen;
}

.hero-veil {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(105deg, rgba(8, 10, 14, 0.88) 0%, rgba(8, 10, 14, 0.48) 36%, rgba(8, 10, 14, 0.12) 64%, rgba(8, 10, 14, 0.35) 100%),
    linear-gradient(180deg, rgba(8, 10, 14, 0.35) 0%, rgba(8, 10, 14, 0.05) 38%, rgba(8, 10, 14, 0.82) 100%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 3;
  padding:
    calc(5.5rem + env(safe-area-inset-top, 0px))
    clamp(1.25rem, 5vw, 4.5rem)
    clamp(4.5rem, 11vh, 6.5rem);
  max-width: min(44rem, 100%);
  animation: rise 1s var(--ease-out) both;
}

.brand {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.05rem, 5.8vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-shadow: 0 4px 40px rgba(0, 0, 0, 0.55);
  max-width: 100%;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
}

.brand-online {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.62em;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--copper);
}

.hero-kicker {
  margin: 0 0 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--copper);
  min-height: 1.1em;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.hero-copy.is-swap .hero-kicker,
.hero-copy.is-swap h1,
.hero-copy.is-swap .lede {
  opacity: 0;
  transform: translateY(10px);
}

.hero h1 {
  margin: 0 0 0.9rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.35rem, 2.8vw, 2.15rem);
  line-height: 1.25;
  letter-spacing: 0.02em;
  color: rgba(244, 238, 228, 0.95);
  max-width: 22ch;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.lede {
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.95rem, 1.45vw, 1.08rem);
  line-height: 1.65;
  max-width: 34rem;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.cta {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
}

.hero-controls {
  position: absolute;
  z-index: 4;
  right: clamp(1.25rem, 5vw, 4.5rem);
  bottom: clamp(1.5rem, 4vh, 2.75rem);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hero-arrow {
  width: 2.6rem;
  height: 2.6rem;
  border: 1px solid rgba(244, 238, 228, 0.18);
  background: rgba(8, 10, 14, 0.55);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(10px);
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.hero-arrow:hover {
  border-color: rgba(208, 160, 90, 0.55);
  background: rgba(18, 22, 29, 0.8);
  transform: translateY(-1px);
}

.hero-arrow span {
  display: block;
  width: 0.55rem;
  height: 0.55rem;
  border-left: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(45deg);
  margin-left: 0.2rem;
}

.hero-arrow-next span {
  transform: rotate(-135deg);
  margin-left: -0.15rem;
}

.hero-dots {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  padding: 0 0.25rem;
}

.hero-dot {
  width: 0.55rem;
  height: 0.55rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(244, 238, 228, 0.28);
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease, width 0.25s ease;
}

.hero-dot.is-on {
  background: var(--ember);
  width: 1.35rem;
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(224, 122, 58, 0.45);
}

.hero-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  height: 3px;
  background: rgba(244, 238, 228, 0.08);
}

.hero-progress-bar {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--ember-deep), var(--copper));
  transform-origin: left center;
}

@media (min-width: 1100px) {
  .hero {
    align-items: center;
  }

  .hero-inner {
    padding-top: calc(4rem + env(safe-area-inset-top, 0px));
    padding-bottom: clamp(3rem, 8vh, 5rem);
    max-width: 46rem;
  }

  .brand {
    font-size: clamp(3.2rem, 5.8vw, 5.4rem);
  }

  .hero h1 {
    font-size: clamp(1.7rem, 2.6vw, 2.45rem);
    max-width: 24ch;
  }

  .hero-veil {
    background:
      linear-gradient(100deg, rgba(8, 10, 14, 0.9) 0%, rgba(8, 10, 14, 0.52) 32%, rgba(8, 10, 14, 0.05) 58%, rgba(8, 10, 14, 0.28) 100%),
      linear-gradient(180deg, rgba(8, 10, 14, 0.28) 0%, transparent 42%, rgba(8, 10, 14, 0.78) 100%);
  }

  .hero-controls {
    bottom: clamp(2rem, 5vh, 3.25rem);
  }

  .hero-scene {
    filter: saturate(1.15) contrast(1.05);
  }
}

@keyframes heroKen {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to { transform: scale(1.12) translate3d(-1.5%, -1%, 0); }
}

.download-meta {
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.download-page {
  max-width: 52rem;
  margin: 0 auto;
  padding: 4rem 1.25rem 5rem;
}

.download-card {
  background:
    linear-gradient(160deg, rgba(22, 27, 36, 0.95), rgba(8, 10, 14, 0.98));
  border: 1px solid rgba(208, 160, 90, 0.22);
  border-radius: 0.5rem;
  padding: 2rem 1.75rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.download-card .brand {
  color: var(--ember);
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 0.5rem;
}

.download-card h1 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.download-stats {
  display: grid;
  gap: 0.65rem;
  margin: 1.5rem 0;
}

.download-stats .k {
  display: inline-block;
  min-width: 5.5rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.download-stats .v {
  color: var(--text);
  word-break: break-all;
}

.download-stats .mono {
  font-family: Cascadia Code, Consolas, monospace;
  font-size: 0.78rem;
}

.download-card .hint {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 0.75rem 0 0;
}


.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.1rem;
  padding: 0 1.5rem;
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition: transform 0.25s var(--ease-out), background 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.btn:hover { transform: translateY(-2px); }

.btn.primary {
  background: linear-gradient(135deg, var(--ember) 0%, var(--ember-deep) 100%);
  color: #140c08;
  border-color: rgba(255, 210, 160, 0.28);
  box-shadow: 0 10px 28px rgba(160, 77, 34, 0.28);
}

.btn.primary:hover {
  background: linear-gradient(135deg, #ea8f52 0%, var(--ember) 100%);
  box-shadow: 0 14px 34px rgba(160, 77, 34, 0.38);
}

.btn.ghost {
  background: rgba(8, 10, 14, 0.4);
  color: var(--ink);
  border-color: var(--line);
  backdrop-filter: blur(10px);
}

.btn.ghost:hover {
  border-color: rgba(208, 160, 90, 0.55);
  color: var(--copper);
}

/* —— Realm status —— */
.realm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: end;
  padding: clamp(3rem, 8vh, 5.5rem) clamp(1.25rem, 5vw, 4.5rem);
  border-top: 1px solid var(--line);
  background:
    radial-gradient(900px 360px at 85% 10%, rgba(217, 119, 58, 0.12), transparent 55%),
    linear-gradient(180deg, #0e1117 0%, var(--bg) 100%);
}

.realm-copy h2 {
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: 0.04em;
}

.realm-copy h2::after {
  content: "";
  display: block;
  width: 3.5rem;
  height: 2px;
  margin-top: 0.85rem;
  background: linear-gradient(90deg, var(--ember), transparent);
}

.realm-copy p {
  margin: 0;
  color: var(--muted);
  max-width: 28rem;
  line-height: 1.55;
}

.realm-meters {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(18, 22, 29, 0.65), rgba(18, 22, 29, 0.2));
  padding: 0 1.25rem;
}

.meter {
  position: relative;
  display: grid;
  grid-template-columns: 7rem 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
}

.meter:last-child { border-bottom: 0; }

.meter-label {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--steel);
}

.meter-value {
  font-weight: 600;
  text-transform: lowercase;
}

.meter-realm-name {
  text-transform: none;
  letter-spacing: 0.02em;
}

.meter-value.is-online { color: var(--ok); }
.meter-value.is-offline { color: var(--down); }

.meter-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--steel);
}

.meter-dot.is-online {
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(111, 191, 122, 0.55);
  animation: pulse 2.2s ease-out infinite;
}

.meter-dot.is-offline { background: var(--down); }

/* —— News —— */
.news {
  padding: clamp(3rem, 8vh, 5.5rem) clamp(1.25rem, 5vw, 4.5rem) 4rem;
  border-top: 1px solid var(--line);
}

.news-head {
  margin-bottom: 2rem;
  max-width: 36rem;
}

.news-head h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: 0.04em;
}

.news-head p {
  margin: 0;
  color: var(--muted);
}

.news-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.news-list article {
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--line);
  transform: translateY(12px);
  opacity: 0;
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.news-list article.is-in {
  opacity: 1;
  transform: none;
}

.news-list h3 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.news-list p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  max-width: 48rem;
}

.site-footer {
  padding: 3rem clamp(1.25rem, 5vw, 4.5rem) calc(2.5rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(18, 22, 29, 0.45), transparent 65%),
    var(--bg);
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.75rem 2.5rem;
  align-items: end;
}

.footer-brand {
  margin: 0 0 0.45rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--copper);
}

.footer-mark {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 0.3rem;
  opacity: 0.95;
}

.footer-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
  max-width: 28rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.35rem;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  transition: color 0.25s ease;
}

.footer-links a:hover { color: var(--copper); }

.footer-copy {
  margin: 2rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--steel);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

/* —— Motion —— */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  animation: rise 0.95s var(--ease-out) forwards;
}

.reveal.delay-1 { animation-delay: 0.12s; }
.reveal.delay-2 { animation-delay: 0.24s; }
.reveal.delay-3 { animation-delay: 0.36s; }

.reveal-section {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.reveal-section.is-in {
  opacity: 1;
  transform: none;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes heroDrift {
  from { transform: scale(1.06) translate3d(0, 0, 0); }
  to { transform: scale(1.12) translate3d(-1.5%, -1%, 0); }
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(111, 191, 122, 0.5); }
  70% { box-shadow: 0 0 0 10px rgba(111, 191, 122, 0); }
  100% { box-shadow: 0 0 0 0 rgba(111, 191, 122, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-section,
  .news-list article,
  .hero-scene,
  .hero-slide.is-active .hero-scene,
  .meter-dot.is-online {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .hero-progress-bar { display: none; }
  #embers { display: none; }
}

@media (max-width: 860px) {
  .realm {
    grid-template-columns: 1fr;
  }

  .meter {
    grid-template-columns: 5rem minmax(0, 1fr) auto;
    gap: 0.65rem;
  }

  .brand {
    font-size: clamp(2.1rem, 11vw, 3.4rem);
  }

  .hero-inner {
    max-width: none;
    padding-bottom: clamp(4.5rem, 12vh, 6rem);
  }

  .stat-row, .features {
    grid-template-columns: 1fr;
  }

  .order-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem 0.75rem;
  }
  .order-row .o-cash { grid-column: 1 / -1; }
  .order-row .o-date { grid-column: 1 / -1; color: var(--muted); font-size: 0.82rem; }

  .pack-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  }

  .dash-head, .store-head {
    align-items: start;
  }

  .store-balance {
    text-align: left;
    justify-items: start;
    width: 100%;
  }

  .dash-actions {
    flex-wrap: wrap;
    width: 100%;
  }

  .dash-actions .btn {
    flex: 1 1 auto;
    min-width: min(100%, 8.5rem);
  }
}

/* —— Auth / Store / Dashboard —— */
.nav-cta {
  color: var(--copper) !important;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 6rem 1.25rem 3rem;
  background:
    radial-gradient(700px 320px at 20% 10%, rgba(217, 119, 58, 0.12), transparent 60%),
    var(--bg);
}

.auth-panel {
  width: min(28rem, 100%);
  border: 1px solid var(--line);
  background: rgba(18, 22, 29, 0.88);
  padding: 2rem 1.5rem;
}

.auth-kicker {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--copper);
}

.auth-panel h1,
.dash-head h1,
.store-head h1 {
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.auth-lede { color: var(--muted); margin: 0 0 1.25rem; line-height: 1.5; }

.auth-form {
  display: grid;
  gap: 0.9rem;
}

.auth-form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.auth-form input {
  background: #0a0c10;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 0.75rem 0.85rem;
  font: inherit;
}

.auth-form input:focus {
  outline: 1px solid rgba(217, 119, 58, 0.55);
  border-color: rgba(217, 119, 58, 0.55);
}

.auth-form .btn { width: 100%; border: 0; cursor: pointer; }
.auth-error { color: var(--down); margin: 0 0 1rem; }
.auth-switch { margin-top: 1.25rem; color: var(--muted); font-size: 0.9rem; }
.auth-switch a { color: var(--copper); }

.flash {
  border: 1px solid rgba(111, 191, 122, 0.35);
  background: rgba(111, 191, 122, 0.08);
  color: var(--ok);
  padding: 0.85rem 1rem;
  margin: 0 0 1.25rem;
}

.dash, .store {
  padding: 6rem clamp(1.25rem, 5vw, 4.5rem) 4rem;
}

.dash-head, .store-head {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.dash-actions { display: flex; gap: 0.75rem; align-items: center; }
.dash-actions form { margin: 0; }
.dash-actions button { cursor: pointer; font: inherit; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.stat {
  border: 1px solid var(--line);
  padding: 1.1rem 1rem;
  background: rgba(18, 22, 29, 0.65);
}

.stat strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.45rem;
  font-family: var(--font-display);
}

.orders h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 1rem;
}

.order-table { border-top: 1px solid var(--line); }
.order-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1fr 0.7fr 1fr;
  gap: 0.75rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.o-status.status-paid { color: var(--ok); }
.o-status.status-pending { color: var(--copper); }
.o-status.status-failed { color: var(--down); }
.muted { color: var(--muted); }

.store-balance {
  text-align: right;
  display: grid;
  gap: 0.35rem;
  justify-items: end;
}

.store-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.store-tabs .tab {
  background: transparent;
  border: 0;
  color: var(--muted);
  font: inherit;
  padding: 0.85rem 1rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.store-tabs .tab.is-on {
  color: var(--ink);
  border-bottom-color: var(--ember);
}

.pack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 1rem;
}

.pack {
  border: 1px solid var(--line);
  background: rgba(18, 22, 29, 0.72);
  padding: 1.2rem;
  display: grid;
  gap: 0.65rem;
  align-content: start;
}

.pack h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.pack-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.pack-title h3 {
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}

.item-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
}

.pack p { margin: 0; color: var(--muted); font-size: 0.9rem; }

.pack-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0.35rem 0 0.5rem;
}

.pack-meta .kc {
  font-family: var(--font-display);
  color: var(--copper);
  font-size: 1.15rem;
}

.pack form { margin: 0; }
.pack .btn { width: 100%; border: 0; cursor: pointer; font: inherit; }
.store-note { margin-top: 1.5rem; font-size: 0.85rem; }

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
  padding: clamp(3rem, 7vh, 4.5rem) clamp(1.25rem, 5vw, 4.5rem);
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(18, 22, 29, 0.35), transparent 70%);
}

.feature {
  border-top: 2px solid rgba(224, 122, 58, 0.4);
  padding: 1.35rem 0 0.35rem;
  transition: border-color 0.35s var(--ease-out), transform 0.35s var(--ease-out);
}

.feature:hover {
  border-top-color: var(--ember);
  transform: translateY(-3px);
}

.feature h3 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.03em;
}

.feature p { color: var(--muted); line-height: 1.55; margin: 0 0 0.85rem; }
.feature a {
  color: var(--copper);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.feature a:hover { color: var(--ember); }

@media (max-width: 860px) {
  .features {
    grid-template-columns: 1fr;
  }
}

/* —— Language picker —— */
.lang-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--line);
  color: var(--ink) !important;
  background: rgba(18, 22, 29, 0.55);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.lang-chip:hover {
  border-color: rgba(200, 146, 74, 0.55);
  color: var(--copper) !important;
}

.lang-flag { font-size: 1rem; line-height: 1; }
.lang-code { font-weight: 600; opacity: 0.9; }

.lang-page {
  padding: clamp(6rem, 14vh, 8rem) clamp(1.25rem, 5vw, 4.5rem) 4rem;
  max-width: 1100px;
  margin: 0 auto;
}

.lang-head { margin-bottom: 2rem; max-width: 36rem; }
.lang-head h1 {
  margin: 0.35rem 0 0.65rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
}

.lang-search { display: block; margin-top: 1.25rem; }
.lang-search input {
  width: min(100%, 22rem);
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  background: rgba(18, 22, 29, 0.85);
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
}

.lang-search input:focus {
  outline: none;
  border-color: rgba(200, 146, 74, 0.65);
}

.lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.lang-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.65rem;
  row-gap: 0.12rem;
  align-items: center;
  padding: 0.75rem 0.8rem;
  border: 1px solid var(--line);
  background: rgba(18, 22, 29, 0.72);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.2s ease, transform 0.2s var(--ease-out);
}

.lang-card:hover {
  border-color: rgba(200, 146, 74, 0.5);
  transform: translateY(-1px);
}

.lang-card.is-current {
  border-color: rgba(217, 119, 58, 0.7);
  box-shadow: inset 0 0 0 1px rgba(217, 119, 58, 0.25);
}

.lang-flag-img {
  grid-row: 1 / span 2;
  width: 32px;
  height: 24px;
  object-fit: cover;
  border: 1px solid rgba(242, 235, 224, 0.12);
}

.lang-flag-emoji {
  grid-row: 1 / span 2;
  font-size: 1.45rem;
  line-height: 1;
}

.lang-native {
  font-weight: 600;
  font-size: 0.88rem;
  grid-column: 2;
}

.lang-name {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.72rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* —— Aether AI chat —— */
.aether-ai-fab {
  position: fixed;
  right: clamp(1rem, 3vw, 1.75rem);
  bottom: clamp(1rem, 3vw, 1.75rem);
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1rem 0.7rem 0.75rem;
  border: 1px solid rgba(200, 146, 74, 0.45);
  background:
    linear-gradient(145deg, rgba(30, 22, 16, 0.95), rgba(12, 14, 18, 0.96));
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  transition: border-color 0.25s ease, transform 0.25s var(--ease-out), box-shadow 0.25s ease;
}

.aether-ai-fab:hover {
  border-color: rgba(217, 119, 58, 0.75);
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(154, 74, 31, 0.28);
}

.aether-ai-fab.is-open {
  border-color: rgba(217, 119, 58, 0.85);
}

.aether-ai-fab-label {
  font-family: var(--font-display);
  font-weight: 600;
}

.aether-ai-panel {
  position: fixed;
  right: clamp(1rem, 3vw, 1.75rem);
  bottom: calc(clamp(1rem, 3vw, 1.75rem) + 3.6rem);
  z-index: 41;
  width: min(380px, calc(100vw - 1.5rem));
  height: min(520px, calc(100vh - 7rem));
  display: grid;
  grid-template-rows: auto 1fr auto;
  border: 1px solid rgba(200, 146, 74, 0.35);
  background:
    linear-gradient(180deg, rgba(18, 22, 29, 0.98), rgba(10, 12, 16, 0.98));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  animation: aetherAiIn 0.28s var(--ease-out);
}

.aether-ai-panel[hidden] { display: none !important; }

@keyframes aetherAiIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.aether-ai-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(217, 119, 58, 0.12), transparent);
}

.aether-ai-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.aether-ai-brand strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
}

.aether-ai-brand span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.aether-ai-orb {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  flex-shrink: 0;
  background:
    radial-gradient(circle at 35% 30%, #f2ebe0 0 12%, transparent 13%),
    radial-gradient(circle at 50% 55%, #d9773a, #9a4a1f 55%, #0a0c10 100%);
  border: 1px solid rgba(200, 146, 74, 0.55);
  box-shadow: 0 0 16px rgba(217, 119, 58, 0.35);
  animation: aetherAiPulse 2.8s ease-in-out infinite;
}

@keyframes aetherAiPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(217, 119, 58, 0.28); }
  50% { box-shadow: 0 0 20px rgba(217, 119, 58, 0.55); }
}

.aether-ai-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
}

.aether-ai-close:hover { color: var(--ink); }

.aether-ai-messages {
  padding: 0.9rem 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.aether-ai-bubble {
  max-width: 92%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  font-size: 0.88rem;
  line-height: 1.45;
}

.aether-ai-bubble p { margin: 0; }

.aether-ai-assistant {
  align-self: flex-start;
  background: rgba(18, 22, 29, 0.9);
  border-color: rgba(200, 146, 74, 0.28);
}

.aether-ai-user {
  align-self: flex-end;
  background: rgba(154, 74, 31, 0.28);
  border-color: rgba(217, 119, 58, 0.4);
}

.aether-ai-bubble.is-thinking {
  color: var(--muted);
  font-style: italic;
}

.aether-ai-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--line);
  background: rgba(10, 12, 16, 0.85);
}

.aether-ai-form input {
  min-width: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  background: rgba(18, 22, 29, 0.9);
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
}

.aether-ai-form input:focus {
  outline: none;
  border-color: rgba(200, 146, 74, 0.65);
}

.aether-ai-send {
  border: 0;
  cursor: pointer;
  padding: 0.65rem 0.9rem;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .logo { letter-spacing: 0.1em; font-size: 0.72rem; }
  .brand { font-size: clamp(1.9rem, 12vw, 2.8rem); }
  .aether-ai-panel {
    height: min(72dvh, 560px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .aether-ai-fab, .aether-ai-panel, .aether-ai-orb { animation: none; transition: none; }
}

/* —— Support tickets —— */
.support-table .support-row {
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.support-table .support-row:hover {
  border-color: rgba(200, 146, 74, 0.45);
  background: rgba(18, 22, 29, 0.9);
}
.support-form textarea,
.support-form select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  background: rgba(18, 22, 29, 0.85);
  color: var(--ink);
  font: inherit;
  resize: vertical;
}
.support-form select { cursor: pointer; }
.support-attach {
  display: grid;
  gap: 0.75rem;
  padding: 1rem 0 0.25rem;
  border-top: 1px solid var(--line);
  margin-top: 0.5rem;
}
.file-label {
  display: grid;
  gap: 0.35rem;
}
.file-label input[type="file"] {
  font: inherit;
  font-size: 0.85rem;
  color: var(--muted);
}
.support-hint { margin: 0; font-size: 0.82rem; }
.support-thread {
  display: grid;
  gap: 0.85rem;
  margin: 1.5rem 0;
}
.support-msg {
  border: 1px solid var(--line);
  background: rgba(18, 22, 29, 0.72);
  padding: 1rem 1.1rem;
}
.support-msg.is-staff {
  border-color: rgba(200, 146, 74, 0.4);
  background: rgba(154, 74, 31, 0.14);
}
.support-msg header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.support-msg header strong { color: var(--copper); }
.support-msg p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.5;
}
.support-files {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}
.support-files a {
  color: var(--copper);
  text-decoration: none;
  font-size: 0.88rem;
}
.support-files a:hover { text-decoration: underline; }
.support-status-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.support-status-form label { display: grid; gap: 0.35rem; min-width: 12rem; }
.support-status-form select {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  background: rgba(18, 22, 29, 0.85);
  color: var(--ink);
  font: inherit;
}
.support-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}
.support-filters a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
}
.support-filters a.is-on,
.support-filters a:hover {
  color: var(--ink);
  border-color: rgba(200, 146, 74, 0.55);
}

/* —— Responsive shell: tablet + phone —— */
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }

  .nav-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 48;
    background: rgba(6, 8, 12, 0.62);
    border: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  body.nav-open .nav-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .nav-scrim[hidden] { display: none; }
  body.nav-open .nav-scrim[hidden] { display: block; }

  .site-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    z-index: 60;
    width: min(20rem, calc(100vw - 2.75rem));
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding:
      calc(4.75rem + env(safe-area-inset-top, 0px))
      1.15rem
      calc(1.5rem + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, #12161d 0%, #0a0c10 100%);
    border-left: 1px solid var(--line);
    box-shadow: -18px 0 40px rgba(0, 0, 0, 0.45);
    transform: translateX(105%);
    transition: transform 0.28s var(--ease-out);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  html[dir="rtl"] .site-nav {
    right: auto;
    left: 0;
    border-left: 0;
    border-right: 1px solid var(--line);
    box-shadow: 18px 0 40px rgba(0, 0, 0, 0.45);
    transform: translateX(-105%);
  }

  body.nav-open .site-nav { transform: translateX(0); }
  body.nav-open { overflow: hidden; touch-action: none; }

  .top { z-index: 70; }

  .site-nav a {
    display: flex;
    align-items: center;
    min-height: 3rem;
    padding: 0.35rem 0.4rem;
    border-bottom: 1px solid var(--line);
    white-space: normal;
    font-size: 0.95rem;
  }

  .site-nav .lang-chip {
    margin-top: 0.85rem;
    justify-content: flex-start;
    min-height: 3rem;
    padding: 0.55rem 0.7rem;
    border-bottom: 0;
  }

  .site-nav .lang-chip-text { display: inline; margin-left: 0.35rem; color: var(--muted); }
  .site-nav .lang-code { display: none; }

  .lang-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr));
  }

  .aether-ai-fab {
    right: max(0.85rem, env(safe-area-inset-right));
    bottom: max(0.85rem, env(safe-area-inset-bottom));
  }

  .aether-ai-panel {
    right: max(0.85rem, env(safe-area-inset-right));
    left: max(0.85rem, env(safe-area-inset-left));
    width: auto;
    height: min(68dvh, 520px);
    bottom: calc(max(0.85rem, env(safe-area-inset-bottom)) + 3.6rem);
  }

  .auth-shell {
    padding: 5.5rem max(1rem, env(safe-area-inset-right)) 3rem max(1rem, env(safe-area-inset-left));
  }

  .dash, .store, .lang-page {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .support-msg header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .support-status-form label { min-width: 0; flex: 1 1 100%; }
  .support-status-form select,
  .support-status-form .btn { width: 100%; }

  .store-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .store-tabs::-webkit-scrollbar { display: none; }
  .store-tabs .tab {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  .top {
    padding-left: max(0.9rem, env(safe-area-inset-left));
    padding-right: max(0.9rem, env(safe-area-inset-right));
  }

  .hero-inner,
  .realm,
  .features,
  .news {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .hero h1 { max-width: none; }

  .cta .btn {
    flex: 1 1 100%;
    width: 100%;
  }

  .meter {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "label dot"
      "value value";
    row-gap: 0.25rem;
  }
  .meter-label { grid-area: label; }
  .meter-value { grid-area: value; min-width: 0; overflow-wrap: anywhere; }
  .meter-dot { grid-area: dot; }

  .order-row {
    grid-template-columns: 1fr;
  }

  .realm-meters { padding: 0 0.85rem; }

  .auth-panel { padding: 1.5rem 1.1rem; }

  .aether-ai-fab-label { display: none; }
  .aether-ai-fab { padding: 0.8rem; }
  .aether-ai-form {
    grid-template-columns: 1fr;
  }
  .aether-ai-send { width: 100%; }

  .lang-search input { width: 100%; }

  .file-label input[type="file"] {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .logo { letter-spacing: 0.1em; font-size: 0.72rem; }
  .brand { font-size: clamp(1.9rem, 12vw, 2.8rem); }
  .aether-ai-panel {
    height: min(72dvh, 560px);
  }
}

@media (min-width: 901px) and (max-width: 1100px) {
  .site-nav { gap: 0.95rem; }
  .site-nav a { font-size: 0.78rem; }
}

@media (hover: none) {
  .btn:hover { transform: none; }
  .aether-ai-fab:hover { transform: none; }
  .lang-card:hover { transform: none; }
  .feature:hover { transform: none; }
}

/* —— Shared page shell —— */
.page-shell {
  max-width: 64rem;
  margin: 0 auto;
  padding: clamp(5.5rem, 12vh, 7rem) clamp(1.25rem, 4vw, 2.5rem) 4.5rem;
}

.page-hero {
  margin-bottom: 1.75rem;
  max-width: 40rem;
}

.eyebrow,
.page-hero .eyebrow {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--copper);
}

.page-hero h1 {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4vw, 2.7rem);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.page-shell .lede {
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* —— Codex —— */
.codex-modes {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1.15rem;
  border-bottom: 1px solid var(--line);
}

.codex-mode {
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  padding: 0.75rem 1rem;
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.codex-mode.is-active {
  color: var(--ink);
  border-bottom-color: var(--ember);
}

.codex-search input {
  width: 100%;
  max-width: 28rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  background: rgba(18, 22, 29, 0.88);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
}

.codex-search input:focus {
  outline: none;
  border-color: rgba(217, 119, 58, 0.55);
  box-shadow: 0 0 0 3px rgba(217, 119, 58, 0.12);
}

.codex-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
  gap: 1.25rem;
  margin-top: 1.35rem;
  align-items: start;
}

.codex-results,
.codex-detail {
  border: 1px solid var(--line);
  background: rgba(18, 22, 29, 0.55);
  min-height: 12rem;
}

.codex-results { padding: 0.35rem; }
.codex-detail { padding: 1.15rem 1.2rem; }

.codex-hint { margin: 1rem; font-size: 0.9rem; }

.codex-hit {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  padding: 0.7rem 0.75rem;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.2s ease;
}

.codex-hit:hover,
.codex-hit.is-active {
  background: rgba(217, 119, 58, 0.1);
}

.codex-hit-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: 0.92rem;
}

.codex-hit-meta {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.codex-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
}

.codex-icon-lg { width: 40px; height: 40px; flex-basis: 40px; }

.codex-icon-empty {
  display: inline-block;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--line);
}

.codex-detail-head {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.codex-detail-head h2 {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.02em;
}

.codex-detail-head .muted { margin: 0; font-size: 0.85rem; }

.codex-rows { display: grid; gap: 0; }

.codex-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(242, 235, 224, 0.06);
  font-size: 0.9rem;
}

.codex-row:last-child { border-bottom: 0; }

.codex-row-name { min-width: 0; }
.codex-row-chance {
  font-family: var(--font-display);
  color: var(--copper);
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.download-page.page-shell { max-width: 52rem; }

.download-card {
  background:
    radial-gradient(520px 180px at 0% 0%, rgba(217, 119, 58, 0.1), transparent 55%),
    linear-gradient(160deg, rgba(18, 22, 30, 0.95), rgba(10, 12, 16, 0.98));
  border: 1px solid rgba(200, 146, 74, 0.28);
  padding: 1.75rem 1.5rem;
}

.download-lore {
  margin-top: 2.75rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.download-lore h2 {
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
}

.download-lore-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.download-lore-grid h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--copper);
}

.download-lore-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.92rem;
}

.codex-lore {
  margin: 0 0 1.75rem;
  padding: 1rem 0;
  border-top: 1px solid rgba(208, 160, 90, 0.25);
  border-bottom: 1px solid rgba(208, 160, 90, 0.25);
  color: var(--muted);
  font-style: italic;
  line-height: 1.55;
  max-width: 40rem;
}

.privacy-body {
  max-width: 40rem;
  display: grid;
  gap: 1rem;
}

.privacy-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

/* —— Home: dense lore sections —— */
.section-head {
  margin-bottom: 2rem;
  max-width: 40rem;
  padding: 0 clamp(1.25rem, 5vw, 4.5rem);
}

.paths .section-head,
.lands .section-head,
.begin .section-head,
.chronicle .section-head {
  padding-left: 0;
  padding-right: 0;
}

.section-head .eyebrow,
.season-copy .eyebrow,
.page-hero .eyebrow {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--copper);
}

.section-head h2 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: 0.04em;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.forge-ticker {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(224, 122, 58, 0.08), transparent 30%, transparent 70%, rgba(224, 122, 58, 0.08));
  padding: 0.75rem 0;
}

.forge-ticker-track {
  display: flex;
  width: max-content;
  gap: 1.25rem;
  align-items: center;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  animation: tickerScroll 42s linear infinite;
}

.tick-sep {
  color: var(--ember);
  opacity: 0.7;
  font-size: 0.55rem;
}

.paths,
.lands,
.begin,
.chronicle {
  padding: clamp(3rem, 8vh, 5.5rem) clamp(1.25rem, 5vw, 4.5rem);
  border-top: 1px solid var(--line);
}

.path-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1rem, 2.5vw, 1.75rem);
}

.path-tile {
  position: relative;
  padding: 1.5rem 0.15rem 0.5rem;
  border-top: 2px solid rgba(224, 122, 58, 0.35);
  transition: border-color 0.35s var(--ease-out), transform 0.4s var(--ease-out);
}

.path-tile:hover {
  border-top-color: var(--ember);
  transform: translateY(-4px);
}

.path-rune {
  display: block;
  width: 2.25rem;
  height: 2.25rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(208, 160, 90, 0.35);
  background:
    linear-gradient(135deg, rgba(224, 122, 58, 0.25), transparent 60%),
    rgba(18, 22, 29, 0.8);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  animation: runePulse 3.6s ease-in-out infinite;
}

.path-rogue .path-rune { animation-delay: 0.4s; clip-path: polygon(50% 0%, 90% 50%, 50% 100%, 10% 50%); }
.path-mage .path-rune { animation-delay: 0.8s; border-radius: 50%; clip-path: none; }
.path-priest .path-rune { animation-delay: 1.2s; clip-path: polygon(45% 0%, 55% 0%, 55% 40%, 100% 40%, 100% 55%, 55% 55%, 55% 100%, 45% 100%, 45% 55%, 0% 55%, 0% 40%, 45% 40%); }

.path-tile h3 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.03em;
}

.path-tile p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.92rem;
}

.land-rail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}

.land {
  padding: 1.5rem 1.25rem 1.5rem 0;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  transition: background 0.35s ease, transform 0.35s var(--ease-out);
}

.land:nth-child(3n) { border-right: 0; padding-right: 0; }
.land:nth-child(n+4) { border-bottom: 0; }

.land:hover {
  background: linear-gradient(180deg, rgba(224, 122, 58, 0.06), transparent 70%);
}

.land h3 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--ink);
  letter-spacing: 0.03em;
}

.land p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.9rem;
  max-width: 28ch;
}

.season {
  position: relative;
  isolation: isolate;
  padding: clamp(3.5rem, 9vh, 6rem) clamp(1.25rem, 5vw, 4.5rem);
  border-top: 1px solid var(--line);
  overflow: hidden;
  background:
    linear-gradient(105deg, rgba(8, 10, 14, 0.92) 0%, rgba(8, 10, 14, 0.55) 55%, rgba(8, 10, 14, 0.85) 100%);
}

.season-glow {
  position: absolute;
  inset: -20% -10% auto auto;
  width: min(70vw, 520px);
  height: min(70vw, 520px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(224, 122, 58, 0.28), transparent 68%);
  animation: seasonOrb 8s ease-in-out infinite alternate;
  z-index: 0;
  pointer-events: none;
}

.season-copy {
  position: relative;
  z-index: 1;
  max-width: 36rem;
}

.season-copy h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: 0.03em;
}

.season-copy > p {
  margin: 0 0 1.25rem;
  color: var(--muted);
  line-height: 1.6;
}

.season-list {
  margin: 0 0 1.75rem;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.season-list li {
  position: relative;
  padding-left: 1.25rem;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.45;
}

.season-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 0.45rem;
  height: 0.45rem;
  background: var(--ember);
  box-shadow: 0 0 12px rgba(224, 122, 58, 0.55);
}

.begin-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
  border-top: 1px solid var(--line);
  padding-top: 2rem;
}

.begin-steps li {
  display: grid;
  gap: 0.45rem;
  align-content: start;
}

.begin-num {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--ember);
  letter-spacing: 0.08em;
  line-height: 1;
  animation: numGlow 3s ease-in-out infinite alternate;
}

.begin-steps h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.begin-steps p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.92rem;
}

.begin-steps a {
  color: var(--copper);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-top: 0.35rem;
}

.begin-steps a:hover { color: var(--ember); }

.chronicle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}

.chronicle-grid article {
  padding: 1.5rem 1.5rem 1.5rem 0;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  transition: background 0.35s ease;
}

.chronicle-grid article:nth-child(2n) {
  border-right: 0;
  padding-right: 0;
  padding-left: 1.5rem;
}

.chronicle-grid article:nth-child(n+3) { border-bottom: 0; }

.chronicle-grid article:hover {
  background: linear-gradient(90deg, rgba(224, 122, 58, 0.05), transparent 80%);
}

.chronicle-grid h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.chronicle-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  max-width: 36rem;
}

.final-call {
  padding: clamp(4rem, 10vh, 6.5rem) clamp(1.25rem, 5vw, 4.5rem);
  border-top: 1px solid var(--line);
  text-align: center;
  background:
    radial-gradient(700px 280px at 50% 0%, rgba(224, 122, 58, 0.16), transparent 65%),
    linear-gradient(180deg, rgba(18, 22, 29, 0.5), var(--bg));
}

.final-call-inner {
  max-width: 34rem;
  margin: 0 auto;
}

.final-call h2 {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  letter-spacing: 0.04em;
}

.final-call p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.final-call .cta {
  justify-content: center;
}

@keyframes tickerScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes emberTwinkle {
  from { opacity: 0.45; transform: translateY(0); }
  to { opacity: 0.95; transform: translateY(-8px); }
}

@keyframes runePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224, 122, 58, 0); filter: brightness(1); }
  50% { box-shadow: 0 0 18px rgba(224, 122, 58, 0.25); filter: brightness(1.15); }
}

@keyframes seasonOrb {
  from { transform: translate(0, 0) scale(1); opacity: 0.7; }
  to { transform: translate(-6%, 8%) scale(1.12); opacity: 1; }
}

@keyframes numGlow {
  from { text-shadow: 0 0 0 transparent; }
  to { text-shadow: 0 0 18px rgba(224, 122, 58, 0.45); }
}

@media (max-width: 960px) {
  .path-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .land-rail { grid-template-columns: 1fr 1fr; }
  .land:nth-child(3n) { border-right: 1px solid var(--line); padding-right: 1.25rem; }
  .land:nth-child(2n) { border-right: 0; padding-right: 0; }
  .land:nth-child(n+4) { border-bottom: 1px solid var(--line); }
  .land:nth-child(n+5) { border-bottom: 0; }
  .begin-steps { grid-template-columns: 1fr; }
  .download-lore-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .land-rail { grid-template-columns: 1fr; }
  .land { border-right: 0 !important; padding-right: 0; }
  .land:nth-child(n+4) { border-bottom: 1px solid var(--line); }
  .land:last-child { border-bottom: 0; }
  .chronicle-grid { grid-template-columns: 1fr; }
  .chronicle-grid article,
  .chronicle-grid article:nth-child(2n) {
    padding: 1.25rem 0;
    border-right: 0;
  }
  .chronicle-grid article:nth-child(n+3) { border-bottom: 1px solid var(--line); }
  .chronicle-grid article:last-child { border-bottom: 0; }
  .path-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .codex-layout { grid-template-columns: 1fr; }
  .footer-grid { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .forge-ticker-track,
  .hero-embers,
  .path-rune,
  .season-glow,
  .begin-num,
  .heroKen,
  .hero-slide.is-active .hero-scene {
    animation: none !important;
  }
}


