/* ============================================================
   BlackSwan Technologies — base.css
   Shared foundation: design tokens, reset, layout helpers,
   buttons, header, page heros, CTA band and footer.
   Every page loads this file first, then its own page CSS.
   ============================================================ */

/* ------------------------------------------------------------
   1. Design tokens (colors sampled from the design files)
   ------------------------------------------------------------ */
:root {
    /* Brand colors */
    --teal: #004B4D;            /* header, heros, CTA band          */
    --teal-deep: #003C3E;       /* hover state of teal              */
    --teal-accent: #006365;     /* headings, links, buttons         */
    --teal-accent-hover: #00787A;

    --cream: #F8F2E7;           /* warm section background          */
    --black: #0A0A0A;           /* footer, testimonials, dark card  */
    --white: #FFFFFF;

    /* Card palette */
    --yellow: #FCEA91;
    --plum: #B04F85;
    --mint: #A8E6CF;
    --red: #E54D4E;

    /* Text */
    --ink: #0A0A0A;
    --ink-soft: #333333;
    --grey: #6F6F6F;
    --grey-light: #9A9A9A;
    --on-teal-soft: rgba(255, 255, 255, 0.85);

    /* Shape */
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 999px;

    /* Type */
    --font-sans: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Layout */
    --container: 1400px;        /* 1240px content + 2 x 80px padding */
    --container-px: 80px;
    --section-py: 100px;

    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ------------------------------------------------------------
   2. Reset / base
   ------------------------------------------------------------ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--white);
    overflow-x: hidden; /* decorative sparkles may poke past the edge */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

ul,
ol {
    list-style: none;
}

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

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

/* Tight display type: big headlines sit almost line-on-line */
h1, h2 {
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
}

h3, h4 {
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

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

/* ------------------------------------------------------------
   3. Buttons (pill shaped throughout the design)
   ------------------------------------------------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    border-radius: var(--radius-pill);
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    transition: background var(--transition), color var(--transition),
                transform var(--transition), box-shadow var(--transition);
}

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

.btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* White pill, teal text — header + hero */
.btn--white {
    background: var(--white);
    color: var(--teal);
}

.btn--white:hover {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

/* Teal pill, white text — section links, forms */
.btn--teal {
    background: var(--teal-accent);
    color: var(--white);
}

.btn--teal:hover {
    background: var(--teal-accent-hover);
}

/* Black pill, white text — CTA band */
.btn--black {
    background: var(--black);
    color: var(--white);
}

.btn--black:hover {
    background: #222222;
}

/* Inline text link, teal with no underline */
/* Green + underlined so it clearly reads as clickable */
.text-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--teal-accent);
    font-size: 15px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 4px;
    transition: color var(--transition), text-shadow var(--transition);
}

.text-link:hover {
    color: var(--teal-accent-hover);
    text-shadow: 0.5px 0 0 currentColor;
}

/* Chevron used inside buttons / links */
.chevron {
    width: 14px;
    height: 14px;
}

/* ------------------------------------------------------------
   4. Header (dark teal on every page)
   ------------------------------------------------------------ */
.site-header {
    background: var(--teal);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    height: 96px;
}

/* Logo */
.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.logo-mark {
    width: auto;
    height: 40px;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.logo-title {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--white);
}

.logo-subtitle {
    margin-top: 3px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: rgba(255, 255, 255, 0.75);
}

/* Primary nav — centered between logo and CTA */
.nav-desktop {
    display: flex;
    align-items: center;
    gap: 40px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.header-inner {
    position: relative;
}

/* Links rest greyed out and "embolden" on hover.
   text-shadow fakes the bold so nav items never shift width. */
.nav-desktop a {
    font-size: 15px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.65);
    padding: 8px 0;
    transition: color var(--transition), text-shadow var(--transition);
}

.nav-desktop a:hover,
.nav-desktop a.is-active {
    color: var(--white);
    text-shadow: 0.6px 0 0 currentColor;
}

.header-cta {
    flex-shrink: 0;
    padding: 14px 28px;
}

/* Hamburger — mobile only */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 42px;
    height: 42px;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--white);
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}

.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
.mobile-menu {
    display: none;
    background: var(--teal);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 16px var(--container-px) 28px;
}

.mobile-menu.is-open {
    display: block;
}

.mobile-menu nav {
    display: flex;
    flex-direction: column;
}

.mobile-menu a {
    padding: 14px 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--white);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.mobile-menu .mobile-cta {
    margin-top: 20px;
    border-bottom: none;
    color: var(--teal); /* beats .mobile-menu a's white so text stays readable */
}

/* ------------------------------------------------------------
   5. Page hero (teal banner used on all inner pages)
   ------------------------------------------------------------ */
.page-hero {
    background: var(--teal);
    padding: 72px 0 96px;
}

.page-hero h1 {
    font-size: clamp(44px, 6vw, 72px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--white);
    max-width: 900px;
}

.page-hero .hero-sub {
    margin-top: 24px;
    font-size: 17px;
    line-height: 1.6;
    color: var(--on-teal-soft);
    max-width: 560px;
}

