/* ==========================================================================
   Design System — Best Plumber
   ==========================================================================
   All tokens derived from brand-guidelines.json and design-profile.json.
   Reference site: Cooper & Jones (cooperjones.com.au)
   Brand fonts: Antonio (headings), Play (body), Anybody (accent)
   Brand colors: Red (#FF1A0D), Gold (#FFDE69), Charcoal (#3A484D)
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties (Design Tokens)
   -------------------------------------------------------------------------- */

:root {
    /* ── Core Brand Colors ──────────────────────────────────────────────── */
    --color-primary: #FF1A0D;
    --color-primary-light: #FF4D42;
    --color-primary-dark: #E0150B;
    --color-primary-rgb: 255, 26, 13;

    --color-secondary: #3A484D;
    --color-secondary-light: #4A5B62;
    --color-secondary-dark: #2D383C;
    --color-secondary-rgb: 58, 72, 77;

    --color-accent: #FFDE69;
    --color-accent-light: #FFE68A;
    --color-accent-dark: #FFD540;
    --color-accent-rgb: 255, 222, 105;

    /* ── Neutrals ──────────────────────────────────────────────────────── */
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111111;
    --gray-950: #0A0A0A;

    /* ── Semantic Colors ────────────────────────────────────────────────── */
    --color-success: #22c55e;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    --color-info: #3b82f6;

    /* ── Background Colors ──────────────────────────────────────────────── */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-dark: #3A484D;
    --bg-darker: #2D383C;

    /* ── Text Colors ────────────────────────────────────────────────────── */
    --text-primary: #111111;
    --text-secondary: #444444;
    --text-tertiary: #888888;
    --text-inverse: #FFFFFF;
    --text-link: var(--color-primary);
    --text-link-hover: var(--color-primary-dark);

    /* ── Overlay Colors ─────────────────────────────────────────────────── */
    --overlay-hero: rgba(58, 72, 77, 0.45);
    --overlay-hero-alt: rgba(17, 17, 17, 0.35);
    --overlay-dark: rgba(0, 0, 0, 0.5);

    /* ── Typography ─────────────────────────────────────────────────────── */
    --font-heading: 'Antonio', sans-serif;
    --font-body: 'Play', sans-serif;
    --font-accent: 'Anybody', sans-serif;

    /* Font Sizes — scale derived from Cooper & Jones (100px hero @ 1920px) */
    --text-xs: 0.75rem;          /* 12px */
    --text-sm: 0.875rem;         /* 14px */
    --text-base: 1.0625rem;      /* 17px — body text */
    --text-md: 1.125rem;         /* 18px — buttons */
    --text-lg: 1.25rem;          /* 20px — body large */
    --text-xl: clamp(1.125rem, 2vw, 1.375rem);      /* H4 */
    --text-2xl: clamp(1.25rem, 2.5vw, 1.75rem);     /* H3 */
    --text-3xl: clamp(2rem, 4vw, 3rem);              /* H2 */
    --text-4xl: clamp(2.75rem, 5vw, 4rem);           /* H1 */
    --text-5xl: clamp(1.125rem, 2vw, 1.875rem);      /* Hero subtitle */
    --text-hero: clamp(3rem, 6vw, 6.25rem);           /* Hero display (100px ref) */

    /* Super title — accent font for labels above headings */
    --text-super: 0.875rem;

    /* Font Weights */
    --font-regular: 400;
    --font-semibold: 600;
    --font-bold: 700;

    /* Line Heights */
    --leading-none: 1;
    --leading-tight: 1.05;
    --leading-heading: 1.1;
    --leading-snug: 1.25;
    --leading-normal: 1.7;
    --leading-relaxed: 1.6;

    /* Letter Spacing */
    --tracking-tight: -0.02em;
    --tracking-slight: -0.01em;
    --tracking-normal: 0;
    --tracking-wide: 0.02em;
    --tracking-wider: 0.05em;
    --tracking-super: 0.15em;

    /* ── Spacing Scale — from Cooper & Jones ───────────────────────────── */
    --space-xs: 0.25rem;     /* 4px */
    --space-sm: 0.5rem;      /* 8px */
    --space-md: 1rem;        /* 16px */
    --space-lg: 1.5rem;      /* 24px */
    --space-xl: 2rem;        /* 32px */
    --space-2xl: 3.125rem;   /* 50px — inner row gap */
    --space-3xl: 4.375rem;   /* 70px — section padding md */

    --section-padding: clamp(4.375rem, 8vw, 9.375rem);  /* 70px–150px */
    --container-max: 1200px;
    --container-padding: clamp(1.25rem, 5vw, 5.625rem);  /* 20px–90px */
    --container-narrow: 800px;

    /* ── Divider ────────────────────────────────────────────────────────── */
    --divider-width: 300px;
    --divider-height: 2px;
    --divider-color: var(--color-primary);
    --divider-color-dark: var(--color-accent);
    --divider-margin: 12.5px 0;

    /* ── Borders & Radius — sharp/angular from Cooper & Jones ──────────── */
    --border-color: #E5E7EB;
    --border-color-dark: #D1D5DB;
    --border-width: 1px;

    --radius-xs: 2px;
    --radius-sm: 3px;       /* Buttons (from C&J CTA) */
    --radius-md: 6px;       /* Cards */
    --radius-lg: 10px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* ── Shadows — charcoal-tinted, layered ────────────────────────────── */
    --shadow-sm: 0 1px 3px rgba(58, 72, 77, 0.08), 0 1px 2px rgba(58, 72, 77, 0.06);
    --shadow-md: 0 4px 6px rgba(58, 72, 77, 0.07), 0 2px 4px rgba(58, 72, 77, 0.06);
    --shadow-lg: 0 10px 25px rgba(58, 72, 77, 0.1), 0 4px 10px rgba(58, 72, 77, 0.05);
    --shadow-xl: 0 20px 50px rgba(58, 72, 77, 0.12), 0 8px 20px rgba(58, 72, 77, 0.06);
    --shadow-card: 0 4px 12px rgba(58, 72, 77, 0.08);
    --shadow-card-hover: 0 8px 30px rgba(58, 72, 77, 0.15);
    --shadow-button: 0 2px 8px rgba(255, 26, 13, 0.2);
    --shadow-button-hover: 0 4px 16px rgba(255, 26, 13, 0.35);

    /* ── Transitions — easeOutCubic from Cooper & Jones ────────────────── */
    --ease-out: cubic-bezier(0.33, 0, 0.2, 1);
    --ease-animation: cubic-bezier(0.215, 0.61, 0.355, 1);
    --transition-fast: 150ms ease;
    --transition-base: 300ms var(--ease-out);
    --transition-slow: 500ms var(--ease-out);
    --transition-button: 100ms ease;
    --animation-duration: 750ms;
    --stagger-base: 200ms;

    /* ── Z-Index Scale ──────────────────────────────────────────────────── */
    --z-behind: -1;
    --z-base: 0;
    --z-raised: 10;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-overlay: 300;
    --z-modal: 400;
    --z-popover: 500;
    --z-toast: 600;
    --z-max: 9999;

    /* ── Layout Constants ───────────────────────────────────────────────── */
    --hero-height: 900px;
    --hero-content-max: 1177px;
    --header-logo-height: 90px;
    --header-logo-mobile: 40px;
    --header-padding: 28px;
    --header-breakpoint: 1000px;
    --cta-padding-x: 47px;
    --footer-bg: #2D383C;
}


