/* Primal Dread Wiki — "Jungle Lab Ledger": chunky ink borders, hard shadows,
   a Mecha / Mutation evolution rail, parchment paper that goes to dark jungle. */

@font-face {
  font-family: "Rubik";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url(/_a/rubik-latin-900.9ab80489ae.woff2) format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/_a/ibm-plex-sans-latin-400.3b646991d3.woff2) format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/_a/ibm-plex-sans-latin-600.8960851d69.woff2) format("woff2");
}

:root {
  --bg: #F7F4EE;
  --fg: #172620;
  --card: #FDFCFA;
  --brand: #C4A574;
  --brand-text: #7A5D29;
  --deep: #1B4332;
  --mecha: #48CAE4;
  --mutation: #70E000;
  --dino: #2A6648;
  --alert: #E63946;
  --on-deep: #FFFFFF;
  --line: color-mix(in srgb, var(--fg) 16%, var(--bg));
  --soft: color-mix(in srgb, var(--fg) 6%, var(--bg));
  --quiet: color-mix(in srgb, var(--fg) 66%, var(--bg));
  --font-display: "Rubik", "Arial Black", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
  --radius: 0.5rem;
  --header-h: 3.75rem;
}
:root[data-theme="dark"] {
  --bg: #0F1410;
  --fg: #F2EFE9;
  --card: #171D18;
  --brand-text: #D1B07A;
  --dino: #5DB985;
}
:root[data-theme="black"] {
  --bg: #000000;
  --fg: #F2EFE9;
  --card: #0B0B0B;
  --brand-text: #D1B07A;
  --dino: #5DB985;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body.has-anchor { padding-bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px)); }
img, svg { max-width: 100%; }
img { height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; }
p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--mecha); outline-offset: 2px; }

.pd-skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--card); color: var(--fg);
  padding: 0.6rem 1rem; border: 3px solid var(--fg); border-radius: var(--radius);
  font-weight: 600; text-decoration: none;
}
.pd-skip:focus { top: 1rem; }

/* ---------- rails ---------- */
.pd-rail { height: 6px; background: linear-gradient(90deg, var(--mecha) 0 48%, var(--deep) 48% 52%, var(--mutation) 52% 100%); }
.pd-rail-characters { background: var(--dino); }
.pd-rail-items, .pd-rail-page { background: var(--brand); }
.pd-rail-top { position: absolute; left: 0; right: 0; top: 0; z-index: 3; }

/* ---------- header ---------- */
.pd-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--card);
  border-bottom: 3px solid var(--fg);
}
.pd-header-in {
  max-width: 80rem; margin: 0 auto; padding: 0.55rem 1rem;
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
}
.pd-brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; margin-right: auto; }
.pd-brand-mark { flex: none; border-radius: 0.5rem; }
.pd-brand-name { font-family: var(--font-display); font-weight: 900; font-size: 1.15rem; letter-spacing: -0.01em; }
.pd-nav { display: flex; gap: 0.25rem; order: 2; }
.pd-nav a {
  display: inline-block; padding: 0.4rem 0.8rem; text-decoration: none;
  font-weight: 600; font-size: 0.95rem; border-radius: var(--radius);
  border: 2px solid transparent;
}
.pd-nav a:hover { border-color: var(--fg); background: var(--soft); }
.pd-nav a[aria-current="page"] { border-color: var(--fg); background: var(--brand); color: var(--deep); }
.pd-tools { display: flex; align-items: center; gap: 0.35rem; order: 3; }
.pd-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; padding: 0; background: transparent;
  border: 2px solid transparent; border-radius: var(--radius); list-style: none;
}
.pd-icon-btn::-webkit-details-marker { display: none; }
.pd-icon-btn:hover { border-color: var(--fg); background: var(--soft); }
.pd-lang { position: relative; }
.pd-lang-menu {
  position: absolute; right: 0; top: calc(100% + 0.4rem); min-width: 10rem;
  background: var(--card); border: 3px solid var(--fg); border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--fg); overflow: hidden; z-index: 50;
}
.pd-lang-menu a { display: block; padding: 0.6rem 0.9rem; text-decoration: none; font-weight: 600; }
.pd-lang-menu a:hover { background: var(--soft); }
.pd-lang-menu a[aria-current="true"] { background: var(--brand); color: var(--deep); }

