:root {
  color-scheme: light;
  --bg: #ffffff;
  --ink: #111111;
  --muted: #666666;
  --gold: #111111;
  --sage: #555555;
  --card: #ffffff;
  --line: #dcdcdc;
  --theory: #f4f4f4;
  --pad: 4vw;
  --ui: "Segoe UI", Arial, sans-serif;
  --read: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ui);
  line-height: 1.65;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

img, iframe, video {
  max-width: 100%;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  width: min(1180px, calc(100% - 2 * var(--pad)));
  margin: 0 auto;
  padding: 1.5rem 0 3.5rem;
}

.top {
  position: sticky;
  top: 0;
  z-index: 4;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid var(--line);
}

.top-inner, .jump {
  width: min(1180px, calc(100% - 2 * var(--pad)));
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.top-inner {
  min-height: 4rem;
  justify-content: space-between;
}

.brand {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.82rem;
}
.brand:hover { color: var(--ink); text-decoration: none; }

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
}

.nav a {
  color: var(--ink);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  background: transparent;
}
.nav a:hover {
  color: #fff;
  background: #555;
  text-decoration: none;
}
.nav a.is-on {
  color: #fff;
  background: #111;
  text-decoration: none;
}

.crumb { display: none; }

.jump {
  overflow-x: auto;
  padding: 0 0 0.85rem;
  gap: 1.2rem;
  border-bottom: 1px solid var(--line);
}

