:root {
  --bg: #ffffff;
  --bg-soft: #f4f6f8;
  --surface: #ffffff;
  --text: #14202b;
  --text-muted: #566472;
  --accent: #1d6ae0;
  --accent-dark: #1550b0;
  --border: #dfe4ea;
  --sunk: #eceff2;
  --good: #2f6b46;
  --good-soft: #e8f2ec;
  --warn: #9a4a26;
  --warn-soft: #f6ebe4;
  --radius: 10px;
  --container: 62rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10161c;
    --bg-soft: #161e26;
    --surface: #182129;
    --text: #e8eef4;
    --text-muted: #a3b1bf;
    --accent: #5aa9f8;
    --accent-dark: #8cc6fb;
    --border: #26323d;
    --sunk: #131a20;
    --good: #7fc09a;
    --good-soft: #17241d;
    --warn: #dd9468;
    --warn-soft: #261a14;
  }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
  letter-spacing: -0.01em;
  font-size: 1.15rem;
}
.brand-mark {
  display: block;
  width: 1.6rem;
  height: 1.6rem;
  flex: none;
  color: var(--accent);
}
.site-nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.95rem;
}
.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--text); }

/* Nav dropdown */
.nav-menu { position: relative; display: flex; }
.nav-menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  font: inherit;
  color: var(--text-muted);
  cursor: pointer;
}
.nav-menu-toggle:hover { color: var(--text); }
.nav-menu-toggle.is-current {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.nav-caret {
  width: 0.6rem;
  height: 0.6rem;
  transition: transform 0.15s ease;
}
.nav-menu-toggle[aria-expanded="true"] { color: var(--text); }
.nav-menu-toggle[aria-expanded="true"] .nav-caret { transform: rotate(180deg); }

.nav-menu-panel {
  position: absolute;
  top: calc(100% + 0.65rem);
  right: 0;
  left: auto;
  z-index: 20;
  min-width: 12rem;
  max-width: min(18rem, calc(100vw - 2.5rem));
  padding: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(20, 32, 43, 0.14);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.nav-menu-panel[hidden] { display: none; }
.nav-menu-panel a {
  padding: 0.5rem 0.7rem;
  border-radius: 7px;
  border-bottom: 0;
}
.nav-menu-panel a:hover { background: var(--bg-soft); color: var(--text); }
.nav-menu-panel a.is-current {
  color: var(--text);
  background: var(--bg-soft);
  border-bottom: 0;
}
.site-nav a.is-current {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* Narrow screens: let the nav drop under the brand rather than squeezing
   link labels mid-word and pushing the page wider than the viewport. */
@media (max-width: 34rem) {
  .header-inner {
    flex-wrap: wrap;
    justify-content: flex-start;
    min-height: 0;
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
  }
  .site-nav {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
  }
  .site-nav a { white-space: nowrap; }
  /* .nav-menu is a flex row, so a static panel would sit beside the toggle
     rather than below it. Keep it anchored; the base rule caps its width. */
}

/* Main */
main { flex: 1; }

.hero {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  padding: 5rem 0;
  text-align: center;
}
.eyebrow {
  margin: 0 0 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--accent);
}
.hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.lead {
  margin: 0 auto 1.25rem;
  max-width: 36rem;
  font-size: 1.2rem;
  color: var(--text-muted);
}
.hero-body {
  margin: 0 auto;
  max-width: 34rem;
  color: var(--text-muted);
}
.actions { margin-top: 2rem; }
.button {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
.button:hover { background: var(--accent-dark); color: #fff; }

.panels { padding: 4rem 0; }
.grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}
.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.97rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 1.5rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
}
.site-footer p { margin: 0; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
}

/* ---------------------------------------------------------------------------
   Long-form document pages (/beef-direct). Scoped under .doc so nothing here
   reaches the home page or the shared shell.
   --------------------------------------------------------------------------- */
.doc { padding: 3rem 0 5rem; }
.doc .container { max-width: 52rem; }

.doc-header {
  border-bottom: 2px solid var(--text);
  padding-bottom: 1.75rem;
  margin-bottom: 2.5rem;
}
.doc-header h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.doc-header .lead {
  margin: 0 0 1.5rem;
  max-width: 40ch;
  font-size: 1.15rem;
  color: var(--text-muted);
  text-wrap: pretty;
}
.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  margin: 0;
  font-size: 0.82rem;
}
.doc-meta div { display: flex; gap: 0.4rem; }
.doc-meta dt {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 650;
  font-size: 0.72rem;
  align-self: center;
}
.doc-meta dd { margin: 0; color: var(--text); }

.doc-summary {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 0.25rem;
  margin-bottom: 3rem;
}
.doc-summary-lead { font-size: 1.08rem; }

.doc-toc {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
  margin-bottom: 3.5rem;
}
.doc-toc h2 {
  margin: 0 0 0.75rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}
.doc-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
  display: grid;
  gap: 0.3rem 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}
