/* Lord of Undead Hub — white / Apple-like visual language.
   Layout architecture stays: sticky left rail, right canvas, asymmetric mast,
   2×2 home related grid. Not the sister hub’s top bar + centered column. */
:root {
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --bg: #ffffff;
  --surface: #f5f5f7;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --code-bg: #f5f5f7;
  --radius: 0;
  --hero-wash: #f5f5f7;
  --card-bg: #ffffff;
  --rule: #d2d2d7;
  --sidebar: #fbfbfd;
  --shadow: 0 8px 24px rgba(0, 0, 0, .06);
  --link: #0066cc;
  --link-hover: #0071e3;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #0a84ff;
    --accent-hover: #409cff;
    --bg: #1c1c1e;
    --surface: #2c2c2e;
    --text: #f5f5f7;
    --muted: #98989d;
    --line: #424245;
    --code-bg: #2c2c2e;
    --hero-wash: #2c2c2e;
    --card-bg: #1c1c1e;
    --rule: #424245;
    --sidebar: #161617;
    --shadow: 0 8px 24px rgba(0, 0, 0, .35);
    --link: #2997ff;
    --link-hover: #6eb5ff;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  letter-spacing: -.01em;
  font-weight: 400;
}
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--link-hover); }
img { max-width: 100%; height: auto; }
code {
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  font-size: .9em;
  background: var(--code-bg);
  padding: 1px 5px;
  border-radius: 4px;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: #d6e8ff; color: #1d1d1f; }

/* ----- Frame: sticky left rail on desktop, stacked chrome on small screens ----- */
.frame { min-height: 100vh; background: var(--bg); }

.site-header {
  background: var(--sidebar);
  border-bottom: 1px solid var(--line);
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  min-width: 0;
}
.brand img {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: var(--surface);
}
.brand span {
  font-family: inherit;
  font-style: normal;
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.2;
  letter-spacing: -.02em;
  white-space: normal;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  letter-spacing: -.01em;
}
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 6px 11px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -.01em;
  text-transform: none;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.lang-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  line-height: 1.3;
  letter-spacing: -.01em;
}
.lang-switch a {
  color: var(--muted);
  text-decoration: none;
}
.lang-switch a:hover { color: var(--text); text-decoration: underline; }
.lang-switch a[aria-current="true"] {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.lang-sep { color: var(--line); }

@media (max-width: 979px) {
  .site-header {
    position: sticky;
    top: 0;
    z-index: 8;
    padding: 12px 20px 14px;
    background: rgba(255, 255, 255, .86);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
  }
  @media (prefers-color-scheme: dark) {
    .site-header {
      background: rgba(22, 22, 23, .86);
    }
  }
  .site-nav {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    padding: 8px 0 6px;
  }
  .site-header:has(.site-nav.is-open),
  .site-nav.is-open { display: flex; }
  .site-header { display: flex; flex-wrap: wrap; }
  .brand-row { flex: 1 1 auto; width: 100%; }
  .header-tools {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .nav-primary, .nav-secondary { display: flex; flex-direction: column; }
  .nav-secondary {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
  }
  .site-nav a {
    display: block;
    padding: 10px 2px;
    font-size: 16px;
  }
  .site-nav a[aria-current="page"] {
    box-shadow: inset 2px 0 0 var(--text);
    padding-left: 10px;
  }
  .canvas-inner { padding: 28px 20px 64px; }
}

@media (min-width: 980px) {
  .frame {
    display: grid;
    grid-template-columns: 216px minmax(0, 1fr);
  }
  .site-header {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding: 36px 22px 40px 24px;
    border-bottom: 0;
    border-right: 1px solid var(--line);
  }
  .nav-toggle { display: none; }
  .brand-row,
  .header-tools { display: contents; }
  .brand { order: 1; }
  .site-nav { order: 2; }
  .lang-switch {
    order: 3;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--line);
  }
  .brand {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  .brand span {
    font-size: 1.22rem;
    max-width: 11.5em;
  }
  .site-nav {
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  .nav-primary, .nav-secondary { display: flex; flex-direction: column; }
  .nav-secondary {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
  }
  .site-nav a {
    display: block;
    padding: 5px 0 5px 0;
    border-left: 0;
    font-size: 14px;
  }
  .site-nav a[aria-current="page"] {
    border-left: 0;
    padding-left: 0;
  }
  .canvas-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 52px 56px 96px;
  }
}

.canvas { min-width: 0; background: var(--bg); }

/* ----- Mast / typography ----- */
.mast { margin: 0 0 36px; }
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 22px;
  font-size: 12px;
  letter-spacing: .01em;
  text-transform: none;
  color: var(--muted);
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }
.crumb-sep { color: var(--line); letter-spacing: 0; }

.mast-grid { display: grid; gap: 24px 48px; }
@media (min-width: 900px) {
  .mast.has-media .mast-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(240px, 22rem);
    align-items: start;
  }
}

