/*
  BusiMana, Inc. — shared design system
  Concept: "The Business Almanac" — a working field-guide to running a
  business, stamped with the BusiMana bee. Honeycomb structure, ledger
  rules, wax-seal badges.
*/

/* ---------- Fonts (self-hosted, latin subset) ---------- */
@font-face {
  font-family: "Zilla Slab";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/zilla-slab-700.woff2") format("woff2");
}
@font-face {
  font-family: "Zilla Slab";
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/zilla-slab-700italic.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/plex-sans-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/plex-sans-600.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/plex-mono-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/plex-mono-500.woff2") format("woff2");
}

/* ---------- Tokens ---------- */
:root {
  --paper: #fbf2e1;
  --paper-raised: #f4e6c8;
  --paper-sunken: #eeddb6;
  --ink: #221a0f;
  --ink-soft: #5e4b34;
  --line: #dcc79e;
  --honey: #de9f2e;
  --honey-deep: #a9631c;
  --honey-tint: #f6e2b8;
  --wax: #8b3a2b;
  --wax-tint: #f1ddd3;

  --shadow: 0 1px 2px rgba(34, 26, 15, 0.06), 0 8px 24px -12px rgba(34, 26, 15, 0.28);
  --radius-s: 6px;
  --radius-m: 12px;
  --radius-l: 20px;

  --container: 1180px;
  --gutter: clamp(1.25rem, 4vw, 3rem);

  --font-display: "Zilla Slab", Georgia, "Times New Roman", serif;
  --font-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --fs-eyebrow: 0.78rem;
  --fs-small: 0.9rem;
  --fs-body: 1.05rem;
  --fs-h4: clamp(1.15rem, 1.05rem + 0.4vw, 1.35rem);
  --fs-h3: clamp(1.45rem, 1.2rem + 1vw, 1.9rem);
  --fs-h2: clamp(1.9rem, 1.5rem + 1.6vw, 2.6rem);
  --fs-h1: clamp(2.4rem, 1.7rem + 3vw, 4rem);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1b1409;
    --paper-raised: #251c0f;
    --paper-sunken: #150f07;
    --ink: #f3e7ce;
    --ink-soft: #c9b48c;
    --line: #3d2e17;
    --honey: #f0b93f;
    --honey-deep: #c97f22;
    --honey-tint: #3a2a12;
    --wax: #d9694c;
    --wax-tint: #3a1f18;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1b1409;
  --paper-raised: #251c0f;
  --paper-sunken: #150f07;
  --ink: #f3e7ce;
  --ink-soft: #c9b48c;
  --line: #3d2e17;
  --honey: #f0b93f;
  --honey-deep: #c97f22;
  --honey-tint: #3a2a12;
  --wax: #d9694c;
  --wax-tint: #3a1f18;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --paper: #fbf2e1;
  --paper-raised: #f4e6c8;
  --paper-sunken: #eeddb6;
  --ink: #221a0f;
  --ink-soft: #5e4b34;
  --line: #dcc79e;
  --honey: #de9f2e;
  --honey-deep: #a9631c;
  --honey-tint: #f6e2b8;
  --wax: #8b3a2b;
  --wax-tint: #f1ddd3;
  color-scheme: light;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.12; margin: 0 0 0.5em; text-wrap: balance; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }
p { margin: 0 0 1em; max-width: 62ch; }
p.wide { max-width: none; }
ul, ol { padding-left: 1.25em; }
:focus-visible { outline: 3px solid var(--honey-deep); outline-offset: 2px; }
::selection { background: var(--honey); color: var(--ink); }

.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(3rem, 6vw, 5.5rem); }
.section-tight { padding-block: clamp(2rem, 4vw, 3rem); }
.stack { display: flex; flex-direction: column; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.55em;
  font-family: var(--font-mono); font-size: var(--fs-eyebrow);
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--honey-deep); font-weight: 500; margin-bottom: 0.9em;
}
.eyebrow::before {
  content: ""; width: 0.62em; height: 0.62em;
  background: var(--honey);
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  flex: none;
}
.lede { font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem); color: var(--ink-soft); max-width: 60ch; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  font-family: var(--font-body); font-weight: 600; font-size: 0.98rem;
  padding: 0.85em 1.5em; border-radius: var(--radius-s);
  border: 1.5px solid transparent; cursor: pointer;
  text-decoration: none; transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  line-height: 1.2;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--honey); color: var(--ink); border-color: var(--honey); }
