@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&family=Source+Serif+4:opsz,wght@8..60,400;8..60,600;8..60,700&display=swap");

:root {
  --bg: #ebe4d8;
  --paper: #fbf8f3;
  --ink: #1b1916;
  --muted: #5c564c;
  --line: #ddd4c6;
  --accent: #8d2f22;
  --pine: #1d4743;
  --sand: #f3e6c8;
  --card: #fffdf9;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: Manrope, "Segoe UI", sans-serif;
  --wrap: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 320px),
    var(--bg);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
}
img { max-width: 100%; height: auto; display: block; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--pine); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: #e7c7a2; }

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--paper);
  padding: 8px 12px;
  z-index: 50;
}
.skip:focus { top: 12px; }

.wrap { width: min(var(--wrap), calc(100% - 32px)); margin: 0 auto; }
.kicker {
  margin: 0 0 8px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(251, 248, 243, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 74px;
  flex-wrap: wrap;
  padding: 8px 0;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  margin-right: auto;
}
.logo img { width: 36px; height: 36px; }
.logo-name {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
}
.logo-name small {
  display: block;
  margin-top: 3px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.search-open, .nav-toggle-label, .btn, .tool button {
  font-family: var(--sans);
  font-weight: 700;
  min-height: 44px;
  border: 1px solid var(--ink);
  background: var(--paper);
  padding: 8px 14px;
  cursor: pointer;
}
.btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  background: var(--pine);
  color: #fbf8f3;
  border-color: var(--pine);
}
.btn.alt { background: transparent; color: var(--ink); }
.menu { width: 100%; }
.nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.nav-toggle-label { width: max-content; }
.nav-top {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 10px;
  text-decoration: none;
  color: inherit;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
}
.site-nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 0 4px; }
.nav-item { position: relative; }
.nav-drop {
  display: none;
  background: var(--card);
  border: 1px solid var(--ink);
  padding: 8px;
  min-width: 280px;
  max-height: 70vh;
  overflow: auto;
  z-index: 25;
}
.nav-drop a, .drop-label {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 7px 8px;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.35;
}
.nav-drop a:hover { background: var(--sand); }
.drop-all { font-weight: 700; color: var(--pine); }
.drop-label {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.search-pop[hidden] { display: none; }
.search-pop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(27, 25, 22, 0.46);
  display: flex;
  justify-content: center;
  padding: 12vh 16px 16px;
}
.search-box {
  width: min(720px, 100%);
  background: var(--card);
  border: 1px solid var(--ink);
  padding: 12px;
  align-self: flex-start;
}
.search-input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 12px 4px;
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 700;
}
.search-results { list-style: none; margin: 8px 0 0; padding: 0; max-height: 48vh; overflow: auto; }
.search-results a {
  display: block;
  padding: 10px 4px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 15px;
}
.search-results span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 0;
  list-style: none;
  padding: 18px 0 0;
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
}
.crumbs li:not(:last-child)::after { content: "/"; margin: 0 8px; color: var(--muted); }
.crumbs span { color: var(--muted); }

.hero, .page-head { padding: 28px 0 10px; }
.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 36px;
  align-items: end;
}
.hero h1, .page-head h1, .article-head h1 {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.08;
  font-weight: 600;
  margin: 0 0 14px;
  letter-spacing: -0.03em;
}
.deck, .page-head .deck { font-size: 20px; margin: 0 0 18px; max-width: 40rem; }
.hero-actions, .inline-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero figure, .shot figure { margin: 0; }
.hero figcaption, .shot figcaption, figure figcaption {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}
.band { padding: 22px 0 8px; }
.band h2, .related h2, .cat-block h2 {
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.15;
  margin: 0 0 14px;
  font-weight: 600;
}
.grid-3, .grid-4, .related-grid, .shot-grid {
  display: grid;
  gap: 14px;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.shot-grid { grid-template-columns: repeat(3, 1fr); }
.card, .cat-card {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 16px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100%;
}
.card:hover, .cat-card:hover, .cat-item:hover { border-color: var(--pine); }
.card strong, .cat-card strong, .cat-item h2, .cat-item h3 {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.25;
  font-weight: 600;
}
.card span, .meta, .cat-card span, .cat-item p, .footer-note {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--muted);
  line-height: 1.45;
}
.home-prose {
  background: var(--paper);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 8px 0 24px;
}
.home-prose p { max-width: 48rem; }

.cat-list { display: flex; flex-direction: column; gap: 10px; }
.cat-item {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 14px 16px;
}
.cat-item h2, .cat-item h3 { margin: 0 0 6px; font-size: 24px; }
.cat-item a { text-decoration: none; }
.cat-item a:hover { text-decoration: underline; }

