/* =====================================================================
   GLOBAL STYLES — Brabo Home Services
   ---------------------------------------------------------------------
   0. Web fonts (self-hosted in assets/fonts)
   1. Design tokens (colours, type, spacing)  ← change brand colours here
   2. Reset & base elements
   3. Typography
   4. Layout helpers (container, sections, grids)
   5. Buttons & links
   6. Utility classes
   7. Reveal animation base + reduced motion
   ===================================================================== */

/* ---------- 0. WEB FONTS ----------
   Self-hosted variable fonts (SIL Open Font License), no third-party
   requests. Headings: Schibsted Grotesk. Body: Source Sans 3.
   To change a font: replace the file here and the --font-* tokens below. */
@font-face {
    font-family: "Schibsted Grotesk";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/schibsted-grotesk-latin.woff2") format("woff2");
}
@font-face {
    font-family: "Source Sans 3";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/source-sans-3-latin.woff2") format("woff2");
}
@font-face {
    font-family: "Source Sans 3";
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/source-sans-3-italic-latin.woff2") format("woff2");
}

/* ---------- 1. DESIGN TOKENS ---------- */
:root {
    /* Brand colours (from the Brabo logo: charcoal + orange) */
    --ink: #141a22;            /* deep charcoal-navy: text & dark sections */
    --navy: #1c2735;           /* secondary dark surface */
    --steel: #24394f;          /* brand-adjacent blue for depth */
    --steel-soft: #e8eef4;     /* pale blue tint */
    --orange: #f26f22;         /* logo orange: accents, primary buttons */
    --orange-deep: #c9560f;    /* hover / pressed */
    --orange-ink: #a8460b;     /* orange for text on light backgrounds (AA) */
    --amber: #f4b63f;          /* warm yellow accent, used sparingly */

    /* Neutrals */
    --white: #ffffff;
    --paper: #f7f5f1;          /* soft warm off-white */
    --paper-2: #efebe4;
    --line: #e2ddd4;
    --line-dark: rgba(255, 255, 255, 0.14);
    --text: #232a33;
    --muted: #5a6370;
    --muted-light: #aab3bf;

    /* Typography */
    --font-head: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
    --font-body: "Source Sans 3", "Segoe UI", Arial, sans-serif;
    --fw-regular: 400;
    --fw-medium: 500;          /* nav links, small labels */
    --fw-semibold: 600;        /* headings & buttons: the heaviest weight in normal use */
    --fw-bold: 700;            /* reserved for rare emphasis */
    --fs-body: 1.125rem;       /* 18px (Source Sans 3 runs slightly small) */
    --fs-small: 1rem;
    --fs-xs: 0.8125rem;
    --fs-h1: clamp(2.15rem, 1.6rem + 2.3vw, 3.4rem);
    --fs-h2: clamp(1.7rem, 1.35rem + 1.35vw, 2.4rem);
    --fs-h3: clamp(1.15rem, 1.07rem + 0.35vw, 1.32rem);
    --lh-body: 1.65;

    /* Spacing & shape */
    --container: 1240px;
    --gutter: clamp(16px, 4vw, 32px);
    --section: clamp(64px, 8vw, 116px);
    --radius-sm: 4px;
    --radius: 8px;
    --shadow-sm: 0 1px 2px rgba(20, 26, 34, 0.06), 0 2px 8px rgba(20, 26, 34, 0.05);
    --shadow: 0 10px 30px -12px rgba(20, 26, 34, 0.25);
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
    --header-h: 84px;
}

/* ---------- 2. RESET & BASE ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
    margin: 0;
    background: var(--white);
    color: var(--text);
    font-family: var(--font-body);
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

img, svg, video, iframe { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
ul, ol { margin: 0; padding: 0; }
figure, blockquote { margin: 0; }
address { font-style: normal; }

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

::selection { background: var(--orange); color: var(--ink); }

/* ---------- 3. TYPOGRAPHY ---------- */
h1, h2, h3, h4 {
    margin: 0 0 0.5em;
    font-family: var(--font-head);
    font-weight: var(--fw-semibold);
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--ink);
}
h1 { font-size: var(--fs-h1); line-height: 1.08; letter-spacing: -0.03em; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); line-height: 1.3; letter-spacing: -0.01em; }
p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }
strong { font-weight: var(--fw-semibold); color: var(--ink); }

a { color: var(--orange-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--orange-deep); }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    font-family: var(--font-head);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--orange-ink);
}
.eyebrow::before {
    content: "";
    width: 26px;
    height: 2px;
    background: var(--orange);
}

.section-title { max-width: 22ch; }
.section-intro { max-width: 62ch; font-size: 1.15rem; color: var(--muted); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }

/* ---------- 4. LAYOUT ---------- */
.container {
    width: 100%;
    max-width: calc(var(--container) + var(--gutter) * 2);
    margin-inline: auto;
    padding-inline: var(--gutter);
}
.container--narrow { max-width: calc(860px + var(--gutter) * 2); }

