/* Aurexa / Velion - shared stylesheet.
   Layout: left-aligned editorial column (max 1120px), Roman inscription caps for
   wordmarks and big headings, plain sans for reading. Velion pages swap the
   accent to "signal" blue via html[data-brand="velion"]. */
:root {
  --bg: #F2F3EF;        /* limestone */
  --surface: #FFFFFF;
  --ink: #141A26;
  --muted: #586070;
  --line: #D8DBD2;
  --gold: #8E6A28;      /* aurum - text-safe on limestone */
  --gold-soft: #E9DFC7;
  --accent: var(--gold);
  --accent-soft: var(--gold-soft);
  --accent-ink: #FFFFFF;
  --f-display: "Cinzel", "Trajan Pro", "Times New Roman", serif;
  --f-body: "Figtree", "Noto Sans Sinhala", "Segoe UI", system-ui, sans-serif;
  --f-si: "Noto Sans Sinhala", "Iskoola Pota", "Nirmala UI", sans-serif;
  --f-mono: "JetBrains Mono", Consolas, monospace;
  --s-1: .8125rem; --s0: 1rem; --s1: 1.1875rem; --s2: 1.5rem; --s3: 2.125rem; --s4: clamp(2.5rem, 6vw, 4.5rem);
  --radius: 10px;
  color-scheme: light;
}
html[data-brand="velion"] { --accent: #1D6A93; --accent-soft: #D8E8F1; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E131B; --surface: #151C27; --ink: #E8EAE5; --muted: #9AA3B1; --line: #263042;
    --gold: #D2AD61; --gold-soft: #3A3121; --accent-ink: #0E131B; color-scheme: dark;
  }
  html[data-brand="velion"]:not([data-theme="light"]) { --accent: #6CC2E6; --accent-soft: #17324A; }
}
:root[data-theme="dark"] {
  --bg: #0E131B; --surface: #151C27; --ink: #E8EAE5; --muted: #9AA3B1; --line: #263042;
  --gold: #D2AD61; --gold-soft: #3A3121; --accent-ink: #0E131B; color-scheme: dark;
}
html[data-brand="velion"][data-theme="dark"] { --accent: #6CC2E6; --accent-soft: #17324A; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--s0)/1.65 var(--f-body); }
img, canvas { max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* bilingual: both languages are in the markup, one is shown */
html[data-lang="en"] [lang="si"], html[data-lang="si"] [lang="en"] { display: none !important; }
[lang="si"] { font-family: var(--f-si); line-height: 1.8; }
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: clamp(16px, 4vw, 40px); }

/* header */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 20px; min-height: 64px; flex-wrap: wrap; padding-block: 8px; }
.mark { font: 600 1.25rem/1 var(--f-display); letter-spacing: .14em; color: var(--ink); text-decoration: none; }
.mark small { display: block; font: 500 .625rem/1.4 var(--f-body); letter-spacing: .18em; color: var(--muted); text-transform: uppercase; margin-top: 3px; }
.nav { display: flex; gap: 4px 18px; flex-wrap: wrap; margin-left: auto; align-items: center; }
.nav a { color: var(--muted); text-decoration: none; font-size: var(--s-1); font-weight: 500; letter-spacing: .02em; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang button { font: 600 .75rem/1 var(--f-body); padding: 7px 11px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.lang button:last-child { font-family: var(--f-si); }

/* type */
h1, h2, h3 { text-wrap: balance; margin: 0; }
.eyebrow { font: 600 .72rem/1 var(--f-body); letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.display { font: 600 var(--s4)/1.04 var(--f-display); letter-spacing: .04em; }
h2 { font: 600 var(--s3)/1.15 var(--f-display); letter-spacing: .03em; }
h2 [lang="si"], .display [lang="si"], h1 [lang="si"], .release .name [lang="si"] { font-family: var(--f-si); letter-spacing: 0; font-weight: 700; }
h3 { font-size: var(--s1); font-weight: 650; line-height: 1.35; }
.lead { font-size: var(--s1); color: var(--muted); max-width: 60ch; }
p { margin: 0; max-width: 68ch; }
.muted { color: var(--muted); }
.mono { font-family: var(--f-mono); font-size: .9em; }

section { padding-block: clamp(48px, 8vw, 96px); }
section + section { border-top: 1px solid var(--line); }
.stack { display: grid; gap: 16px; align-content: start; }
.stack-lg { display: grid; gap: 28px; align-content: start; }

/* buttons */
.btns { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 13px 22px; border-radius: 999px; font: 600 var(--s0)/1 var(--f-body);
  text-decoration: none; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); filter: none; }
.btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* grids */
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 28px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
@media (max-width: 860px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid-3, .grid-2 { grid-template-columns: minmax(0, 1fr); } }
.feat { display: grid; gap: 8px; align-content: start; padding-top: 18px; border-top: 2px solid var(--ink); }
.feat .tag { font: 500 .7rem/1 var(--f-mono); color: var(--muted); letter-spacing: .06em; }

/* table */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; min-width: 420px; font-size: .95rem; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child th, tr:last-child td { border-bottom: 0; }
th { font-weight: 600; width: 34%; }

/* steps (a real sequence) */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; display: grid; gap: 0; }
.steps > li { counter-increment: s; display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 4px 18px; padding-block: 26px; border-top: 1px solid var(--line); }
.steps > li::before { content: counter(s, upper-roman); font: 600 1.5rem/1 var(--f-display); color: var(--accent); grid-row: span 3; padding-top: 2px; }
.steps > li > * { grid-column: 2; }
.note { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 12px 16px; border-radius: 0 var(--radius) var(--radius) 0; max-width: 68ch; }
kbd { font: 500 .85em var(--f-mono); padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); }
ul.plain { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; max-width: 68ch; }

/* faq */
details { border-top: 1px solid var(--line); padding-block: 18px; max-width: 78ch; }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 600; font-size: var(--s1); list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::after { content: "+"; color: var(--accent); font-weight: 400; font-size: 1.4rem; line-height: 1; }
details[open] summary::after { content: "\2212"; }
details > div { padding-top: 10px; color: var(--muted); display: grid; gap: 10px; }

/* release log */
.release { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 12px 40px; padding-block: 32px; border-top: 1px solid var(--line); }
.release:first-of-type { border-top: 0; }
.release .name { font: 600 var(--s2)/1.1 var(--f-display); letter-spacing: .04em; }
.release .meta { font: 500 var(--s-1)/1.5 var(--f-mono); color: var(--muted); }
@media (max-width: 700px) { .release { grid-template-columns: minmax(0, 1fr); } }

footer { border-top: 1px solid var(--line); padding-block: 40px; font-size: var(--s-1); color: var(--muted); }
footer .wrap { display: flex; gap: 12px 32px; flex-wrap: wrap; justify-content: space-between; align-items: baseline; }
footer a { color: var(--muted); }
.copy { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.copy button { font: 600 .75rem/1 var(--f-body); padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
