/*
  Apex by Mountain Air Web: site layer. Loaded after the theme (unlayered), so anything here wins.
  Put this site's design here, not in the shared maw-starter theme.

  1. Tokens: override --maw-* variables (full list in user/themes/maw-starter/css/tokens.css).
  2. Site-wide rules: typography, header/footer tweaks.
  3. Per-block styling: user/site/css/blocks/<type>.css is loaded only when that block is on the page.

  ─── Apex design system ───────────────────────────────────────────────────
  Everything comes from the logo (Apex Proof Logo.pdf, page 4).

  Colour
    ink      #18191d  text, dark sections, the mark
    ink-2    #232429  surfaces on ink (the dark app icon)
    cream    #f5f4ef  the logo's ground; alternate sections
    paper    #fbfaf7  page background
    green    #148a5a  brand green: the slash and the dot. Decoration only;
                      white text on it is 4.4:1, just short of AA.
    green-strong #0f7a4f  buttons, links, eyebrows on light (5.3:1 with white)
    green-bright #3ecf8e  the green on ink (8.7:1)

  Type
    Geist           headings and body
    JetBrains Mono  the wordmark, eyebrows, badges, prices: the "code" voice

  Signature
    The slash. Eyebrows read as a path ("/ how it works"), echoing apex/proof.

  Section recipe: paper hero with a faint grid, cream (alt) and ink (dark)
  bands alternating below, an ink footer. Keep green scarce so it pops.
*/

:root {
  --apex-ink: #18191d;
  --apex-ink-2: #232429;
  --apex-ink-line: #33353b;
  --apex-cream: #f5f4ef;
  --apex-paper: #fbfaf7;
  --apex-green: #148a5a;
  --apex-green-strong: #0f7a4f;
  --apex-green-deep: #0b6340;
  --apex-green-bright: #3ecf8e;
  --apex-mint: #e3f1e9;
  --apex-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --maw-accent: var(--apex-green-strong);
  --maw-accent-hover: var(--apex-green-deep);
  --maw-accent-contrast: #ffffff;
  --maw-accent-soft: var(--apex-mint);
  --maw-bg: var(--apex-paper);
  --maw-bg-alt: var(--apex-cream);
  --maw-bg-inverse: var(--apex-ink);
  --maw-surface: #ffffff;
  --maw-text: var(--apex-ink);
  --maw-text-muted: #5b5d64;
  --maw-border: #e4e2da;
  --maw-link: var(--apex-green-strong);
  --maw-focus: color-mix(in oklab, var(--apex-green) 40%, transparent);

  --maw-font-body: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --maw-font-heading: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --maw-font-mono: var(--apex-mono);
  --maw-leading-tight: 1.08;

  --maw-radius: 0.625rem;
  --maw-shadow-sm: 0 1px 2px rgb(24 25 29 / 0.06);
  --maw-shadow: 0 6px 20px rgb(24 25 29 / 0.08);
  --maw-shadow-lg: 0 30px 70px -20px rgb(24 25 29 / 0.35);
}

/* ── Type ──────────────────────────────────────────────────────────────── */

body { font-feature-settings: "ss01", "cv11"; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.035em; text-wrap: balance; }
h3, h4 { letter-spacing: -0.02em; }
p { text-wrap: pretty; }
code, kbd, pre { font-family: var(--apex-mono); }
::selection { background: color-mix(in oklab, var(--apex-green) 22%, white); }

