:root {
  --bg: #f1efe9;
  --paper: #f8f7f2;
  --surface: #fffdf8;
  --text: #1f2226;
  --muted: #5c656f;
  --line: #d5d2c8;
  --accent: #2f5b7c;
  --accent-strong: #1f425d;
  --shadow: 0 14px 34px rgba(35, 41, 48, 0.08);
  --callout-note: #355e74;
  --callout-note-soft: rgba(53, 94, 116, 0.1);
  --callout-key: #6e5532;
  --callout-key-soft: rgba(110, 85, 50, 0.12);
  --callout-action: #2f6a52;
  --callout-action-soft: rgba(47, 106, 82, 0.12);
  --callout-warning: #8d4e37;
  --callout-warning-soft: rgba(141, 78, 55, 0.13);
  --callout-source: #4f4f73;
  --callout-source-soft: rgba(79, 79, 115, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  color: var(--text);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  background:
    radial-gradient(1200px 600px at 18% 4%, rgba(68, 111, 142, 0.16), transparent 60%),
    radial-gradient(900px 520px at 84% 0%, rgba(140, 126, 81, 0.14), transparent 50%),
    var(--bg);
}

.shell {
  width: min(1080px, 92vw);
  margin-inline: auto;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.2rem;
  padding: 1.2rem 0 0.8rem;
}

.identity {
  display: grid;
  gap: 0.2rem;
}

.brand {
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.tagline {
  color: var(--muted);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.top-nav a {
  color: var(--accent);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.64);
  border-radius: 999px;
  padding: 0.36rem 0.78rem;
  text-decoration: none;
  font-size: 0.94rem;
}

.container {
  margin: 0.5rem auto 3rem;
}

.hero {
  background: linear-gradient(145deg, #fffdf8, #f5f2ea);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 18px;
  padding: 1.6rem;
}

.hero h1 {
  margin: 0.25rem 0 0.4rem;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(1.5rem, 4.2vw, 2.28rem);
  line-height: 1.25;
  letter-spacing: 0.01em;
}

.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 44rem;
  line-height: 1.7;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.actions {
  margin-top: 1rem;
}

.btn {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 10px;
  padding: 0.52rem 0.94rem;
  font-weight: 600;
}

.page-head {
  margin: 0.3rem 0 1rem;
}

.page-head h1 {
  margin: 0.24rem 0 0;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(1.4rem, 3.6vw, 2.1rem);
}

section {
  margin-top: 1.2rem;
}

.prose-block {
  color: var(--muted);
  line-height: 1.8;
}

.prose-block > :first-child {
  margin-top: 0;
}

.prose-block > :last-child {
  margin-bottom: 0;
}

h2 {
  margin: 0 0 0.74rem;
  font-size: 1.1rem;
}

.card-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.72rem;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.card-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.card-link {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.7rem;
  color: var(--text);
  text-decoration: none;
  padding: 0.84rem 0.94rem;
}

.card-copy {
  display: grid;
  gap: 0.26rem;
}

.card-title {
  font-weight: 700;
}

.card-summary {
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  color: var(--accent);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.card-link .arrow {
  color: var(--accent);
  font-size: 1.15rem;
  padding-top: 0.15rem;
}

.doc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.54);
  border-radius: 10px;
}

.doc-list li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--line);
}

.doc-list li:last-child {
  border-bottom: 0;
}

.doc-list a {
  color: var(--accent-strong);
  text-decoration: none;
}

.doc-row-main {
  min-width: 0;
  flex: 1;
}

.doc-row-title {
  display: inline-block;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.doc-row-summary {
  margin: 0.48rem 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.doc-row-side {
  flex-shrink: 0;
  padding-top: 0.12rem;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  border-radius: 999px;
  padding: 0.08rem 0.62rem;
  border: 1px solid rgba(31, 66, 93, 0.14);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.84);
}

.badge-book {
  color: var(--accent-strong);
  background: rgba(47, 91, 124, 0.08);
}

.badge-status-draft {
  color: #7a5534;
  background: rgba(152, 108, 66, 0.12);
}

.badge-status-active {
  color: #245d48;
  background: rgba(36, 93, 72, 0.12);
}

.badge-status-review {
  color: #6b4f16;
  background: rgba(166, 133, 45, 0.14);
}

.badge-status-archived {
  color: #4d5966;
  background: rgba(77, 89, 102, 0.12);
}

.badge-evidence {
  color: #455472;
  background: rgba(69, 84, 114, 0.1);
}

.badge-confidence-low {
  color: #8d4e37;
  background: rgba(141, 78, 55, 0.12);
}

.badge-confidence-medium {
  color: #5d5b1f;
  background: rgba(125, 119, 39, 0.13);
}

.badge-confidence-high {
  color: #245d48;
  background: rgba(36, 93, 72, 0.12);
}

.meta,
.source {
  color: var(--muted);
  font-size: 0.9rem;
}

.doc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 1.1rem;
  align-items: start;
}

