:root {
  --brand: #a9714a;
  --brand-dark: #82502f;
  --brand-soft: #f6eee7;
  --ink: #232a31;
  --body: #3d4650;
  --muted: #66727d;
  --line: #e8e1d9;
  --bg: #fbf9f6;
  --card: #ffffff;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --max: 1080px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 15% -10%, #f7eee7 0%, rgba(247, 238, 231, 0) 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--brand-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(100% - 40px, var(--max));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  height: 68px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #fff;
}

.brand-name {
  font-size: 1.18rem;
  font-weight: 750;
  letter-spacing: -0.025em;
}

.nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav a {
  padding: 8px 13px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 550;
}

.nav a:hover {
  background: var(--brand-soft);
  color: var(--brand-dark);
  text-decoration: none;
}

.nav a[aria-current="page"] {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.page-hero {
  padding: 56px 0 24px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: clamp(2.1rem, 4.4vw, 3rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.subtitle {
  max-width: 64ch;
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 550;
}

.chip-link {
  border-color: #e2d2c4;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 650;
}

.button-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 17px;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 650;
}

.button-link:hover {
  background: var(--brand-dark);
  text-decoration: none;
}

.layout {
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
  align-items: start;
  gap: 34px;
  padding: 18px 0 76px;
}

.toc {
  position: sticky;
  top: 92px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  font-size: 0.85rem;
}

.toc-title {
  margin: 0 0 10px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.toc ol {
  margin: 0;
  padding-left: 17px;
  color: var(--muted);
}

.toc li {
  margin: 6px 0;
}

.toc a {
  color: var(--muted);
}

.toc a:hover {
  color: var(--brand-dark);
}

.doc {
  padding: clamp(24px, 4vw, 48px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  box-shadow:
    0 1px 2px rgba(35, 42, 49, 0.03),
    0 24px 60px -38px rgba(35, 42, 49, 0.22);
}

.doc section {
  scroll-margin-top: 92px;
}

.doc h2 {
  margin: 2.1em 0 0.55em;
  font-family: var(--serif);
  font-size: 1.46rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.doc section:first-of-type h2 {
  margin-top: 0;
}

.doc h3 {
  margin: 1.5em 0 0.35em;
  font-size: 1.02rem;
  font-weight: 650;
}

.doc p,
.doc li {
  color: var(--body);
}

.doc ul,
.doc ol {
  margin: 0.6em 0;
  padding-left: 1.3em;
}

.doc li {
  margin: 0.4em 0;
}

.doc strong {
  color: var(--ink);
}

.doc code {
  padding: 1px 5px;
  border-radius: 5px;
  background: #f4f1ed;
  font-size: 0.88em;
}

.notice {
  margin: 20px 0;
  padding: 14px 16px;
  border: 1px solid #ebdfd5;
  border-radius: 14px;
  background: var(--brand-soft);
  color: #594636;
  font-size: 0.92rem;
}

.notice strong {
  color: #4a3626;
}

.tablewrap {
  margin: 16px 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.91rem;
}

th,
td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #fbf8f5;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: none;
}

.contact-box {
  margin-top: 26px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fcfaf8;
}

.contact-box p {
  margin: 0.25em 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-weight: 650;
}

.footer-brand img {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: #fff;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.landing-hero {
  padding: 88px 0 44px;
  text-align: center;
}

.landing-hero h1 {
  max-width: 18ch;
  margin-inline: auto;
}

.landing-hero .subtitle {
  margin-inline: auto;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding-bottom: 84px;
}

.card-link {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  color: var(--ink);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.card-link:hover {
  transform: translateY(-2px);
  border-color: #d9c7b8;
  box-shadow: 0 18px 40px -28px rgba(35, 42, 49, 0.35);
  text-decoration: none;
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 700;
}

.card-link h2 {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card-link p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.card-link .card-more {
  margin-top: auto;
  padding-top: 8px;
  color: var(--brand-dark);
  font-size: 0.85rem;
  font-weight: 650;
}

.landing-note {
  margin: 0 auto 84px;
  max-width: 620px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--muted);
  font-size: 0.89rem;
  text-align: center;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .toc {
    position: static;
  }

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

@media (max-width: 620px) {
  .container {
    width: min(100% - 32px, var(--max));
  }

  .header-inner {
    height: 62px;
    gap: 10px;
  }

  .brand img {
    width: 30px;
    height: 30px;
  }

  .brand-name {
    font-size: 1.05rem;
  }

  .nav a {
    padding: 7px 9px;
    font-size: 0.82rem;
  }

  .page-hero {
    padding-top: 40px;
  }

  .doc {
    border-radius: 18px;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media print {
  .site-header,
  .toc,
  .site-footer {
    display: none;
  }

  body {
    background: #fff;
  }

  .doc {
    border: none;
    box-shadow: none;
    padding: 0;
  }
}