.pd-search { border-top: 2px solid var(--line); background: var(--card); }
.pd-search[hidden] { display: none; }
.pd-search-in { max-width: 44rem; margin: 0 auto; padding: 0.9rem 1rem 1rem; }
.pd-search-input {
  width: 100%; padding: 0.7rem 0.9rem; font: inherit; font-size: 1rem;
  background: var(--bg); color: var(--fg);
  border: 3px solid var(--fg); border-radius: var(--radius);
}
.pd-search-list { margin-top: 0.5rem; }
.pd-search-list a {
  display: flex; flex-direction: column; gap: 0.1rem; padding: 0.55rem 0.7rem;
  text-decoration: none; border-radius: var(--radius);
}
.pd-search-list a:hover, .pd-search-list a:focus-visible { background: var(--soft); }
.pd-search-t { font-weight: 600; }
.pd-search-c { font-size: 0.8rem; color: var(--quiet); text-transform: uppercase; letter-spacing: 0.06em; }
.pd-search-empty { padding: 0.6rem 0.7rem; color: var(--quiet); }

.pd-progress { position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 60; pointer-events: none; }
.pd-progress-bar { height: 100%; width: 0; background: var(--mecha); }

/* ---------- layout ---------- */
.pd-main {
  min-height: calc(100vh - 12rem);
  background-image: repeating-linear-gradient(135deg, transparent 0 30px, color-mix(in srgb, var(--fg) 3.5%, transparent) 30px 31px);
}
.pd-wrap { max-width: 80rem; margin: 0 auto; padding: 2rem 1rem 3rem; }
.pd-narrow { max-width: 50rem; }
.pd-eyebrow {
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--brand-text);
}
.pd-h1 { font-family: var(--font-display); font-weight: 900; font-size: clamp(1.9rem, 4.6vw, 2.9rem); letter-spacing: -0.02em; line-height: 1.08; margin-top: 0.5rem; }
.pd-h2 { font-family: var(--font-display); font-weight: 900; font-size: clamp(1.4rem, 3vw, 1.9rem); letter-spacing: -0.015em; }
.pd-sub { margin-top: 0.5rem; max-width: 42rem; color: var(--quiet); font-size: 1.05rem; }
.pd-lede { margin-top: 0.8rem; color: var(--quiet); font-size: 1.08rem; max-width: 46rem; }
.pd-frame {
  background: var(--card); border: 3px solid var(--fg); border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--fg);
}
.pd-block { margin-top: 3.25rem; }
.pd-block:first-child { margin-top: 0; }

/* ---------- buttons ---------- */
.pd-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.7rem 1.1rem; font-weight: 600; font-size: 0.98rem; text-decoration: none;
  border: 3px solid var(--on-deep); border-radius: var(--radius);
  transition: transform 0.12s ease, background 0.12s ease;
}
.pd-btn-brand { background: var(--brand); color: var(--deep); box-shadow: 3px 3px 0 var(--mecha); }
.pd-btn-brand:hover { transform: translate(-1px, -1px); }
.pd-btn-ghost { background: transparent; color: var(--on-deep); }
.pd-btn-ghost:hover { background: color-mix(in srgb, var(--on-deep) 14%, transparent); }
.pd-btn-deep { background: var(--deep); color: var(--on-deep); border-color: var(--fg); box-shadow: 3px 3px 0 var(--brand); }
.pd-btn-deep:hover { transform: translate(-1px, -1px); }