.article-head { padding-top: 12px; }
.article-head h1 { max-width: 22em; }
.byline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 8px;
}
.figures { display: grid; gap: 14px; margin: 8px 0 18px; }
.figures figure {
  margin: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 10px;
}
.article-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 32px;
  align-items: start;
}
.article-grid .prose { grid-column: 1; }
.article-grid .toc { grid-column: 2; }
.prose { max-width: 68ch; }
.prose > p:first-of-type { font-size: 1.18rem; }
.prose h2 { font-size: 1.7rem; line-height: 1.2; margin: 2rem 0 0.7rem; scroll-margin-top: 96px; }
.prose h3 { font-size: 1.25rem; line-height: 1.3; margin: 1.4rem 0 0.4rem; scroll-margin-top: 96px; }
.prose p { margin: 0 0 1rem; }
.prose ul, .prose ol { margin: 0 0 1rem; padding-left: 1.2rem; }
.prose li { margin: 0.3rem 0; }
.prose li::marker { color: var(--accent); }
.prose a { text-underline-offset: 3px; }
.note {
  background: var(--sand);
  border-left: 3px solid var(--accent);
  padding: 12px 14px;
  margin: 0 0 1rem;
}
.note p { margin: 0; }
.table-wrap { overflow-x: auto; margin: 0 0 1rem; }
table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 15px; background: var(--card); }
th, td { border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; padding: 8px; }
th { font-size: 12px; letter-spacing: 0.03em; color: var(--muted); }
.toc {
  position: sticky;
  top: 92px;
  font-family: var(--sans);
  font-size: 14px;
  border-top: 2px solid var(--ink);
  padding-top: 10px;
}
.toc strong { display: block; margin-bottom: 8px; }
.toc ol { margin: 0; padding-left: 18px; }
.toc a { text-decoration: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 18px; }
.chips a {
  font-family: var(--sans);
  font-size: 13px;
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 6px 8px;
}
.related { padding: 10px 0 36px; }
.related-grid { grid-template-columns: repeat(3, 1fr); }

.tool {
  background: var(--card);
  border: 1px solid var(--ink);
  padding: 14px;
  margin: 0 0 1.2rem;
}
.tool h2, .tool h3 { margin: 0 0 8px; font-size: 1.3rem; }
.fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}
.fields label, .tool-note, .calc-out, .saved-list {
  font-family: var(--sans);
  font-size: 14px;
}
.fields label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
.fields input, .fields select {
  border: 1px solid #cfc6b6;
  background: #fff;
  padding: 10px;
  min-height: 44px;
  font-weight: 600;
}
.tool .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.calc-out { margin-top: 12px; background: var(--sand); padding: 12px 14px; }
.calc-out.is-error { background: #f6d6d0; }
.calc-out strong { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; }
.planner canvas { width: 100%; height: auto; background: #fff; border: 1px solid var(--line); margin-top: 12px; touch-action: none; }
.tool button.is-on { background: var(--pine); color: #fbf8f3; border-color: var(--pine); }
.saved-list { margin: 10px 0 0; padding-left: 18px; }

.site-footer {
  background: #1b1916;
  color: #f3efe6;
  margin-top: 20px;
  padding: 32px 0 20px;
}
.site-footer a { color: #f3efe6; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 22px; }
.footer-name { font-family: var(--serif); font-size: 28px; margin: 0 0 8px; }
.footer-grid p, .footer-grid a, .footer-legal { font-family: var(--sans); font-size: 14px; line-height: 1.45; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin: 6px 0; }
.footer-legal { border-top: 1px solid rgba(243, 239, 230, 0.2); margin-top: 22px; padding-top: 14px; color: #d9d0c3; }

@media (min-width: 900px) {
  .nav-toggle-label { display: none; }
  .nav-drop { position: absolute; top: 100%; left: 0; }
  .nav-item:hover > .nav-drop,
  .nav-item:focus-within > .nav-drop { display: block; }
}
@media (max-width: 899px) {
  .logo { margin-right: 8px; }
  .search-open { margin-left: auto; }
  .hero, .article-grid, .grid-3, .grid-4, .shot-grid, .related-grid, .footer-grid { grid-template-columns: 1fr; }
  .toc { position: static; margin-bottom: 8px; }
  .article-grid { display: flex; flex-direction: column; }
  .toc { order: -1; }
  .article-head h1 { max-width: none; }
  .site-nav { display: none; flex-direction: column; }
  .nav-toggle:checked ~ .site-nav { display: flex; }
  .nav-toggle:checked ~ .site-nav .nav-drop { display: block; position: static; border: 0; max-height: none; }
}
@media (max-width: 640px) {
  body { font-size: 17px; }
  .wrap { width: min(var(--wrap), calc(100% - 20px)); }
}
@media print {
  .site-header, .site-footer, .toc, .related, .search-open, .crumbs, .hero-actions { display: none !important; }
  body { background: #fff; }
  .article-grid { display: block; }
  a { color: #000; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
