/* ============================================================================
   Avogado — base layer (reset, type, layout, shared chrome)
   Desktop reference width 1160px; all px values from the design handoff.
   ========================================================================== */

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

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

body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--accentDeep); text-underline-offset: 0.18em; }
a:hover { color: var(--accent); }
::selection { background: var(--accentSoft2); color: var(--ink); }

:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--accent); color: #fff; padding: 10px 16px;
  font-size: 13px; font-weight: 600; border-radius: 0 0 var(--r-btn) 0;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---- Headings ------------------------------------------------------------ */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--ink);
  text-wrap: balance;
}
p { text-wrap: pretty; }
strong, b { font-weight: 600; }

/* ---- Layout primitives ----------------------------------------------------- */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad-x); }

.section { padding-block: var(--section-y); position: relative; }
.section--surf { background: var(--surf); border-block: 1px solid var(--line); }
/* adjacent surf bands: don't double the hairline */
.section--surf + .section--surf { border-top: 0; }

/* ---- Section header against the signature left rule ------------------------- */
.sec-head {
  border-left: 2px solid var(--line2);
  padding-left: 36px;
  max-width: 640px;
}
.sec-head h2 {
  font-size: clamp(30px, 3.4vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin-top: 14px;
}
.sec-head .lead { margin-top: 16px; }
.lead { font-size: 16px; line-height: 1.65; color: var(--inkSoft); }
.lead--serif { font-family: var(--serif); font-size: 19px; line-height: 1.6; }

/* ---- Eyebrow / micro labels --------------------------------------------------- */
.eyebrow {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--inkSoft);
  display: inline-block;
}
.eyebrow--dark { color: var(--skinMut); }
.microlabel {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--mut);
}

/* ---- Buttons -------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-size: 15px; font-weight: 600; line-height: 1;
  padding: 14px 26px; border-radius: var(--r-btn);
  background: var(--accent); color: #fff; border: 1px solid var(--accentDeep);
  cursor: pointer; text-decoration: none;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}
.btn:hover { background: var(--accentDeep); color: #fff; }
.btn--secondary {
  background: var(--card); color: var(--ink); border-color: var(--line2);
}
.btn--secondary:hover { background: var(--surf); color: var(--ink); }
.btn--sm { padding: 9px 18px; font-size: 14px; }

/* ---- Provenance tag chips (mono, radius 4) ------------------------------------------ */
.tag {
  font-family: var(--mono);
  font-size: 10.5px; font-weight: 600; line-height: 1;
  padding: 1px 7px; border-radius: 4px;
  border: 1px solid transparent;
  white-space: nowrap;
  display: inline-block; vertical-align: 0.12em;
}
.tag--corpus   { color: var(--blue);   background: var(--blueSoft); }
.tag--verified { color: var(--accent); background: var(--accentSoft); }
.tag--reasoned { color: var(--pit);    background: var(--pitSoft); }
.tag--flagged  { color: var(--danger); background: var(--dangerSoft); }
.tag--neutral  { color: var(--mut);    background: var(--paper); }

/* ---- Navigation -------------------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(241, 237, 224, .9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad-x);
  display: flex; align-items: center; gap: 28px;
  height: 68px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand img { width: 26px; height: 36px; object-fit: contain; }
.brand__word { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.brand__word .av { color: var(--accent); }
.nav__spacer { flex: 1; }
.nav__links { display: flex; align-items: center; gap: 26px; }
.nav__links a {
  font-size: 14px; font-weight: 500;
  color: var(--inkSoft); text-decoration: none; padding-bottom: 2px;
}
.nav__links a:hover { color: var(--ink); }
.nav__links a.is-active {
  font-weight: 600; color: var(--ink);
  border-bottom: 2px solid var(--accent);
}
.nav__links a.nav__cta {
  color: #fff; border-bottom: 0; padding-bottom: 9px;
}
.nav__toggle {
  display: none; background: none; border: 0; border-radius: 8px; padding: 6px 4px;
  min-width: 44px; min-height: 44px; cursor: pointer;
  align-items: center; justify-content: center; order: 10;
}
.nav__toggle span, .nav__toggle span::before, .nav__toggle span::after {
  content: ""; display: block; width: 18px; height: 2px; border-radius: 1px;
  background: var(--ink); position: relative;
  transition: transform var(--dur-mid) var(--ease-out), opacity var(--dur-fast) linear,
              background var(--dur-fast) linear;
}
.nav__toggle span::before { position: absolute; top: -6px; }
.nav__toggle span::after  { position: absolute; top: 6px; }
.nav.is-open .nav__toggle span { background: transparent; }
.nav.is-open .nav__toggle span::before { transform: translateY(6px) rotate(45deg); background: var(--skinTx); }
.nav.is-open .nav__toggle span::after  { transform: translateY(-6px) rotate(-45deg); background: var(--skinTx); }

/* Menu-only items (full-width CTA + legal row inside the mobile overlay) */
.nav__menu-cta, .nav__legal { display: none; }