/* Eyebrows read as a path: "/ how it works". */
.eyebrow {
  font-family: var(--apex-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: var(--apex-green-strong);
}
.eyebrow::before { content: "/ "; font-weight: 700; color: var(--apex-green); }

/* ── Buttons ───────────────────────────────────────────────────────────── */

.btn { font-weight: 600; border-radius: 0.55rem; letter-spacing: -0.01em; }
.btn-primary {
  background: var(--apex-green-strong);
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.18) inset, 0 6px 18px -6px rgb(15 122 79 / 0.55);
}
.btn-primary:hover { background: var(--apex-green-deep); }
.btn-secondary { background: #fff; border-color: #d6d4cb; color: var(--apex-ink); }
.btn-secondary:hover { border-color: var(--apex-ink); }

/* ── Header ────────────────────────────────────────────────────────────── */

.site-header { border-bottom-color: transparent; }
.site-header::before { background: color-mix(in oklab, var(--apex-paper) 82%, transparent); box-shadow: 0 1px 0 var(--maw-border); }
.nav-list a { font-weight: 500; color: #3d3f45; }
.nav-list a:hover, .nav-list a[aria-current="page"], .nav-list .is-active > a { background: transparent; color: var(--apex-ink); box-shadow: inset 0 -2px 0 var(--apex-green); border-radius: 0; }

/* ── Logo ──────────────────────────────────────────────────────────────── */
/* Mark + "apex/<tool>" wordmark (templates/partials/logo.html.twig).
   Proportions are the artwork's, in em of the wordmark: the mark is 1.64em
   tall, the gap 0.79em, the slash 0.95em tall from 0.11em below the baseline. */
.apex-logo { gap: 0.79em; font-size: 1.3rem; color: var(--apex-ink); }
.apex-logo__mark { flex: none; height: 1.64em; width: auto; }
.apex-logo__word { font-family: var(--apex-mono); font-weight: 700; letter-spacing: 0; line-height: 1; white-space: nowrap; }
.apex-logo__slash { display: inline-block; height: 0.95em; width: auto; margin-inline: 0.02em 0.05em; vertical-align: -0.11em; }

/* ── Sections ──────────────────────────────────────────────────────────── */

/* Ink bands replace the theme's navy. */
.section--bg-dark {
  background: var(--apex-ink);
  color: #eceae3;
  --maw-text: #f5f4ef;
  --maw-text-muted: #a9aab0;
  --maw-border: var(--apex-ink-line);
  --maw-surface: var(--apex-ink-2);
  --maw-bg-alt: var(--apex-ink-2);
  --maw-link: var(--apex-green-bright);
  --maw-accent-soft: rgb(62 207 142 / 0.12);
}
.section--bg-dark .eyebrow { color: var(--apex-green-bright); opacity: 1; }
.section--bg-dark .eyebrow::before { color: var(--apex-green-bright); }
.section--bg-dark .icon-badge { color: var(--apex-green-bright); }
.section--bg-dark .checklist svg { color: var(--apex-green-bright); }
.section--bg-dark .btn-primary { background: var(--apex-green-bright); color: var(--apex-ink); box-shadow: 0 8px 24px -8px rgb(62 207 142 / 0.6); }
.section--bg-dark .btn-primary:hover { background: #5ee0a5; }
.section--bg-dark .btn-secondary { background: transparent; color: #f5f4ef; border-color: #4a4c52; }
.section--bg-dark .btn-secondary:hover { border-color: #f5f4ef; }

/* Faint blueprint grid behind a band, fading out. On the first hero by default. */
.site-main > .block--hero:first-child,
.apex-grid { isolation: isolate; }
.site-main > .block--hero:first-child::before,
.apex-grid::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(42rem 22rem at 78% 8%, rgb(20 138 90 / 0.10), transparent 70%),
    linear-gradient(to right, rgb(24 25 29 / 0.055) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(to bottom, rgb(24 25 29 / 0.055) 1px, transparent 1px) 0 0 / 44px 44px;
  mask-image: linear-gradient(to bottom, #000 45%, transparent);
  pointer-events: none;
}
.section--bg-dark.apex-grid::before {
  background:
    radial-gradient(40rem 20rem at 50% 0%, rgb(62 207 142 / 0.16), transparent 70%),
    linear-gradient(to right, rgb(255 255 255 / 0.05) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(to bottom, rgb(255 255 255 / 0.05) 1px, transparent 1px) 0 0 / 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 20%, #000 30%, transparent 75%);
}

/* The first hero sits closer to the header, so the fold shows more. */
.site-main > .block--hero:first-child { padding-top: var(--maw-section-sm); }
.site-main > .block--hero:first-child .hero__title { font-size: clamp(2.5rem, 1.6rem + 2.6vw, 3.75rem); font-weight: 750; letter-spacing: -0.045em; }
.hero__text { font-size: var(--maw-text-lg); color: var(--maw-text-muted); }

/* ── Components ────────────────────────────────────────────────────────── */

.icon-badge { border-radius: 0.55rem; background: var(--maw-accent-soft); color: var(--apex-green-strong); }
.card { border-color: var(--maw-border); box-shadow: var(--maw-shadow-sm); }
.section--bg-dark .card { box-shadow: none; }
.checklist svg { color: var(--apex-green); }

/* Features as cards: a hairline of green on hover. */
.block--features .features--cards .feature { transition: border-color var(--maw-duration), transform var(--maw-duration) var(--maw-ease); }
.block--features .features--cards .feature:hover { border-color: color-mix(in oklab, var(--apex-green) 55%, transparent); transform: translateY(-2px); }

/* Pricing: the featured plan is an ink card. */
.block--pricing .plan__badge { font-family: var(--apex-mono); font-weight: 600; letter-spacing: 0.02em; text-transform: lowercase; background: var(--apex-mint); color: var(--apex-green-deep); }
.block--pricing .plan__amount { font-weight: 750; letter-spacing: -0.05em; }
.block--pricing .plan--featured {
  background: var(--apex-ink);
  color: #f5f4ef;
  border: 1px solid var(--apex-ink);
  box-shadow: var(--maw-shadow-lg), 0 0 0 1px rgb(62 207 142 / 0.25);
  --maw-text: #f5f4ef;
  --maw-text-muted: #a9aab0;
  --maw-border: var(--apex-ink-line);
}
.block--pricing .plan--featured .card__title,
.block--pricing .plan--featured .plan__amount { color: #fff; }
.block--pricing .plan--featured .plan__badge { background: rgb(62 207 142 / 0.14); color: var(--apex-green-bright); }
.block--pricing .plan--featured .checklist svg,
.block--pricing .plan--featured svg { color: var(--apex-green-bright); }
.block--pricing .plan--featured .btn-primary { background: var(--apex-green-bright); color: var(--apex-ink); }

/* FAQ: mono question marks the path voice without shouting. */
.block--faq summary { font-weight: 600; letter-spacing: -0.015em; }
.block--faq details[open] summary svg { color: var(--apex-green); }

/* Forms. */
.form-input { border-color: #d9d7ce; background: #fff; transition: border-color var(--maw-duration), box-shadow var(--maw-duration); }
.form-input:hover { border-color: #b9b7ae; }
.form-input:focus { outline: none; border-color: var(--apex-green); box-shadow: 0 0 0 4px color-mix(in oklab, var(--apex-green) 18%, transparent); }
.form-label { font-weight: 500; }

/* Product screenshots (class: apex-shot on the block): framed, never bare pixels on the page. */
.apex-shot .hero__media img { width: 100%; height: auto; }
@media (min-width: 861px) {
  /* The theme stacks the split below 861px; only rebalance above it. */
  .apex-shot .hero--split { grid-template-columns: 1fr 1.2fr; }
}
.apex-shot .hero__media img,
.apex-shot .media-text__media img {
  border-radius: 0.9rem;
  border: 1px solid rgb(24 25 29 / 0.14);
  box-shadow: var(--maw-shadow-lg);
}

/* ── Footer: ink, like the dark lockup ─────────────────────────────────── */

.site-footer { background: var(--apex-ink); border-top: 0; color: #a9aab0; }
.site-footer .apex-logo { font-size: 1.1rem; color: #f5f4ef; }
.site-footer a:hover { color: #f5f4ef; }
.site-footer .footer-links a { text-decoration: none; }
.site-footer .footer-links a:hover { color: var(--apex-green-bright); }

/* ── Coming soon ───────────────────────────────────────────────────────── */
/* A "soon" tag on unreleased tools in the nav. Remove the selector at launch. */
.nav-list a[href$="/scout"]::after {
  content: "soon";
  margin-left: 0.45em;
  padding: 0.1em 0.45em;
  border-radius: 0.35rem;
  background: var(--apex-mint);
  color: var(--apex-green-deep);
  font: 600 0.68rem/1.4 var(--apex-mono);
  vertical-align: 0.12em;
}

/* Centred heroes sit in the regular wrapper, but the headline reads best at ~1000px. */
.block--hero .hero--centered .hero__title { max-width: 62.5rem; margin-inline: auto; }
