/* Design tokens (from Figma variables) */
:root {
    --bg: #212121;
    /* Background/Background/bg-background-black-primary */
    --text-primary: #f9f9f9;
    /* Text/Text/text-primary-white */
    --text-primary-black: #212121;
    /* Text/Text/text-primary-black */
    --text-secondary: #d1d1d1;
    /* Text/Text/text-secondary-white */
    --outline-tertiary: #b0b0b0;
    /* Outline/Outline/outline-black-tertiary */
    --outline-secondary: #e7e7e7;
    /* Outline/Outline/outline-black-secondary */
    --radius-l: 16px;
    /* Border-Radius/L */
    --radius-s: 8px;
    /* Border-Radius/S */
    --space-2xs: 2px;
    /* Space/2XS */
    --space-xs: 4px;
    /* Space/XS */
    --space-s: 8px;
    /* Space/S */
    --space-m: 12px;
    /* Space/M */
    --space-l: 16px;
    /* Space/L */
    --space-xl: 24px;
    /* Space/XL */
    --space-2xl: 32px;
    /* Space/3XL */
    --container-max: 1240px;
    --panel: #161616;
    /* derived for cards/forms */
    --panel-border: #2c2c2c;
    --brand-contrast: #ffffff;
}

/* Background utilities */
.background-pure-white {
    background: #ffffff;
}

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text-primary);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.white-bg {
    background: #ffffff;
    color: #212121;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-primary);
    margin: 0 0 var(--space-l);
}

.hero {
    font-family: Poppins, Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
    font-weight: 700;
    font-size: clamp(28px, 5vw, 56px);
    line-height: 1.2;
    letter-spacing: 0.2px;
}

.eyebrow {
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-s);
}

.lede {
    color: var(--text-secondary);
}

/* Layout */
.container {
    width: 100%;
    max-width: var(--container-max);
    padding: 0 var(--space-2xl);
    margin: 0 auto;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: transparent;
    backdrop-filter: none;
}

/* Header background adaptation */
body:not(.white-bg) .site-header {
    background: rgba(33, 33, 33, 0.92);
    backdrop-filter: saturate(120%) blur(6px);
}

body.white-bg .site-header {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(120%) blur(6px);
}

/* Home page override: keep header fully transparent over hero */
body.white-bg .home-hero-container .site-header {
    background: transparent;
    backdrop-filter: none;
}

/* Home page only: float header over hero */
.home-hero-container .site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
}

.brand img {
    display: block;
    height: 32px;
}

.site-nav .nav-list {
    list-style: none;
    display: flex;
    gap: var(--space-2xl);
    margin: 0;
    padding: 0;
}

.site-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
}

.site-nav a[aria-current="page"],
.site-nav a:hover,
.site-nav a:focus-visible {
    color: var(--text-primary);
}

/* Navigation link adaptation */
body.white-bg .site-nav a {
    color: #888888;
    padding-right: 16px;
}

body.white-bg .site-nav a[aria-current="page"],
body.white-bg .site-nav a:hover,
body.white-bg .site-nav a:focus-visible {
    color: #212121;
}

/* Home page nav colors over hero image */
.home-hero-container .site-header .site-nav a {
    color: var(--text-primary);
}

.home-hero-container .site-header .site-nav a[aria-current="page"],
.home-hero-container .site-header .site-nav a:hover,
.home-hero-container .site-header .site-nav a:focus-visible {
    color: var(--text-primary);
    padding-right: 16px;
}

/* Logo adaptation */
.header-logo {
    display: block;
    height: 32px;
}

/* Main */
.site-main {
    padding: var(--space-2xl) 0;
    flex: 1;
}

.contact-hero {
    padding: clamp(24px, 4vw, 64px) 0 clamp(24px, 4vw, 64px);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: clamp(24px, 5vw, 64px);
    align-items: start;
}

.info-stack {
    display: grid;
    gap: var(--space-xl);
    margin-top: var(--space-2xl);
}

.info-card {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: var(--space-l);
    align-items: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-l);
    padding: var(--space-xl);
}

.info-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #2a2a2a;
    font-size: 22px;
}

.card-title {
    font-size: 18px;
    margin: 0 0 var(--space-xs);
}

.card-body {
    color: var(--text-secondary);
    margin: 0;
}

.tel {
    color: inherit;
}

/* Form */
.contact-right {
    width: 100%;
}

