/* =============================================================
   CYLVY DESIGN SYSTEM — override layer
   Loads after the parent React/Tailwind v4 bundle.
   See docs/design-system.md for the spec this implements.
   ============================================================= */

/* -- 1. Redefine the parent theme tokens (Tailwind v4 @theme layer) --
   These cascade through every utility class (.font-bold, .text-base,
   .text-mine-shaft, etc.) so we change the whole site by editing here. */
:root,
:host {
    /* Typography
       "Inter Variable"   = self-hosted via @fontsource-variable/inter (Vite bundle, woff2 in theme/dist/assets/)
       "Inter Fallback"   = metric-matched Arial (@font-face in global.css) — same metrics as Inter, zero layout shift
       No external Google Fonts request is made. */
    --font-sans: 'Inter Variable', 'Inter Fallback', ui-sans-serif, system-ui, sans-serif;

    /* Colour — Cylvy palette (see design-system.md §5) */
    --color-ink:        #0A0A0A;
    --color-paper:      #FFFFFF;
    --color-mine-shaft: #0A0A0A;   /* was #282828 — unify on one ink */
    --color-black:      #0A0A0A;   /* push pure black to near-black */
    --color-concrete:   #F4F4F2;   /* warmer paper for sections */
    --color-swiss-coffee: #f4f4f2;
    --color-divider:    #E5E2DF;
    --color-silver-chalice: #8E8E8E;
    --color-send:       #5C5C5C;

    /* Accents */
    --color-cobalt:     #1B2BE0;
    --color-magenta:    #E94CB8;
    --color-cylvy-purple:      #7C3AED;   /* email accent (#7C3AED) */
    --color-cylvy-purple-dark: #6D28D9;   /* CTA hover (darker shade) */
    --color-cylvy-secondary:   #5F828F;   /* cooler secondary CTA */
    --color-cylvy-secondary-dark: #4B6974;
    --color-cylvy-cta:         #6B767A;
    --color-cylvy-cta-dark:    #596367;
    --color-header-demo:       #6B767A;
    --color-header-demo-hover: #596367;
    --color-header-login:      #0A0A0A;
    --color-header-login-hover: #282828;

    /* The ring gradient (use sparingly, hero/footer only) */
    --ring-linear: linear-gradient(135deg, #1B2BE0 0%, #E94CB8 100%);
}

/* -- 2. Body baseline -- */
html, body {
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'ss01', 'cv11';
    color: var(--color-ink);
}

/* -- 3. THE TYPE SYSTEM — semantic-first --
   Every heading lands on the ramp regardless of what classes the React
   bundle stamps on it. Descendants are forced to inherit so utility
   classes like `font-bold` and arbitrary `text-[Npx]` inside headings
   are neutralised. This is the real refactor — not a patch. */

/* Display — homepage hero H1. Generous, light, slightly tracked.
   Ceiling lowered to 44px so "Ultra-Intelligence Marketing™" fits on a
   single line inside the 601px hero text column.
   Line-height 1.25 gives the two block <span> lines (heading + subheading)
   visible breathing room without overcorrecting on single-line H1s. */
h1 {
    font-size: clamp(32px, 2vw + 18px, 44px);
    line-height: 1.25;
    letter-spacing: -0.012em;
    font-weight: 400;
    color: var(--color-ink);
}

/* H2 — section subheadings ("The AI growth engine for B2B marketing.") */
h2 {
    font-size: clamp(28px, 1.4vw + 20px, 36px);
    line-height: 1.3;
    letter-spacing: -0.006em;
    font-weight: 400;
    color: var(--color-ink);
}

/* H3 — card and component headings */
h3 {
    font-size: 22px;
    line-height: 1.4;
    letter-spacing: -0.003em;
    font-weight: 400;
    color: var(--color-ink);
}

/* H4 — small labels / strong inline section breaks */
h4 {
    font-size: 18px;
    line-height: 1.45;
    letter-spacing: 0;
    font-weight: 500;
    color: var(--color-ink);
}

h5, h6 {
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0;
    font-weight: 500;
    color: var(--color-ink);
}

/* The neutraliser — every descendant of a heading inherits the heading's
   type properties. This kills `<span class="text-[36px] font-bold">`
   inside `<h2>` and similar bundle-stamped variants.
   Exception: `.tm-mark` (®/™) must keep its own 50% size — excluding it here
   lets the .tm-mark rule below win, so the symbol scales down inside headings
   instead of inheriting the full heading size and floating high.
   No !important needed: override.css is unlayered, so per CSS Cascade
   Layers these rules already beat any @layer utilities/components rule
   regardless of specificity — unless the bundle stamps a bang-prefixed
   (!text-*, !font-*, etc.) utility, which as of this writing does not
   occur on headings or their descendants (see CSS audit). If a future
   bang-prefixed heading utility is introduced, this rule will need to
   move into `@layer utilities` with matching specificity, following the
   pattern used for `.\!text-2xl.\!leading-5` below. */
h1 *:not(.tm-mark), h2 *:not(.tm-mark), h3 *:not(.tm-mark),
h4 *:not(.tm-mark), h5 *:not(.tm-mark), h6 *:not(.tm-mark) {
    font-size: inherit;
    line-height: inherit;
    letter-spacing: inherit;
    font-weight: inherit;
}

/* Paragraphs — generous line-height, gentle tracking, never bold. */
p {
    font-size: 16px;
    line-height: 1.65;
    letter-spacing: 0.003em;
    font-weight: 400;
    color: var(--color-ink);
}

/* "Lead" paragraphs — first child of a hero/section gets more presence.

   `.type-lead` is the semantic class emitted by src/lib/typography.ts via
   src/styles/typography.css. That definition lives inside @layer components,
   while this rule is unlayered — per CSS Cascade Level 5, unlayered rules
   beat any layered rule regardless of specificity, so no !important is
   needed to win against `.type-lead` (components layer). It also beats the
   `p { font-size: 16px }` rule above on specificity alone (both unlayered,
   same file). Verified 0 bang-prefixed (`!text-*`) utilities are stamped on
   any lead paragraph in src/. */
.lead, p.lead, p[class*="text-[22px]"], p[class*="text-[19.5px]"], p.text-lg,
.type-lead, p.type-lead {
    font-size: 20px;
    line-height: 1.55;
    letter-spacing: 0;
    font-weight: 400;
}

/* -- 4. Class escape hatches — only for sizes outside headings --
   Maps Tailwind utility classes onto the design-system ramp.
   Arbitrary text-[Npx] classes have been removed from source (0 usage
   confirmed in src/); only standard Tailwind scale classes remain.

   These are unlayered normal rules, so they already beat Tailwind's own
   layered utility of the same name — no !important required. Bang-prefixed
   (`!text-*`) variants had a dedicated @layer utilities rescue block here;
   removed in Phase 5 after confirming 0 usage in src/ (see git history if
   one is ever reintroduced — it will need the same layered !important
   treatment to win against Tailwind's own bang-prefixed utilities). */

.text-base {
    font-size: 16px;
    line-height: 1.65;
    letter-spacing: 0.003em;
}

.text-sm,
.text-\[13px\],
.text-\[11px\] {
    font-size: 14px;
    line-height: 1.55;
    letter-spacing: 0.005em;
}

.text-xs {
    font-size: 12px;
    line-height: 1.4;
    letter-spacing: 0.005em;
}

.text-xl {
    font-size: 20px;
    line-height: 1.5;
    letter-spacing: 0;
    font-weight: 400;
}

.text-2xl {
    font-size: 24px;
    line-height: 1.4;
    letter-spacing: -0.003em;
    font-weight: 400;
}

/* -- 12. Targeted bundle fixes --
   The compiled React/Tailwind bundle ships a few utility combinations
   that produce broken layout. These are surgical overrides. */

/* Agents section row alignment.
   The three agent cards each render as `flex flex-col gap-5`, so every
   card sizes its rows independently. When one card has a longer
   subhead or body the image and CTA rows fall out of sync between
   columns. Promote the outer grid to a subgrid-aware layout so the
   five rows (title, subhead, image, body, buttons) auto-size to the
   tallest sibling and align horizontally across all three cards.

   Use row-gap: 0 and per-row margin-top instead of a uniform gap so
   we can keep the title→subhead pair tight while still giving the
   image and CTA rows generous breathing room.

   No !important needed: AgentsSection.tsx (src/components/AgentsSection.tsx)
   stamps only plain Tailwind utilities on the grid/article/card elements
   (no bang-prefixed `!*` classes), so override.css already wins as an
   unlayered rule regardless of specificity, per CSS Cascade Layers. */
@media (min-width: 1024px) {
    .grid.lg\:grid-cols-3:has(> article > div.aspect-\[1024\/852\]) {
        grid-template-rows: repeat(5, auto);
        row-gap: 0;
    }

    .grid.lg\:grid-cols-3:has(> article > div.aspect-\[1024\/852\]) > article {
        display: grid;
        grid-row: span 5;
        grid-template-rows: subgrid;
        row-gap: 0;
        column-gap: 0;
    }

    /* Equalise card widths so all three images render at identical
       dimensions. The bundle ships card 1 with `pl-0 border-l-0` and
       cards 2/3 with `pl-6 border-l`, leaving card 1 about 25 px
       wider than its siblings. Force the same left padding on every
       card; the visual dividers remain on cards 2 and 3. */
    .grid.lg\:grid-cols-3:has(> article > div.aspect-\[1024\/852\]) > article {
        padding-left: 1.5rem;
    }

    /* Per-row spacing — subgrid still aligns rows across columns
       because every card has the same structure and the same
       margin-top values. */
    .grid.lg\:grid-cols-3:has(> article > div.aspect-\[1024\/852\]) > article > *:nth-child(2) {
        margin-top: 0.5rem;   /* title → subhead: 8 px */
    }
    .grid.lg\:grid-cols-3:has(> article > div.aspect-\[1024\/852\]) > article > *:nth-child(3) {
        margin-top: 2rem;     /* subhead → image: 32 px */
    }
    .grid.lg\:grid-cols-3:has(> article > div.aspect-\[1024\/852\]) > article > *:nth-child(4) {
        margin-top: 1.5rem;   /* image → body: 24 px */
    }
    .grid.lg\:grid-cols-3:has(> article > div.aspect-\[1024\/852\]) > article > *:nth-child(5) {
        margin-top: 2rem;     /* body → buttons: 32 px */
    }
}

/* Agents section — typography.
   Title at 400 (already in the H3 ramp). Subhead at 300 for a
   noticeably lighter weight. Body description drops to 14 px
   (text-sm tier) at 400 to soften the column.
   No !important needed — see row-alignment comment above; the h3/p/rich-text
   elements here carry only plain Tailwind utilities (`type.h2`, `type.body`,
   `type.caption` from src/lib/typography.ts), never bang-prefixed classes. */
.grid.lg\:grid-cols-3:has(> article > div.aspect-\[1024\/852\]) > article h3 {
    font-weight: 400;
}

.grid.lg\:grid-cols-3:has(> article > div.aspect-\[1024\/852\]) > article > p {
    font-weight: 300;
}

.grid.lg\:grid-cols-3:has(> article > div.aspect-\[1024\/852\]) > article .rich-text,
.grid.lg\:grid-cols-3:has(> article > div.aspect-\[1024\/852\]) > article .rich-text *:not(.tm-mark) {
    font-size: 14px;
    line-height: 1.55;
    font-weight: 400;
}

/* Agents section H2 — restore the missing character space between the
   `text-mine-shaft` and `text-silver-chalice` spans. The block ships
   the two colour runs as adjacent `<span>`s with no whitespace
   between them, so we add right-margin to the first span equal to
   the width of a space character at the current font size. */
h2 > span.text-mine-shaft:has(+ span.text-silver-chalice) {
    margin-right: 0.25em;
}

/* Case-study cards (section 4 "Changing the game") — apply the same
   typography ramp as the agents cards. Article shape is unique to
   this module: a square image tile with bg-black followed by H3,
   subhead, quote, attribution and a CTA. Colour inherits from the
   light section so no explicit color is set here.
   No !important needed — ChangingSection.tsx (src/components/ChangingSection.tsx)
   stamps only plain `type.h3` / `type.body` / `type.caption` utilities here,
   never bang-prefixed classes, so the unlayered rule already wins. */
article:has(> div.aspect-square.bg-black) > h3 {
    font-weight: 400;
}

article:has(> div.aspect-square.bg-black) > p {
    font-weight: 300;
}

article:has(> div.aspect-square.bg-black) > .rich-text,
article:has(> div.aspect-square.bg-black) > .rich-text *:not(.tm-mark) {
    font-size: 14px;
    line-height: 1.55;
    font-weight: 400;
}

/* Podcast episode cards (section 5 "Between Me, Myself & AI") — same
   ramp, scoped to the dark section's articles. There is no separate
   subhead <p> in this layout (both copy blocks are .rich-text divs),
   so we only style the H3 and the rich-text bodies. White text is
   already handled by the section.bg-black.text-white inherit rule.
   No !important needed — CustomerStories.tsx (src/components/CustomerStories.tsx)
   stamps only plain `type.h3` / `type.body` / `type.small` utilities here,
   never bang-prefixed classes, so the unlayered rule already wins. */
section.bg-black.text-white article > h3 {
    font-weight: 400;
}

section.bg-black.text-white article > .rich-text,
section.bg-black.text-white article > .rich-text *:not(.tm-mark) {
    font-size: 14px;
    line-height: 1.55;
    font-weight: 400;
}

/* Video-band crosshatch overlay for readability.
   Every section that renders a looping video background also ships
   a dark tint overlay div. Two markup variants are in play:
   (a) legacy single-layer: `div.absolute.inset-0.bg-black/XX`
   (b) new SectionBackgroundMedia: a z-[2] overlay div whose tint
       class may be `bg-black/XX` or an arbitrary `bg-[rgb(...)]`
   so we match both — anywhere inside a video-bearing section. Layer
   a dense 1 px on / 2 px off line grid on top of that overlay so
   light text reads cleanly against the moving video. */
section:has(video) div.absolute.inset-0[class*="bg-black"],
section:has(video) div.absolute.inset-0.z-\[2\],
footer:has(video) div.absolute.inset-0[class*="bg-black"],
footer:has(video) div.absolute.inset-0.z-\[2\],
/* Image-band companion: static (non-video) dark hero/CTA bands ship the
   same tint-overlay markup with an <img> instead of a <video> — namely
   SecondaryHero's `bg-black/35` band and CtaLinks' `bg-black/50` band.
   Both classes are unique to those two (always-dark) components, so no
   `text-white`/`bg-black` tone gate is needed here. */
section:has(img) div.absolute.inset-0.bg-black\/35,
section:has(img) div.absolute.inset-0.bg-black\/50,
/* Image-band companion for SectionBackgroundMedia consumers (Footer,
   GrowthEngine, dark ContactSection, dark TextTwoCol): these share one
   `z-[2]` tint-overlay div for both image and video modes, but the
   component also renders an always-present `z-0 bg-black` backdrop div
   that would false-match a bare `:has(img)` selector even on *light*
   TextTwoCol/TwoColSection instances using the same background-image
   plumbing. Gate on the dark tone classes (`text-white` / `bg-black`)
   already stamped on the section/footer element so only dark modules
   pick up the grid. */
section.text-white:has(img) div.absolute.inset-0.z-\[2\],
section.bg-black:has(img) div.absolute.inset-0.z-\[2\],
footer.text-white:has(img) div.absolute.inset-0.z-\[2\] {
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent 0,
            transparent 2px,
            rgba(0, 0, 0, 0.35) 2px,
            rgba(0, 0, 0, 0.35) 3px
        ),
        repeating-linear-gradient(
            90deg,
            transparent 0,
            transparent 2px,
            rgba(0, 0, 0, 0.35) 2px,
            rgba(0, 0, 0, 0.35) 3px
        );
    pointer-events: none;
}


