/* ==========================================================================
   Design tokens and base styles
   --------------------------------------------------------------------------
   Single source of truth for colour, type, spacing, radius and shadow.
   Loaded before every other stylesheet so all of them can use these values.
   ========================================================================== */

:root {
    /* --- Surfaces and text ------------------------------------------------ */
    --surface:        #fdfdfc;   /* page background, warm near-white       */
    --surface-sunken: #f5f4f0;   /* alternating section band               */
    --surface-card:   #ffffff;   /* raised cards                           */
    --ink:            #1c1c1a;   /* primary text, warm charcoal            */
    --ink-muted:      #5c5c56;   /* secondary text                         */
    --ink-faint:      #8a8a82;   /* meta text, captions                    */
    --hairline:       #e6e4de;   /* dividers, input borders                */

    /* --- Brand ------------------------------------------------------------
       The yellow is for emphasis only, always as a background behind dark
       text. It does not have enough contrast to be used as a text colour on
       white, so it never is. */
    --accent:         #f2b807;
    --accent-hover:   #d9a406;
    --accent-ink:     #1c1c1a;   /* text that sits on the accent           */
    --accent-wash:    #fef6df;   /* faint accent tint for backgrounds      */

    /* --- On dark surfaces (header, hero, mobile menu) --------------------- */
    --on-dark:        #ffffff;
    --on-dark-muted:  #d6d4cd;

    /* --- Type -------------------------------------------------------------
       System stack: no network request, no layout shift, native on every
       platform. */
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
            "Helvetica Neue", Arial, sans-serif;

    --text-xs:   0.8125rem;
    --text-sm:   0.9375rem;
    --text-base: 1.0625rem;
    --text-lg:   1.1875rem;
    --text-xl:   1.375rem;
    --text-2xl:  clamp(1.5rem,  2.5vw, 1.875rem);
    --text-3xl:  clamp(1.875rem, 3.5vw, 2.5rem);
    --text-hero: clamp(2.25rem,  5.5vw, 4rem);

    --leading-tight: 1.15;
    --leading-snug:  1.35;
    --leading-body:  1.65;

    /* --- Spacing scale ---------------------------------------------------- */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 1rem;
    --space-4: 1.5rem;
    --space-5: 2.5rem;
    --space-6: 4rem;
    --space-7: 6rem;

    /* Vertical rhythm between major sections, tighter on small screens */
    --section-y: clamp(3.5rem, 8vw, 6.5rem);

    /* --- Layout ----------------------------------------------------------- */
    --container: 1180px;
    --container-narrow: 720px;
    --gutter: clamp(1.25rem, 4vw, 2.5rem);

    /* --- Radius ----------------------------------------------------------- */
    --radius-sm:   8px;
    --radius:     14px;
    --radius-lg:  22px;
    --radius-pill: 999px;

    /* --- Elevation --------------------------------------------------------
       Two stacked shadows: a tight contact shadow plus a wide soft one. */
    --shadow-sm: 0 1px 2px rgb(28 28 26 / 0.05),
                 0 2px 8px  rgb(28 28 26 / 0.04);
    --shadow:    0 1px 2px rgb(28 28 26 / 0.04),
                 0 8px 24px rgb(28 28 26 / 0.07);
    --shadow-lg: 0 2px 4px  rgb(28 28 26 / 0.04),
                 0 16px 48px rgb(28 28 26 / 0.11);

    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}


/* ==========================================================================
   Reset and base
   ========================================================================== */

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

html {
    -webkit-text-size-adjust: 100%;
}

/* Anchors land below the fixed header rather than underneath it */
html {
    scroll-padding-top: 6rem;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

body {
    font-family: var(--font);
    font-size: var(--text-base);
    line-height: var(--leading-body);
    color: var(--ink);
    background-color: var(--surface);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
    line-height: var(--leading-tight);
    letter-spacing: -0.015em;
    font-weight: 650;
    text-wrap: balance;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-lg); }
h4 { font-size: var(--text-base); }

p {
    text-wrap: pretty;
}

a {
    color: inherit;
}

img, svg {
    display: block;
    max-width: 100%;
}

/* Visible focus for keyboard users on every interactive element */
:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Respect a user's request for less motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}


/* ==========================================================================
   Shared layout helpers
   ========================================================================== */

/* Replaces the old max-width:80vw pattern, which grew without limit on wide
   screens and left no gutter on small ones. */
.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.section {
    padding-block: var(--section-y);
}

/* A tinted band, used instead of the old 5px black rules to separate
   sections. */
.section--sunken {
    background: var(--surface-sunken);
}

.section__head {
    max-width: var(--container-narrow);
    margin-inline: auto;
    margin-bottom: var(--space-5);
    text-align: center;
}

.section__head p {
    margin-top: var(--space-2);
    color: var(--ink-muted);
    font-size: var(--text-lg);
}


/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 0.875rem 1.75rem;
    border: 0;
    border-radius: var(--radius-pill);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s var(--ease), color 0.2s var(--ease),
                transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.btn--primary {
    background: var(--accent);
    color: var(--accent-ink);
    box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* For use on photographs and dark panels */
.btn--ghost {
    background: rgb(255 255 255 / 0.12);
    color: var(--on-dark);
    border: 1px solid rgb(255 255 255 / 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.btn--ghost:hover {
    background: var(--on-dark);
    color: var(--ink);
    border-color: var(--on-dark);
    transform: translateY(-1px);
}