.btn-primary:hover { background: var(--honey-deep); border-color: var(--honey-deep); color: #fff8ea; }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--honey-deep); color: var(--honey-deep); }
.btn-ghost { background: transparent; color: var(--honey-deep); border-color: transparent; padding-inline: 0.2em; }
.btn-ghost:hover { color: var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: center; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-block: 0.85rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.65rem; text-decoration: none; color: var(--ink); }
.brand img { width: 34px; height: 34px; }
.brand-word { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; letter-spacing: 0.01em; }
.brand-word small { display: block; font-family: var(--font-mono); font-size: 0.6rem; font-weight: 400; letter-spacing: 0.12em; color: var(--ink-soft); text-transform: uppercase; }

.nav-links { display: flex; align-items: center; gap: 1.9rem; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: 0.95rem;
  padding-block: 0.3rem; border-bottom: 2px solid transparent; transition: color 0.15s ease, border-color 0.15s ease;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); border-color: var(--honey); }
.nav-cta { display: flex; align-items: center; gap: 0.75rem; }
.nav-toggle {
  display: none; background: transparent; border: 1.5px solid var(--line); border-radius: var(--radius-s);
  width: 42px; height: 38px; cursor: pointer; align-items: center; justify-content: center;
}
.nav-toggle svg { width: 20px; height: 20px; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 40;
    flex-direction: column; align-items: stretch; gap: 0; background: var(--paper);
    border-bottom: 1px solid var(--line); padding: 0.5rem var(--gutter) 1rem;
    display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding-block: 0.7rem; border-bottom: 1px solid var(--line); }
  .nav-cta .btn-outline { display: none; }
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--paper-raised); }
.footer-grid {
  display: grid; gap: 2.5rem;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  padding-block: clamp(2.5rem, 5vw, 4rem) 2rem;
}
@media (max-width: 900px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand img { width: 40px; height: 40px; margin-bottom: 0.75rem; }
.footer-brand h5 { font-family: var(--font-display); text-transform: none; letter-spacing: normal; font-size: 1.05rem; color: var(--ink); margin: 0 0 0.4rem; }
.footer-brand p { color: var(--ink-soft); font-size: var(--fs-small); max-width: 32ch; }
.footer-col h5 {
  font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em;
  font-size: 0.78rem; color: var(--honey-deep); margin: 0 0 0.9rem;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.footer-col a { text-decoration: none; color: var(--ink-soft); font-size: var(--fs-small); }
.footer-col a:hover { color: var(--honey-deep); }
.footer-bottom {
  border-top: 1px solid var(--line); padding-block: 1.1rem;
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between;
  font-size: 0.82rem; color: var(--ink-soft); font-family: var(--font-mono);
}
.footer-bottom a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.footer-bottom a:hover { color: var(--honey-deep); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding-block: clamp(3.5rem, 8vw, 6.5rem);
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper) 78%, var(--paper-raised) 100%);
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }
.hero h1 { margin-bottom: 0.4em; }
.hero .lede { margin-bottom: 1.75rem; }

/* large faint hexagon watermarks — decorative, non-tiling (kept simple & correct-by-construction) */
.hero-hex {
  position: absolute; z-index: 0; pointer-events: none;
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  background: var(--honey-tint);
}
.hero-hex--1 { width: 420px; height: 485px; top: -140px; right: -120px; opacity: 0.55; }
.hero-hex--2 { width: 220px; height: 254px; bottom: -90px; right: 240px; opacity: 0.4; }
.hero-hex--3 { width: 150px; height: 173px; top: 60%; right: -40px; opacity: 0.3; border: 1px solid var(--honey); background: transparent; }
@media (max-width: 900px) {
  .hero-hex--2, .hero-hex--3 { display: none; }
  .hero-hex--1 { width: 280px; height: 323px; top: -100px; right: -140px; opacity: 0.5; }
}

/* ---------- Honeycomb seal / badge ---------- */
.seal {
  width: 3.1rem; height: 3.1rem; flex: none;
  background: var(--honey);
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink); font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
}
.seal-outline {
  background: transparent; border: 1.5px solid var(--honey-deep); color: var(--honey-deep);
}
.seal img { width: 62%; height: 62%; object-fit: contain; }

/* ---------- Cards ---------- */
.card {
  background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-m);
  padding: 1.6rem; display: flex; flex-direction: column; gap: 0.85rem;
}
.card-hover { transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--honey); }
.card h3, .card h4 { margin-bottom: 0.2em; }
.card p { color: var(--ink-soft); margin-bottom: 0; }

.grid { display: grid; gap: 1.25rem; }
.grid-1 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 980px) { .grid-4, .grid-5 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) { .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; } }