.doc-layout-single {
  grid-template-columns: minmax(0, 1fr);
}

.doc {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1.4rem;
}

.doc-main {
  min-width: 0;
}

.doc h1 {
  margin: 0.15rem 0 0.5rem;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(1.45rem, 3.4vw, 2.05rem);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.36rem;
  margin-bottom: 0.7rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb-sep {
  opacity: 0.58;
}

.page-context {
  display: grid;
  gap: 0.15rem;
  margin-top: 0.7rem;
}

.page-context .meta,
.page-context .source {
  margin: 0;
}

.doc-content {
  margin-top: 1rem;
}

.doc-content p,
.doc-content li {
  font-family: "Noto Serif SC", serif;
  line-height: 1.84;
  font-size: 1.03rem;
}

.doc-content h2,
.doc-content h3,
.doc-content h4 {
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  margin-top: 1.4rem;
}

.doc-content blockquote {
  margin: 1rem 0;
  padding: 0.6rem 1rem;
  border-left: 3px solid var(--accent);
  background: rgba(47, 91, 124, 0.08);
  border-radius: 0 8px 8px 0;
}

.doc-style-key-sentences .doc-content > h2:first-of-type {
  margin-top: 0.9rem;
}

.sentence-card {
  position: relative;
  margin: 1.15rem 0;
  padding: 0.95rem 1.05rem 1rem 1.1rem;
  border: 1px solid rgba(47, 91, 124, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(250, 248, 242, 0.96)),
    linear-gradient(135deg, rgba(47, 91, 124, 0.06), rgba(110, 85, 50, 0.06));
  box-shadow: 0 14px 32px rgba(32, 39, 45, 0.06);
  overflow: hidden;
}

.sentence-card::before {
  content: "“";
  position: absolute;
  right: 0.9rem;
  top: 0.2rem;
  font-family: "Noto Serif SC", serif;
  font-size: 5rem;
  line-height: 1;
  color: rgba(47, 91, 124, 0.1);
  pointer-events: none;
}

.sentence-card-head {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 0.55rem;
}

.sentence-card-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.35rem;
  height: 2.35rem;
  border-radius: 999px;
  border: 1px solid rgba(47, 91, 124, 0.2);
  background: rgba(255, 255, 255, 0.9);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  box-shadow: 0 8px 20px rgba(31, 66, 93, 0.08);
}

.sentence-card-quote {
  position: relative;
  z-index: 1;
}

.sentence-card-quote > :first-child {
  margin-top: 0;
}

.sentence-card-quote > :last-child {
  margin-bottom: 0;
}

.sentence-card-quote p {
  margin: 0;
  color: var(--text);
  font-family: "Noto Serif SC", serif;
  font-size: clamp(1.12rem, 2vw, 1.34rem);
  line-height: 1.72;
  font-weight: 600;
  text-wrap: pretty;
}

.sentence-card-body {
  margin-top: 0.85rem;
  padding-top: 0.8rem;
  border-top: 1px dashed rgba(47, 91, 124, 0.18);
}

.sentence-card-body > :first-child {
  margin-top: 0;
}

.sentence-card-body > :last-child {
  margin-bottom: 0;
}

.sentence-card-body p,
.sentence-card-body li {
  color: var(--muted);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  font-size: 0.98rem;
  line-height: 1.8;
}

.callout {
  --callout-ink: var(--callout-note);
  --callout-surface: var(--callout-note-soft);
  margin: 1.25rem 0;
  padding: 0.95rem 1rem 1rem 1.1rem;
  border: 1px solid color-mix(in srgb, var(--callout-ink) 18%, white);
  border-left: 5px solid var(--callout-ink);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.58)),
    var(--callout-surface);
  box-shadow: 0 10px 24px rgba(28, 35, 42, 0.05);
}