/* ---------- hero ---------- */
.pd-hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: center; min-height: 34rem;
  background: var(--deep); color: var(--on-deep);
  border-bottom: 3px solid var(--fg);
}
.pd-hero-img { position: absolute; inset: 0; z-index: -3; width: 100%; height: 100%; object-fit: cover; object-position: right center; }
.pd-hero-shade { position: absolute; inset: 0; z-index: -2; background: linear-gradient(90deg, var(--deep) 0%, color-mix(in srgb, var(--deep) 90%, transparent) 38%, color-mix(in srgb, var(--deep) 25%, transparent) 100%); }
.pd-hero-mark {
  position: absolute; left: 0; right: 0; top: 50%; z-index: -1; transform: translateY(-50%);
  padding-left: 1rem; font-family: var(--font-display); font-weight: 900;
  font-size: clamp(4rem, 18vw, 11rem); line-height: 1; letter-spacing: -0.04em;
  color: color-mix(in srgb, var(--on-deep) 7%, transparent); user-select: none; pointer-events: none;
}
.pd-hero-in { width: 100%; max-width: 80rem; margin: 0 auto; padding: 4.5rem 1rem; }
.pd-badge {
  display: inline-block; padding: 0.3rem 0.65rem; border-radius: 0.375rem;
  background: var(--brand); color: var(--deep);
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase;
}
.pd-hero-h1 {
  max-width: 46rem; margin-top: 1rem;
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(2.2rem, 6vw, 3.9rem); line-height: 1.05; letter-spacing: -0.02em;
}
.pd-hero-kicker { display: block; margin-bottom: 0.5rem; font-family: var(--font-body); font-weight: 600; font-size: clamp(1rem, 2vw, 1.15rem); letter-spacing: 0.07em; text-transform: uppercase; color: var(--brand); }
.pd-hero-desc { margin-top: 1.25rem; max-width: 36rem; font-size: 1.1rem; color: color-mix(in srgb, var(--on-deep) 88%, transparent); }
.pd-hero-cta { margin-top: 1.75rem; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.pd-hero-note {
  margin-top: 1.5rem; max-width: 36rem; padding: 0.55rem 0.8rem;
  border-left: 4px solid var(--mutation);
  background: color-mix(in srgb, var(--deep) 70%, transparent);
  font-size: 0.92rem; color: color-mix(in srgb, var(--on-deep) 92%, transparent);
}

/* ---------- home blocks ---------- */
.pd-start-grid { margin-top: 1.25rem; display: grid; gap: 1rem; grid-template-columns: repeat(4, 1fr); }
.pd-start {
  position: relative; display: flex; flex-direction: column; gap: 0.4rem; padding: 1.15rem 1.1rem 1.2rem;
  background: var(--card); border: 3px solid var(--fg); border-radius: var(--radius);
  text-decoration: none; transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.pd-start:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--fg); }
.pd-start-num { font-family: var(--font-display); font-weight: 900; font-size: 2.3rem; line-height: 1; color: var(--brand-text); }
.pd-start-title { font-weight: 600; font-size: 1.05rem; line-height: 1.25; }
.pd-start-desc { font-size: 0.93rem; color: var(--quiet); }

.pd-split { display: grid; gap: 2rem; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.pd-row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.pd-more { font-size: 0.92rem; font-weight: 600; color: var(--brand-text); }
.pd-grid { margin-top: 1.1rem; display: grid; gap: 1rem; }
.pd-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pd-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pd-trend { margin-top: 1rem; display: grid; gap: 0.6rem; }
.pd-trend a {
  display: block; padding: 0.75rem 0.9rem; background: var(--card);
  border: 2px solid var(--line); border-radius: var(--radius);
  font-weight: 600; font-size: 0.95rem; line-height: 1.3; text-decoration: none;
  border-left: 6px solid var(--mutation);
}
.pd-trend a:hover { border-color: var(--fg); border-left-color: var(--mutation); }

.pd-modules { margin-top: 1.5rem; display: grid; gap: 1.25rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pd-module { padding: 1.25rem 1.3rem 1.35rem; background: var(--card); border: 3px solid var(--fg); border-radius: var(--radius); }
.pd-module-head { display: flex; align-items: center; gap: 0.75rem; }
.pd-module-no {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 2.2rem; height: 2.2rem; border-radius: 0.4rem;
  background: var(--deep); color: var(--on-deep);
  font-family: var(--font-display); font-weight: 900; font-size: 1.1rem;
}
.pd-module-name { font-family: var(--font-display); font-weight: 900; font-size: 1.25rem; }
.pd-module-name a { text-decoration: none; }
.pd-module-name a:hover { text-decoration: underline; text-underline-offset: 4px; }
.pd-module-desc { margin-top: 0.7rem; color: var(--quiet); font-size: 0.97rem; }
.pd-module-list { margin-top: 0.9rem; display: grid; gap: 0.55rem; }
.pd-module-list li { display: grid; gap: 0.1rem; padding-left: 0.8rem; border-left: 4px solid var(--brand); font-size: 0.93rem; }
.pd-module-list strong { font-weight: 600; }
.pd-module-list span { color: var(--quiet); }
.pd-module-badges .pd-module-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pd-module-timeline .pd-module-list li { border-left-color: var(--mecha); }
.pd-closing { padding: 2.2rem 1.6rem; }

/* ---------- cards ---------- */
.pd-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--card); border: 3px solid var(--fg); border-radius: var(--radius);
  text-decoration: none; transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.pd-card:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--fg); }
