/* miravain.online — self-hosted stylesheet. System fonts only, no remote requests. */

:root {
  --bg: #ffffff;
  --surface: #f7f8fa;
  --surface-2: #eceff4;
  --ink: #15171c;
  --muted: #555c6a;
  --line: #dde2ea;
  --accent: #5b3fd6;
  --accent-hover: #4a32b8;
  --on-accent: #ffffff;
  --amber: #8a5209;
  --amber-bg: #fdf4e3;
  --amber-line: #ecd8ae;
  --ok: #15694a;
  --radius: 10px;
  --maxw: 1180px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", "Liberation Sans", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1015;
    --surface: #161922;
    --surface-2: #1d2230;
    --ink: #e7e9ef;
    --muted: #a3aab8;
    --line: #272d3a;
    --accent: #9d8bff;
    --accent-hover: #b3a4ff;
    --on-accent: #12101f;
    --amber: #e8b269;
    --amber-bg: #221a0e;
    --amber-line: #4a3a1c;
    --ok: #5fd0a0;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1015;
  --surface: #161922;
  --surface-2: #1d2230;
  --ink: #e7e9ef;
  --muted: #a3aab8;
  --line: #272d3a;
  --accent: #9d8bff;
  --accent-hover: #b3a4ff;
  --on-accent: #12101f;
  --amber: #e8b269;
  --amber-bg: #221a0e;
  --amber-line: #4a3a1c;
  --ok: #5fd0a0;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  overflow-wrap: break-word;
}

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

img, svg { max-width: 100%; height: auto; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--on-accent);
  padding: 10px 16px; z-index: 100;
}
.skip:focus { left: 0; }

/* ---------- Top disclosure bar ---------- */

.topbar {
  background: var(--amber-bg);
  border-bottom: 1px solid var(--amber-line);
  color: var(--amber);
  font-size: 14px;
  line-height: 1.45;
  padding: 9px 16px;
  text-align: center;
}
.topbar strong { color: var(--amber); }
.topbar a { color: inherit; }

/* ---------- Header ---------- */

.nav {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.nav-in {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  align-items: baseline;
}
.brand {
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}
.brand span { color: var(--accent); }
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-size: 15px;
}
.nav-links a { color: var(--muted); text-decoration: none; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--accent); }

/* ---------- Layout ---------- */

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 34px 16px 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 40px;
  align-items: start;
}
.wrap.narrow { grid-template-columns: minmax(0, 1fr); max-width: 820px; }

@media (max-width: 900px) {
  .wrap { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}

main { min-width: 0; }

aside.rail { min-width: 0; }
@media (min-width: 901px) {
  aside.rail .sticky { position: sticky; top: 18px; }
}

/* ---------- Typography ---------- */

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 10px;
}
h1 {
  font-size: clamp(28px, 4.6vw, 42px);
  line-height: 1.16;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}
h2 {
  font-size: clamp(22px, 3vw, 28px);
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 46px 0 12px;
  padding-top: 6px;
}
h3 {
  font-size: 19px;
  line-height: 1.3;
  margin: 30px 0 8px;
}
.lede { font-size: 19px; color: var(--muted); margin: 0 0 18px; }
p { margin: 0 0 16px; }
ul, ol { margin: 0 0 18px; padding-left: 22px; }
li { margin-bottom: 8px; }

.byline {
  font-size: 14.5px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  margin: 0 0 26px;
}
.byline a { color: var(--muted); }

/* ---------- Boxes ---------- */

.box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 0 0 26px;
}
.box > :last-child { margin-bottom: 0; }
.box h2, .box h3 { margin-top: 0; }

.disclosure {
  background: var(--amber-bg);
  border: 1px solid var(--amber-line);
  border-left: 4px solid var(--amber);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 0 0 28px;
  font-size: 15.5px;
}
.disclosure > :last-child { margin-bottom: 0; }
.disclosure h2 {
  font-size: 15px;
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--amber);
  padding-top: 0;
}

.note {
  font-size: 14px;
  color: var(--muted);
  margin: 8px 0 0;
}

.correction {
  border-left: 4px solid var(--ok);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 0 0 26px;
  font-size: 15.5px;
}
.correction > :last-child { margin-bottom: 0; }

/* ---------- Table of contents ---------- */

.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 0 0 30px; }
.toc h2 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.07em; margin: 0 0 10px; color: var(--muted); padding-top: 0; }
.toc ol { margin: 0; padding-left: 20px; font-size: 15.5px; columns: 2; column-gap: 26px; }
.toc li { margin-bottom: 6px; break-inside: avoid; }
@media (max-width: 620px) { .toc ol { columns: 1; } }

/* ---------- CTA ---------- */

.cta-wrap { margin: 0 0 26px; }
.btn {
  display: block;
  width: 100%;
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
  text-align: center;
  font-weight: 650;
  font-size: 17px;
  padding: 15px 20px 11px;
  border-radius: var(--radius);
  border: 1px solid transparent;
}
.btn:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn .btn-tag {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-top: 5px;
}
.cta-note {
  font-size: 13.5px;
  color: var(--muted);
  margin: 9px 2px 0;
  line-height: 1.5;
}

.promo {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin: 34px 0;
}
.promo h2, .promo h3 { margin-top: 0; }
.promo > :last-child { margin-bottom: 0; }

/* ---------- Figures ---------- */

figure {
  margin: 28px 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
figure img { display: block; width: 100%; border-radius: 6px; }
figcaption {
  font-size: 14px;
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.5;
}

/* ---------- Tables ---------- */

.tw { overflow-x: auto; margin: 0 0 24px; }
table { border-collapse: collapse; width: 100%; font-size: 15.5px; }
th, td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; vertical-align: top; }
th { background: var(--surface-2); font-weight: 650; }

/* ---------- Definition lists ---------- */

dl { margin: 0 0 22px; }
dt { font-weight: 650; margin-top: 16px; }
dd { margin: 4px 0 0; color: var(--muted); }

/* ---------- Footer ---------- */

.foot {
  border-top: 1px solid var(--line);
  background: var(--surface);
  font-size: 14.5px;
  color: var(--muted);
}
.foot-in { max-width: var(--maxw); margin: 0 auto; padding: 34px 16px 44px; }
.foot-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 26px;
  margin-bottom: 28px;
}
.foot h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 10px; color: var(--ink); padding-top: 0; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin-bottom: 7px; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--accent); text-decoration: underline; }
.foot-legal { border-top: 1px solid var(--line); padding-top: 20px; font-size: 13.5px; line-height: 1.6; }
.foot-legal p { margin: 0 0 8px; }

/* ---------- Bridge page ---------- */

.bridge {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 16px;
  gap: 14px;
}