/* --------------------------------------------------------------------------
   CSS Reset
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--font-regular);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

a {
    color: inherit;
    text-decoration: none;
}

ul,
ol {
    list-style: none;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

address {
    font-style: normal;
}


/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-bold);
    line-height: var(--leading-heading);
    color: var(--text-primary);
    text-transform: uppercase;
}

h1 {
    font-size: var(--text-4xl);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
}

h2 {
    font-size: var(--text-3xl);
    letter-spacing: var(--tracking-slight);
}

h3 {
    font-size: var(--text-2xl);
    font-weight: var(--font-semibold);
    line-height: var(--leading-snug);
}

h4 {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    line-height: 1.3;
}

h5 {
    font-size: var(--text-lg);
}

h6 {
    font-size: var(--text-md);
    font-weight: var(--font-semibold);
}

p {
    margin-bottom: var(--space-md);
    line-height: var(--leading-normal);
    color: var(--text-secondary);
}

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

strong, b {
    font-weight: var(--font-bold);
}

/* Super title — small caps label above headings */
.super-title {
    font-family: var(--font-accent);
    font-size: var(--text-super);
    font-weight: var(--font-bold);
    line-height: 1.5;
    letter-spacing: var(--tracking-super);
    text-transform: uppercase;
    color: var(--color-primary);
    margin-bottom: var(--space-sm);
    display: block;
}

.section--dark .super-title {
    color: var(--color-accent);
}

/* Divider — thin colored line below section headings */
.heading-divider {
    width: var(--divider-width);
    height: var(--divider-height);
    background-color: var(--divider-color);
    margin: var(--divider-margin);
    border: none;
}

.section--dark .heading-divider {
    background-color: var(--divider-color-dark);
}


