/* ============ Vars & Base ============ */
:root{
  --bg: #ffffff;
  --text: #111111;
  --muted: #666666;
  --line: #e9e9ee;
  --card: #fafafc;
  --accent: #7a5cff;      /* TheThrone purple */
  --accent-2: #5ce1e6;    /* TheThrone aqua */
  --maxw: 900px;
}

@media (prefers-color-scheme: dark){
  :root{
    --bg: #0f1115;
    --text: #f2f3f5;
    --muted: #a7aab0;
    --line: #23262d;
    --card: #141720;
  }
}

html { scroll-behavior: smooth; }

body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Page container */
body > header,
body > section{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(16px, 2vw, 24px);
}

/* Optional card feel for the header */
body > header{
  background: linear-gradient(180deg, color-mix(in oklab, var(--card) 92%, transparent), transparent 55%);
  border-bottom: 1px solid var(--line);
}

/* ============ Typography ============ */
h1, h2, h3, h4{
  line-height: 1.25;
  margin: 1.6rem 0 0.6rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}
h1{
  font-size: clamp(1.8rem, 2.4vw, 2.2rem);
  margin-top: 0.5rem;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
h2{ font-size: clamp(1.25rem, 2vw, 1.4rem); border-top: 1px solid var(--line); padding-top: 1.2rem; }
h3{ font-size: clamp(1.05rem, 1.6vw, 1.15rem); }

p{ margin: 0.6rem 0 1rem; }
small{ color: var(--muted); }

.updated{
  color: var(--muted);
  font-weight: 600;
  margin: 0.25rem 0 1.25rem;
}

/* ============ Lists ============ */
ul, ol{ padding-left: 1.25rem; margin: 0.25rem 0 1rem; }
li{ margin: 0.25rem 0; }
ol li::marker{ color: var(--accent); }

/* ============ Links ============ */
a{
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in oklab, var(--accent) 35%, transparent);
}
a:hover{ border-bottom-color: var(--accent); }

/* ============ Rules & Utility ============ */
hr{
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}

.address{ 
  white-space: pre-wrap;
  background: var(--card);
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  display: inline-block;
}

/* Optional subtle callout style (use .note around paragraphs if desired) */
.note{
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  padding: 0.9rem 1rem;
  border-radius: 12px;
  margin: 1rem 0;
}

/* ============ Table of Contents (optional) ============ */
/* If you add a #toc <nav> with anchor links, this styles it nicely */
#toc{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0  clamp(16px, 2vw, 24px)  8px;
}
#toc .toc-box{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.1rem;
}
#toc ul{ list-style: none; padding: 0; margin: 0.25rem 0 0; columns: 2; column-gap: 1.25rem; }
#toc li{ break-inside: avoid; margin: 0.2rem 0; }
#toc a{ border: none; }
@media (max-width: 640px){ #toc ul{ columns: 1; } }

/* ============ Code & Pre (just in case) ============ */
code, pre{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.95em;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
}
code{ padding: 0.15em 0.4em; }
pre{ padding: 0.9rem 1rem; overflow: auto; }

/* ============ Print ============ */
@media print{
  :root{
    --bg: #fff; --text: #000; --line: #ddd; --card: #fff;
  }
  a{ color: inherit; border: none; text-decoration: underline; }
  body > header, body > section{ padding: 0; }
  h1{ color: #000; background: none; -webkit-text-fill-color: currentColor; }
}