.pd-card-img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 3px solid var(--fg); background: var(--soft); }
.pd-card-body { display: flex; flex-direction: column; gap: 0.3rem; padding: 0.95rem 1rem 1.05rem; }
.pd-card-label { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand-text); }
.pd-card-label:empty { display: none; }
.pd-card-title { font-weight: 600; font-size: 1.02rem; line-height: 1.3; }
.pd-card-desc {
  font-size: 0.9rem; color: var(--quiet);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.pd-card-meta { margin-top: 0.2rem; font-size: 0.8rem; color: var(--quiet); }

/* ---------- list + page heads ---------- */
.pd-list-head { margin-bottom: 1.75rem; padding: 0 0 0.2rem; }
.pd-list-head .pd-rail { margin-bottom: 1.25rem; max-width: 9rem; border-radius: 3px; }
.pd-list-head .pd-crumbs { margin-bottom: 0.2rem; }
.pd-updated { margin-top: 0.6rem; font-size: 0.88rem; color: var(--quiet); }
.pd-editorial { margin-top: 3rem; padding-top: 2rem; border-top: 3px solid var(--fg); }
.pd-404 { padding-top: 4rem; }
.pd-404-h { margin-top: 2.5rem; }

/* ---------- article ---------- */
.pd-article-wrap { max-width: 80rem; margin: 0 auto; padding: 2rem 1rem 3rem; display: flex; gap: 2rem; align-items: flex-start; }
.pd-ad-side { display: none; flex: none; width: 10rem; align-self: flex-start; }
.pd-ad-sticky { position: sticky; top: 5.5rem; min-height: 1px; }
.pd-article { flex: 1 1 0; min-width: 0; max-width: 48rem; margin: 0 auto; }
.pd-rail-col { display: none; flex: none; width: 14rem; align-self: stretch; }
.pd-sticky { position: sticky; top: 5.5rem; display: grid; gap: 1.5rem; }

.pd-crumbs { display: flex; flex-wrap: wrap; gap: 0.4rem; font-size: 0.9rem; color: var(--quiet); }
.pd-crumbs a { text-decoration: none; }
.pd-crumbs a:hover { text-decoration: underline; }
.pd-art-head {
  margin-top: 0.8rem; overflow: hidden; padding: 0 1.25rem 1.25rem;
  background: var(--card); border: 3px solid var(--fg); border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--fg);
}
.pd-art-head .pd-rail { margin: 0 -1.25rem 1.1rem; height: 8px; }
.pd-art-head .pd-h1 { font-size: clamp(1.8rem, 4vw, 2.45rem); }
.pd-meta { margin-top: 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 1.1rem; font-size: 0.86rem; color: var(--quiet); }
.pd-meta-end { margin-left: auto; }
.pd-ver {
  display: inline-block; padding: 0.1rem 0.5rem; border: 2px solid var(--fg); border-radius: 0.375rem;
  background: var(--mecha); color: var(--deep); font-weight: 600;
}
.pd-share, .pd-copy {
  padding: 0.25rem 0.7rem; background: var(--bg); color: var(--fg);
  border: 2px solid var(--fg); border-radius: 0.375rem; font-size: 0.82rem; font-weight: 600;
}
.pd-share:hover, .pd-copy:hover { background: var(--brand); color: var(--deep); }

