/*
 * Theming: light is the default; dark applies when the visitor's system
 * prefers dark OR they toggle it (data-theme on <html>). Components reference
 * the semantic tokens (or the legacy --bg-dark/--bg-card/--text-main/
 * --text-muted aliases), so they follow the theme automatically.
 */
:root {
    /* Brand — identical in both themes */
    --primary-magenta: #9E0071;
    --primary-blue: #00539F;
    --white: #ffffff;
    --black: #000000;

    /* Light theme values */
    --bg-body: #ffffff;
    --bg-surface: #f4f7fb;
    --text-body: #16202e;
    --text-dim: #52627a;
    --heading: #0b1622;
    --header-bg: rgba(255, 255, 255, 0.9);
    --border-blue: rgba(0, 83, 159, 0.28);
    --shadow: rgba(15, 30, 50, 0.14);
    --placeholder: linear-gradient(135deg, #eef3f9 0%, #dbe6f2 100%);
    --hero-overlay: linear-gradient(90deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 255, 255, 0.55) 55%, rgba(255, 255, 255, 0.15) 100%);
    --hero-text: #0b1622;
    --hero-text-dim: #40566e;
    --hero-shadow: none;

    /* Logo block — white card in light mode */
    --logo-bg: #ffffff;
    --logo-border: var(--border-blue);
    --logo-divider: #d1d5db;
    --logo-text-blue: var(--primary-blue);
    --logo-text-magenta: var(--primary-magenta);
    --logo-secondary: #6b7280;
    --logo-icon-filter: none;

    /* Legacy aliases — re-resolve to the active theme's values */
    --bg-dark: var(--bg-body);
    --bg-card: var(--bg-surface);
    --text-main: var(--text-body);
    --text-muted: var(--text-dim);
}

/* Dark theme — explicit toggle */
:root[data-theme="dark"] {
    --bg-body: #070e1c;
    --bg-surface: #0c1830;
    --text-body: #e2e8f0;
    --text-dim: #94a3b8;
    --heading: #ffffff;
    --header-bg: rgba(7, 14, 28, 0.95);
    --border-blue: rgba(0, 83, 159, 0.7);
    --shadow: rgba(0, 0, 0, 0.45);
    --placeholder: linear-gradient(135deg, #0c1830 0%, #070e1c 100%);
    --hero-overlay: linear-gradient(90deg, rgba(7, 14, 28, 0.9) 0%, rgba(7, 14, 28, 0.4) 100%);
    --hero-text: #ffffff;
    --hero-text-dim: #cbd5e1;
    --hero-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);

    /* Logo block — dissolves into the dark header (no white card) */
    --logo-bg: transparent;
    --logo-border: transparent;
    --logo-divider: rgba(148, 163, 184, 0.35);
    --logo-text-blue: #5ba3e0;
    --logo-text-magenta: #e055ac;
    --logo-secondary: #94a3b8;
    --logo-icon-filter: brightness(1.18) saturate(1.05);
}

/* Dark theme — system preference, unless the visitor chose light */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-body: #070e1c;
        --bg-surface: #0c1830;
        --text-body: #e2e8f0;
        --text-dim: #94a3b8;
        --heading: #ffffff;
        --header-bg: rgba(7, 14, 28, 0.95);
        --border-blue: rgba(0, 83, 159, 0.7);
        --shadow: rgba(0, 0, 0, 0.45);
        --placeholder: linear-gradient(135deg, #0c1830 0%, #070e1c 100%);
        --hero-overlay: linear-gradient(90deg, rgba(7, 14, 28, 0.9) 0%, rgba(7, 14, 28, 0.4) 100%);
        --hero-text: #ffffff;
        --hero-text-dim: #cbd5e1;
        --hero-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);

        /* Logo block — dissolves into the dark header (no white card) */
        --logo-bg: transparent;
        --logo-border: transparent;
        --logo-divider: rgba(148, 163, 184, 0.35);
        --logo-text-blue: #5ba3e0;
        --logo-text-magenta: #e055ac;
        --logo-secondary: #94a3b8;
        --logo-icon-filter: brightness(1.18) saturate(1.05);
    }
}

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

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

/* Nothing may force a horizontal scroll on small screens */
img, video, iframe {
    max-width: 100%;
}
body {
    overflow-x: hidden;
    overflow-wrap: break-word;
}

