/* ==========================================================================
   ENGINE GLOBAL LAYER — base typography, layout helpers, the shared button
   system, color utilities, scroll reveal, and the section-order knob.
   Extracted from the pre-plugin theme style.css (everything below the brand
   :root block, which stays in the thin theme as the client fallback).
   Enqueued between the theme's style.css and archetypes.css — same source
   order as before the split, so the cascade is unchanged. RFC-001 D3.
   ========================================================================== */
/* ==========================================================================
   1. Base typography + element resets the child owns
   ========================================================================== */

body { font-family: var(--suds-font-body); color: var(--suds-ink); background: var(--suds-bg); }

/* Front-facing links never carry an underline by default (components opt back
   in locally where an underline is meaningful, e.g. inline prose links). */
a { text-decoration: none; }

h1, h2, h3, h4,
.suds-font-header {
    font-family: var(--suds-font-header);
    font-weight: var(--suds-fw-head, 700);
    letter-spacing: var(--suds-ls-head, -0.01em);
    text-transform: var(--suds-tt-head, none);
    line-height: 1.08;
}

.suds-font-body { font-family: var(--suds-font-body); }

/* ==========================================================================
   2. Layout helpers (global, reused on every page)
   ========================================================================== */

.suds-wrap { width: min(var(--suds-container, 1180px), 92vw); margin-inline: auto; }
.suds-section { padding-block: var(--suds-pad-section, 5rem); position: relative; }

.suds-eyebrow {
    font-family: var(--suds-font-header);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--suds-eyebrow-fg, var(--suds-primary));
    display: inline-flex;
    align-items: center;
    gap: .55em;
    margin-bottom: 1rem;
    /* chip-mode axis — inert (transparent/zero) unless an archetype sets the
       tokens (basecamp renders eyebrows as chips; see archetypes.css) */
    background: var(--suds-eyebrow-bg, transparent);
    padding: var(--suds-eyebrow-pad, 0);
    border-radius: var(--suds-chip-radius, 999px);
}
.suds-eyebrow::before {
    content: "";
    width: var(--suds-eyebrow-mark-w, 26px);
    height: 2px;
    background: currentColor;
    border-radius: 2px;
}
.suds-eyebrow.no-mark::before { display: none; }

.suds-section-head { max-width: 60ch; margin-bottom: 3rem; }
.suds-section-head h2 { font-size: var(--suds-h2, clamp(2rem, 3.6vw, 2.9rem)); margin-bottom: .9rem; }
.suds-section-head p { font-size: 1.12rem; color: var(--suds-muted); }
.suds-section-head.center { margin-inline: auto; text-align: center; }

/* ==========================================================================
   3. Button system (shared, token-driven) — restyles Bootstrap .btn.
   Shape/shadow/case come from the archetype knob-set.
   ========================================================================== */

.btn {
    --_bg: var(--suds-primary);
    --_fg: var(--suds-on-primary);
    display: inline-flex;
    align-items: center;
    gap: .6em;
    font-family: var(--suds-font-header);
    font-weight: var(--suds-fw-btn, 700);
    font-size: .98rem;
    letter-spacing: var(--suds-ls-btn, 0);
    text-transform: var(--suds-tt-btn, none);
    padding: var(--suds-btn-pad, .92em 1.5em);
    border-radius: var(--suds-btn-radius, 10px);
    background: var(--_bg);
    color: var(--_fg);
    border: var(--suds-btn-border-w, 2px) solid var(--_bg);
    box-shadow: var(--suds-btn-shadow, none);
    cursor: pointer;
    transition: transform var(--suds-dur, .25s) var(--suds-ease, ease),
                box-shadow var(--suds-dur, .25s) var(--suds-ease, ease),
                background-color var(--suds-dur, .25s) var(--suds-ease, ease);
    white-space: nowrap;
    text-decoration: none;
}
/* Re-pin bg/border/fg on hover: the BCB parent's `.btn:hover` resets background to
   its (empty, for our plain `.btn`) --bs-btn-hover-bg, which otherwise turns the
   button transparent → white-on-white. The lift + shadow stay the hover affordance. */