/* ---------- Services compendium (category blocks, vendor cards, TOC) ---------- */
.toc-wrap {
  display: flex; flex-wrap: wrap; gap: 0.6rem;
  padding: 1.25rem; background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-m);
}
.toc-chip {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-size: 0.85rem; font-weight: 600; text-decoration: none; color: var(--ink-soft);
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
  padding: 0.4em 0.85em 0.4em 0.5em; transition: border-color 0.15s ease, color 0.15s ease;
}
.toc-chip:hover { border-color: var(--honey-deep); color: var(--ink); }
.toc-num {
  font-family: var(--font-mono); font-size: 0.7rem; color: var(--ink);
  background: var(--honey); border-radius: 999px; width: 1.6em; height: 1.6em;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.rank-list { gap: 1.5rem; }
.rank-card .category-head { margin-bottom: 0.9rem; }
.rank-card .category-head h3 { margin-top: 0.35rem; }
.category-block { padding-block: clamp(2.25rem, 4vw, 3.25rem); border-bottom: 1px solid var(--line); scroll-margin-top: 5.5rem; }
.category-block:last-child { border-bottom: none; }
.category-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.category-head .seal { font-family: var(--font-mono); font-size: 0.95rem; }
.vendor-card h4 a { color: var(--ink); text-decoration: none; border-bottom: 1.5px solid var(--honey); }
.vendor-card h4 a:hover { color: var(--honey-deep); }
.price-list { display: flex; flex-direction: column; gap: 0.3rem; margin-top: auto; padding-top: 0.5rem; border-top: 1px dashed var(--line); }
.price-list span {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-soft); font-variant-numeric: tabular-nums;
}

/* ---------- Ledger rule / divider ---------- */
.rule { border: none; border-top: 1px solid var(--line); margin: 0; }
.ledger-row {
  display: flex; justify-content: space-between; gap: 1rem;
  padding-block: 0.9rem; border-bottom: 1px dashed var(--line);
  font-family: var(--font-mono); font-size: 0.85rem; color: var(--ink-soft);
}

/* ---------- Section header ---------- */
.section-head { max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .lede { margin-inline: auto; }
.section-head.center .eyebrow, .section-head.center .btn-row { justify-content: center; }
.section-alt { background: var(--paper-raised); border-block: 1px solid var(--line); }
.section-dark { background: var(--ink); color: var(--paper); }
.section-dark .ink-soft, .section-dark .lede { color: color-mix(in srgb, var(--paper) 70%, transparent); }
.section-dark .eyebrow { color: var(--honey); }

/* ---------- Tables (compendium / ledger) ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--paper-raised); }
table.ledger { width: 100%; border-collapse: collapse; font-size: 0.94rem; min-width: 640px; }
table.ledger caption { text-align: left; padding: 1rem 1.25rem 0; font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-soft); }
table.ledger th, table.ledger td { text-align: left; padding: 0.85rem 1.25rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.ledger thead th {
  font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.72rem;
  color: var(--honey-deep); border-bottom: 2px solid var(--honey);
}
table.ledger tbody tr:last-child td { border-bottom: none; }
table.ledger tbody tr:hover { background: var(--honey-tint); }
table.ledger td.num, table.ledger th.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- Callout / CTA banner ---------- */
.callout {
  background: var(--ink); color: var(--paper); border-radius: var(--radius-l);
  padding: clamp(2rem, 5vw, 3.5rem); display: flex; flex-wrap: wrap; gap: 2rem;
  align-items: center; justify-content: space-between;
}
.callout h2, .callout h3 { color: var(--paper); max-width: 22ch; }
.callout p { color: color-mix(in srgb, var(--paper) 72%, transparent); max-width: 48ch; }
.callout .eyebrow { color: var(--honey); }
.callout .btn-primary { background: var(--honey); color: var(--ink); border-color: var(--honey); }

/* ---------- small spacing utilities (reused across pages) ---------- */
.mt-lg { margin-top: 1.75rem; }
.gap-sm { gap: 1rem; }
.eyebrow-tight { margin-bottom: 0.2rem; }
.card-accent { border-color: var(--honey); }

.badge {
  display: inline-flex; align-items: center; gap: 0.4em;
  font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em;
  background: var(--wax-tint); color: var(--wax); border-radius: 999px; padding: 0.3em 0.7em;
}

/* ---------- Legal document (disclaimer.html) ---------- */
.updated { font-family: var(--font-mono); font-size: 0.82rem; color: var(--ink-soft); margin-bottom: 2rem; }
.legal-part { max-width: 68ch; padding-block: clamp(2rem, 4vw, 3rem); border-bottom: 1px solid var(--line); scroll-margin-top: 5.5rem; }
.legal-part:last-child { border-bottom: none; }
.legal-part h2 { font-size: var(--fs-h3); }
.legal-part h3 { font-size: var(--fs-h4); margin-top: 1.6em; }
.legal-part p, .legal-list { color: var(--ink-soft); }
.legal-list { padding-left: 1.4em; display: flex; flex-direction: column; gap: 0.4em; }
.legal-note {
  background: var(--honey-tint); border-left: 3px solid var(--honey-deep);
  border-radius: 0 var(--radius-s) var(--radius-s) 0; padding: 1rem 1.25rem;
  font-size: 0.95rem; color: var(--ink); margin-block: 1.2em;
}
.legal-fine { font-size: 0.85rem; color: var(--ink-soft); font-style: italic; }

/* ---------- Utility ---------- */
.text-soft { color: var(--ink-soft); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
