:root {
  /* Layout lock: these three variables define the hard top boundary contract. */
  --bg: #080b10;
  --ink: #edf2fb;
  --muted: #9aa9bf;
  --line: #2a3447;
  --panel: #101622;
  --accent: #71deff;
  --accent-2: #ffd36e;
  --header-offset: 84px;
  --content-gap: 12px;
  --anchor-offset: calc(var(--header-offset) + var(--content-gap));
  /* Type scale tokens: change these to resize site text consistently. */
  --fs-body: 1rem;
  --fs-ui: 0.95rem;
  --fs-ui-sm: 0.9rem;
  --fs-meta: 0.88rem;
  --fs-heading-sm: 1.04rem;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
  /* Prevent pull/bounce overscroll above the fixed top boundary. */
  overscroll-behavior-y: none;
}
html { scroll-padding-top: var(--anchor-offset); }

body {
  font-family: "Rajdhani", "Segoe UI", sans-serif;
  font-size: var(--fs-body);
  color: var(--ink);
  /* Hard reservation for fixed header; content must never render above it. */
  padding-top: var(--header-offset);
  background:
    radial-gradient(circle at 8% 0%, rgba(113, 222, 255, 0.14), transparent 34%),
    radial-gradient(circle at 95% 90%, rgba(255, 211, 110, 0.09), transparent 32%),
    var(--bg);
}

.topbar {
  height: var(--header-offset);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 11, 16, 0.86);
  backdrop-filter: blur(6px);
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 min(4vw, 26px);
  /* Fixed reference line for the whole page (do not change to sticky). */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
}

.brand {
  text-decoration: none;
  color: var(--ink);
  font-family: "Audiowide", "Rajdhani", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  font-size: var(--fs-ui);
}

.main-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  flex: 1 1 auto;
  min-width: 0;
  justify-content: center;
}

.main-nav a,
.foot-links a,
.rail-links a,
.section a {
  color: #8de6ff;
}

.main-nav a {
  text-decoration: none;
  border: 1px solid #364760;
  border-radius: 999px;
  color: #dce7fb;
  padding: 9px 14px;
  font-size: var(--fs-ui);
  font-weight: 700;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid #4b8fff;
  outline-offset: 2px;
  border-radius: 8px;
}

.lang-switch {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  width: 68px;
}