.btn:hover { transform: var(--suds-btn-hover-t, translateY(-2px)); box-shadow: var(--suds-btn-shadow-hover, none); background: var(--_bg); border-color: var(--_bg); color: var(--_fg); }
.btn .ico { transition: transform var(--suds-dur, .25s) var(--suds-ease, ease); }
.btn:hover .ico { transform: translateX(3px); }

.suds-btn-primary { --_bg: var(--suds-primary); --_fg: var(--suds-on-primary); }
/* Accent button colours are indirected through --suds-btn-accent-* so a client
   thin theme can re-tone the accent CTA without touching engine CSS — e.g. a
   mono-colour brand whose accent equals the CTA-band colour (t2: blue-on-blue)
   sets these three tokens to get a light button. Defaults = the historic values,
   so every existing site renders byte-identically. */
.suds-btn-accent  { --_bg: var(--suds-btn-accent-bg, var(--suds-accent));  --_fg: var(--suds-btn-accent-fg, var(--suds-on-accent)); border-color: var(--suds-btn-accent-border, var(--suds-accent)); }
.suds-btn-light   { --_bg: var(--suds-bg); --_fg: var(--suds-ink); border-color: var(--suds-bg); }
.suds-btn-ghost {
    --_bg: transparent;
    --_fg: var(--suds-ink);
    border-color: var(--suds-btn-ghost-border, color-mix(in srgb, currentColor 40%, transparent));
    box-shadow: none;
}
.suds-btn-ghost:hover { background: var(--suds-btn-ghost-hover-bg, color-mix(in srgb, currentColor 12%, transparent)); box-shadow: none; }
.suds-btn-lg { font-size: 1.08rem; padding: var(--suds-btn-pad-lg, 1.05em 1.9em); }

/* Color utilities */
.suds-text-primary { color: var(--suds-primary); }
.suds-text-ink { color: var(--suds-ink); }
.suds-text-muted { color: var(--suds-muted); }
.suds-bg-primary { background-color: var(--suds-primary); color: var(--suds-on-primary); }
.suds-bg-surface { background-color: var(--suds-surface); }
.suds-bg-ink { background-color: var(--suds-ink); color: var(--suds-bg); }

/* ==========================================================================
   4. Scroll reveal — transform-only; opacity stays 1 at all times so a
   frozen-frame capture engine never leaves content invisible.
   ========================================================================== */

.suds-reveal { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
    .suds-reveal { transform: translateY(var(--suds-reveal-y, 22px)); transition: transform .7s var(--suds-ease, ease); will-change: transform; }
    .suds-reveal.in { transform: none; }
}

/* ==========================================================================
   5. Section-order knob — the homepage tells a different story per archetype
   purely via CSS `order`. The orchestrator wraps sections in .suds-flow.
   ========================================================================== */

.suds-flow { display: flex; flex-direction: column; }
.suds-flow > * { order: 0; min-width: 0; }
/* The home orchestrator wraps each section in a .suds-flow-item so any chosen
   variant reorders per archetype via the wrapper (decoupled from the section's
   own class). The legacy .suds-s-* rules below stay as a fallback. */
.suds-ord-hero { order: var(--suds-o-hero, 1); }
.suds-ord-services { order: var(--suds-o-services, 2); }
.suds-ord-how { order: var(--suds-o-how, 3); }
.suds-ord-why { order: var(--suds-o-why, 4); }
/* Card-balance band: no archetype defines --suds-o-cardbalance, so it ties with
   the next slot's order value and resolves by DOM position — right after "why". */
.suds-ord-cardbalance { order: var(--suds-o-cardbalance, 5); }
.suds-ord-areas { order: var(--suds-o-areas, 5); }
.suds-ord-quotes { order: var(--suds-o-quotes, 6); }
.suds-ord-cta { order: var(--suds-o-cta, 7); }
.suds-s-hero { order: var(--suds-o-hero, 1); }
.suds-s-services { order: var(--suds-o-services, 2); }
.suds-s-how { order: var(--suds-o-how, 3); }
.suds-s-why { order: var(--suds-o-why, 4); }
.suds-s-areas { order: var(--suds-o-areas, 5); }
.suds-s-quotes { order: var(--suds-o-quotes, 6); }
.suds-s-cta { order: var(--suds-o-cta, 7); }