/* Body scroll lock while the mobile menu is open */
body.nav-locked { overflow: hidden; }

@media (max-width: 760px) {
  .nav__inner { height: 56px; gap: 12px; padding-inline: 18px; }
  .brand img { width: 21px; height: 29px; }
  .brand__word { font-size: 17px; }
  .nav__toggle { display: inline-flex; }
  .nav__links a.is-active { border-bottom: 0; }
  a.nav__cta { padding: 8px 13px; font-size: 13px; border-radius: 9px; }

  /* Open menu: full-screen overlay in --skin, big serif rows */
  .nav__links {
    position: fixed; top: 56px; left: 0; right: 0; bottom: 0; z-index: 99;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--skin);
    padding: 36px 26px 44px;
    overflow-y: auto;
    clip-path: inset(0 0 100% 0);
    transition: clip-path var(--dur-mid) var(--ease-out);
  }
  .nav.is-open .nav__links { clip-path: inset(0 0 0 0); }
  .nav__links > a {
    font-family: var(--serif); font-size: 28px; font-weight: 600;
    color: var(--skinTx); padding: 14px 0; border-bottom: 1px solid var(--skin2);
  }
  .nav__links > a.is-active { color: var(--logoGreen); }
  .nav__links a.nav__menu-cta {
    display: block; font-family: var(--sans); font-size: 16px; font-weight: 600;
    color: #fff; text-align: center; padding: 15px; border-bottom: 0;
    margin-top: 28px; border-radius: var(--r-btn);
  }
  .nav__legal {
    display: flex; gap: 16px; justify-content: center; margin-top: 26px;
  }
  .nav__legal a { font-size: 12px; color: var(--skinMut); text-decoration: none; }

  /* The bar itself goes dark while the menu is open. backdrop-filter must go:
     it turns the bar into the containing block for the fixed overlay, which
     would clip the menu to the bar's height. */
  .nav.is-open {
    background: var(--skin); border-bottom-color: var(--skin2);
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .nav.is-open .brand__word { color: var(--skinTx); }
  .nav.is-open .brand__word .av { color: var(--logoGreen); }
  .nav.is-open a.nav__cta { display: none; }
}

/* ---- Dark CTA band -------------------------------------------------------------------- */
.cta-band {
  background: var(--skin);
  padding-block: var(--section-y-dark);
  text-align: center;
}
.cta-band__inner { max-width: 760px; margin-inline: auto; padding-inline: var(--pad-x); }
.cta-band h2 {
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.12; letter-spacing: -0.01em;
  color: var(--skinTx);
  margin-top: 16px;
}
.cta-band .lead { color: var(--skinMut); margin-top: 18px; }
.cta-band .btn { margin-top: 28px; font-size: 16px; padding: 14px 28px; }
.cta-band .fine {
  margin-top: 22px; font-size: 12.5px; color: var(--skinMut); line-height: 1.6;
}

/* ---- Footer: full (Home) ----------------------------------------------------------------- */
.footer { background: var(--skin); padding-block: 56px 36px; }
.footer__grid {
  display: grid; gap: 32px 40px;
  grid-template-columns: 2fr 1fr 1fr 1fr;
}
@media (max-width: 860px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer__grid { grid-template-columns: 1fr; } }
.footer .brand__word { color: var(--skinTx); }
.footer .brand__word .av { color: var(--logoGreen); }
.footer__tagline { margin-top: 14px; font-size: 13.5px; line-height: 1.65; color: var(--skinMut); max-width: 34ch; }
.footer h5 {
  font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--skinMut); margin-bottom: 14px;
}
.footer ul { list-style: none; padding: 0; display: grid; gap: 9px; }
.footer ul a, .footer__lines span { color: var(--skinMut); text-decoration: none; font-size: 13px; }
.footer ul a:hover { color: var(--skinTx); }
.footer__lines { display: grid; gap: 9px; }
.footer__base {
  margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--skin2);
  display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: center;
  font-size: 12.5px; color: var(--skinMut);
}
.footer__base .lab strong { color: var(--skinTx); font-weight: 600; }
.footer__base .sourced {
  font-family: var(--mono); font-size: 11px; color: var(--logoGreen);
  background: var(--skin2); border-radius: 4px; padding: 3px 9px;
  margin-left: auto;
}

