/* ─────────────────────────────────────────────────────────────
   site-polish.css (2026-11-24)
   Shared layer for the public marketing pages. Two jobs:

   1. Small rewards on interaction: buttons lift and press, cards
      rise under the pointer, links underline from the left, the
      FAQ icon turns as it opens. Every movement answers a hover,
      a press or an open; nothing moves on page load
      (CLAUDE.md rule 7). Transforms sit inside
      `prefers-reduced-motion: no-preference`, so a visitor who
      asks for less motion gets the colour change and nothing else.

   2. The editorial frame (`body[data-surface="editorial"]`): About,
      For auditors, Notes and Methodology were built on a separate
      folio template with a sticky numbered margin, a narrow column
      and small type. This puts them on one centred column at the
      same scale as the corporate pages, turns their ruled lists
      into floating cards and gives them the full footer.
   ───────────────────────────────────────────────────────────── */

:root {
  --polish-radius: 16px;
  --polish-shadow: 0 12px 32px -16px rgba(15, 74, 40, 0.22);
  --polish-shadow-hover: 0 18px 40px -16px rgba(15, 74, 40, 0.30);
  --polish-ease: cubic-bezier(.2, .7, .2, 1);
}

::selection { background: rgba(151, 188, 98, 0.35); color: var(--ink); }

/* ── 1. Interaction rewards ────────────────────────────────── */

a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--moss);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: no-preference) {
  /* Buttons: lift on hover, settle on press. */
  body .btn, body .nav__cta.nav__cta, body .nav__book {
    transition: background var(--motion-fast), border-color var(--motion-fast),
                color var(--motion-fast), transform 180ms var(--polish-ease),
                box-shadow 180ms var(--polish-ease);
  }
  body .btn:hover:not(:disabled), body .nav__cta.nav__cta:hover, body .nav__book:hover {
    transform: translateY(-1px);
  }
  body .btn-primary:hover:not(:disabled), body .nav__cta.nav__cta:hover {
    box-shadow: 0 8px 18px -10px rgba(15, 74, 40, 0.55);
  }
  body .btn:active:not(:disabled), body .nav__cta.nav__cta:active, body .nav__book:active {
    transform: translateY(0) scale(0.98);
    box-shadow: none;
    transition-duration: 60ms;
  }

  /* Pricing and home tier cards: rise with a soft shadow. */
  body .tier {
    transition: border-color var(--motion-base), transform 220ms var(--polish-ease),
                box-shadow 220ms var(--polish-ease);
  }
  body .tier:hover { transform: translateY(-3px); box-shadow: var(--polish-shadow-hover); }

  /* Nav: a moss underline draws in under the link you point at. */
  body .nav__links a:not(.is-current)::after {
    content: ''; display: block; height: 2px; margin-top: 2px; border-radius: 2px;
    background: var(--moss);
    transform: scaleX(0); transform-origin: left;
    transition: transform 200ms var(--polish-ease);
  }
  body .nav__links a:not(.is-current):hover::after { transform: scaleX(1); }

  /* FAQ: the plus turns a quarter as the answer opens. */
  body .faq__q-icon { transition: background var(--motion-base), border-color var(--motion-base), transform 260ms var(--polish-ease); }
  body .faq__item.is-open .faq__q-icon { transform: rotate(180deg); }
  body .faq__q:hover .faq__q-icon { border-color: var(--green); }

  /* Billing toggle: the chosen option settles in. */
  body .billing-toggle__opt { transition: background var(--motion-base), color var(--motion-base), transform 140ms var(--polish-ease); }
  body .billing-toggle__opt:active { transform: scale(0.97); }
}

/* Prose links: underline draws from the left on hover. */
.lede p a, .section p a, .row p a, .row li a, .close a, .sources__desc a, .assure a, .faq__a a {
  border-bottom: none;
  text-decoration: none;
  background-image: linear-gradient(var(--green), var(--green)), linear-gradient(var(--rule), var(--rule));
  background-size: 0% 1px, 100% 1px;
  background-position: 0 100%, 0 100%;
  background-repeat: no-repeat;
  padding-bottom: 1px;
}
.lede p a:hover, .section p a:hover, .row p a:hover, .row li a:hover, .close a:hover,
.sources__desc a:hover, .assure a:hover, .faq__a a:hover {
  color: var(--green);
  background-size: 100% 1px, 100% 1px;
}
@media (prefers-reduced-motion: no-preference) {
  .lede p a, .section p a, .row p a, .row li a, .close a, .sources__desc a, .assure a, .faq__a a {
    transition: background-size 260ms var(--polish-ease), color var(--motion-fast);
  }
}

/* ── 2. Editorial frame ────────────────────────────────────── */

body[data-surface="editorial"] { background: var(--paper); }