/* Dark-band text colour inheritance.
   Any section or footer that opts in to dark styling with the
   `text-white` utility sets the desired colour on the container,
   but a global headings rule from the base stylesheet resets every
   h2/h3/h4/p inside back to var(--color-ink) (black), producing
   black-on-black text. Force those elements to inherit the container's
   white colour instead. Covers three layouts: solid black bands
   (`bg-black text-white`), video-background bands (just `text-white`),
   and the `<footer>` element which also ships `text-white`.
   `section.text-white h1` etc. is (0,1,2) specificity — beats the plain
   `h1 { color }` rule (0,0,1) above fine on its own, but `!important` IS
   needed on `.rich-text *` (which matches anchors too): the prose-link
   rule below (`p a:not(...):not(...):not(...)`) computes to (0,3,2) —
   each `:not()` argument selector counts — which outranks this rule's
   (0,2,1) for `section.text-white .rich-text *`. Without !important, an
   editor-added <a> inside dark-section WYSIWYG content would render
   cobalt instead of inheriting white. */
section.text-white h1,
section.text-white h2,
section.text-white h3,
section.text-white h4,
section.text-white h5,
section.text-white h6,
section.text-white p,
section.text-white li,
section.text-white .rich-text,
section.text-white .rich-text * {
    color: inherit !important;
}