/* --------------------------------------------------------------------------
   Layout: Container
   -------------------------------------------------------------------------- */

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

.container--narrow {
    max-width: var(--container-narrow);
}

.container--wide {
    max-width: 1440px;
}

.container--hero {
    max-width: var(--hero-content-max);
}


/* --------------------------------------------------------------------------
   Layout: Section
   -------------------------------------------------------------------------- */

.section {
    padding-top: var(--section-padding);
    padding-bottom: var(--section-padding);
}

.section--alt {
    background-color: var(--bg-secondary);
}

.section--dark {
    background-color: var(--bg-dark);
    color: var(--text-inverse);
}

.section--darker {
    background-color: var(--bg-darker);
    color: var(--text-inverse);
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4,
.section--dark h5,
.section--dark h6,
.section--darker h1,
.section--darker h2,
.section--darker h3,
.section--darker h4,
.section--darker h5,
.section--darker h6 {
    color: var(--text-inverse);
}

.section--dark p,
.section--darker p {
    color: var(--gray-300);
}

.section__header {
    text-align: center;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: var(--space-3xl);
}

.section__header--left {
    text-align: left;
    margin-left: 0;
}

.section__title {
    margin-bottom: var(--space-md);
}


/* --------------------------------------------------------------------------
   Flexbox & Grid Utilities
   -------------------------------------------------------------------------- */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }
.text-center { text-align: center; }

.grid { display: grid; gap: var(--space-xl); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--5 { grid-template-columns: repeat(5, 1fr); }

@media (max-width: 1024px) {
    .grid--4,
    .grid--5 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .grid--2,
    .grid--3,
    .grid--4,
    .grid--5 { grid-template-columns: 1fr; }
}


/* --------------------------------------------------------------------------
   Buttons — from Cooper & Jones CTA patterns
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 14px var(--cta-padding-x);
    font-family: var(--font-body);
    font-size: var(--text-md);
    font-weight: var(--font-bold);
    line-height: 1;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color var(--transition-button),
                border-color var(--transition-button),
                transform var(--transition-button),
                box-shadow var(--transition-button),
                filter var(--transition-button);
    white-space: nowrap;
}

.btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Primary Button — Red */
.btn--primary {
    background-color: var(--color-primary);
    color: var(--text-inverse);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-button);
}

.btn--primary:hover {
    background-color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    filter: brightness(120%);
    box-shadow: var(--shadow-button-hover);
}

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

/* Secondary Button — Charcoal */
.btn--secondary {
    background-color: var(--color-secondary);
    color: var(--text-inverse);
    border-color: var(--color-secondary);
}

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

/* Outline Button */
.btn--outline {
    background-color: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn--outline:hover {
    background-color: var(--color-primary);
    color: var(--text-inverse);
}

/* Outline on dark backgrounds */
.section--dark .btn--outline,
.section--darker .btn--outline {
    color: var(--text-inverse);
    border-color: var(--text-inverse);
}

.section--dark .btn--outline:hover,
.section--darker .btn--outline:hover {
    background-color: var(--text-inverse);
    color: var(--color-secondary);
}

/* Text Link with Arrow — "Read our story →" pattern */
.btn--text {
    padding: 0;
    background: none;
    border: none;
    color: var(--color-primary);
    font-weight: var(--font-bold);
    text-decoration: none;
    border-radius: 0;
    box-shadow: none;
}

.btn--text:hover {
    text-decoration: underline;
}

.btn--text::after {
    content: ' \2192';
}

.section--dark .btn--text {
    color: var(--color-accent);
}

/* Button Sizes */
.btn--sm { padding: 10px 24px; font-size: var(--text-sm); }
.btn--lg { padding: 18px 56px; font-size: var(--text-md); }
.btn--full { width: 100%; }


/* --------------------------------------------------------------------------
   Form Elements
   -------------------------------------------------------------------------- */

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="search"],
input[type="password"],
textarea,
select {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    appearance: none;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.15);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-tertiary);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

label {
    display: block;
    margin-bottom: var(--space-xs);
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    color: var(--text-primary);
}


/* --------------------------------------------------------------------------
   Responsive Breakpoints — from Cooper & Jones
   -------------------------------------------------------------------------- */

@media (max-width: 999px) {
    :root {
        --section-padding: clamp(3rem, 6vw, 6.25rem);  /* tablet: ~100px */
    }
}

@media (max-width: 690px) {
    :root {
        --section-padding: clamp(2rem, 5vw, 3.4375rem);  /* phone: ~55px */
        --container-padding: 1.25rem;
    }
}
