/* Bindery — legal site
   Brand: deep teal #0F3B3E, orange #E8935A, cream #EFE9DC */

:root {
  --bg: #ffffff;
  --surface: #faf7f1;
  --ink: #122f31;
  --ink-soft: #46605f;
  --ink-faint: #7a8e8d;
  --rule: #e4e0d6;
  --rule-strong: #cfc9ba;
  --accent: #0e5c61;
  --accent-ink: #0f3b3e;
  --orange: #e8935a;
  --cream: #efe9dc;
  --footer-bg: #0f3b3e;
  --footer-ink: #bdcfcd;
  --footer-head: #efe9dc;
  --chip: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b2224;
    --surface: #102e30;
    --ink: #e9e4d8;
    --ink-soft: #b4c4c2;
    --ink-faint: #859896;
    --rule: #1d4245;
    --rule-strong: #2b585b;
    --accent: #7fc9cc;
    --accent-ink: #a7dedf;
    --orange: #e8935a;
    --cream: #1a3b3d;
    --footer-bg: #071a1b;
    --footer-ink: #93a8a6;
    --footer-head: #e9e4d8;
    --chip: #ffffff;
  }
}

:root[data-theme="dark"] {
  --bg: #0b2224;
  --surface: #102e30;
  --ink: #e9e4d8;
  --ink-soft: #b4c4c2;
  --ink-faint: #859896;
  --rule: #1d4245;
  --rule-strong: #2b585b;
  --accent: #7fc9cc;
  --accent-ink: #a7dedf;
  --orange: #e8935a;
  --cream: #1a3b3d;
  --footer-bg: #071a1b;
  --footer-ink: #93a8a6;
  --footer-head: #e9e4d8;
  --chip: #ffffff;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- header ---------- */

.site-head {
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  box-shadow: inset 0 -3px 0 -2px var(--orange);
}

.head-inner {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0.85rem 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  flex: none;
}

.brand-text {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.brand-text span {
  display: block;
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  font-size: 0.925rem;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.15rem 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover { color: var(--accent-ink); }

.site-nav a[aria-current="page"] {
  color: var(--accent);
  font-weight: 600;
  border-bottom-color: var(--orange);
}

/* ---------- content ---------- */

main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 46rem;
  margin: 0 auto;
  padding: 2.75rem 16px 4rem;
}

h1 {
  font-size: 1.95rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.4rem;
  color: var(--accent-ink);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) h1 { color: var(--ink); }
}

:root[data-theme="dark"] h1 { color: var(--ink); }

h2 {
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  margin: 2.4rem 0 0.6rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--rule);
}

h2:first-of-type { margin-top: 2rem; }

h3 {
  font-size: 1rem;
  margin: 1.5rem 0 0.4rem;
}

p, ul, ol { margin: 0 0 1rem; }

ul, ol { padding-left: 1.4rem; }

li { margin-bottom: 0.4rem; }

a { color: var(--accent); }

a:hover { color: var(--accent-ink); }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.05em 0.35em;
}

.meta {
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin-bottom: 2rem;
}

.lede {
  font-size: 1.075rem;
  color: var(--ink-soft);
}

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--orange);
  border-radius: 10px;
  padding: 1.4rem 1.5rem;
  margin: 0 0 1.5rem;
}

.card h2, .card h3 { margin-top: 0; border-top: 0; padding-top: 0; }

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

.entity {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin: 0;
}

.entity dt {
  font-weight: 600;
  color: var(--ink);
  margin-top: 0.7rem;
}

.entity dt:first-child { margin-top: 0; }

.entity dd { margin: 0; }

.caps {
  text-transform: uppercase;
  font-size: 0.925rem;
  letter-spacing: 0.01em;
}

.doc-links {
  list-style: none;
  padding: 0;
}

.doc-links li { margin-bottom: 0.7rem; }

.doc-links > li > a { font-weight: 600; }

.doc-links span {
  display: block;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 0 0 1.25rem;
}

th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.75rem 0.55rem 0;
  border-bottom: 1px solid var(--rule);
}

th { font-weight: 600; }

.card table { margin-bottom: 0; }

.card table tr:last-child th,
.card table tr:last-child td { border-bottom: 0; }

/* ---------- footer ---------- */

.site-foot {
  background: var(--footer-bg);
  color: var(--footer-ink);
  font-size: 0.825rem;
  line-height: 1.6;
  margin-top: auto;
  border-top: 3px solid var(--orange);
}

.foot-inner {
  max-width: 68rem;
  margin: 0 auto;
  padding: 2rem 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  align-items: flex-start;
}

.foot-brand {
  background: var(--chip);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  flex: none;
  line-height: 0;
}

.foot-brand img {
  display: block;
  width: 150px;
  height: auto;
}

.foot-text {
  flex: 1 1 22rem;
  min-width: 0;
}

.foot-text p { margin: 0 0 0.6rem; }

.foot-text p:last-child { margin-bottom: 0; }

.foot-text strong { color: var(--footer-head); }

.site-foot a { color: #d6e2e0; }

.site-foot a:hover { color: #ffffff; }

@media (max-width: 460px) {
  h1 { font-size: 1.65rem; }
  .brand-text { font-size: 1.1rem; }
  .foot-brand img { width: 128px; }
}

@media print {
  body { background: #fff; color: #000; }
  .site-head, .site-foot { display: none; }
  main { max-width: none; padding: 0; }
  a { color: #000; text-decoration: underline; }
  h1 { color: #000; }
  h2 { page-break-after: avoid; }
  .card { border-left-color: #999; }
}