/* Footer body copy: an intermediate `.inner-container.text-[13px]` div
   in the footer paints itself rgb(92,92,92) via the parent theme's
   size-13 styling, which would override a plain `color: inherit` rule
   here (inherit would resolve to that gray instead of the footer's
   white). Force the body paragraphs and rich-text blocks to white
   explicitly so the Mission / Vision / copyright / legal lines read
   clearly. Standalone `<a>` nav links and `<span>` award badges are
   intentionally left at the inherited 92,92,92 muted-gray.
   `footer.text-white p` etc. (0,2,1) outranks the parent theme's
   `.inner-container.text-\[13px\]` (0,2,0) on specificity for the plain
   elements, but `!important` IS needed here too: `wp_kses_post()` (used
   by `cylvy_site_rich_text()` in theme/inc/acf-data.php) does NOT strip
   the `style` attribute — WordPress core's `_wp_add_global_attributes()`
   allows `style` on every posttag, and `safecss_filter_attr()` permits
   `color`/`font-size`/etc. through unfiltered, including any
   `!important` inside them. A pasted-from-Word inline colour in the
   Mission/Copyright/Disclaimer WYSIWYG fields could otherwise win. Same
   prose-link specificity gap as the section rule above also applies to
   `footer.text-white .rich-text *`. */