/* Back link used on detail pages (case study, article) */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 500;
    color: var(--white);
    margin-bottom: 48px;
    transition: opacity var(--transition);
}

.back-link:hover {
    opacity: 0.75;
}

/* ------------------------------------------------------------
   6. Shared section helpers
   ------------------------------------------------------------ */
.section {
    padding: var(--section-py) 0;
}

.section--cream { background: var(--cream); }
.section--black { background: var(--black); }

.section-title {
    font-size: clamp(30px, 3.4vw, 40px);
    line-height: 1.02;
    letter-spacing: -0.03em;
}

/* Oversized statement paragraph on cream (home, about, details).
   Words rest grey and light up progressively as you scroll —
   main.js wraps each word in a .word span and drives .is-lit. */
.statement {
    padding: 120px 0;
}

.statement p {
    font-size: clamp(24px, 2.6vw, 34px);
    line-height: 1.32;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--grey-light);
    max-width: 1060px;
}

.statement .word {
    transition: color 350ms ease;
}

.statement .word.is-lit {
    color: var(--ink);
}

/* ------------------------------------------------------------
   7. Numbers band (About + Case Studies)
   ------------------------------------------------------------ */
.numbers {
    background: var(--black);
    padding: 120px 0;
    position: relative;
    overflow: hidden;
}

.numbers .section-title {
    color: var(--white);
    max-width: 520px;
}

.numbers-intro {
    margin-top: 24px;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.75);
    max-width: 520px;
}

.numbers-grid {
    margin-top: 88px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
}

.stat-value {
    font-size: clamp(48px, 5.4vw, 76px);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--white);
    line-height: 1;
}

.stat-label {
    margin-top: 16px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
}

.numbers-sparkle {
    position: absolute;
    top: 90px;
    right: 40px;
    width: 150px;
    opacity: 0.9;
}

/* ------------------------------------------------------------
   8. CTA band — "Ready to Build Something That Lasts?"
   ------------------------------------------------------------ */
.cta-band {
    background: var(--teal);
    padding: 150px 0;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.cta-band h2 {
    font-size: clamp(38px, 5vw, 60px);
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--white);
    margin: 0 auto 48px;
    max-width: 720px;
}

.cta-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.cta-band .btn--white {
    color: var(--teal-accent);
}

/* Decorative sparkles */
.cta-sparkle--yellow {
    position: absolute;
    top: 64px;
    right: 12%;
    width: 104px;
}

.cta-sparkle--orange {
    position: absolute;
    bottom: 26%;
    left: 8.5%;
    width: 80px;
}

/* ------------------------------------------------------------
   9. Footer (black)
   ------------------------------------------------------------ */
.site-footer {
    background: var(--black);
    color: var(--white);
    padding: 96px 0 64px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: 48px;
}

.footer-brand .logo {
    margin-bottom: 12px;
}

.footer-tagline {
    font-size: 14px;
    color: var(--grey-light);
}

.footer-blurb {
    margin-top: 40px;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.55;
    color: var(--white);
    max-width: 300px;
}

.footer-col h4 {
    font-size: 14px;
    font-weight: 500;
    color: var(--grey-light);
    margin-bottom: 24px;
    letter-spacing: 0;
}

.footer-col ul {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer-col a {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.55);
    transition: color var(--transition), text-shadow var(--transition);
}

.footer-col a:hover {
    color: var(--white);
    text-shadow: 0.5px 0 0 currentColor;
}

.footer-email {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.footer-bottom {
    margin-top: 110px;
    font-size: 15px;
    color: var(--grey-light);
}

/* ------------------------------------------------------------
   10. Reveal-on-scroll animation (applied by main.js)
   ------------------------------------------------------------ */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 700ms ease, transform 700ms ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Photo variant — big images also settle from a gentle zoom */
.reveal--zoom {
    transform: translateY(24px) scale(1.04);
}

.reveal--zoom.is-visible {
    transform: translateY(0) scale(1);
}


@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ------------------------------------------------------------
   11. Responsive
   ------------------------------------------------------------ */
@media (max-width: 1024px) {
    :root {
        --container-px: 40px;
    }

    .nav-desktop {
        gap: 28px;
    }

    .numbers-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 48px;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    :root {
        --section-py: 72px;
        --container-px: 20px;
    }

    .header-inner {
        height: 76px;
    }

    .nav-desktop,
    .header-cta {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .page-hero {
        padding: 48px 0 64px;
    }

    .statement {
        padding: 80px 0;
    }

    .numbers {
        padding: 80px 0;
    }

    .numbers-grid {
        margin-top: 56px;
    }

    .numbers-sparkle {
        width: 90px;
        top: 40px;
        right: 20px;
    }

    .cta-band {
        padding: 100px 0;
    }

    .cta-sparkle--yellow {
        width: 64px;
        top: 32px;
        right: 24px;
    }

    .cta-sparkle--orange {
        width: 48px;
        left: 24px;
        bottom: 10%;
    }

    .cta-actions {
        flex-direction: column;
        gap: 14px;
    }

    .cta-actions .btn {
        width: 100%;
        max-width: 340px;
    }

    .site-footer {
        padding: 64px 0 40px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .footer-bottom {
        margin-top: 64px;
    }
}
