/* Stillwell / Afakgun Studio — shared styles. No external fonts, images or scripts. */

:root {
  color-scheme: light dark;
  --bg: #f7f6f2;
  --surface: #ffffff;
  --text: #1d2428;
  --muted: #5a666d;
  --border: #dcdad3;
  --accent: #2f6b62;
  --accent-text: #ffffff;
  --link: #1f5d8f;
  --link-visited: #5b4a93;
  --note-bg: #eef5f3;
  --note-border: #2f6b62;
  --warn-bg: #fdf3e4;
  --warn-border: #b4741c;
  --focus: #c2410c;
  --radius: 12px;
  --measure: 44rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121618;
    --surface: #1a2023;
    --text: #e6eaec;
    --muted: #a3afb5;
    --border: #2e373b;
    --accent: #6cc0b2;
    --accent-text: #0d1f1c;
    --link: #8cc4f2;
    --link-visited: #c2b2f0;
    --note-bg: #17282a;
    --note-border: #6cc0b2;
    --warn-bg: #2a2114;
    --warn-border: #e0a24a;
    --focus: #fb923c;
  }
}

:root[data-theme="dark"] {
  --bg: #121618;
  --surface: #1a2023;
  --text: #e6eaec;
  --muted: #a3afb5;
  --border: #2e373b;
  --accent: #6cc0b2;
  --accent-text: #0d1f1c;
  --link: #8cc4f2;
  --link-visited: #c2b2f0;
  --note-bg: #17282a;
  --note-border: #6cc0b2;
  --warn-bg: #2a2114;
  --warn-border: #e0a24a;
  --focus: #fb923c;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

a { color: var(--link); text-underline-offset: 0.15em; }
a:visited { color: var(--link-visited); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  padding: 0.5rem 0.875rem;
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--focus);
  border-radius: 8px;
  z-index: 10;
}
.skip-link:focus { top: 1rem; }

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1rem;
}

/* ---------------------------------------------------------------- header / footer */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding-top: 0.875rem;
  padding-bottom: 0.875rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text);
  text-decoration: none;
}
.brand:visited { color: var(--text); }
.brand-mark {
  width: 1.75rem;
  height: 1.75rem;
  flex: none;
}
.header-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  font-size: 0.9375rem;
}
.header-nav a { color: var(--muted); }
.header-nav a[aria-current="page"] { color: var(--text); font-weight: 600; text-decoration: none; }

.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9375rem;
}
.site-footer .wrap { padding-top: 1.5rem; padding-bottom: 2.5rem; }
.site-footer ul {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}
.site-footer a { color: var(--muted); }
.site-footer p { margin: 0.25rem 0; }

/* ---------------------------------------------------------------- content */
main { padding-top: 2rem; }

h1, h2, h3 { line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.375rem); margin: 0 0 0.5rem; }
h2 { font-size: 1.375rem; margin: 2.5rem 0 0.75rem; padding-top: 0.25rem; }
h3 { font-size: 1.125rem; margin: 1.75rem 0 0.5rem; }
p, ul, ol, dl, table { margin: 0 0 1rem; }
ul, ol { padding-left: 1.4rem; }
li + li { margin-top: 0.35rem; }
strong { font-weight: 650; }
small, .muted { color: var(--muted); }

.meta { color: var(--muted); font-size: 0.9375rem; margin-bottom: 1.5rem; }
.lead { font-size: 1.1875rem; color: var(--text); }

[id] { scroll-margin-top: 1rem; }

.note, .warn {
  border-left: 4px solid var(--note-border);
  background: var(--note-bg);
  padding: 0.875rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.25rem 0;
}
.warn { border-left-color: var(--warn-border); background: var(--warn-bg); }
.note > :last-child, .warn > :last-child { margin-bottom: 0; }

.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0 2rem;
}
.toc h2 { margin: 0 0 0.5rem; font-size: 1rem; text-transform: none; }
.toc ol { margin: 0; padding-left: 1.25rem; columns: 2 16rem; column-gap: 2rem; }
.toc li { break-inside: avoid; margin-top: 0.2rem; }

/* Tables become stacked cards on narrow screens so the page never scrolls sideways. */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9688rem; }
.data-table caption { text-align: left; font-weight: 600; padding-bottom: 0.5rem; }
.data-table th, .data-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.data-table thead th { font-size: 0.875rem; color: var(--muted); font-weight: 600; }
@media (max-width: 40rem) {
  .data-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .data-table, .data-table tbody, .data-table tr, .data-table td, .data-table th { display: block; width: 100%; }
  .data-table tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 0.25rem;
    margin-bottom: 0.75rem;
  }
  .data-table td, .data-table tbody th { border-bottom: 0; padding: 0.25rem 0.75rem; }
  .data-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.8125rem;
    color: var(--muted);
    font-weight: 600;
  }
}

dl.defs dt { font-weight: 650; margin-top: 0.75rem; }
dl.defs dd { margin: 0.15rem 0 0; }

/* ---------------------------------------------------------------- landing */
.hero { padding: 1.5rem 0 1rem; }
.hero .eyebrow { color: var(--accent); font-weight: 650; font-size: 0.9375rem; margin-bottom: 0.25rem; }
.hero h1 { font-size: clamp(2rem, 1.5rem + 2.4vw, 3rem); }

.buttons { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.875rem;
  padding: 0.625rem 1.125rem;
  border-radius: 999px;
  border: 2px solid var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.button, .button:visited { color: var(--accent); }
.button.primary, .button.primary:visited { background: var(--accent); color: var(--accent-text); }

.steps { list-style: none; padding: 0; counter-reset: step; display: grid; gap: 0.75rem; }
.steps li {
  counter-increment: step;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1rem 1rem 3.25rem;
  position: relative;
  margin: 0;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 1rem;
  top: 1rem;
  width: 1.625rem;
  height: 1.625rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
  font-size: 0.875rem;
  display: grid;
  place-items: center;
}

.cards { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); margin-bottom: 1rem; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.card h3 { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media print {
  .site-header, .site-footer, .skip-link, .toc { display: none; }
  body { background: #fff; color: #000; }
  a { color: #000; }
}