/* One centred column; the numbered margin goes. */
body[data-surface="editorial"] .folio,
body[data-surface="editorial"] .wrap {
  display: block;
  max-width: 840px;
  margin: 0 auto;
  padding: var(--space-10) var(--space-7) var(--space-9);
}
body[data-surface="editorial"] .folio__margin,
body[data-surface="editorial"] .row__margin { display: none; }
@media (max-width: 820px) {
  body[data-surface="editorial"] .folio,
  body[data-surface="editorial"] .wrap { padding: var(--space-9) var(--space-5) var(--space-8); }
}

/* Hero: centred, at the corporate pages' scale. */
body[data-surface="editorial"] .lede,
body[data-surface="editorial"] .row.hero { text-align: center; }
body[data-surface="editorial"] .lede h1,
body[data-surface="editorial"] .row.hero h1 {
  font-size: clamp(44px, 6vw, 80px);
  line-height: 1.02; letter-spacing: -0.035em;
}
body[data-surface="editorial"] .lede p,
body[data-surface="editorial"] .row.hero p {
  margin: var(--space-6) auto 0;
  max-width: 660px;
  font-size: clamp(17px, 1.4vw, 19px);
  line-height: 1.6;
}
/* Methodology keeps its version pin: the hero meta moves under the byline. */
body[data-surface="editorial"] .row.hero { display: flex; flex-direction: column-reverse; gap: 0; }
body[data-surface="editorial"] .row.hero .row__margin {
  display: block; position: static; align-self: center; margin-top: var(--space-3);
  font-size: 13.5px; color: var(--ink-3);
}
body[data-surface="editorial"] .row.hero .row__num,
body[data-surface="editorial"] .row.hero .row__rule,
body[data-surface="editorial"] .row.hero .row__label { display: none; }
body[data-surface="editorial"] .row.hero .row__meta {
  border-top: none; padding-top: 0; margin-top: 0;
  font-size: 13.5px; letter-spacing: 0;
}
body[data-surface="editorial"] .byline {
  border-top: none; padding-top: 0;
  margin-top: var(--space-5);
  font-size: 13.5px;
}

/* Sections: spacing instead of rules, larger reading type. */
body[data-surface="editorial"] .section,
body[data-surface="editorial"] .row {
  display: block;
  border-top: none;
  padding: var(--space-9) 0 0;
}
body[data-surface="editorial"] .section:first-of-type { padding-top: var(--space-10); }
body[data-surface="editorial"] .row.hero { padding-top: var(--space-7); }
body[data-surface="editorial"] .section h2,
body[data-surface="editorial"] .row h2 {
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.12; letter-spacing: -0.025em;
  margin-bottom: var(--space-5);
  max-width: none;
}
body[data-surface="editorial"] .section p,
body[data-surface="editorial"] .row p,
body[data-surface="editorial"] .row__lede {
  font-size: 17px; line-height: 1.7;
  max-width: 68ch;
}
body[data-surface="editorial"] .row__lede { margin-top: 0; }

/* Shared floating card. */
body[data-surface="editorial"] .fact,
body[data-surface="editorial"] .approach__row,
body[data-surface="editorial"] .pull,
body[data-surface="editorial"] .cta,
body[data-surface="editorial"] .note-row,
body[data-surface="editorial"] .methods__row,
body[data-surface="editorial"] .sources,
body[data-surface="editorial"] .thresholds,
body[data-surface="editorial"] .assure,
body[data-surface="editorial"] .revlog {
  background: var(--card);
  border: 1px solid rgba(217, 214, 207, 0.6);
  border-radius: var(--polish-radius);
  box-shadow: var(--polish-shadow);
}

/* For auditors: three facts as cards. */
body[data-surface="editorial"] .facts { gap: var(--space-5); }
body[data-surface="editorial"] .fact { padding: var(--space-6) var(--space-5); }
body[data-surface="editorial"] .fact__lbl,
body[data-surface="editorial"] .thresholds__lbl {
  text-transform: none; letter-spacing: 0;
  font-size: 13.5px; color: var(--ink-2);
}
body[data-surface="editorial"] .fact__sub { max-width: none; font-size: 13.5px; line-height: 1.55; }

/* Engagement steps and calculation methods: a stack of cards. */
body[data-surface="editorial"] .approach,
body[data-surface="editorial"] .methods { gap: var(--space-4); }
body[data-surface="editorial"] .approach__row,
body[data-surface="editorial"] .methods__row,
body[data-surface="editorial"] .approach__row:last-child,
body[data-surface="editorial"] .methods__row:last-child {
  padding: var(--space-6);
  border-bottom: 1px solid rgba(217, 214, 207, 0.6);
  grid-template-columns: 40px 1fr;
}
body[data-surface="editorial"] .approach__row .n,
body[data-surface="editorial"] .methods__row .n {
  width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--green-tint); color: var(--green);
  font-size: 14px; font-weight: 600; letter-spacing: 0; padding: 0;
}
body[data-surface="editorial"] .approach__row p,
body[data-surface="editorial"] .methods__row p { font-size: 15px; color: var(--ink-2); max-width: none; }

