/* Astrolabe guide pages: static, long-form editorial layout.
 * Self-contained (does not load the app's style.css) and dark-only, reusing the
 * app's tokens so the guide reads as one instrument with the tool. */

:root {
  --bg: #0b0e14;
  --bg-glow: #141a28;
  --panel: #12161f;
  --panel-2: #171c28;
  --line: #232a3a;
  --line-soft: rgba(35, 42, 58, 0.55);
  --line-strong: #5b6480;
  --text: #e6e9f0;
  --muted: #99a1b5;
  --accent: #c9a86a;
  --accent-dim: #8a744a;
  --accent-contrast: #14100a;
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --measure: 68ch;
  /* one spacing scale, applied everywhere for an even vertical rhythm */
  --space-block: 32px;    /* gap between major blocks inside the article */
  --space-region: 48px;   /* gap between page regions (article/related/cta/sources) */
  --space-para: 16px;     /* gap between paragraphs within a block */
}

* { box-sizing: border-box; }

.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;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-contrast); padding: 8px 16px;
  border-radius: 0 0 8px 0; font-family: var(--sans); font-weight: 600;
}
.skip-link:focus { left: 0; }

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

body {
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: radial-gradient(1200px 600px at 50% -200px, var(--bg-glow) 0%, var(--bg) 60%) no-repeat;
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
}

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: #e0c489; }

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

.wrap {
  max-width: 900px; margin: 0 auto;
  padding: 0 max(20px, env(safe-area-inset-left)) calc(72px + env(safe-area-inset-bottom))
           max(20px, env(safe-area-inset-right));
}

/* ---- top bar: brand + language switcher ---- */
header.site {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: 8px 16px;
  padding: calc(22px + env(safe-area-inset-top, 0px)) 0 16px;
  border-bottom: 1px solid var(--line-soft); margin-bottom: 22px;
}
header.site .brand { font-family: var(--serif); font-size: 20px; font-weight: 400;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--text); text-decoration: none; }
header.site .brand .star { color: var(--accent); }
nav.langs { display: flex; gap: 4px; font-family: var(--sans); }
nav.langs a {
  min-width: 44px; min-height: 44px; display: inline-flex; align-items: center;
  justify-content: center; padding: 4px 8px; border-radius: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-decoration: none;
  color: var(--muted);
  transition: color 0.15s ease, background-color 0.15s ease;
}
nav.langs a[aria-current="true"] { color: var(--accent-contrast); background: var(--accent); }
nav.langs a:not([aria-current="true"]):hover { color: var(--text); background: var(--panel-2); }

.header-nav { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }

/* Simple|Pro toggle: one segmented pill, matching the app's control. */
nav.modes { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
nav.modes[hidden] { display: none; }
nav.modes button {
  font-family: var(--sans); background: none; border: 0; color: var(--muted);
  cursor: pointer; min-height: 44px; padding: 4px 12px; font-size: 13px; font-weight: 600;
  letter-spacing: 0.04em;
  transition: color 0.15s ease, background-color 0.15s ease;
}
nav.modes button + button { border-inline-start: 1px solid var(--line); }
nav.modes button:active { transform: scale(0.96); }
nav.modes button.active { color: var(--accent-contrast); background: var(--accent); }

/* Only one reading register is shown at a time (guide.js toggles [hidden]). */
.register[hidden] { display: none; }

/* ---- breadcrumb ---- */
nav.crumbs { font-family: var(--sans); font-size: 13px; color: var(--muted); margin-bottom: 18px; }
nav.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
nav.crumbs li::after { content: "›"; margin-inline-start: 6px; color: var(--line-strong); }
nav.crumbs li:last-child::after { content: ""; }
nav.crumbs a { color: var(--muted); text-decoration: none; }
nav.crumbs a:hover { color: var(--text); text-decoration: underline; }
nav.crumbs [aria-current="page"] { color: var(--text); }

/* ---- article ---- */
article { font-family: var(--serif); }
.eyebrow {
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-dim);
  margin: 0 0 8px;
}
article h1 {
  font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 6vw, 44px);
  line-height: 1.12; letter-spacing: -0.01em; margin: 0 0 6px; text-wrap: balance;
}
article h1 .glyph { color: var(--accent); font-size: 0.8em; margin-inline-end: 6px; }
.subtitle { font-family: var(--sans); color: var(--muted); font-size: 15px; margin: 0 0 var(--space-block); }