.jump a {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.jump a:hover,
.jump a.is-on {
  color: var(--gold);
  text-decoration: none;
}

#map,
[id^="theory-"],
[id^="insight-"],
[id^="sub-"],
.subhead {
  scroll-margin-top: 6.2rem;
}

.ico {
  width: 0.82rem;
  height: 0.82rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero {
  display: grid;
  grid-template-columns: 10.5rem 1fr;
  gap: 1.6rem;
  padding: 1.6rem 0 1.4rem;
  align-items: start;
}

.cover {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  object-position: center center;
  justify-self: start;
  background: #ddd;
}

.kicker {
  margin: 0 0 0.35rem;
  color: var(--sage);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

h1 {
  margin: 0 0 0.35rem;
  font-weight: 700;
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  line-height: 1.25;
}

.by {
  margin: 0 0 0.7rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.meta li {
  font-size: 0.75rem;
  color: var(--muted);
}

.promise {
  margin: 0.8rem 0 0;
  font-size: 1.05rem;
  max-width: 40rem;
  font-family: var(--read);
}

section { padding: 1.1rem 0 0.2rem; }

.sec-label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0 0 0.55rem;
  color: var(--sage);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

.map-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  counter-reset: map;
}

.map-list li {
  position: relative;
  counter-increment: map;
  padding: 0.9rem 1.05rem 0.9rem 3.15rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-left-color: #111;
  background: #f2f2f2;
  color: var(--ink);
  font-size: 1.05rem;
  font-family: var(--read);
  line-height: 1.55;
}

.map-list li::before {
  content: counter(map);
  position: absolute;
  left: 0.85rem;
  top: 0.95rem;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--ui);
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: #111;
  line-height: 1;
}

.theory {
  background: var(--theory);
  color: var(--ink);
  border-left: 4px solid #111;
  padding: 1.1rem 1.25rem;
  margin: 0.35rem 0 1rem;
  font-size: 1.05rem;
  font-family: var(--read);
}

.theory p { margin: 0 0 0.75rem; }
.theory p:last-child { margin-bottom: 0; }

.prose {
  color: var(--ink);
  margin: 0.35rem 0 1rem;
  font-size: 1.05rem;
  font-family: var(--read);
}

.prose p { margin: 0 0 0.75rem; }
.prose p:last-child { margin-bottom: 0; }

.insight {
  border-bottom: 1px solid var(--line);
  padding: 0.4rem 0 1.2rem;
  margin: 0 0 1.1rem;
  font-family: var(--read);
}

.insight h2 {
  margin: 0.1rem 0 0.2rem;
  font-size: 1.12rem;
  font-weight: 700;
  font-family: var(--ui);
}

.short {
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-style: italic;
}

.when { margin: 0 0 0.7rem; font-size: 1rem; }

.steps { margin: 0.15rem 0 0.7rem; padding: 0 0 0 1.15rem; }
.steps li { margin: 0 0 0.45rem; }

.know {
  margin: 0;
  padding-top: 0.55rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  margin: 0.5rem 0 0.8rem;
}

.grid span {
  background: var(--theory);
  padding: 0.5rem 0.3rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
}

.library-hero {
  padding: 1.8rem 0 1.2rem;
}

.library-hero h1 {
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
  font-weight: 700;
}
.library-hero p { color: var(--muted); margin: 0.4rem 0 0; }

.intro-panel {
  margin: 0 0 2.2rem;
  padding: 1.7rem 1.6rem 1.5rem 1.7rem;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid #111;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.intro-panel .library-hero {
  padding: 0 0 0.85rem;
}

.intro-panel .kicker {
  color: var(--sage);
}

.intro-panel .about {
  margin: 0;
}

.about {
  width: 100%;
  font-family: var(--read);
  font-size: 1.08rem;
  margin: 0 0 1.8rem;
}
.about p { margin: 0 0 0.8rem; }
.about p:last-child { margin-bottom: 0; }

.find-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.find {
  width: 100%;
  max-width: 36rem;
  display: block;
  margin: 0 0 1rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}
.find:focus {
  outline: 2px solid #111;
  outline-offset: 1px;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  margin: 0 0 1.6rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.65rem;
  margin: 0.55rem 0 0.35rem;
}

.tag {
  color: var(--gold);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}
.tag:hover { text-decoration: underline; }

.cat-note {
  margin: -0.4rem 0 0.9rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.tile.is-off,
.cat.is-off { display: none; }

.cats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin: 0 0 0.8rem;
  padding-bottom: 0.5rem;
}

.cats a {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cats a:hover,
.cats a.is-on {
  color: var(--gold);
  text-decoration: none;
}

.cat { padding: 0.3rem 0 1.8rem; }

.cat h2 {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.tile {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 56px;
  height: auto;
  padding: 0.15rem 0.55rem 0.15rem 0;
  border: 1px solid var(--line);
  background: var(--card);
  color: inherit;
  overflow: hidden;
}

.tile:hover {
  border-color: #111;
  background: #f0f0f0;
  text-decoration: none;
}

.tile img {
  flex: 0 0 auto;
  width: 36px;
  height: 56px;
  object-fit: cover;
  display: block;
}

.tile img.wide {
  width: 88px;
}

.tile .ph {
  flex: 0 0 auto;
  width: 88px;
  height: 56px;
  background: #ddd;
}

@media (max-width: 720px) {
  .tile .ph { width: 102px; height: 64px; }
}

.tile .tile-text {
  min-width: 0;
  flex: 1;
}

.tile h3 {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-tags {
  color: var(--gold) !important;
  font-size: 0.68rem !important;
}

@media (max-width: 800px) {
  .tiles { grid-template-columns: 1fr 1fr; }
}

.notice {
  font-size: 0.88rem;
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--card);
  padding: 0.75rem 0.9rem;
  margin: 0.85rem 0 1.2rem;
  line-height: 1.5;
}

.buy {
  display: inline-block;
  margin-top: 0.45rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.foot {
  margin-top: 1.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
}

.video-block {
  margin: 0 0 2.2rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--line);
}

.video-block h2 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111;
  margin: 0.8rem 0 0;
}

.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-soon {
  display: grid;
  place-items: center;
  background: #111;
  color: #ccc;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

.frame-foot {
  background: #111;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  padding: 1.4rem var(--pad);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.frame-foot a { color: #fff; }
.frame-foot a:hover { color: var(--sage); }

@media (max-width: 800px) {
  .hero { grid-template-columns: 7.2rem 1fr; gap: 1rem; }
}

@media (max-width: 720px) {
  :root { --pad: 1rem; }

  .wrap { padding: 1rem 0 2.4rem; }

  .top-inner {
    flex-wrap: wrap;
    min-height: 0;
    padding-top: 0.55rem;
    padding-bottom: 0.45rem;
    gap: 0.25rem 0.8rem;
    align-items: center;
  }

  .brand {
    font-size: 0.82rem;
    letter-spacing: 0.04em;
  }

  .nav {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex: 1 1 100%;
    gap: 0;
    flex-wrap: wrap;
  }

  .nav a {
    display: inline-block;
    padding: 0.4rem 0.5rem;
    font-size: 0.68rem;
    letter-spacing: 0.05em;
  }

  .jump {
    gap: 0.2rem 0.85rem;
    padding-bottom: 0.55rem;
    -webkit-overflow-scrolling: touch;
  }

  .jump a {
    padding: 0.45rem 0.1rem;
    font-size: 0.7rem;
  }

  .library-hero { padding: 1rem 0 0.7rem; }
  .intro-panel { padding: 1.2rem 1rem 1.05rem 1.1rem; border-radius: 12px; }
  .intro-panel .library-hero { padding: 0 0 0.7rem; }

  .about { font-size: 1rem; }

  .theory {
    padding: 0.85rem 0.9rem;
    font-size: 1rem;
  }

  .map-list li {
    padding: 0.8rem 0.9rem 0.8rem 2.9rem;
    font-size: 1rem;
  }
  .map-list li::before {
    left: 0.7rem;
    top: 0.85rem;
  }

  .insight h2 { font-size: 1.05rem; }

  .tiles { grid-template-columns: 1fr; }

  .tile { height: 64px; }

  .tile img {
    width: 44px;
    height: 64px;
  }

  .tile img.wide { width: 102px; }

  .tile h3 { font-size: 0.92rem; }

  .grid span { font-size: 0.68rem; padding: 0.4rem 0.2rem; }

  .notice { font-size: 0.84rem; padding: 0.7rem 0.75rem; }

  .buy { padding: 0.35rem 0; }
}

@media (max-width: 480px) {
  .hero { grid-template-columns: 1fr; }
  .hero .cover { width: 7.2rem; }
}

/* Topics — long-page index */
.wrap.topic-page {
  width: min(1360px, calc(100% - 2 * var(--pad)));
  display: grid;
  grid-template-columns: 14.5rem minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

.topic-shell {
  display: contents;
}

.toc {
  position: sticky;
  top: 5.2rem;
  max-height: calc(100vh - 6.2rem);
  overflow: auto;
  padding: 0.1rem 1rem 1.4rem 0;
  border-right: 1px solid var(--line);
  align-self: start;
}

.toc a {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
  padding: 0.2rem 0 0.2rem 0.65rem;
  border-left: 2px solid transparent;
}

.toc a:hover {
  color: var(--ink);
  text-decoration: none;
}

.toc a.is-on {
  color: var(--ink);
  font-weight: 700;
  border-left-color: #111;
}

.toc-group {
  margin: 0.85rem 0 0.12rem;
  color: var(--sage);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}

.toc-group:first-child { margin-top: 0; }

.toc-now {
  margin: 0 0 0.85rem;
  padding: 0 0 0.7rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.toc-now strong {
  display: block;
  margin-top: 0.2rem;
  color: var(--ink);
  font-size: 0.92rem;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 700;
  line-height: 1.3;
}

.contents {
  margin: 0.2rem 0 1.4rem;
}

.contents-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.contents-grid a {
  display: block;
  border: 1px solid var(--line);
  background: var(--card);
  color: inherit;
  padding: 0.7rem 0.85rem 0.75rem;
  border-radius: 10px;
}

.contents-grid a:hover {
  border-color: #111;
  background: #f4f4f4;
  text-decoration: none;
}

.contents-grid strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  font-family: var(--ui);
}

.contents-grid span {
  display: block;
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.contents-group {
  grid-column: 1 / -1;
  margin: 0.55rem 0 0.05rem;
  color: var(--sage);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}

.contents-group:first-child { margin-top: 0; }

.subhead {
  margin: 1.6rem 0 0.15rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
}

.subhead h2 {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.subhead p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-family: var(--read);
}

.related {
  margin-top: 1.6rem;
  padding-top: 0.4rem;
}

.jump svg {
  width: 0.78rem;
  height: 0.78rem;
  vertical-align: -0.12rem;
  margin-right: 0.18rem;
}

.topic-blurb {
  max-width: 40rem;
}

.topic-family-label {
  margin: 1.25rem 0 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.topic-family-label:first-of-type {
  margin-top: 0.35rem;
}

.compare {
  width: 100%;
  border-collapse: collapse;
  margin: 0.6rem 0 1rem;
  font-size: 0.88rem;
  line-height: 1.45;
}

.compare th,
.compare td {
  border: 1px solid var(--line);
  padding: 0.55rem 0.65rem;
  text-align: left;
  vertical-align: top;
}

.compare thead th {
  background: var(--theory);
  color: var(--ink);
  font-weight: 700;
}

.compare tbody th[scope="row"] {
  background: #fafafa;
  font-weight: 700;
  white-space: nowrap;
}

@media (min-width: 981px) {
  body.topic-long .jump { display: none; }
}

@media (max-width: 980px) {
  .wrap.topic-page {
    width: min(1180px, calc(100% - 2 * var(--pad)));
    display: block;
  }
  .topic-shell { display: block; }
  .toc { display: none; }
  .contents-grid { grid-template-columns: 1fr; }
}