::selection {
    background-color: var(--primary-magenta);
    color: #ffffff;
}

/* Visible keyboard focus everywhere, without doubling up on mouse clicks */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary-magenta);
    outline-offset: 2px;
}

/* Skip link: hidden until focused, then pinned top-left */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 200;
    background-color: var(--primary-magenta);
    color: #ffffff;
    padding: 10px 18px;
    font-weight: 600;
    border-radius: 0 0 4px 0;
}
.skip-link:focus {
    left: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--heading);
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.2rem; margin-top: 3rem; border-bottom: 1px solid var(--primary-blue); padding-bottom: 0.5rem; }
h3 { font-size: 1.5rem; color: var(--text-main); }
p { margin-bottom: 1.5rem; }
a { color: var(--primary-magenta); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.8; }
ul, ol { margin-bottom: 1.5rem; padding-left: 1.5rem; }
li { margin-bottom: 0.5rem; }
blockquote { border-left: 4px solid var(--primary-magenta); padding-left: 1rem; font-style: italic; color: var(--text-muted); }
hr { border: 0; border-top: 1px solid var(--primary-blue); margin: 3rem 0; opacity: 0.3; }

/* Buttons */
.btn-magenta {
    display: inline-block;
    background-color: var(--primary-magenta);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.btn-magenta:hover { color: var(--white); background-color: #7a0057; opacity: 1; }

.btn-outline {
    display: inline-block;
    border: 2px solid var(--primary-blue);
    background-color: var(--primary-blue);
    color: var(--white);
    padding: 10px 24px;
    border-radius: 4px;
    font-weight: 600;
}
.btn-outline:hover { background-color: transparent; opacity: 1; }

/* Header & Nav */
.site-header {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--primary-blue);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}
.header-right {
    display: flex;
    align-items: center;
    gap: 24px;
}
/* Logo block: a white card in light mode, dissolved into the header in dark mode */
.logo-block {
    border: 1px solid var(--logo-border);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-blue);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.2s, border-color 0.2s;
}
.theme-toggle:hover {
    color: var(--primary-magenta);
    border-color: var(--primary-magenta);
}
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
    :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo-container {
    display: block;
    text-decoration: none;
}
.logo-block {
    background-color: var(--logo-bg);
    padding: 8px 16px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.header-logo-square {
    height: 50px;
    width: auto;
    display: block;
    filter: var(--logo-icon-filter);
}
.logo-divider {
    width: 1px;
    height: 36px;
    background-color: var(--logo-divider);
}
.logo-text-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
}
.logo-text-primary {
    font-size: 1.3rem;
    font-weight: 700;
}
.blue-text {
    color: var(--logo-text-blue);
}
.magenta-text {
    color: var(--logo-text-magenta);
}
.logo-text-secondary {
    font-size: 0.85rem;
    color: var(--logo-secondary);
    font-weight: 500;
}

.primary-nav {
    display: flex;
    align-items: center;
    gap: 30px;
}
.primary-nav > a {
    color: var(--text-main);
    font-weight: 600;
}
.primary-nav > a:hover { color: var(--primary-magenta); }

.nav-dropdown {
    position: relative;
    display: inline-block;
}
.nav-dropdown > a {
    color: var(--text-main);
    font-weight: 600;
}
.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--bg-card);
    min-width: 200px;
    box-shadow: 0 8px 16px var(--shadow);
    z-index: 1;
    border: 1px solid var(--primary-blue);
    border-radius: 4px;
    top: 100%;
    left: 0;
}
.dropdown-content a {
    color: var(--text-main);
    padding: 12px 16px;
    display: block;
}
.dropdown-content a:hover {
    background-color: var(--primary-blue);
    color: var(--white);
}
.nav-dropdown:hover .dropdown-content,
.nav-dropdown:focus-within .dropdown-content {
    display: block;
}

/* Current page indicator */
.primary-nav > a.active:not(.btn-magenta),
.nav-dropdown > a.active {
    color: var(--primary-magenta);
}
.dropdown-content a.active {
    color: var(--primary-magenta);
    font-weight: 600;
}