article .lede {
  font-size: clamp(18px, 2.4vw, 21px); line-height: 1.55; color: var(--text);
  max-width: var(--measure); margin: 0 0 var(--space-block); text-wrap: pretty;
}
article h2 {
  font-family: var(--serif); font-weight: 400; font-size: clamp(22px, 3.4vw, 28px);
  line-height: 1.2; margin: var(--space-block) 0 12px; scroll-margin-top: 20px;
  padding-bottom: 6px; border-bottom: 1px solid var(--line-soft);
}
article h3 {
  font-family: var(--sans); font-weight: 600; font-size: 16px; letter-spacing: 0.01em;
  margin: 24px 0 8px; color: var(--text);
}
article p, article li { max-width: var(--measure); }
article p { margin: 0 0 16px; }
article ul { margin: 0 0 16px; padding-inline-start: 22px; }
article li { margin: 0 0 7px; }
article em { color: #f0ead9; }
article strong { color: #fff; font-weight: 600; }
article a { text-decoration: underline; text-decoration-thickness: 1px;
  text-decoration-color: var(--accent-dim); }

/* ---- facts box ---- */
.facts {
  font-family: var(--sans); background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px 18px; margin: 0 0 var(--space-block);
}
.facts h2 {
  font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 12px; border: 0; padding: 0;
}
.facts dl { display: grid; grid-template-columns: minmax(96px, auto) 1fr; gap: 8px 16px; margin: 0; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; font-size: 14px; color: var(--text); }
.facts dd a { color: var(--accent); text-decoration: none; }
.facts dd a:hover { text-decoration: underline; }

/* ---- related links ---- */
.related { margin: var(--space-region) 0 0; font-family: var(--sans); }
.related h2 { font-family: var(--sans); font-size: 13px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 12px; border: 0; padding: 0; }
.related ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; max-width: none; }
.related li { margin: 0; max-width: none; }
.related a {
  display: inline-block; padding: 7px 13px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--panel); color: var(--text);
  font-size: 13px; text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.1s ease;
}
.related a:hover { border-color: var(--accent-dim); background: var(--panel-2); }
.related a:active { transform: scale(0.96); }

/* ---- call to action ---- */
.cta {
  margin: var(--space-region) 0 0; padding: 22px; border-radius: 16px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); font-family: var(--sans);
}
.cta p { font-family: var(--serif); font-size: 18px; margin: 0 0 14px; max-width: 56ch; color: var(--text); }
.cta a.button {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  padding: 11px 20px; border-radius: 999px; background: var(--accent);
  color: var(--accent-contrast); font-weight: 600; font-size: 15px; text-decoration: none;
  transition: background-color 0.15s ease, transform 0.1s ease;
}
.cta a.button:hover { background: #d9ba7d; }
.cta a.button:active { transform: scale(0.96); }

/* ---- sources / disclaimer ---- */
.sources {
  font-family: var(--sans); font-size: 12.5px; color: var(--muted);
  margin: var(--space-region) 0 0; padding-top: 18px; border-top: 1px solid var(--line-soft);
  max-width: var(--measure); line-height: 1.5;
}
.sources h2 { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 8px; border: 0; padding: 0; }
.sources p { margin: 0 0 6px; }
.sources ul { margin: 4px 0 0; padding-inline-start: 18px; max-width: var(--measure); }
.sources li { margin: 2px 0; }
.sources a { color: var(--muted); }

footer.site {
  margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line-soft);
  font-family: var(--sans); font-size: 13px; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center;
}
footer.site a { color: var(--muted); text-decoration: none; }
footer.site a:hover { color: var(--text); text-decoration: underline; }

/* ---- guide index ---- */
.index-hero { margin: 8px 0 8px; }
.index-hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 6vw, 44px);
  line-height: 1.12; margin: 0 0 10px; }
.index-hero p { font-family: var(--serif); font-size: clamp(17px, 2.4vw, 20px); color: var(--text);
  max-width: var(--measure); margin: 0 0 8px; }
.index-group { margin: var(--space-region) 0 0; }
.index-group h2 { font-family: var(--serif); font-weight: 400; font-size: 24px; margin: 0 0 14px;
  padding-bottom: 6px; border-bottom: 1px solid var(--line-soft); }
.tiles { list-style: none; display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); margin: 0; padding: 0; }
.tiles li { margin: 0; }
.tiles a {
  display: flex; align-items: center; gap: 11px; padding: 11px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  color: var(--text); text-decoration: none; font-family: var(--sans); min-height: 56px;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.1s ease;
}
.tiles a:hover { border-color: var(--accent-dim); background: var(--panel-2); }
.tiles a:active { transform: scale(0.98); }
.tiles .glyph { color: var(--accent); font-family: var(--serif); font-size: 19px; line-height: 1; flex: none; }
.tiles .label { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tiles .name { font-size: 15px; line-height: 1.25; }
.tiles .sub { color: var(--muted); font-size: 12px; line-height: 1.3; }

@media (prefers-reduced-motion: no-preference) {
  article, .index-group { animation: guide-rise 0.4s cubic-bezier(0.2, 0, 0, 1) both; }
  @keyframes guide-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