.pd-quick {
  margin-top: 1.5rem; padding: 1rem 1.15rem 1.1rem;
  background: var(--card); border: 3px solid var(--fg); border-left: 10px solid var(--brand);
  border-radius: var(--radius); box-shadow: 4px 4px 0 var(--fg);
}
.pd-quick-h { display: flex; align-items: center; gap: 0.7rem; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brand-text); }
.pd-quick-t { margin-top: 0.5rem; font-size: 1rem; }

.pd-toc { font-size: 0.9rem; }
.pd-toc[hidden] { display: none; }
.pd-toc-m { margin-top: 1.5rem; padding: 0.9rem 1rem; background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); }
.pd-toc-h { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brand-text); margin-bottom: 0.5rem; }
.pd-toc ul { display: grid; gap: 0.1rem; }
.pd-toc a { display: block; padding: 0.3rem 0.6rem; border-left: 3px solid var(--line); text-decoration: none; color: var(--quiet); line-height: 1.35; }
.pd-toc a:hover { color: var(--fg); border-left-color: var(--fg); }
.pd-toc a.is-on { color: var(--fg); font-weight: 600; border-left-color: var(--mutation); }
.pd-toc .pd-toc-sub a { padding-left: 1.3rem; font-size: 0.86rem; }
.pd-explore { padding: 0.9rem 1rem; background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); }
.pd-explore ul { display: grid; gap: 0.2rem; font-size: 0.92rem; }
.pd-explore a { display: block; padding: 0.3rem 0.6rem; border-radius: 0.375rem; text-decoration: none; font-weight: 600; }
.pd-explore a:hover { background: var(--soft); }
.pd-explore a[aria-current="page"] { background: var(--brand); color: var(--deep); }

/* ---------- prose ---------- */
.pd-prose { margin-top: 2rem; font-size: 1.0625rem; line-height: 1.75; overflow-wrap: break-word; }
.pd-narrow .pd-prose, .pd-editorial { margin-top: 1.5rem; }
.pd-prose > :first-child { margin-top: 0; }
.pd-prose h2 { margin-top: 2.6rem; font-family: var(--font-display); font-weight: 900; font-size: clamp(1.45rem, 3vw, 1.85rem); letter-spacing: -0.015em; line-height: 1.15; scroll-margin-top: 5rem; }
.pd-prose h3 { margin-top: 2rem; font-weight: 600; font-size: 1.28rem; line-height: 1.25; scroll-margin-top: 5rem; }
.pd-prose h4 { margin-top: 1.5rem; font-weight: 600; font-size: 1.08rem; }
.pd-prose p, .pd-prose ul, .pd-prose ol, .pd-prose table, .pd-prose blockquote, .pd-prose pre { margin-top: 1.1rem; }
.pd-prose ul { list-style: none; padding-left: 0; }
.pd-prose ul > li { position: relative; padding-left: 1.4rem; margin-top: 0.4rem; }
.pd-prose ul > li::before { content: ""; position: absolute; left: 0.2rem; top: 0.72em; width: 0.5rem; height: 0.5rem; background: var(--brand); border: 2px solid var(--fg); border-radius: 2px; }
.pd-prose ol { list-style: decimal; padding-left: 1.6rem; }
.pd-prose ol > li { margin-top: 0.4rem; padding-left: 0.3rem; }
.pd-prose ol > li::marker { font-weight: 600; color: var(--brand-text); }
.pd-prose li > ul, .pd-prose li > ol { margin-top: 0.3rem; }
.pd-prose a { color: var(--brand-text); font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.pd-prose a:hover { color: var(--fg); }
.pd-prose strong { font-weight: 600; }
.pd-prose img { display: block; margin: 1.5rem auto 0; border: 3px solid var(--fg); border-radius: var(--radius); }
.pd-prose code { padding: 0.1rem 0.35rem; background: var(--soft); border: 1px solid var(--line); border-radius: 0.3rem; font-size: 0.9em; }
.pd-prose pre { padding: 1rem; overflow-x: auto; background: var(--soft); border: 2px solid var(--line); border-radius: var(--radius); }
.pd-prose pre code { padding: 0; background: none; border: 0; }
.pd-prose blockquote { padding: 0.2rem 1rem; border-left: 6px solid var(--brand); color: var(--quiet); }
.pd-prose hr { margin: 2.2rem 0; border: 0; border-top: 3px solid var(--line); }
.pd-prose table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 0.95rem; line-height: 1.5; }
.pd-prose th, .pd-prose td { padding: 0.6rem 0.8rem; text-align: left; vertical-align: top; border: 2px solid var(--line); min-width: 8rem; }
.pd-prose th { background: var(--deep); color: var(--on-deep); font-weight: 600; border-color: var(--deep); }
.pd-prose tr:nth-child(even) td { background: var(--soft); }