.doc-toc li { counter-increment: toc; }
.doc-toc a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.92rem;
}
.doc-toc a::before {
  content: counter(toc, decimal-leading-zero) "  ";
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
}
.doc-toc a:hover { color: var(--text); }

.doc-section { margin-bottom: 3.5rem; scroll-margin-top: 1.5rem; }
.doc-part {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}
.doc-section h2 {
  margin: 0 0 1.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
  font-size: clamp(1.4rem, 3.2vw, 1.8rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.doc-section h3 {
  margin: 2rem 0 0.6rem;
  font-size: 1.12rem;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.doc-section p { margin: 0 0 1rem; max-width: 68ch; text-wrap: pretty; }
.doc-section ul,
.doc-section ol { margin: 0 0 1.15rem; padding-left: 1.2rem; max-width: 68ch; }
.doc-section li { margin-bottom: 0.4rem; }
.doc-section code {
  background: var(--sunk);
  border-radius: 4px;
  padding: 0.1em 0.35em;
  font-size: 0.88em;
}
.doc-caption {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0.5rem 0 1.25rem !important;
}
.doc-disclaimer {
  font-size: 0.9rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

/* Callouts */
.doc-note {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem 0.25rem;
  margin: 1.5rem 0;
  max-width: 68ch;
}
.doc-note p { font-size: 0.95rem; }
.doc-note-tag {
  font-size: 0.7rem !important;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.4rem !important;
}
.doc-note.is-good { border-color: var(--good); background: var(--good-soft); }
.doc-note.is-good .doc-note-tag { color: var(--good); }
.doc-note.is-warn { border-color: var(--warn); background: var(--warn-soft); }
.doc-note.is-warn .doc-note-tag { color: var(--warn); }
.doc-note.is-gap { background: var(--sunk); }

/* Tables */
.doc-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin: 1.5rem 0;
}
.doc-table-wrap table {
  border-collapse: collapse;
  width: 100%;
  min-width: 34rem;
  font-size: 0.9rem;
}
.doc-table-wrap caption {
  caption-side: top;
  text-align: left;
  padding: 0.8rem 1rem 0.7rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.7rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.doc-table-wrap th,
.doc-table-wrap td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--border);
}
.doc-table-wrap thead th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  white-space: nowrap;
}
.doc-table-wrap tbody th { font-weight: 550; }
.doc-table-wrap tbody tr:last-child th,
.doc-table-wrap tbody tr:last-child td { border-bottom: none; }
.doc-table-wrap .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.doc-table-wrap .up { color: var(--good); font-weight: 650; }
.doc-table-wrap tr.is-sub th,
.doc-table-wrap tr.is-sub td {
  color: var(--text-muted);
  font-size: 0.82rem;
  padding-top: 0;
  font-weight: 400;
}
.doc-table-wrap tr.is-ruled th,
.doc-table-wrap tr.is-ruled td { border-top: 1px solid var(--border); }
.doc-table-wrap tr.is-total th,
.doc-table-wrap tr.is-total td {
  background: var(--bg-soft);
  font-weight: 650;
  border-top: 1px solid var(--text-muted);
}

/* Numbered steps — children are placed explicitly so a second paragraph
   cannot flow into the narrow number column. */
.doc-steps {
  list-style: none;
  margin: 1.5rem 0;
  padding: 0;
  counter-reset: step;
  max-width: 68ch;
  border-top: 1px solid var(--border);
}
.doc-steps > li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  padding: 0.85rem 0;
  margin: 0;
  border-bottom: 1px solid var(--border);
}
.doc-steps > li::before {
  content: counter(step, decimal-leading-zero);
  grid-column: 1;
  grid-row: 1;
  font-size: 0.75rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  padding-top: 0.3rem;
}
.doc-steps > li > * { grid-column: 2; margin: 0; max-width: none; }
.doc-steps > li > p { font-size: 0.95rem; }
.doc-steps > li > p + p {
  margin-top: 0.3rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Yield cascade */
.doc-yield {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 1.5rem 0 0;
  max-width: 68ch;
}
.doc-yield-bar {
  min-width: 15rem;
  background: var(--bg-soft);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 0.6rem 0.85rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.75rem;
}
.doc-yield-w {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  white-space: nowrap;
}
.doc-yield-l { font-size: 0.88rem; color: var(--text-muted); }


/* ---------------------------------------------------------------------------
   Marketing pages (/shop-platform). Reuses .hero, .grid, .card, .button and
   .doc-table-wrap; everything below is scoped to .mkt.
   --------------------------------------------------------------------------- */
.mkt { padding-bottom: 1rem; }
.mkt-section { padding: 3.5rem 0; border-bottom: 1px solid var(--border); }
.mkt-section:last-child { border-bottom: none; }
.mkt-section > h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.mkt-section > p { margin: 0 0 1rem; max-width: 68ch; text-wrap: pretty; }
.mkt-section .eyebrow { margin-bottom: 0.5rem; }
.mkt-section .grid { margin-top: 1.75rem; }

.mkt-intro { padding-top: 3rem; }
.mkt-lead {
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--text);
}
.mkt-intro p:last-child { color: var(--text-muted); }