/* Pull quote: a centred card, no rules. */
body[data-surface="editorial"] .pull {
  margin: var(--space-9) 0 0;
  padding: var(--space-8) var(--space-7);
  text-align: center; max-width: none;
}
body[data-surface="editorial"] .pull cite { text-transform: none; letter-spacing: 0; font-size: 13.5px; }

/* Closing call to action: a centred card. */
body[data-surface="editorial"] .cta {
  margin-top: var(--space-9);
  padding: var(--space-8) var(--space-7);
  flex-direction: column; text-align: center;
}
body[data-surface="editorial"] .cta p { margin-left: auto; margin-right: auto; }
body[data-surface="editorial"] .cta__actions { justify-content: center; }

/* Notes index: each note a card. */
body[data-surface="editorial"] .notes-list {
  border-top: none; margin-top: var(--space-9);
  display: flex; flex-direction: column; gap: var(--space-4);
}
body[data-surface="editorial"] .note-row {
  padding: var(--space-6) var(--space-7);
  border-bottom: 1px solid rgba(217, 214, 207, 0.6);
}
body[data-surface="editorial"] .note-row:hover { background: var(--card); }
body[data-surface="editorial"] .note-row.is-draft { box-shadow: none; background: transparent; }
body[data-surface="editorial"] .note-row__tag { text-transform: none; letter-spacing: 0; font-size: 12.5px; }
body[data-surface="editorial"] .close { border-top: none; text-align: center; padding-top: 0; margin-top: var(--space-9); }
@media (max-width: 760px) {
  body[data-surface="editorial"] .note-row { padding: var(--space-5); }
}

/* Methodology: sources, thresholds, assurance box and log as cards. */
body[data-surface="editorial"] .sources { padding: var(--space-2) var(--space-6); }
body[data-surface="editorial"] .sources__row { grid-template-columns: 170px 110px 1fr; }
@media (max-width: 700px) {
  body[data-surface="editorial"] .sources__row { grid-template-columns: 1fr; }
}
body[data-surface="editorial"] .thresholds { padding: var(--space-6); }
body[data-surface="editorial"] .assure {
  border-left: 1px solid rgba(217, 214, 207, 0.6);
  padding: var(--space-6) var(--space-7);
  font-size: 15px; max-width: none;
}
body[data-surface="editorial"] .revlog { padding: var(--space-2) var(--space-6); max-width: none; }
body[data-surface="editorial"] .revlog__row:first-child { border-top: none; }
body[data-surface="editorial"] .revlog__row:last-child { border-bottom: none; }

@media (prefers-reduced-motion: no-preference) {
  body[data-surface="editorial"] .fact,
  body[data-surface="editorial"] .approach__row,
  body[data-surface="editorial"] .note-row:not(.is-draft) {
    transition: transform 220ms var(--polish-ease), box-shadow 220ms var(--polish-ease);
  }
  body[data-surface="editorial"] .fact:hover,
  body[data-surface="editorial"] .approach__row:hover,
  body[data-surface="editorial"] .note-row:not(.is-draft):hover {
    transform: translateY(-3px);
    box-shadow: var(--polish-shadow-hover);
  }
}

/* Full corporate footer (markup copied from enterprise.html). The
   pages' own inline `footer {}` rule is overridden here. */
body[data-surface="editorial"] footer.footer {
  display: block;
  padding: var(--space-9) 0 var(--space-7);
  margin-top: var(--space-7);
  border-top: var(--border);
  font-size: inherit; color: inherit;
}
body[data-surface="editorial"] .footer__grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-7); margin-bottom: var(--space-8);
}
@media (max-width: 820px) {
  body[data-surface="editorial"] .footer__grid { grid-template-columns: 1fr 1fr; gap: var(--space-6); }
  body[data-surface="editorial"] .footer__brand-block { grid-column: 1 / -1; }
}
body[data-surface="editorial"] .footer__brand {
  font-size: 14px; color: var(--ink-3); line-height: 1.55;
  max-width: 320px; margin-top: var(--space-3);
}
body[data-surface="editorial"] .footer__col h4 {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  font-weight: 600; color: var(--ink-3); margin-bottom: var(--space-3);
}
body[data-surface="editorial"] .footer__col ul { display: flex; flex-direction: column; gap: var(--space-2); list-style: none; padding: 0; margin: 0; }
body[data-surface="editorial"] .footer__col a { font-size: 13.5px; color: var(--ink-2); }
body[data-surface="editorial"] .footer__col a:hover { color: var(--ink); }
body[data-surface="editorial"] .footer__legal {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: var(--space-5); border-top: var(--border-2);
  font-size: 12px; color: var(--ink-4);
  flex-wrap: wrap; gap: var(--space-3);
}
body[data-surface="editorial"] .footer__legal a { color: var(--ink-3); white-space: nowrap; }