footer.text-white h1,
footer.text-white h2,
footer.text-white h3,
footer.text-white h4,
footer.text-white h5,
footer.text-white h6,
footer.text-white p,
footer.text-white li,
footer.text-white .rich-text,
footer.text-white .rich-text * {
    color: #ffffff !important;
}

/* Footer typography — Small tier across the board.
   The parent theme stamps the right column nav, the "Explore" header, and
   the award figcaptions as Eyebrow (uppercase, weight 500, tracked). The
   design direction now wants the whole footer at Small tier: 14/22, weight
   400, sentence case, no tracking. Award badge text is intentionally still
   uppercase in the source HTML ("WINNER GOLD 2025"), so we only override
   the CSS transform — characters typed as caps stay caps.
   No !important needed — scoped to `footer.text-white` (0,2,1) instead of
   bare `footer` (0,0,1) so it outranks Tailwind's `.text-xs` (0,1,0) on the
   "by Silver Agency" credit-line span, which previously needed !important
   to win. Footer.tsx (src/components/Footer.tsx) always renders
   `<footer className="... text-white ...">`, so the extra class is always
   present. Verified live: computed font-size/line-height/text-transform/
   font-weight/letter-spacing on every footer h1–h6/p/li/a/span/figcaption/
   .rich-text node match the Small-tier spec with !important removed. */