.callout-note {
  --callout-ink: var(--callout-note);
  --callout-surface: var(--callout-note-soft);
}

.callout-key {
  --callout-ink: var(--callout-key);
  --callout-surface: var(--callout-key-soft);
}

.callout-action {
  --callout-ink: var(--callout-action);
  --callout-surface: var(--callout-action-soft);
}

.callout-warning {
  --callout-ink: var(--callout-warning);
  --callout-surface: var(--callout-warning-soft);
}

.callout-source {
  --callout-ink: var(--callout-source);
  --callout-surface: var(--callout-source-soft);
}

.callout-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.55rem;
  margin-bottom: 0.5rem;
}

.callout-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--callout-ink);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.callout-label::before {
  content: "";
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 999px;
  background: var(--callout-ink);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--callout-ink) 16%, white);
}

.callout-subtitle {
  color: var(--muted);
  font-size: 0.92rem;
}

.callout-body > :first-child {
  margin-top: 0;
}

.callout-body > :last-child {
  margin-bottom: 0;
}

.callout-body p,
.callout-body li {
  color: color-mix(in srgb, var(--text) 88%, var(--callout-ink));
}

.callout-body code {
  background: color-mix(in srgb, var(--callout-ink) 10%, white);
}

.doc-content code {
  background: rgba(31, 66, 93, 0.08);
  padding: 0.12rem 0.3rem;
  border-radius: 5px;
}

.doc-content pre code {
  display: block;
  padding: 0.8rem;
  overflow: auto;
}

.doc-side {
  position: sticky;
  top: 1rem;
}

.toc-panel {
  background: rgba(255, 253, 248, 0.9);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 0.95rem 1rem;
}

.toc-panel .eyebrow {
  margin-bottom: 0.55rem;
}

.toc-panel nav ul {
  margin: 0;
  padding-left: 1rem;
}

.toc-panel li {
  margin: 0.36rem 0;
  color: var(--muted);
}

.toc-panel a {
  color: var(--accent-strong);
  text-decoration: none;
  line-height: 1.55;
}

.sequence-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.sequence-link {
  display: grid;
  gap: 0.2rem;
  min-height: 100%;
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
  color: var(--text);
  text-decoration: none;
}

.sequence-label {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sequence-link-section {
  text-align: center;
}

.sequence-link-next {
  text-align: right;
}

@media (max-width: 760px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .doc-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .doc-side {
    position: static;
  }

  .doc-list li {
    flex-direction: column;
    align-items: flex-start;
  }

  .doc-row-side {
    padding-top: 0;
  }

  .sequence-nav {
    grid-template-columns: minmax(0, 1fr);
  }

  .sequence-link-section,
  .sequence-link-next {
    text-align: left;
  }

  .callout {
    padding-inline: 0.9rem;
  }

  .hero {
    padding: 1.15rem 1rem;
    border-radius: 16px;
  }

  .card-link {
    padding: 0.78rem 0.82rem;
  }

  .card-summary {
    -webkit-line-clamp: 2;
    font-size: 0.9rem;
  }

  .badge-row {
    gap: 0.3rem;
  }

  .badge {
    min-height: 1.68rem;
    padding: 0.02rem 0.5rem;
    font-size: 0.72rem;
  }

  .sentence-card {
    margin: 0.9rem 0;
    padding: 0.82rem 0.82rem 0.88rem 0.85rem;
    border-radius: 14px;
  }

  .sentence-card::before {
    right: 0.45rem;
    top: 0.1rem;
    font-size: 3.4rem;
  }

  .sentence-card-head {
    margin-bottom: 0.48rem;
  }

  .sentence-card-no {
    min-width: 2rem;
    height: 2rem;
    font-size: 0.74rem;
  }

  .sentence-card-quote p {
    font-size: 1rem;
    line-height: 1.64;
  }

  .sentence-card-body {
    margin-top: 0.7rem;
    padding-top: 0.68rem;
  }

  .sentence-card-body p,
  .sentence-card-body li {
    font-size: 0.92rem;
    line-height: 1.72;
  }
}