.lang-toggle {
  border: 1px solid #3a4a66;
  background: #111b2d;
  color: #d6e4fd;
  border-radius: 8px;
  padding: 7px 22px 7px 10px;
  font-size: var(--fs-ui);
  font-weight: 700;
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, #9db0cf 50%),
    linear-gradient(135deg, #9db0cf 50%, transparent 50%);
  background-position:
    calc(100% - 13px) calc(50% - 2px),
    calc(100% - 8px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  width: 100%;
  text-align: left;
}

.lang-toggle:focus {
  outline: 2px solid #4b8fff;
  outline-offset: 1px;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 6px;
  min-width: 0;
  border: 1px solid #3a4a66;
  border-radius: 10px;
  background: #0f1728;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.32);
  z-index: 30;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-2px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.lang-switch.is-open .lang-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.lang-item {
  border: 1px solid transparent;
  border-radius: 8px;
  background: #111b2d;
  color: #d6e4fd;
  font-size: var(--fs-ui);
  font-weight: 700;
  padding: 7px 8px;
  cursor: pointer;
  text-align: center;
}

.lang-item.is-active {
  border-color: var(--accent);
  color: #082028;
  background: var(--accent);
}

.shell {
  width: min(1180px, 94vw);
  /* First visible row starts exactly header+gap below the fixed topbar. */
  margin: var(--content-gap) auto 32px;
  padding-top: 0;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: var(--content-gap);
}

.rail {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(160deg, #131b2b, #0c121d);
  padding: 14px;
  position: sticky;
  top: var(--anchor-offset);
  height: fit-content;
}

.rail-label {
  margin: 0;
  color: #aac2e8;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: var(--fs-meta);
  font-weight: 700;
}

h1,
h2,
h3,
.n {
  font-family: "Audiowide", "Rajdhani", sans-serif;
}

.rail h2 {
  margin: 12px 0 0;
  line-height: 1.08;
  font-size: 1.18rem;
}

.rail-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rail-brand img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid #30415c;
}

.rail-brand span {
  font-family: "Audiowide", "Rajdhani", sans-serif;
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rail-subline {
  margin: 8px 0 0;
  color: var(--accent-2);
  font-size: var(--fs-ui);
  font-weight: 700;
}

.rail-cta {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.download-switch {
  position: relative;
}

.download-toggle {
  width: 100%;
  text-align: left;
  justify-content: flex-start;
  padding-right: 24px;
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, #9db0cf 50%),
    linear-gradient(135deg, #9db0cf 50%, transparent 50%);
  background-position:
    calc(100% - 13px) calc(50% - 2px),
    calc(100% - 8px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.download-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid #3a4a66;
  border-radius: 10px;
  background: #0f1728;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.32);
  z-index: 30;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-2px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.download-switch.is-open .download-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.download-item {
  border: 1px solid transparent;
  border-radius: 8px;
  background: #111b2d;
  color: #d6e4fd;
  font-size: var(--fs-ui);
  font-weight: 700;
  padding: 8px 9px;
  text-decoration: none;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.download-item:hover,
.download-item:focus-visible {
  border-color: var(--accent);
  background: #15314b;
  color: #e9f7ff;
}

.btn {
  text-decoration: none;
  border-radius: 999px;
  padding: 9px 12px;
  line-height: 1.2;
  font-weight: 700;
  font-family: inherit;
  font-size: var(--fs-ui);
  border: 1px solid transparent;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  -webkit-appearance: none;
  appearance: none;
}

.btn.primary {
  color: #082028;
  background: var(--accent);
}

.btn.ghost {
  color: #dce7fb;
  border-color: #46597a;
  background: transparent;
}

.facts {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.facts li {
  border: 1px solid #2f3d56;
  border-radius: 8px;
  background: #0f1724;
  padding: 8px;
}

.facts p {
  margin: 0;
  color: #91a4c3;
  font-size: var(--fs-ui-sm);
}

.facts b {
  margin-top: 3px;
  display: block;
  color: #e6efff;
  font-size: var(--fs-ui);
}

.rail-links {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.rail-links a {
  font-size: var(--fs-ui);
}

.rail-meta-cards {
  margin-top: 12px;
  gap: 8px;
}

.rail-meta-cards article {
  border-color: #2f3d56;
  background: #0f1724;
  border-radius: 8px;
  min-height: 58px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
}

.rail-meta-cards h3 {
  margin: 0;
  color: #91a4c3;
  font-size: var(--fs-meta);
  line-height: 1.12;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: "Rajdhani", "Segoe UI", sans-serif;
  font-weight: 700;
}

.rail-meta-cards article.is-value {
  justify-content: center;
  background: #111b2d;
  border-color: #3a4a66;
}

.rail-meta-cards p {
  margin: 0;
  color: #e6efff;
  font-size: var(--fs-ui);
  line-height: 1.1;
  font-weight: 700;
}

.rail-community {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.rail-community .btn {
  width: 100%;
  justify-content: center;
}

.content {
  display: grid;
  gap: var(--content-gap);
  min-width: 0;
}

.hero,
.section,
.foot {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  padding: 14px;
  min-width: 0;
}

.hero {
  background: linear-gradient(156deg, #131b2b, #0c111a);
}

.hero h1 {
  max-width: none;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  text-wrap: balance;
  font-size: clamp(1.6rem, 3.2vw, 2.8rem);
}

.eyebrow {
  margin: 0;
  color: #abc2e8;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: var(--fs-meta);
  font-weight: 700;
}

h1 {
  margin: 10px 0 0;
  line-height: 1.07;
  font-size: clamp(1.9rem, 4.5vw, 3.2rem);
  max-width: 16ch;
}

.lead {
  margin: 12px 0 0;
  color: var(--muted);
  max-width: 64ch;
}

.hero .lead {
  max-width: none;
  width: 100%;
}

.tagline {
  margin: 10px 0 0;
  color: var(--accent-2);
  font-weight: 700;
}

.section h2 {
  margin: 0;
  line-height: 1.1;
  font-size: 1.35rem;
}

.cards {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.cards article {
  border: 1px solid #2d374b;
  border-radius: 10px;
  background: #0d1320;
  padding: 10px;
  min-width: 0;
}

.support-actions {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.support-actions .btn {
  width: 100%;
}

.cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.n {
  margin: 0;
  color: var(--accent);
  font-weight: 700;
}

h3 {
  margin: 7px 0 0;
  font-size: var(--fs-heading-sm);
  line-height: 1.15;
}

.section p,
.section li {
  color: #b8c5dc;
}

.section p { margin: 8px 0 0; }
.section ol,
.section ul { margin: 8px 0 0; padding-left: 18px; }
.section li { margin-bottom: 6px; }

code {
  font-family: "Rajdhani", "Segoe UI", sans-serif;
  color: #ddf5ff;
  font-size: var(--fs-ui-sm);
  word-break: break-word;
}

.faq-list {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

details {
  border: 1px solid #2d374b;
  border-radius: 10px;
  background: #0d1320;
  padding: 8px 10px;
}

summary {
  cursor: pointer;
  font-weight: 700;
  color: #deebff;
}

details p {
  margin-top: 8px;
}

.foot {
  display: grid;
  gap: 10px;
}

.foot-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.foot p {
  margin: 0;
  color: #9eb0cd;
}

.foot-text {
  margin: 0;
}

.foot-site-version {
  margin: 0;
  color: #8fa2c2;
  font-size: var(--fs-meta);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  justify-self: end;
  text-align: right;
  white-space: nowrap;
}

.foot-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  grid-column: 1 / -1;
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1080px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .rail {
    position: static;
  }
}

@media (max-width: 900px) {
  :root {
    --header-offset: 72px;
    --content-gap: 12px;
    --anchor-offset: calc(var(--header-offset) + var(--content-gap));
  }

  .topbar {
    align-items: center;
  }

  .cards.two,
  .cards.three,
  .cards.four {
    grid-template-columns: 1fr;
  }

  .rail-meta-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