footer.text-white h1, footer.text-white h2, footer.text-white h3,
footer.text-white h4, footer.text-white h5, footer.text-white h6,
footer.text-white p, footer.text-white li, footer.text-white a,
footer.text-white span, footer.text-white figcaption,
footer.text-white .rich-text, footer.text-white .rich-text * {
    text-transform: none;
    font-weight: 400;
    letter-spacing: 0;
}

footer.text-white p, footer.text-white li, footer.text-white a,
footer.text-white span, footer.text-white figcaption,
footer.text-white .rich-text, footer.text-white .rich-text *:not(.tm-mark) {
    font-size: 14px;
    line-height: 1.55;
}

/* The "Explore" column header sits a notch above the link list. Keep it
   at Small tier but give it a touch more weight so it reads as a label
   rather than another link. Sentence case (no uppercase).
   No !important needed — same `footer.text-white` specificity bump as above. */
footer.text-white nav > p:first-child {
    font-weight: 500;
}

/* Logo carousel — dark variant (opt-in).
   Parked for future use. NOT applied by default.

   To enable: add the `is-dark` class to the carousel section (either
   from the editor via an ACF "Variant" select, or by hand-editing the
   block markup).

   KNOWN ISSUE: works correctly only when the logo files are SVGs or
   transparent PNGs. The current AVIF logo set ships with opaque white
   backgrounds, so the `invert()` filter produces solid white blocks
   instead of clean glyphs. Replace the logo files with SVGs (or
   transparent-bg PNGs) before flipping any carousel to this variant. */