/* ---- Footer: condensed (interior pages) ----------------------------------------------------- */
.footer--mini { padding-block: 44px 36px; }
.footer--mini .footer__row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
}
.footer--mini .brand img { width: 20px; height: 27px; }
.footer--mini .brand__word { font-size: 16px; }
.footer--mini .footer__links { display: flex; flex-wrap: wrap; gap: 22px; }
.footer--mini .footer__links a { font-size: 13px; color: var(--skinMut); text-decoration: none; }
.footer--mini .footer__links a:hover,
.footer--mini .footer__links a.is-here { color: var(--skinTx); }
.footer--mini .footer__lab { font-size: 12.5px; color: var(--skinMut); }
.footer--mini .footer__lab strong { color: var(--skinTx); font-weight: 600; }

/* ---- Interior page head (left rule) ------------------------------------------------------------ */
.page-head { padding: 84px 0 0; }
.page-head .sec-head { max-width: 720px; }
.page-head h1 {
  font-size: clamp(36px, 4.6vw, 56px);
  line-height: 1.08; letter-spacing: -0.015em;
  margin-top: 16px;
}
.page-head .lead--serif { margin-top: 18px; }

/* ---- Ambient bits --------------------------------------------------------------------------------- */
.livedot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  display: inline-block; flex: none;
}
.livedot--bright { background: var(--logoGreen); }
@keyframes avPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.livedot { animation: avPulse 1.5s ease-in-out infinite; }

@keyframes avSpin { to { transform: rotate(360deg); } }
.spinner {
  width: 12px; height: 12px; border-radius: 50%; flex: none;
  border: 2px solid var(--accentSoft2); border-top-color: var(--accent);
  animation: avSpin 0.8s linear infinite;
}

/* ---- Utility ----------------------------------------------------------------------------------------- */
.center { text-align: center; }
.muted { color: var(--mut); }
.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:22px}.mt-4{margin-top:36px}.mt-5{margin-top:56px}
.sr-only {
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;
  clip:rect(0 0 0 0);white-space:nowrap;border:0;
}
.hp { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .livedot, .spinner { animation: none; }
}

/* ---- Responsive copy/content swaps ------------------------------------------------------ */
/* .m-only renders only ≤760px; .d-only renders only ≥761px */
@media (min-width: 761px) { .m-only { display: none !important; } }
@media (max-width: 760px) { .d-only { display: none !important; } }

/* ---- Global mobile rules (≤760px) -------------------------------------------------------- */
@media (max-width: 760px) {
  .wrap { padding-inline: 20px; }
  .section { padding-block: 44px; }

  .sec-head { padding-left: 18px; }
  .sec-head h2 { font-size: 27px; line-height: 1.14; margin-top: 10px; }
  .sec-head .lead { margin-top: 10px; }
  .eyebrow { font-size: 10px; }
  .lead { font-size: 14px; line-height: 1.6; }
  .lead--serif { font-size: 16px; }

  .page-head { padding-top: 44px; }
  .page-head h1 { font-size: 32px; line-height: 1.1; margin-top: 12px; }
  .page-head .lead--serif { margin-top: 14px; }

  /* CTA buttons full width, stacked — never two side by side (nav CTA exempt) */
  .btn { width: 100%; padding: 14px; font-size: 15px; }
  .btn--sm, .nav .btn { width: auto; }

  .cta-band { padding-block: 52px; }
  .cta-band__inner { padding-inline: 24px; }
  .cta-band h2 { font-size: 29px; line-height: 1.15; margin-top: 12px; }
  .cta-band .lead { font-size: 13.5px; margin-top: 12px; }
  .cta-band .btn { margin-top: 22px; font-size: 15px; padding: 14px; }
  .cta-band .fine { font-size: 11px; margin-top: 14px; }

  /* Full footer: brand + tagline, then Product/Company 2-up, stacked base lines */
  .footer { padding-block: 32px 28px; }
  .footer .wrap { padding-inline: 24px; }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 20px; }
  .footer__grid > div:first-child { grid-column: 1 / -1; }
  .footer__how { display: none; }
  .footer__tagline { font-size: 12px; margin-top: 10px; }
  .footer__base { flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 22px; padding-top: 16px; }
  .footer__base .sourced { margin-left: 0; }

  /* Condensed footer stacks */
  .footer--mini .footer__row { flex-direction: column; align-items: flex-start; gap: 18px; }
}