.form-panel {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-l);
    padding: calc(var(--space-2xl) + 16px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.field {
    display: grid;
    gap: var(--space-s);
    margin-bottom: var(--space-xl);
}

.field label {
    font-size: 12px;
    color: var(--text-secondary);
}

.field input,
.field textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    color: var(--text-primary);
    background: transparent;
    border: 1px solid var(--outline-tertiary);
    border-radius: var(--radius-s);
    padding: 16px 20px;
}

.field textarea {
    resize: vertical;
    min-height: 160px;
}

.field input::placeholder,
.field textarea::placeholder {
    color: var(--outline-tertiary);
}

.field input:focus-visible,
.field textarea:focus-visible,
.btn-primary:focus-visible {
    outline: 2px solid #8ec5ff;
    outline-offset: 2px;
}

.btn-primary {
    display: inline-block;
    width: 100%;
    border: none;
    border-radius: var(--radius-s);
    background: var(--brand-contrast);
    color: #111;
    font-weight: 600;
    padding: 16px;
    cursor: pointer;
}

.btn-primary:hover {
    filter: brightness(0.95);
}

.form-note {
    margin-top: var(--space-m);
    color: var(--text-secondary);
    font-size: 12px;
}

/* Custom reCAPTCHA replacement */
.recaptcha-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--outline-tertiary);
    border-radius: var(--radius-s);
    background: transparent;
    cursor: pointer;
}

.recaptcha-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--brand-contrast);
}

.recaptcha-label {
    font-size: 14px !important;
    color: var(--text-primary) !important;
    cursor: pointer !important;
    margin: 0 !important;
    font-family: inherit !important;
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    background: #10b981;
    color: white;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease-in-out;
    max-width: 400px;
    word-wrap: break-word;
}

.toast.error {
    background: #ef4444;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast-icon {
    font-size: 18px;
    font-weight: bold;
    flex-shrink: 0;
}

.toast-message {
    font-size: 14px;
    line-height: 1.4;
    flex: 1;
}

/* Mobile toast positioning */
@media (max-width: 768px) {
    .toast {
        top: 16px;
        right: 16px;
        left: 16px;
        max-width: none;
    }
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--panel-border);
    padding: 48px 0;
    background: #1a1a1a;
}

.footer-inner {
    display: grid;
    gap: 24px;
}

.footer-top {
    display: grid;
    gap: 24px;
    grid-template-columns: 1fr 1fr;
    align-items: start;
}

.footer-heading {
    font-size: 16px;
    margin-bottom: var(--space-s);
}

.footer-text {
    color: var(--text-secondary);
}

.footer-bottom {
    border-top: 1px solid var(--panel-border);
    padding-top: 16px;
    color: var(--text-secondary);
    font-size: 12px;
}

/* Breakpoints: 1200/992/768/576 */
@media (max-width: 1200px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .site-nav .nav-list {
        gap: var(--space-xl);
    }
}

@media (max-width: 768px) {
    .site-header {
        padding-top: 12px;
    }

    .header-inner {
        flex-direction: column;
        gap: var(--space-m);
        padding-top: var(--space-m);
        padding-bottom: var(--space-m);
    }

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

@media (max-width: 576px) {
    .container {
        padding: 0 16px;
    }

    .info-card {
        grid-template-columns: 48px 1fr;
    }
}

/* Team page */
.team-main {
    background: #ffffff;
    color: #212121;
}

.team-main .hero {
    margin-bottom: var(--space-l);
    color: #212121;
}

.team-main .lede {
    color: #888888;
}

/* About page */
.values-section {
    padding: clamp(24px, 4vw, 64px) 0;
}

/* Home page */
.home-hero {
    position: relative;
    padding: 0;
    margin-top: 0;
    min-height: 100vh;
}

.home-hero .hero-media {
    height: 100vh;
    background: url('../public/hero.png') center/cover no-repeat;
}

/* Wrapper used on index.html only to let header float over hero background */
.home-hero-container {
    background: url('../public/hero.png') center/cover no-repeat;
    height: 100vh;
    position: relative;
    width: 100%;
}

.home-hero .hero-content {
    position: absolute;
    inset: 0;
    margin: 0;
    max-width: none;
    width: 100%;
    pointer-events: none;
    overflow: visible;
}

.home-hero .hero-left,
.home-hero .hero-right {
    position: absolute;
    pointer-events: auto;
}

.home-hero .hero-left {
    top: clamp(48px, 10vw, 145px);
    left: clamp(16px, 5vw, 72px);
    max-width: min(38vw, 450px);
    padding-right: 16px;
    padding-left: 16px;
}

.home-hero .hero-right {
    bottom: clamp(24px, 10vh, 160px);
    right: clamp(16px, 4vw, 72px);
    max-width: min(40vw, 500px);
    padding-right: 16px;
}

.display {
    font-family: Poppins, Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
    font-weight: 700;
    font-size: clamp(28px, 4.5vw, 48px);
    line-height: 1.2;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: auto;
}

/* Force hero title into exactly three lines by block-stacking spans */
.home-hero .display span {
    display: block;
}

.display-sub {
    font-family: Poppins, Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
    font-weight: 700;
    font-size: clamp(22px, 3.2vw, 40px);
    line-height: 1.25;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: auto;
}

.home-features {
    background: #ffffff;
    color: var(--text-primary-black);
    padding: 64px 0;
}

.home-features .section-title {
    text-align: center;
    color: var(--text-primary-black);
    margin-bottom: 24px;
}

.feature-grid {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(240px, 1fr));
    gap: 24px;
}