.pd-callout {
  margin-top: 1.5rem; padding: 0.9rem 1.1rem 1rem;
  background: var(--card); border: 3px solid var(--fg); border-left-width: 10px; border-radius: var(--radius);
  font-size: 1rem; line-height: 1.65;
}
.pd-callout > :last-child { margin-bottom: 0; }
.pd-callout p { margin-top: 0.6rem; }
.pd-callout .pd-callout-title { margin-top: 0; font-weight: 600; font-size: 0.95rem; letter-spacing: 0.06em; text-transform: uppercase; }
.pd-callout-info { border-left-color: var(--mecha); }
.pd-callout-tip { border-left-color: var(--mutation); }
.pd-callout-warn { border-left-color: var(--brand); }
.pd-callout-danger { border-left-color: var(--alert); }

/* ---------- FAQ / details ---------- */
.pd-faq { margin-top: 3rem; }
.pd-faq h2 { font-family: var(--font-display); font-weight: 900; font-size: 1.6rem; }
.pd-faq-list { margin-top: 1rem; }
.pd-q { margin-top: 0.7rem; background: var(--card); border: 2px solid var(--fg); border-radius: var(--radius); }
.pd-faq h2 + .pd-q { margin-top: 1rem; }
.pd-q > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.8rem 1rem; list-style: none; cursor: pointer; font-weight: 600; line-height: 1.35;
}
.pd-q > summary::-webkit-details-marker { display: none; }
.pd-q > summary::after { content: "+"; flex: none; font-family: var(--font-display); font-weight: 900; font-size: 1.4rem; line-height: 1; color: var(--brand-text); }
.pd-q[open] > summary::after { content: "\2212"; }
.pd-q[open] > summary { border-bottom: 2px solid var(--line); }
.pd-q-a { padding: 0.8rem 1rem 1rem; font-size: 0.98rem; }
.pd-prose .pd-q { font-size: 1rem; line-height: 1.6; }
.pd-prose .pd-q > p, .pd-prose .pd-q > ul, .pd-prose .pd-q > ol { margin-left: 1rem; margin-right: 1rem; }
.pd-prose .pd-q > :last-child { margin-bottom: 1rem; }

/* ---------- related + pager ---------- */
.pd-related { margin-top: 3.25rem; padding-top: 1.75rem; border-top: 3px solid var(--fg); }
.pd-related h2 { font-family: var(--font-display); font-weight: 900; font-size: 1.5rem; }
.pd-related .pd-card-desc { -webkit-line-clamp: 2; }
.pd-pager { margin-top: 2.5rem; display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pd-pager-a {
  display: flex; flex-direction: column; gap: 0.3rem; padding: 0.9rem 1rem;
  background: var(--card); border: 3px solid var(--fg); border-radius: var(--radius); text-decoration: none;
}
.pd-pager-a:hover { box-shadow: 4px 4px 0 var(--fg); transform: translate(-2px, -2px); }
.pd-pager-next { grid-column: 2; text-align: right; }
.pd-pager-k { font-size: 0.82rem; font-weight: 600; color: var(--brand-text); }
.pd-pager-t { font-weight: 600; line-height: 1.3; }

/* ---------- footer ---------- */
.pd-footer { margin-top: 2rem; background: var(--deep); color: var(--on-deep); border-top: 3px solid var(--fg); }
.pd-footer-in { max-width: 80rem; margin: 0 auto; padding: 2.5rem 1rem 1.5rem; display: grid; gap: 2rem; grid-template-columns: 2fr 1fr 1fr; }
.pd-footer-name { font-family: var(--font-display); font-weight: 900; font-size: 1.35rem; }
.pd-footer-note { margin-top: 0.6rem; max-width: 30rem; font-size: 0.9rem; color: color-mix(in srgb, var(--on-deep) 80%, transparent); }
.pd-footer-h { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brand); }
.pd-footer-col ul { margin-top: 0.7rem; display: grid; gap: 0.35rem; }
.pd-footer-col a { text-decoration: none; font-size: 0.95rem; }
.pd-footer-col a:hover { text-decoration: underline; text-underline-offset: 3px; }
.pd-footer-copy { max-width: 80rem; margin: 0 auto; padding: 1rem 1rem 1.5rem; border-top: 2px solid color-mix(in srgb, var(--on-deep) 18%, transparent); font-size: 0.85rem; color: color-mix(in srgb, var(--on-deep) 75%, transparent); }