.mkt-pillars .card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.mkt-pillars .card p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }

/* Feature columns */
.mkt-features {
  display: grid;
  gap: 2rem 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  margin-top: 1.75rem;
}
.mkt-feature h3 {
  margin: 0 0 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}
.mkt-feature ul { margin: 0; padding-left: 1.1rem; }
.mkt-feature li {
  margin-bottom: 0.45rem;
  font-size: 0.94rem;
  color: var(--text-muted);
}
.mkt-feature li::marker { color: var(--border); }

.mkt-inline-list {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.5rem 2rem;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
}
.mkt-inline-list li {
  position: relative;
  padding-left: 1.4rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}
.mkt-inline-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 2px;
  background: var(--accent);
}

.doc-table-wrap .mkt-yes { color: var(--good); font-weight: 650; white-space: nowrap; }

.mkt-cta { text-align: center; }
.mkt-cta > p { margin-left: auto; margin-right: auto; }
.mkt-cta .actions { margin-top: 1.5rem; }
.mkt-fineprint {
  margin-top: 2rem !important;
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 60ch !important;
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---------------------------------------------------------------------------
   Contact page (/contact).
   --------------------------------------------------------------------------- */
.page-head {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  padding: 4rem 0 3.5rem;
}
.page-head h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.page-head .lead { margin-left: 0; margin-right: 0; max-width: 42ch; }

.contact-layout {
  display: grid;
  gap: 2.5rem;
  align-items: start;
}
@media (min-width: 52rem) {
  .contact-layout { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
}

.contact-bio {
  display: flex;
  align-items: flex-start;
  gap: 1.35rem;
}
.contact-bio-text { min-width: 0; }

.contact-portrait {
  display: block;
  flex: none;
  width: 7.5rem;
  height: 7.5rem;
  object-fit: cover;
  object-position: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin: 0;
}

@media (max-width: 26rem) {
  .contact-bio { gap: 1rem; }
  .contact-portrait { width: 5rem; height: 5rem; }
}

.contact-bio h2 {
  margin: 0 0 0.6rem;
  padding-top: 0.1rem;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.contact-bio p {
  margin: 0;
  max-width: 62ch;
  color: var(--text-muted);
  text-wrap: pretty;
}

.contact-details {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.contact-row {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1rem;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.contact-row:last-child { border-bottom: 0; }
.contact-details dt {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 650;
  font-size: 0.72rem;
  padding-top: 0.28rem;
}
.contact-details dd { margin: 0; }
.contact-details address { font-style: normal; }
.contact-details address span { display: block; }

@media (max-width: 30rem) {
  .contact-row {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }
  .contact-details dt { padding-top: 0; }
}

/* ---------------------------------------------------------------------------
   Passphrase gate (/unlock).
   --------------------------------------------------------------------------- */
.unlock-form {
  max-width: 24rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.unlock-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.unlock-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}
.unlock-input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.unlock-input[aria-invalid="true"] { border-color: var(--warn); }
.unlock-error {
  margin: 0.6rem 0 0;
  color: var(--warn);
  font-size: 0.9rem;
}
.unlock-form .button {
  margin-top: 1.1rem;
  width: 100%;
  text-align: center;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}
.unlock-help {
  margin: 1rem 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}