section:has(> .animate-logo-scroll).is-dark {
    background-color: var(--color-ink);
    padding-top: 32px;
    padding-bottom: 32px;
}
section:has(> .animate-logo-scroll).is-dark > .animate-logo-scroll > ul > li {
    height: 140px;
    width: 240px;
    padding-left: 24px;
    padding-right: 24px;
}
section:has(> .animate-logo-scroll).is-dark > .animate-logo-scroll > ul > li > img {
    max-height: 80px;
    filter: invert(1) grayscale(1);
}

/* -- 5. Prose links — cobalt, but ONLY inside running prose --
   The earlier rule used `li a` which caught the whole nav menu. Scope
   tightly to paragraph anchors and the bundle's explicit prose-anchor
   utility class. Nav, footer, and CTAs are not touched.
   No !important needed against Tailwind here — `richTextClass` (see
   src/lib/content.tsx) stamps anchors with plain `[&_a]:underline` only,
   and override.css is unlayered so it already wins against Tailwind's
   `@layer utilities` regardless. NOTE: this selector's own specificity
   (0,3,2 — three `:not()` argument selectors) is higher than the dark-
   section/footer `color: inherit`/`#ffffff` rules above (0,2,1 for the
   `.rich-text *` descendant form), which is *why* those two rules keep
   !important — otherwise an editor-added link inside dark WYSIWYG prose
   would render cobalt instead of white. */
p a:not([class*="rounded"]):not([class*="bg-"]):not(.btn) {
    color: var(--color-cobalt);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-decoration-color: rgba(27, 43, 224, 0.4);
    transition: text-decoration-color 0.15s ease;
}

p a:not([class*="rounded"]):not([class*="bg-"]):not(.btn):hover {
    text-decoration-color: var(--color-cobalt);
}

/* -- 6. Buttons — square-edged outlined --
   The parent theme already ships outlined-white CTAs on `border-mine-shaft`.
   Keep the square corners; only refine the colour, weight and tracking.
   NOTE: We do NOT touch `.bg-black` — it's used for the dark hero section
   and image-thumbnail frames, not buttons.
   No !important needed — Button.tsx's `outline-dark` variant stamps only
   plain `bg-white border-mine-shaft text-mine-shaft`; consuming components
   (Header, TwoColSectionView, TextTwoCol, NotFoundPage) only ever add
   bang-prefixed *sizing* utilities (`!min-h-11`, `!px-5`, `!min-w-*`) on
   top, never bang-prefixed border-color/color/font-weight/radius, so
   nothing here competes with a layered !important. */
a.border-mine-shaft.bg-white,
a.border-mine-shaft[class*="bg-white"],
button.border-mine-shaft.bg-white {
    border-radius: 0;
    border-color: var(--color-ink);
    color: var(--color-ink);
    font-weight: 400;
    letter-spacing: 0.005em;
    transition: background-color 0.15s ease, color 0.15s ease;
}

a.border-mine-shaft.bg-white:hover,
button.border-mine-shaft.bg-white:hover {
    background-color: var(--color-ink);
    color: var(--color-paper);
    opacity: 1;
}

/* Button typography — light, slightly tracked. Square corners remain.
   No !important needed — no component in src/ stamps a bang-prefixed
   `!rounded-*` utility on any button/link. */
a[class*="rounded-full"],
button[class*="rounded-full"],
a[class*="rounded-md"],
button[class*="rounded-md"] {
    border-radius: 0;
    font-weight: 400;
    letter-spacing: 0.005em;
}

/* -- 7. Eyebrow rescue --
   The current 13px award/category labels become tracked eyebrows.
   No !important needed — confirmed 0 live elements match `.text-[13px]`
   across every route (homepage, fs-fintech, industries, marketing-template,
   etc.); the class is legacy from a pre-refactor Footer.tsx (see git
   history) and Footer now uses the semantic `type.small` class instead. */
.text-\[13px\] {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
    font-size: 12px;
    line-height: 1.33;
    color: var(--color-send);
}