.section { padding-block: var(--section); }
.section--tight { padding-block: calc(var(--section) * 0.65); }
.section--paper { background: var(--paper); }
.section--dark { background: var(--ink); color: #d6dbe2; }
.section--navy { background: var(--navy); color: #d6dbe2; }
.section--steel { background: var(--steel); color: #dbe3ec; }
.section--dark h2, .section--dark h3,
.section--navy h2, .section--navy h3,
.section--steel h2, .section--steel h3 { color: var(--white); }
.section--dark .section-intro,
.section--navy .section-intro,
.section--steel .section-intro { color: var(--muted-light); }
.section--dark .eyebrow,
.section--navy .eyebrow,
.section--steel .eyebrow { color: var(--amber); }
.section--dark .eyebrow::before,
.section--navy .eyebrow::before,
.section--steel .eyebrow::before { background: var(--amber); }

.section-head { margin-bottom: clamp(32px, 4vw, 56px); }
.section-head--center { text-align: center; }
.section-head--center .section-title,
.section-head--center .section-intro { margin-inline: auto; }
.section-head--center .eyebrow { justify-content: center; }

.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(32px, 6vw, 88px);
    align-items: center;
}
.split--wide-left { grid-template-columns: 1.15fr 0.85fr; }
.split--wide-right { grid-template-columns: 0.85fr 1.15fr; }
.split--top { align-items: start; }

.prose { max-width: 68ch; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.4em; }
.prose ul { padding-left: 1.2em; margin-bottom: 1.1em; }
.prose li { margin-bottom: 0.4em; }

/* Image frame with fixed aspect ratio (prevents layout shift) */
.frame { position: relative; overflow: hidden; border-radius: var(--radius-sm); background: var(--paper-2); }
.frame img { width: 100%; height: 100%; object-fit: cover; }
.frame--43 { aspect-ratio: 4 / 3; }
.frame--54 { aspect-ratio: 5 / 4; }
.frame--45 { aspect-ratio: 4 / 5; }
.frame--169 { aspect-ratio: 16 / 9; }
.frame--tall { aspect-ratio: 3 / 4; }

/* ---------- 5. BUTTONS & LINKS ---------- */
.btn {
    --btn-bg: var(--orange);
    --btn-fg: var(--ink);
    --btn-border: var(--orange);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 50px;
    padding: 12px 22px;
    border: 2px solid var(--btn-border);
    border-radius: var(--radius-sm);
    background: var(--btn-bg);
    color: var(--btn-fg);
    font-family: var(--font-head);
    font-size: 0.97rem;
    font-weight: var(--fw-semibold);
    letter-spacing: 0.01em;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.btn .icon { width: 18px; height: 18px; flex: none; transition: transform 0.25s var(--ease); }
.btn:hover { transform: translateY(-1px); }
.btn:hover .icon:last-child:not(:first-child) { transform: translateX(3px); }
.btn:active { transform: translateY(0); }

.btn--primary:hover { --btn-bg: var(--orange-deep); --btn-border: var(--orange-deep); --btn-fg: var(--white); }
.btn--dark { --btn-bg: var(--ink); --btn-fg: var(--white); --btn-border: var(--ink); }
.btn--dark:hover { --btn-bg: var(--navy); --btn-border: var(--navy); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--ink); --btn-border: var(--ink); }
.btn--ghost:hover { --btn-bg: var(--ink); --btn-fg: var(--white); }
.btn--light { --btn-bg: transparent; --btn-fg: var(--white); --btn-border: rgba(255, 255, 255, 0.7); }
.btn--light:hover { --btn-bg: var(--white); --btn-fg: var(--ink); --btn-border: var(--white); }
.btn--sm { min-height: 42px; padding: 8px 16px; font-size: 0.9rem; }
.btn--lg { min-height: 58px; padding: 14px 28px; font-size: 1.05rem; }

/* Filled icons (e.g. the Google "G" and stars) instead of outlined strokes */
.icon--fill { fill: currentColor; stroke: none; }
.btn--block { width: 100%; }

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

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-head);
    font-weight: var(--fw-semibold);
    font-size: 0.95rem;
    color: var(--ink);
    text-decoration: none;
}
.link-arrow .icon { width: 18px; height: 18px; color: var(--orange); transition: transform 0.25s var(--ease); }
.link-arrow:hover { color: var(--orange-ink); }
.link-arrow:hover .icon { transform: translateX(4px); }
.section--dark .link-arrow, .section--navy .link-arrow, .section--steel .link-arrow { color: var(--white); }

.icon { width: 20px; height: 20px; flex: none; }

/* ---------- 6. UTILITIES ---------- */
.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}
.skip-link {
    position: absolute;
    left: 16px; top: -60px;
    z-index: 999;
    padding: 10px 16px;
    background: var(--ink);
    color: var(--white);
    border-radius: var(--radius-sm);
    transition: top 0.2s;
}
.skip-link:focus { top: 12px; color: var(--white); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-28 { margin-top: 28px; }
.mt-48 { margin-top: 48px; }
.muted { color: var(--muted); }
.note {
    font-size: var(--fs-small);
    color: var(--muted);
    border-left: 3px solid var(--amber);
    padding: 4px 0 4px 14px;
}

/* ---------- 7. REVEAL ANIMATIONS ---------- */
.js [data-reveal] {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
    transition-delay: var(--reveal-delay, 0s);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .js [data-reveal] { opacity: 1; transform: none; }
}
