:root {
  color-scheme: light;
  --canvas: #f5f1e8;
  --canvas-deep: #ebe2cf;
  --surface: #fffaf0;
  --ink: #040e1f;
  --navy: #081f34;
  --navy-soft: #183a54;
  --steel: #345f7a;
  --steel-light: #8fb1bf;
  --mist: #d7e5e7;
  --brass: #b9904a;
  --brass-dark: #876833;
  --oxblood: #742c36;
  --hairline: rgba(8, 31, 52, 0.18);
  --hairline-strong: rgba(8, 31, 52, 0.4);
  --shadow: 0 18px 48px rgba(4, 14, 31, 0.12);
  --max: 980px;
  --radius: 12px;
  font-family: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  background: var(--canvas);
  color: var(--ink);
  line-height: 1.55;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 8%, rgba(143, 177, 191, 0.18), transparent 26rem),
    radial-gradient(circle at 88% 0%, rgba(185, 144, 74, 0.12), transparent 22rem),
    var(--canvas);
  color: var(--ink);
}

a { color: var(--steel); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brass-dark); }
code, .mono {
  font-family: "JetBrains Mono", ui-monospace, Menlo, monospace;
  font-size: 0.9em;
  background: rgba(52, 95, 122, 0.1);
  border: 1px solid rgba(52, 95, 122, 0.18);
  padding: 0.05rem 0.28rem;
  border-radius: 4px;
}
img { max-width: 100%; height: auto; display: block; }

.docs-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.7rem 1.25rem;
  background: rgba(255, 250, 240, 0.92);
  border-bottom: 1px solid var(--hairline);
  backdrop-filter: blur(8px);
}
.docs-brand {
  display: flex; align-items: center; gap: 0.7rem;
  color: var(--navy); text-decoration: none; font-weight: 650;
}
.docs-brand img { width: 34px; height: 34px; border-radius: 6px; }
.docs-brand span { font-family: "Cormorant SC", "Palatino Linotype", serif; font-size: 1.15rem; letter-spacing: 0.03em; }
.docs-nav { display: flex; flex-wrap: wrap; gap: 0.85rem; font-size: 0.92rem; }
.docs-nav a { color: var(--navy-soft); text-decoration: none; }
.docs-nav a:hover, .docs-nav a[aria-current="page"] { color: var(--brass-dark); }

.docs-shell { max-width: var(--max); margin: 0 auto; padding: 1.6rem 1.25rem 3.5rem; }
.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--brass-dark);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
}
h1, h2, h3 {
  font-family: "Cormorant SC", "Palatino Linotype", Georgia, serif;
  color: var(--navy);
  line-height: 1.2;
  font-weight: 600;
}
h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin: 0.2rem 0 0.8rem; }
h2 { font-size: 1.55rem; margin: 2rem 0 0.65rem; border-bottom: 1px solid var(--hairline); padding-bottom: 0.35rem; }
h3 { font-size: 1.2rem; margin: 1.4rem 0 0.45rem; }
p, li { font-size: 1.02rem; }
.lead { font-size: 1.12rem; color: var(--navy-soft); }

.toc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.9rem;
  margin: 1.4rem 0 2rem;
}
.toc-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 1rem 1.05rem;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.toc-card:hover { border-color: var(--brass); transform: translateY(-1px); color: inherit; }
.toc-card strong { display: block; color: var(--navy); margin-bottom: 0.25rem; }
.toc-card span { color: var(--navy-soft); font-size: 0.94rem; }

.callout {
  background: rgba(143, 177, 191, 0.16);
  border-left: 3px solid var(--steel);
  border-radius: 0 10px 10px 0;
  padding: 0.85rem 1rem;
  margin: 1rem 0 1.3rem;
}
.callout.warn {
  background: rgba(185, 144, 74, 0.14);
  border-left-color: var(--brass);
}
.callout strong { color: var(--navy); }

.figure {
  margin: 1.25rem 0 1.6rem;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 0.85rem;
  box-shadow: var(--shadow);
}
.figure figcaption {
  margin-top: 0.65rem;
  font-size: 0.92rem;
  color: var(--navy-soft);
}
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.pair .shot {
  border: 1px solid var(--hairline);
  border-radius: 8px;
  overflow: hidden;
  background: #ddd;
}
.pair .shot img { width: 100%; }
.pair .label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.35rem 0.5rem;
  color: var(--navy);
  background: var(--canvas-deep);
  border-bottom: 1px solid var(--hairline);
}
.pair .label.dark { background: #1c2a36; color: #d7e5e7; }

.steps { counter-reset: step; list-style: none; padding: 0; }
.steps > li {
  position: relative;
  margin: 0 0 0.85rem;
  padding: 0.85rem 1rem 0.85rem 3.2rem;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 10px;
}
.steps > li::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 0.85rem; top: 0.9rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  color: var(--brass-dark);
  font-weight: 700;
}

.matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  margin: 1rem 0 1.5rem;
  background: var(--surface);
}
.matrix th, .matrix td {
  border: 1px solid var(--hairline);
  padding: 0.35rem 0.4rem;
  text-align: center;
}
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.matrix th { background: var(--canvas-deep); color: var(--navy); }
.matrix .p { color: var(--brass-dark); font-weight: 700; }

.pager {
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: 2.4rem; padding-top: 1rem;
  border-top: 1px solid var(--hairline);
  font-size: 0.95rem;
}
.docs-footer {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--hairline);
  color: var(--navy-soft);
  font-size: 0.88rem;
}

@media (max-width: 820px) {
  .pair { grid-template-columns: 1fr; }
  .docs-header { flex-direction: column; align-items: flex-start; }
}
@media print {
  .docs-header { position: static; }
  .figure { break-inside: avoid; box-shadow: none; }
  a { text-decoration: none; color: inherit; }
}