/* -- 8. Focus ring — cobalt 2px, not browser default -- */
:focus-visible {
    outline: 2px solid var(--color-cobalt);
    outline-offset: 3px;
    border-radius: 2px;
}

/* -- 9. Selection — cobalt at 20% on light bg -- */
::selection {
    background-color: rgba(27, 43, 224, 0.2);
    color: var(--color-ink);
}

/* -- 10. Reduced motion (already in parent, reaffirm) -- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* -- 11. Optical sizing — Inter Variable supports opsz axis -- */
body {
    font-optical-sizing: auto;
}


/* -- 13. Section tint overrides --
 * The parent bundle ships a hard-coded `bg-[#f5f5f5]` Tailwind arbitrary
 * value on the agents card section. That cool neutral grey clashes with
 * the warm off-white palette in this design system. Swap it for the
 * design token instead. Selector targets the literal class attribute.
 * No !important needed — AgentsSection.tsx stamps plain `bg-[#f5f5f5]`
 * (never bang-prefixed), so the unlayered rule already wins. */
section[class*="bg-[#f5f5f5]"] {
    background-color: var(--color-swiss-coffee);
}


/* -- 14. Sitewide CTA colour --
 * Solid slate actions with a darken + lift + glow on hover. Masthead actions
 * receive their own hierarchy below; decorative purple accents are unchanged.
 *
 * Every <a> rendered by the shared Button component carries `inline-flex` and
 * `border`, so buttons using the former global purple treatment become slate.
 * Explicit component treatments using bang-prefixed colour utilities retain
 * their established non-purple appearance. CtaLinks anchors are inline-flex
 * but not bordered, so they are left alone. */
a.inline-flex.border {
    background-color: var(--color-cylvy-cta) !important;
    border-color: var(--color-cylvy-cta) !important;
    color: var(--color-paper) !important;
    transition: background-color 0.18s ease, border-color 0.18s ease,
        transform 0.18s ease, box-shadow 0.18s ease !important;
}

a.inline-flex.border:hover {
    background-color: var(--color-cylvy-cta-dark) !important;
    border-color: var(--color-cylvy-cta-dark) !important;
    color: var(--color-paper) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(107, 118, 122, 0.28);
    opacity: 1 !important;
}

/* Masthead hierarchy: demo uses the requested cool grey with white text;
 * login remains a solid black action. Applies to desktop
 * and mobile header buttons through the shared Header component. */
a.inline-flex.border.cylvy-header-demo {
    background-color: var(--color-header-demo) !important;
    border-color: var(--color-header-demo) !important;
    color: var(--color-paper) !important;
}

a.inline-flex.border.cylvy-header-demo:hover {
    background-color: var(--color-header-demo-hover) !important;
    border-color: var(--color-header-demo-hover) !important;
    color: var(--color-paper) !important;
    box-shadow: 0 8px 20px rgba(107, 118, 122, 0.28);
}

a.inline-flex.border.cylvy-header-login {
    background-color: var(--color-header-login) !important;
    border-color: var(--color-header-login) !important;
    color: var(--color-paper) !important;
}

a.inline-flex.border.cylvy-header-login:hover {
    background-color: var(--color-header-login-hover) !important;
    border-color: var(--color-header-login-hover) !important;
    color: var(--color-paper) !important;
    box-shadow: 0 8px 20px rgba(10, 10, 10, 0.24);
}

/* Secondary CTA (.cylvy-cta-secondary): cool slate outline beside a filled
 * primary (e.g. Hero's second CTA); fills slate on hover. The extra class
 * gives this higher specificity than the primary rule above, so it wins
 * regardless of source order. Available to any page/component, not just
 * Hero.tsx. */
a.inline-flex.border.cylvy-cta-secondary {
    background-color: transparent !important;
    border-color: var(--color-cylvy-secondary) !important;
    color: var(--color-cylvy-secondary) !important;
}

a.inline-flex.border.cylvy-cta-secondary:hover {
    background-color: var(--color-cylvy-secondary-dark) !important;
    border-color: var(--color-cylvy-secondary-dark) !important;
    color: var(--color-paper) !important;
}

/* Contact form submit buttons — every page's Contact block (ContactSection.tsx),
 * covering both the live Gravity Forms embed and the no-JS/no-GF fallback
 * form. Selectors mirror src/styles/contact-gravity-form.css exactly (same
 * specificity + !important) so this wins on cascade order: override.css is
 * enqueued after the Vite bundle that ships contact-gravity-form.css. */
