/* Hermes Ventures product template — shared stylesheet.
   No web fonts, no framework: system font stacks, mobile-first layout.

   HOW THEMING WORKS
   - Everything between BASE START / BASE END is the shared template and lives
     in the `base` cascade layer. Copy it verbatim into every site; never edit
     it per site.
   - Each site re-themes in public/css/theme.css (imported below into the
     `theme` layer, which always beats `base` regardless of selector
     specificity). Override the design tokens on :root there, plus any
     site-specific component rules.
   - Site-only rules that are not theme (app screens etc.) go AFTER BASE END,
     unlayered, and beat both layers.
   Tokens: --brand --brand-strong --brand-ink --on-brand --accent --on-accent
   --ink --ink-muted --bg --surface --surface-strong --line --link --focus
   --radius --radius-lg --font-display --font-body --font-mono and the
   --header-* / --hero-* / --band-* / --footer-* surface groups. */

@layer base, theme;
@import url("theme.css") layer(theme);

/* ===================== BASE START (shared template) ===================== */
@layer base {
  :root {
    /* ---- design tokens (override in theme.css) ---- */
    --brand: #1d4ed8;
    --brand-strong: #1739a6;
    --brand-ink: #0f1f4d;
    --on-brand: #ffffff;
    --accent: #0ea5e9;
    --on-accent: #06202c;
    --ink: #16181d;
    --ink-muted: #4b5262;
    --bg: #ffffff;
    --surface: #f5f7fa;
    --surface-strong: #eaeef4;
    --card-bg: #ffffff;
    --line: #d8dce3;
    --link: var(--brand);
    --focus: var(--brand);
    --danger: #b3261e;
    --success: #146c2e;

    --radius: 10px;
    --radius-lg: 16px;
    --radius-pill: 999px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
    --shadow-lg: 0 24px 60px -24px rgba(16, 24, 40, 0.35);

    --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
    --display-weight: 750;
    --display-tracking: -0.02em;
    --display-case: none;
    --eyebrow-font: var(--font-body);

    --header-bg: rgba(255, 255, 255, 0.92);
    --header-ink: var(--ink);
    --header-line: var(--line);
    --hero-bg: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
    --hero-ink: var(--ink);
    --hero-muted: var(--ink-muted);
    --hero-eyebrow: var(--brand);
    --hero-line: var(--line);
    --band-bg: var(--brand-ink);
    --band-ink: #ffffff;
    --band-link: #ffffff;
    --footer-bg: var(--surface);
    --footer-ink: var(--ink-muted);

    --max-width: 1120px;
    --gutter: 20px;
    --section-space: clamp(56px, 8vw, 96px);

    /* ---- legacy aliases (site-specific CSS written before tokens) ---- */
    --color-bg: var(--bg);
    --color-text: var(--ink);
    --color-text-muted: var(--ink-muted);
    --color-border: var(--line);
    --color-surface: var(--surface);
    /* Legacy CSS uses --color-primary mostly as TEXT/border colour, so it maps
       to the AA-safe --link, not to --brand (which may be a light button fill). */
    --color-primary: var(--link);
    --color-primary-dark: var(--link);
    --color-primary-contrast: var(--on-brand);
    --color-focus: var(--focus);
    --color-danger: var(--danger);
    --color-success: var(--success);
    --font-sans: var(--font-body);
  }

  * {
    box-sizing: border-box;
  }

  /* Author display rules (e.g. .progress { display: flex }) must never
     un-hide an element carrying the hidden attribute. */
  [hidden] {
    display: none !important;
  }

  html {
    color-scheme: light;
    scroll-padding-top: 96px;
    -webkit-text-size-adjust: 100%;
  }

  body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 1.0625rem;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-wrap: break-word;
  }

  img,
  svg,
  video {
    max-width: 100%;
  }

  img {
    display: block;
    height: auto;
  }

  h1,
  h2,
  h3 {
    font-family: var(--font-display);
    font-weight: var(--display-weight);
    letter-spacing: var(--display-tracking);
    line-height: 1.15;
    text-wrap: balance;
  }

  h1,
  h2 {
    text-transform: var(--display-case);
  }

  p {
    text-wrap: pretty;
  }

  a {
    color: var(--link);
    text-underline-offset: 0.18em;
    text-decoration-thickness: 1px;
  }

  a:hover {
    text-decoration-thickness: 2px;
  }

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

  .container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding-left: var(--gutter);
    padding-right: var(--gutter);
  }

  .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--brand);
    color: var(--on-brand);
    padding: 10px 16px;
    z-index: 100;
    border-radius: 0 0 var(--radius) 0;
  }

  .skip-link:focus {
    left: 0;
  }

  /* ---------------- Header / nav ---------------- */
  .site-header {
    background: var(--header-bg);
    color: var(--header-ink);
    border-bottom: 1px solid var(--header-line);
    position: relative;
    z-index: 40;
  }

  @media (min-width: 720px) {
    .site-header {
      position: sticky;
      top: 0;
      -webkit-backdrop-filter: saturate(1.4) blur(10px);
      backdrop-filter: saturate(1.4) blur(10px);
    }
  }

  /* .nav is also a .container: only set vertical padding here so the
     container's side gutters survive (the old `padding: 16px 0` removed them). */
  .nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 24px;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .nav__brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 750;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
    color: var(--header-ink);
    text-decoration: none;
    min-height: 40px;
  }

  /* Brand mark: every site ships /favicon.svg, reused here so no page markup
     has to change. */
  .nav__brand::before {
    content: "";
    flex: none;
    width: 30px;
    height: 30px;
    background: url("/favicon.svg") center / contain no-repeat;
  }

  .nav__links {
    display: flex;
    align-items: center;
    gap: 6px 22px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
  }

  .nav__links a:not(.btn) {
    color: var(--header-ink);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 6px 0;
    display: inline-block;
  }

  .nav__links a:not(.btn):hover {
    text-decoration: underline;
    text-decoration-thickness: 2px;
  }

  .nav__links .btn {
    padding: 9px 16px;
    font-size: 0.95rem;
  }

  /* Phones: row 1 = brand + CTA, row 2 = text links. The list is flattened
     with display: contents so its items can be ordered around a forced line
     break (.nav::after), without any markup change or JS. */
  @media (max-width: 719px) {
    .nav {
      padding-top: 10px;
      padding-bottom: 10px;
      gap: 8px 16px;
      justify-content: flex-start;
    }

    .nav__brand {
      font-size: 1rem;
      gap: 8px;
    }

    .nav__brand::before {
      width: 26px;
      height: 26px;
    }

    .nav__links {
      display: contents;
    }

    .nav__links li {
      order: 3;
    }

    .nav__links li:has(> .btn) {
      order: 1;
      margin-left: auto;
    }

    .nav::after {
      content: "";
      order: 2;
      flex-basis: 100%;
      height: 1px;
      background: var(--header-line);
    }

    .nav__links a:not(.btn) {
      font-size: 0.92rem;
      padding: 4px 0;
    }

    .nav__links .btn {
      padding: 7px 12px;
      font-size: 0.9rem;
      min-height: 38px;
    }
  }

  /* ---------------- Buttons ---------------- */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font: inherit;
    font-weight: 650;
    line-height: 1.2;
    padding: 13px 22px;
    min-height: 44px;
    border-radius: var(--radius);
    border: 1.5px solid transparent;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
  }

  .btn:active {
    transform: translateY(1px);
  }

  .btn--primary,
  .nav__links a.btn--primary {
    background: var(--brand);
    color: var(--on-brand);
  }

  .btn--primary:hover,
  .nav__links a.btn--primary:hover {
    background: var(--brand-strong);
    color: var(--on-brand);
  }

  .btn--secondary {
    background: transparent;
    border-color: var(--line);
    color: var(--ink);
  }

  .btn--secondary:hover {
    border-color: var(--ink);
    color: var(--ink);
  }

  .btn--block {
    display: flex;
    width: 100%;
  }

  /* ---------------- Hero ---------------- */
  /* Optional hero art: a theme sets --hero-art: url("/art/hero.webp") plus a
     --hero-scrim gradient that keeps the copy legible. Decorative, so it is a
     CSS background (no alt text, no layout shift). Phones get the art as a
     band behind the visual at the bottom of the hero. */
  .hero {
    padding: clamp(40px, 7vw, 96px) 0 clamp(48px, 7vw, 96px);
    background:
      var(--hero-scrim, linear-gradient(transparent, transparent)),
      var(--hero-art, none) var(--hero-art-pos, right center) / cover no-repeat,
      var(--hero-bg);
    color: var(--hero-ink);
    overflow: hidden;
  }

  @media (max-width: 899px) {
    .hero {
      background:
        var(--hero-scrim-mobile, linear-gradient(transparent, transparent)),
        var(--hero-art, none) center bottom / 100% auto no-repeat,
        var(--hero-bg);
    }
  }

  .hero__grid {
    display: grid;
    gap: 40px;
    align-items: center;
  }

  @media (min-width: 900px) {
    .hero__grid {
      grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
      gap: 56px;
    }
  }

  .hero__visual {
    min-width: 0;
  }

  .hero__visual svg {
    display: block;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 24px 40px rgba(10, 14, 24, 0.18));
  }

  .hero__eyebrow {
    display: inline-block;
    color: var(--hero-eyebrow);
    font-family: var(--eyebrow-font);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
    margin: 0 0 16px;
  }

  .hero h1 {
    font-size: clamp(2.1rem, 5.2vw, 3.5rem);
    line-height: 1.06;
    margin: 0 0 18px;
    color: inherit;
  }

  .hero__sub {
    font-size: clamp(1.05rem, 1.6vw, 1.2rem);
    color: var(--hero-muted);
    max-width: 620px;
    margin: 0 0 30px;
  }

  .hero__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
  }

  .hero .btn--secondary {
    color: var(--hero-ink);
    border-color: var(--hero-line);
  }

  .hero .btn--secondary:hover {
    border-color: var(--hero-ink);
  }

  .hero__note {
    margin: 18px 0 0;
    font-size: 0.9rem;
    color: var(--hero-muted);
  }

  /* ---------------- Sections ---------------- */
  section {
    padding: var(--section-space) 0;
  }

  section h2 {
    font-size: clamp(1.65rem, 3.2vw, 2.25rem);
    margin: 0 0 12px;
  }

  section h2 + .grid,
  section h2 + details {
    margin-top: 28px;
  }

  .section-lead {
    color: var(--ink-muted);
    max-width: 680px;
    margin: 0 0 32px;
  }

  .how-it-works {
    background: var(--surface);
  }

  .grid {
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr;
  }

  @media (min-width: 720px) {
    .grid--3 {
      grid-template-columns: repeat(3, 1fr);
    }
  }

  .card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 26px 24px;
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
  }

  .card h3 {
    margin-top: 0;
    font-size: 1.15rem;
  }

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

  /* Decorative accent bar on value-prop cards. */
  .value-props .card::before {
    content: "";
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--accent);
    margin-bottom: 18px;
  }

  /* Pricing teaser: a full-bleed brand band. */
  .pricing-teaser {
    background: var(--band-bg);
    color: var(--band-ink);
  }

  .pricing-teaser .container > p {
    font-size: 1.15rem;
    margin: 0;
  }

  .pricing-teaser a {
    color: var(--band-link);
    font-weight: 650;
  }

  .pricing-teaser .plan-card a,
  .plan-card a:not(.btn) {
    color: var(--link);
  }

  .pricing-teaser .grid {
    margin-top: 28px;
  }

  /* ---------------- Pricing ---------------- */
  section.pricing {
    background: var(--hero-bg);
    color: var(--hero-ink);
    padding-bottom: clamp(56px, 7vw, 88px);
  }

  .pricing h1 {
    font-size: clamp(2.1rem, 5vw, 3.2rem);
    margin: 0 0 14px;
  }

  .pricing .container > p {
    max-width: 720px;
    color: var(--hero-muted);
    font-size: 1.08rem;
  }

  .pricing .container > p a {
    color: inherit;
  }

  .pricing .grid {
    margin-top: 36px;
  }

  .pricing .plan-card {
    color: var(--ink);
  }

  .plan-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 30px 26px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--card-bg);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
  }

  .plan-card h3 {
    margin: 0;
    font-size: 1.2rem;
  }

  .plan-card--highlight {
    border-color: var(--brand);
    box-shadow: 0 0 0 1px var(--brand), var(--shadow-lg);
  }

  .plan-card__price {
    font-family: var(--font-display);
    font-size: 2.4rem;
    font-weight: 750;
    letter-spacing: -0.02em;
    margin: 0;
  }

  .plan-card__period {
    font-size: 1rem;
    font-weight: 400;
    color: var(--ink-muted);
  }

  .plan-card__desc {
    color: var(--ink-muted);
    margin: 0;
  }

  .plan-card__features {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
  }

  .plan-card__features li {
    padding: 8px 0 8px 26px;
    border-top: 1px solid var(--line);
    position: relative;
  }

  .plan-card__features li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 0.95em;
    width: 12px;
    height: 7px;
    border-left: 2px solid var(--brand);
    border-bottom: 2px solid var(--brand);
    transform: translateY(-50%) rotate(-45deg);
  }

  .plan-card__features li:first-child {
    border-top: none;
  }

  /* ---------------- Forms ---------------- */
  .form-field {
    margin-bottom: 16px;
  }

  .form-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
  }

  .form-field input[type="email"],
  .form-field input[type="text"],
  .form-field input[type="url"],
  .form-field input[type="number"],
  .form-field input[type="search"],
  .form-field input[type="password"],
  .form-field textarea,
  .form-field select {
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff;
    color: var(--ink);
    font: inherit;
  }

  .form-field input:focus-visible,
  .form-field textarea:focus-visible,
  .form-field select:focus-visible {
    border-color: var(--focus);
  }

  .form-field--checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
  }

  .form-field--checkbox input {
    margin-top: 5px;
    width: 18px;
    height: 18px;
    flex: none;
    accent-color: var(--focus);
  }

  .form-field--checkbox label {
    font-weight: 400;
    font-size: 0.95rem;
    color: var(--ink-muted);
  }

  .form-status {
    margin-top: 12px;
    font-size: 0.95rem;
  }

  .form-status--error {
    color: var(--danger);
  }

  .form-status--ok {
    color: var(--success);
  }

  /* Honeypot field: present in the DOM for bots, hidden from sighted and
     screen-reader users, and never reachable by keyboard tab order. */
  .hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
  }

  /* Inline waitlist: a centred card. */
  .waitlist .container {
    max-width: 640px;
  }

  .waitlist h2 {
    text-align: center;
  }

  .waitlist form {
    margin-top: 24px;
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: clamp(20px, 4vw, 32px);
    box-shadow: var(--shadow-lg);
  }

  /* ---------------- FAQ ---------------- */
  .faq details {
    max-width: 880px;
    border-bottom: 1px solid var(--line);
    padding: 4px 0;
  }

  .faq details:first-of-type {
    border-top: 1px solid var(--line);
  }

  .faq summary {
    cursor: pointer;
    font-weight: 650;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
  }

  .faq summary::-webkit-details-marker {
    display: none;
  }

  .faq summary::after {
    content: "+";
    content: "+" / "";
    flex: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 500;
    font-size: 1.2rem;
    line-height: 1;
    background: var(--surface-strong);
    color: var(--ink);
  }

  .faq details[open] summary::after {
    content: "\2212";
    content: "\2212" / "";
  }

  .faq details p {
    margin: 0 0 16px;
    color: var(--ink-muted);
    max-width: 720px;
  }

  /* ---------------- Modal ---------------- */
  .modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 18, 25, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 50;
  }

  .modal-backdrop[hidden] {
    display: none;
  }

  .modal {
    background: var(--bg);
    color: var(--ink);
    border-radius: var(--radius-lg);
    padding: 28px;
    max-width: 460px;
    width: 100%;
    max-height: calc(100vh - 40px);
    overflow: auto;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
  }

  .modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
  }

  .modal__header h2 {
    margin: 0;
    font-size: 1.4rem;
  }

  .modal__close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    color: var(--ink);
    border-radius: var(--radius);
  }

  /* ---------------- Footer ---------------- */
  .site-footer {
    background: var(--footer-bg);
    color: var(--footer-ink);
    padding: 40px 0;
    font-size: 0.9rem;
  }

  main + .site-footer,
  .site-footer {
    margin-top: 0;
  }

  .site-footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    list-style: none;
    padding: 0;
    margin: 0 0 14px;
  }

  .site-footer__links a,
  .site-footer a {
    color: var(--footer-ink);
  }

  /* ---------------- Legal / content pages ---------------- */
  .legal {
    padding: 48px 0 72px;
    max-width: 800px;
  }

  .legal h1 {
    margin-bottom: 4px;
    font-size: clamp(1.9rem, 4vw, 2.6rem);
  }

  .legal .legal__meta {
    color: var(--ink-muted);
    margin-top: 0;
    margin-bottom: 32px;
  }

  .legal h2 {
    font-size: 1.3rem;
    margin-top: 36px;
  }

  /* 404 */
  .not-found {
    padding: 96px 0;
    text-align: center;
  }

  @media (prefers-reduced-motion: reduce) {
    * {
      transition: none !important;
      animation: none !important;
      scroll-behavior: auto !important;
    }
  }
}
/* ====================== BASE END (shared template) ====================== */

/* Cloudflare Turnstile widget slot (rendered by app.js only when a site key is configured). */
.turnstile-slot {
  margin: 0.75rem 0;
  min-height: 65px;
}