/* Mobile menu button — hidden on desktop */
.nav-burger {
    display: none;
    background: transparent;
    border: 1px solid var(--border-blue);
    border-radius: 4px;
    width: 40px;
    height: 40px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    flex-shrink: 0;
}
.nav-burger span {
    display: block;
    width: 18px;
    height: 2px;
    background-color: var(--text-main);
    border-radius: 1px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
body.nav-open .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.nav-open .nav-burger span:nth-child(2) { opacity: 0; }
body.nav-open .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Hero Section */
.hero-section {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 80px 0;
}
.hero-media-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}
.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero-placeholder {
    width: 100%;
    height: 100%;
    background: var(--placeholder);
}
.hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--hero-overlay);
    z-index: 1;
}
/* Dark-band hero: forced dark treatment regardless of page theme. Applied when
   only dark artwork exists (no matching -hero-light- assets). */
.hero-section.hero--dark {
    --hero-overlay: linear-gradient(90deg, rgba(7, 14, 28, 0.9) 0%, rgba(7, 14, 28, 0.4) 100%);
    --hero-text: #ffffff;
    --hero-text-dim: #cbd5e1;
    --hero-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    --placeholder: linear-gradient(135deg, #0c1830 0%, #070e1c 100%);
}
.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
}
.hero-text-wrapper {
    max-width: 800px;
}
.hero-title {
    font-size: 3.5rem;
    margin-bottom: 2rem;
    color: var(--hero-text);
    text-shadow: var(--hero-shadow);
}
.hero-actions {
    display: flex;
    gap: 20px;
    margin-top: 2rem;
}

/* Breadcrumbs */
.breadcrumbs {
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: var(--hero-text-dim);
}
.breadcrumbs a {
    color: var(--hero-text-dim);
}
.breadcrumbs a:hover { color: var(--primary-magenta); }
.breadcrumbs .separator { margin: 0 10px; }
.breadcrumbs .current { color: var(--hero-text); }

/* Page Content */
.page-content {
    padding: 60px 20px;
}
.content-section {
    margin-bottom: 60px;
}

/* Custom Components */
.two-column-list {
    column-count: 2;
    column-gap: 40px;
}

.section-what-we-do {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 30px;
}
.card {
    background-color: var(--bg-card);
    padding: 30px;
    border-radius: 8px;
    border-top: 4px solid var(--primary-blue);
    box-shadow: 0 4px 6px var(--shadow);
    transition: transform 0.3s ease;
}
.card:hover {
    transform: translateY(-5px);
    border-top-color: var(--primary-magenta);
}
.card h3 {
    color: var(--heading);
    margin-bottom: 15px;
}

.timeline {
    list-style: none;
    padding: 0;
    position: relative;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--primary-blue);
}
.timeline li {
    position: relative;
    padding-left: 60px;
    margin-bottom: 30px;
}
.timeline li::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 6px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: var(--primary-magenta);
    border: 3px solid var(--bg-dark);
}

.service-cta {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--primary-blue);
    text-align: center;
}

/* Accessibility helper: text equivalents for background media */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Demoted in-content headline (hero already carries the page <h1>) */
.page-lede {
    font-size: 2.4rem;
    border-bottom: none;
    margin-top: 0;
    padding-bottom: 0;
}

/* In-page media */
.content-figure {
    margin: 0 0 1.5rem 0;
}
.content-img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    border: 1px solid var(--primary-blue);
}
.content-caption {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* FAQ */
.faq-item {
    background-color: var(--bg-card);
    border: 1px solid var(--primary-blue);
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 0;
}
.faq-item summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--heading);
    padding: 18px 24px;
    list-style-position: inside;
}
.faq-item summary:hover {
    color: var(--primary-magenta);
}
.faq-item[open] summary {
    border-bottom: 1px solid var(--primary-blue);
}
.faq-item p {
    padding: 18px 24px;
    margin-bottom: 0;
    color: var(--text-main);
}

/* Contact form */
.contact-form {
    max-width: 640px;
}
.form-row {
    margin-bottom: 1.25rem;
}
.form-row label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: var(--heading);
}
.form-row .req {
    color: var(--primary-magenta);
}
.contact-form input,
.contact-form select,
.contact-form textarea {
    width: 100%;
    padding: 12px 14px;
    background-color: var(--bg-card);
    border: 1px solid var(--primary-blue);
    border-radius: 4px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
}
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-magenta);
    box-shadow: 0 0 0 2px rgba(158, 0, 113, 0.3);
}
.contact-form textarea {
    resize: vertical;
}
/* Honeypot — visually and non-interactively hidden, but not display:none so
   bots that skip hidden fields still trip it */