/* ---------- floating bits ---------- */
.pd-top {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 35;
  display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem;
  background: var(--brand); color: var(--deep); border: 3px solid var(--fg); border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--fg);
}
.pd-top[hidden] { display: none; }
body.has-anchor .pd-top { bottom: calc(6rem + env(safe-area-inset-bottom, 0px)); }
.pd-anchor { position: fixed; left: 50%; bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px)); z-index: 30; transform: translateX(-50%); pointer-events: none; }
.pd-anchor-card {
  pointer-events: auto; display: flex; flex-direction: column; align-items: center; width: fit-content; max-width: calc(100vw - 1rem);
  padding: 0.35rem; background: var(--card); border: 2px solid var(--fg); border-radius: 0.6rem;
  box-shadow: 3px 3px 0 var(--fg);
}
.pd-anchor-bar { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0 0.15rem 0.3rem; }
.pd-anchor-tag { padding: 0 0.35rem; border-radius: 0.25rem; background: var(--soft); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; color: var(--quiet); }
.pd-anchor-toggle { display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; padding: 0; background: var(--soft); border: 2px solid var(--line); border-radius: 0.3rem; }
.pd-anchor-toggle svg { transition: transform 0.15s ease; }
.pd-anchor-card.is-collapsed .pd-anchor-body { display: none; }
.pd-anchor-card.is-collapsed .pd-anchor-bar { padding-bottom: 0; }
.pd-anchor-card.is-collapsed .pd-anchor-toggle svg { transform: rotate(180deg); }
.pd-anchor-body { min-width: 320px; min-height: 50px; max-width: 100%; display: flex; justify-content: center; }

/* ---------- responsive ---------- */
@media (min-width: 1024px) {
  .pd-rail-col { display: block; width: 14rem; }
  .pd-toc-m { display: none; }
}
@media (min-width: 1280px) {
  .pd-ad-side { display: block; }
  .pd-rail-col { width: 16rem; }
}
@media (max-width: 1023px) {
  .pd-start-grid { grid-template-columns: repeat(2, 1fr); }
  .pd-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pd-split { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .pd-header-in { gap: 0.4rem 0.75rem; padding: 0.5rem 0.75rem; }
  .pd-nav { order: 4; width: 100%; overflow-x: auto; }
  .pd-hero { min-height: 30rem; }
  .pd-hero-in { padding: 3rem 1rem; }
  .pd-hero-shade { background: linear-gradient(180deg, color-mix(in srgb, var(--deep) 94%, transparent) 0%, color-mix(in srgb, var(--deep) 80%, transparent) 100%); }
  .pd-modules, .pd-module-badges .pd-module-list { grid-template-columns: 1fr; }
  .pd-grid-2, .pd-grid-3 { grid-template-columns: 1fr; }
  .pd-footer-in { grid-template-columns: 1fr; }
  .pd-pager { grid-template-columns: 1fr; }
  .pd-pager-next { grid-column: 1; text-align: left; }
  .pd-wrap { padding-top: 1.5rem; }
  .pd-article-wrap { padding-top: 1.5rem; }
  .pd-prose { font-size: 1.0625rem; }
  .pd-meta-end { margin-left: 0; }
  .pd-art-head { padding: 0 1rem 1rem; }
  .pd-art-head .pd-rail { margin: 0 -1rem 1rem; }
}
@media (max-width: 480px) {
  .pd-start-grid { grid-template-columns: 1fr; }
  .pd-anchor-body { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