.page-head { min-width: 0; }
h1, h2, h3, .footer-mark, .card strong {
  font-family: inherit;
  letter-spacing: -.022em;
  font-weight: 600;
  font-style: normal;
}
h1 {
  font-size: clamp(2.15rem, 1.4rem + 2.2vw, 3.1rem);
  line-height: 1.12;
  letter-spacing: -.03em;
  margin: 0 0 14px;
  font-weight: 600;
}
.updated {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0;
  margin: 0 0 16px;
}
.lead {
  font-size: 1.15rem;
  line-height: 1.55;
  max-width: 38em;
  margin: 0;
  color: var(--text);
  font-weight: 400;
}
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0 0; }
.btn {
  display: inline-block;
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -.01em;
  text-transform: none;
  padding: 9px 16px;
  border-radius: 980px;
  border: 1px solid var(--text);
}
.btn:hover { color: var(--bg); background: var(--text); opacity: .86; border-color: var(--text); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.btn-ghost:hover { color: var(--text); background: var(--surface); opacity: 1; }

.mast-media { min-width: 0; }
.mast-media figure.shot { margin: 0; }
.mast-media figure.shot img {
  display: block;
  width: 100%;
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
}
.mast-media figcaption,
.prose figure.shot figcaption,
.shot-grid figcaption {
  margin-top: .55rem;
  font-size: .8rem;
  line-height: 1.5;
  color: var(--muted);
  letter-spacing: 0;
}

/* ----- Prose ----- */
.prose h2 {
  font-size: 1.5rem;
  line-height: 1.25;
  margin: 2.4em 0 .6em;
  padding-bottom: .35em;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 20px;
  font-weight: 600;
  font-style: normal;
}
.prose h3 {
  font-size: 1.12rem;
  margin: 1.7em 0 .45em;
  scroll-margin-top: 20px;
  font-style: normal;
  font-weight: 600;
}
.prose p, .prose li, .prose .note { max-width: 42em; }
.prose p { margin: 0 0 1.05em; }
.prose ul, .prose ol { margin: 0 0 1.05em; padding-left: 1.2em; }
.prose li { margin: 6px 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 16px; letter-spacing: 0; }

.table-wrap {
  overflow-x: auto;
  margin: 24px 0 32px;
  max-width: 52em;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
.table-wrap th, .table-wrap td {
  text-align: left;
  padding: 12px 16px 12px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.table-wrap tr:last-child td { border-bottom: 0; }
.table-wrap th {
  background: transparent;
  font-family: inherit;
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
}
.table-wrap caption {
  caption-side: bottom;
  text-align: left;
  padding: 10px 0 0;
}

.prose figure.shot { margin: 1.5rem 0; }
.prose figure.shot img {
  display: block;
  width: 100%;
  border-radius: 0;
  background: var(--surface);
}
.shot-grid { display: grid; gap: 1.25rem; grid-template-columns: 1fr; margin: 1.5rem 0; }
@media (min-width: 640px) { .shot-grid { grid-template-columns: 1fr 1fr; } }
.shot-grid figure { margin: 0; }
.shot-grid img { width: 100%; height: auto; border-radius: 0; display: block; background: var(--surface); }

.note {
  background: var(--surface);
  border: 0;
  border-left: 2px solid var(--text);
  border-radius: 0;
  padding: 14px 18px 14px 20px;
  margin: 20px 0;
}
.toc {
  background: transparent;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 18px 0 20px;
  margin: 28px 0;
  font-size: 16px;
}
.toc p {
  margin: 0 0 8px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  font-size: 13px;
  font-family: inherit;
  color: var(--muted);
}
.toc ol, .toc ul { margin: 0; padding-left: 1.25em; }

.hint, .solution {
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 14px 0 14px 16px;
  margin: 16px 0 20px;
  background: transparent;
}
.hint { border-left: 2px solid #86868b; }
.solution { border-left: 2px solid var(--text); }
.hint > p:first-child, .solution > p:first-child { margin-top: 0; font-weight: 600; }

/* ----- FAQ / related ----- */
.faq { margin-top: 56px; padding-top: 8px; }
.faq h2, .related h2 {
  font-size: 1.45rem;
  margin: 0 0 16px;
  font-style: normal;
}
.faq details {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 14px 0;
  margin: 0;
  background: transparent;
}
.faq details:first-of-type { border-top: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; }
.faq .answer p { margin: .65em 0 0; max-width: 42em; }

.related { margin-top: 56px; }
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--line);
}
.card {
  display: grid;
  gap: 4px;
  padding: 18px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  text-decoration: none;
  color: var(--text);
  background: transparent;
}
.card:hover { color: var(--text); }
.card:hover strong { color: var(--link); }
.card strong { font-size: 1.15rem; font-style: normal; font-weight: 600; }
.card span { font-size: 15px; color: var(--muted); letter-spacing: 0; }

@media (min-width: 700px) {
  .is-inner .cards {
    grid-template-columns: 1fr 1fr;
    column-gap: 40px;
  }
}

/* Home: magazine / hub tile grid, not a card list */
.is-home .related { margin-top: 64px; }
.is-home .related h2 {
  font-size: .82rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-family: inherit;
  font-weight: 600;
  font-style: normal;
  color: var(--muted);
}
.is-home .cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.is-home .card {
  background: var(--card-bg);
  padding: 28px 24px 32px;
  border: 0;
  min-height: 148px;
  align-content: start;
}
.is-home .card strong {
  font-size: 1.45rem;
  font-style: normal;
  font-weight: 600;
  margin-bottom: 6px;
}
@media (min-width: 700px) {
  .is-home .cards { grid-template-columns: 1fr 1fr; }
}

.source-list { font-size: 16px; }
.source-list li { margin: 6px 0; }

/* ----- Footer ----- */
.site-footer {
  color: var(--muted);
  font-size: 13px;
  margin-top: 64px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  background: transparent;
}
.footer-grid {
  display: grid;
  gap: 28px;
}
.footer-mark {
  margin: 0 0 10px;
  color: var(--text);
  font-style: normal;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -.02em;
}
.disclaimer { max-width: 70ch; margin: 0 0 10px; }
.footer-copy { margin: 0; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }

@media (min-width: 700px) {
  .footer-grid {
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 40px;
  }
  .site-footer nav {
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    text-align: right;
  }
}