.feature-card {
    background: #f9f9f9;
    border-radius: 16px;
    padding: 16px;
}

.feature-icon {
    font-size: 22px;
    margin-bottom: 8px;
    width: 32px;
    height: 32px;
}

.feature-title {
    margin: 0 0 8px;
    font-weight: 700;
    color: var(--text-primary-black);
}

.feature-copy {
    margin: 0;
    color: #555;
}

@media (max-width: 992px) {
    .home-hero .hero-content {
        position: static;
        max-width: var(--container-max);
        padding: clamp(32px, 8vw, 64px) var(--space-2xl);
        pointer-events: auto;
        display: flex;
        flex-direction: column;
        min-height: 50vh;
    }

    .home-hero .hero-left {
        position: static;
        max-width: min(75vw, 450px);
        padding-left: 16px;
        margin-top: var(--space-xl);
    }

    .home-hero .hero-right {
        display: none;
    }

    .feature-grid {
        grid-template-columns: repeat(2, minmax(200px, 1fr));
    }
}

@media (max-width: 576px) {
    .feature-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile viewport constraints for all pages */
@media (max-width: 768px) {

    /* Ensure all elements respect viewport width */
    * {
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Prevent horizontal overflow */
    body {
        overflow-x: hidden;
    }

    /* Container constraints */
    .container {
        max-width: 100%;
        width: 100%;
        padding-left: 16px;
        padding-right: 16px;
    }

    /* Card elements */
    .value-card,
    .team-card,
    .info-card,
    .feature-card {
        max-width: 100%;
        width: 100%;
    }

    /* Form elements */
    .form-panel {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }

    .field {
        max-width: 100%;
        width: 100%;
    }

    .field input,
    .field textarea,
    .field select {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }

    .btn-primary {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }

    /* Text elements */
    .hero,
    .lede,
    .value-copy,
    .team-intro {
        max-width: 100%;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

.values-grid {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    gap: 24px;
}

.value-card {
    background: #ffffff;
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 20px;
}

.value-title {
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--text-primary-black);
}

.value-copy {
    margin: 0;
    color: var(--text-primary-black);
}

@media (max-width: 992px) {
    .values-grid {
        grid-template-columns: 1fr;
    }
}

.team-intro {
    max-width: 100%;
}

.team-grid-section {
    padding-top: 24px;
    background: #ffffff;
}

.team-grid {
    list-style: none;
    padding: 0;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(200px, 1fr));
    gap: clamp(16px, 2vw, 32px);
    max-width: min(100%, 600px);
    width: fit-content;
}

.team-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
}

.team-figure {
    margin: 0;
    padding: 24px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.team-figure img {
    display: block;
    width: 100%;
    height: auto;
    background: #e8e8e8;
    flex: 1;
    object-fit: cover;
}

.team-figure figcaption {
    margin-top: auto;
    padding-top: 16px;
}

.team-name {
    display: block;
    font-weight: 600;
    color: #212121;
}

.team-title {
    display: block;
    font-size: 14px;
    font-weight: 400;
    color: #666;
    margin-top: 4px;
}

@media (max-width: 768px) {
    .team-grid {
        grid-template-columns: 1fr;
    }
}