.contact-section form button[type="submit"],
.contact-section .cylvy-gravity-form .gform_button,
.contact-section .cylvy-gravity-form input[type="submit"],
.contact-section .cylvy-gravity-form button[type="submit"] {
    background-color: var(--color-cylvy-cta) !important;
    transition: background-color 0.18s ease, transform 0.18s ease,
        box-shadow 0.18s ease !important;
}

.contact-section form button[type="submit"]:hover,
.contact-section .cylvy-gravity-form .gform_button:hover,
.contact-section .cylvy-gravity-form input[type="submit"]:hover,
.contact-section .cylvy-gravity-form button[type="submit"]:hover {
    background-color: var(--color-cylvy-cta-dark) !important;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(107, 118, 122, 0.28);
    opacity: 1 !important;
}

/* -- 15. FS & Fintech landing — page-specific refinements --
 * Flat UI accents use slate while iridescent media retains its full palette.
 * These rules and the tightened hero→logo-carousel spacing stay scoped to
 * body.cylvy-fs-fintech so other page-specific colour systems are untouched. */
body.cylvy-fs-fintech section.bg-white :is(h1, h2, p) strong {
    color: var(--color-cylvy-slate);
}

body.cylvy-fs-fintech .text-cylvy-purple {
    color: var(--color-cylvy-slate);
}

body.cylvy-fs-fintech .bg-cylvy-purple {
    background-color: var(--color-cylvy-slate);
}

body.cylvy-fs-fintech .border-cylvy-purple {
    border-color: var(--color-cylvy-slate);
}

/* The FinTech Hero primary CTA carries bang-prefixed concrete/ink utilities.
 * Keep this rescue in Tailwind's utilities layer so its higher specificity
 * can replace those important declarations without affecting other Heroes. */
@layer utilities {
    body.cylvy-fs-fintech section[aria-labelledby="hero-heading"]
        a.inline-flex.border[class~="!bg-concrete"] {
        background-color: var(--color-cylvy-slate) !important;
        border-color: var(--color-cylvy-slate) !important;
        color: var(--color-paper) !important;
    }

    body.cylvy-fs-fintech section[aria-labelledby="hero-heading"]
        a.inline-flex.border[class~="!bg-concrete"]:hover {
        background-color: var(--color-cylvy-cta-dark) !important;
        border-color: var(--color-cylvy-cta-dark) !important;
        color: var(--color-paper) !important;
    }
}

/* Tighten the gap between the Hero and the Logo carousel (social-proof strip
 * sits directly under the hero). Trims the hero's bottom padding and the
 * carousel's top padding; scoped so other Hero/LogoCarousel uses are untouched.
 * No !important needed — Hero.tsx and LogoCarousel.tsx stamp only plain `py-*`/
 * `pb-*` utilities on these sections (never bang-prefixed), so the unlayered
 * rule already wins regardless of specificity. */
body.cylvy-fs-fintech section[aria-labelledby="hero-heading"] {
    padding-bottom: 1.5rem;
}

body.cylvy-fs-fintech section[aria-label="Client logos"] {
    padding-top: 0.5rem;
}

/* -- Trademark marks (®/™) --
   Client rule (T6): symbols render at 50% of the surrounding type size,
   everywhere they appear (React copy, ACF rich text, and static email
   HTML). The mark is nudged up to sit near cap height (not full
   superscript, which floats above large headings). Emails use an
   inline-style equivalent of this same rule since they can't load site CSS.

   Tailwind's preflight (@layer base) sets `sup { position: relative;
   top: -0.5em; vertical-align: baseline; font-size: 75% }`. This rule is
   unlayered so per CSS Cascade Layers it already beats preflight's layered
   `sup` rule on every property regardless of specificity — no !important
   needed. It never previously cancelled preflight's `position`/`top`,
   so the two stacked: vertical-align: 0.5em from here PLUS top: -0.5em
   from preflight pushed the mark far above cap height (full floating
   superscript). Resetting position/top here fixes that. */
.tm-mark {
    font-size: 50%;
    vertical-align: 0.5em;
    line-height: 0;
    position: static;
    top: auto;
}