.form-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.cf-turnstile {
    margin: 1.5rem 0;
}
.form-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.contact-form button[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}
.form-status {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-muted);
}
.form-status--ok {
    color: #34d399;
}
.form-status--err {
    color: #f87171;
}

.site-footer {
    background-color: var(--bg-card);
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid var(--primary-blue);
    color: var(--text-muted);
}

@media (max-width: 768px) {
    /* Typography scales down so headings never dominate a phone screen */
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.7rem; margin-top: 2.2rem; }
    h3 { font-size: 1.25rem; }
    .page-lede { font-size: 1.8rem; }
    .hero-title { font-size: 2.2rem; margin-bottom: 1.25rem; }

    /* Tighter vertical rhythm */
    .hero-section { min-height: 45vh; padding: 48px 0; }
    .page-content { padding: 36px 16px; }
    .content-section { margin-bottom: 40px; }
    .container { padding: 0 16px; }
    hr { margin: 2rem 0; }

    .two-column-list { column-count: 1; }

    /* Full-width, easy-to-tap buttons */
    .hero-actions { flex-direction: column; align-items: stretch; gap: 12px; }
    .hero-actions .btn-magenta,
    .hero-actions .btn-outline { text-align: center; }
    .service-cta .btn-magenta { display: block; text-align: center; }

    /* Compact header that still fits the logo, toggle and burger */
    .header-inner { height: 64px; }
    .header-right { gap: 10px; }
    .logo-block { padding: 6px 10px; gap: 10px; }
    .header-logo-square { height: 36px; }
    .logo-divider { height: 28px; }
    .logo-text-primary { font-size: 1rem; }
    .logo-text-secondary { font-size: 0.7rem; }

    /* Cards, timeline, FAQ and form: less padding, same look */
    .card { padding: 20px; }
    .timeline li { padding-left: 44px; margin-bottom: 22px; }
    .timeline::before { left: 14px; }
    .timeline li::before { left: 8px; }
    .faq-item summary,
    .faq-item p { padding: 14px 16px; }
    .breadcrumbs { font-size: 0.82rem; line-height: 1.9; }
    .site-footer { padding: 28px 0; font-size: 0.9rem; }

    /* Mobile menu: hidden by default, opens as a full-width panel under the header */
    .nav-burger { display: flex; }
    .primary-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background-color: var(--bg-body);
        border-bottom: 1px solid var(--primary-blue);
        box-shadow: 0 12px 24px var(--shadow);
        padding: 10px 20px 20px;
    }
    body.nav-open .primary-nav { display: flex; }
    .primary-nav > a,
    .nav-dropdown > a {
        display: block;
        padding: 12px 4px;
        border-bottom: 1px solid var(--border-blue);
    }
    .primary-nav > a.btn-magenta {
        margin-top: 14px;
        text-align: center;
        border-bottom: none;
    }
    /* Sub-links always visible inline on mobile — no hover needed */
    .nav-dropdown { position: static; }
    .dropdown-content {
        display: block;
        position: static;
        min-width: 0;
        box-shadow: none;
        border: none;
        background: transparent;
    }
    .dropdown-content a {
        padding: 10px 4px 10px 22px;
        font-size: 0.95rem;
    }
}

/* Small phones */
@media (max-width: 480px) {
    h1 { font-size: 1.85rem; }
    h2 { font-size: 1.5rem; }
    .page-lede { font-size: 1.55rem; }
    .hero-title { font-size: 1.85rem; }
    .hero-section { min-height: 40vh; padding: 36px 0; }

    /* Drop the tagline so the logo, theme toggle and burger fit side by side */
    .logo-text-secondary { display: none; }
    .logo-divider { display: none; }
    .header-logo-square { height: 32px; }

    .contact-form input,
    .contact-form select,
    .contact-form textarea { font-size: 16px; } /* stops iOS zoom-on-focus */
    .form-actions .btn-magenta { width: 100%; text-align: center; }
    /* Turnstile's fixed-width iframe scales instead of overflowing */
    .cf-turnstile { transform: scale(0.92); transform-origin: 0 0; }
}
