/* roboto-mono-regular - latin */
@font-face {
    font-display: swap;
    font-family: "Roboto Mono";
    font-style: normal;
    font-weight: 400;
    src: url("../fonts/roboto-mono-v31-latin-regular.woff2") format("woff2");
}

/* google-sans-flex-regular - latin */
@font-face {
    font-display: swap;
    font-family: "Google Sans Flex";
    font-style: normal;
    font-weight: 400;
    src: url("../fonts/google-sans-flex-v16-latin-regular.woff2")
        format("woff2");
}

/* montserrat-regular - latin */
@font-face {
    font-display: swap;
    font-family: "Montserrat";
    font-style: normal;
    font-weight: 400;
    src: url("../fonts/montserrat-v31-latin-regular.woff2") format("woff2");
}

/* lato-regular - latin */
@font-face {
    font-display: swap;
    font-family: "Lato";
    font-style: normal;
    font-weight: 400;
    src: url("../fonts/lato-v25-latin-regular.woff2") format("woff2");
}

/* manrope-regular - latin */
@font-face {
    font-family: "Manrope";
    src: url("../fonts/manrope-v20-latin-regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    /* --- ORIGINAL THEME COLORS (Unchanged) --- */
    color-scheme: light;
    --page-bg: #eef0cf;
    --page-bg-alt: #e2e5c1;
    --surface: #f5f6dc;
    --surface-2: #dde0b8;
    --surface-contrast: #5b5f3f;
    --text: #2e3121;
    --text-soft: #50553a;
    --text-inverse: #f5f6dc;
    --border: #c3c79f;
    --border-strong: #8f946c;
    --shadow: 0 18px 50px rgba(46, 49, 33, 0.12);
    --accent: #6a6f49;
    --accent-hover: #5b5f3f;
    --accent-2: #dde0b8;
    --button-text: #f5f6dc;
    --overlay: rgba(32, 32, 32, 0.6);

    /* --- GLOBAL DEFAULTS (Inter) --- */
    --font-stack: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
    --hero-h1-width: 12ch;
    --hero-h1-size: clamp(2.4rem, 5vw, 4.8rem);
    --hero-h1-line-height: 1.05;
    --hero-h1-spacing: -0.03em;
    --card-h2-size: clamp(1.5rem, 2.2vw, 2.3rem);
    --card-h2-line-height: 1.05;
    --card-h2-spacing: -0.03em;

    /* Structure */
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --max-width: 1200px;
    --grid-gap: 1.25rem;
}

/* --- THE ONE-TOUCH SWITCHER --- */

[data-font="inter"] {
    --font-stack: Inter, ui-sans-serif, system-ui, sans-serif;
    --hero-h1-width: 12ch;
    --hero-h1-size: clamp(2.4rem, 5vw, 4.8rem);
    --hero-h1-line-height: 1.05;
    --hero-h1-spacing: -0.03em;
    --card-h2-size: clamp(1.5rem, 2.2vw, 2.3rem);
    --card-h2-line-height: 1.05;
    --card-h2-spacing: -0.03em;
}

[data-font="manrope"] {
    --font-stack: "Manrope", sans-serif;
    --hero-h1-width: 13ch;
    --hero-h1-size: clamp(2.35rem, 4.9vw, 4.7rem);
    --hero-h1-line-height: 1.04;
    --hero-h1-spacing: -0.035em;
    --card-h2-size: clamp(1.48rem, 2.1vw, 2.2rem);
    --card-h2-line-height: 1.06;
    --card-h2-spacing: -0.03em;
}

[data-font="lato"] {
    --font-stack: "Lato", sans-serif;
    --hero-h1-width: 13ch;
    --hero-h1-size: clamp(2.3rem, 4.8vw, 4.6rem);
    --hero-h1-line-height: 1.05;
    --hero-h1-spacing: -0.02em;
    --card-h2-size: clamp(1.45rem, 2.05vw, 2.15rem);
    --card-h2-line-height: 1.07;
    --card-h2-spacing: -0.02em;
}

[data-font="roboto-mono"] {
    --font-stack: "Roboto Mono", monospace;
    --hero-h1-width: 14ch;
    --hero-h1-size: clamp(2.15rem, 4.5vw, 4.15rem);
    --hero-h1-line-height: 1.08;
    --hero-h1-spacing: -0.02em;
    --card-h2-size: clamp(1.35rem, 1.9vw, 1.95rem);
    --card-h2-line-height: 1.1;
    --card-h2-spacing: -0.015em;
}

[data-font="montserrat"] {
    --font-stack: "Montserrat", sans-serif;
    --hero-h1-width: 13ch;
    --hero-h1-size: clamp(2.3rem, 4.8vw, 4.55rem);
    --hero-h1-line-height: 1.04;
    --hero-h1-spacing: -0.035em;
    --card-h2-size: clamp(1.45rem, 2.05vw, 2.15rem);
    --card-h2-line-height: 1.06;
    --card-h2-spacing: -0.025em;
}

[data-font="google-sans"] {
    --font-stack: "Google Sans Flex", sans-serif;
    --hero-h1-width: 12ch;
    --hero-h1-size: clamp(2.38rem, 4.95vw, 4.75rem);
    --hero-h1-line-height: 1.05;
    --hero-h1-spacing: -0.03em;
    --card-h2-size: clamp(1.48rem, 2.15vw, 2.25rem);
    --card-h2-line-height: 1.05;
    --card-h2-spacing: -0.03em;
}

/* --- Original Light/Dark Themes --- */
[data-theme="original-light"] {
    color-scheme: light;
}
[data-theme="original-dark"] {
    color-scheme: dark;
    --page-bg: #4c5035;
    --page-bg-alt: #43472f;
    --surface: #5b5f3f;
    --surface-2: #6a6f49;
    --surface-contrast: #7c8158;
    --text: #f5f6dc;
    --text-soft: #dde0b8;
    --text-inverse: #f5f6dc;
    --border: #8f946c;
    --border-strong: #c3c79f;
    --shadow: 0 20px 60px rgba(33, 36, 23, 0.35);
    --accent: #8f946c;
    --accent-hover: #7c8158;
    --accent-2: #6a6f49;
    --button-text: #f5f6dc;
    --overlay: rgba(32, 32, 32, 0.6);
}

[data-theme="original-tactical-dark"] {
    color-scheme: dark;
    --page-bg: #0d0f0e;
    --page-bg-alt: #131614;
    --surface: #1a1e1c;
    --surface-2: #242926;
    --surface-contrast: #6a6f49;
    --text: #f5f6dc;
    --text-soft: #8a938e;
    --text-inverse: #26281a;
    --border: #2d3430;
    --border-strong: #3f4943;
    --accent: #6a6f49;
    --accent-hover: #7c8158;
    --overlay: rgba(32, 32, 32, 0.6);
}

/* --- OBSIDIAN COBALT --- */
[data-theme="obsidian-light"] {
    --page-bg: #f4f7fa;
    --page-bg-alt: #e9eef5;
    --surface: #ffffff;
    --surface-2: #dde4ed;
    --surface-contrast: #2f58cd;
    --text: #1a1d23;
    --text-soft: #5c6470;
    --text-inverse: #ffffff;
    --border: #d1d9e4;
    --border-strong: #adb9c9;
    --accent: #2f58cd;
    --accent-hover: #1e3fa3;
    --shadow: 0 12px 40px rgba(47, 88, 205, 0.08);
}
[data-theme="obsidian-dark"] {
    color-scheme: dark;
    --page-bg: #0b0e14;
    --page-bg-alt: #0f121a;
    --surface: #161b22;
    --surface-2: #1f242c;
    --surface-contrast: #2f58cd;
    --text: #f0f2f5;
    --text-soft: #9da3ae;
    --text-inverse: #ffffff;
    --border: #21262d;
    --border-strong: #30363d;
    --accent: #2f58cd;
    --accent-hover: #3b66e0;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}

/* --- TACTICAL STEALTH --- */
[data-theme="tactical-light"] {
    --page-bg: #fcfcfc;
    --page-bg-alt: #f0f2f1;
    --surface: #ffffff;
    --surface-2: #e2e6e4;
    --surface-contrast: #1a1e1c;
    --text: #0d0f0e;
    --text-soft: #5f6662;
    --text-inverse: #cbd6a2;
    --border: #dee2e0;
    --border-strong: #bfc5c2;
    --accent: #1a1e1c;
    --accent-hover: #000000;
}
[data-theme="tactical-dark"] {
    color-scheme: dark;
    --page-bg: #0d0f0e;
    --page-bg-alt: #131614;
    --surface: #1a1e1c;
    --surface-2: #242926;
    --surface-contrast: #94a852;
    --text: #eef1f0;
    --text-soft: #8a938e;
    --text-inverse: #0d0f0e;
    --border: #2d3430;
    --border-strong: #3f4943;
    --accent: #94a852;
    --accent-hover: #839648;
}

/* --- AEROSPACE INDUSTRIAL --- */
[data-theme="aerospace-light"] {
    --page-bg: #f5f5f5;
    --page-bg-alt: #ebebeb;
    --surface: #ffffff;
    --surface-2: #d1d1d1;
    --surface-contrast: #2a2e30;
    --text: #1a1c1d;
    --text-soft: #5e6266;
    --text-inverse: #ffffff;
    --border: #c2c2c2;
    --border-strong: #8a8a8a;
    --accent: #4a5157;
    --accent-hover: #2a2e30;
}
[data-theme="aerospace-dark"] {
    color-scheme: dark;
    --page-bg: #121415;
    --page-bg-alt: #191b1d;
    --surface: #1e2124;
    --surface-2: #282c31;
    --surface-contrast: #949da3;
    --text: #e1e4e6;
    --text-soft: #8b9298;
    --text-inverse: #121415;
    --border: #32383d;
    --border-strong: #454d54;
    --accent: #949da3;
    --accent-hover: #b0b8be;
}

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

html {
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
}

body {
    margin: 0;
    min-width: 320px;
    background:
        radial-gradient(
            circle at top left,
            rgba(245, 246, 220, 0.24),
            transparent 28%
        ),
        linear-gradient(180deg, var(--page-bg) 0%, var(--page-bg-alt) 100%);
    color: var(--text);
    font-family: var(--font-stack);
    line-height: 1.6;
}

body.legal-panel-open {
    overflow: hidden;
}

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

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

p,
ul {
    margin-top: 0;
}

.site-shell {
    width: min(calc(100% - 2rem), var(--max-width));
    margin: 0 auto;
    padding: 1.25rem 0 2rem;
}

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.hero {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
    align-items: center;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}

.hero__logo-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface-2);
    padding: 0.875rem;
}

.hero__logo {
    width: 100%;
    height: auto;
    border-radius: 0;
    object-fit: contain;
}

.eyebrow,
.section-label {
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-soft);
}

.hero h1,
.card h2 {
    margin: 0 0 1rem;
    line-height: 1.05;
}

.hero h1 {
    font-size: var(--hero-h1-size);
    max-width: var(--hero-h1-width);
    letter-spacing: var(--hero-h1-spacing);
    line-height: var(--hero-h1-line-height);
    word-break: keep-all;
}

.card h2 {
    font-size: var(--card-h2-size);
    letter-spacing: var(--card-h2-spacing);
    line-height: var(--card-h2-line-height);
    margin: 0 0 0.75rem;
}

.hero__lead,
.card p,
.card li,
.site-footer p,
.site-footer a {
    font-size: 1rem;
    color: var(--text-soft);
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.875rem;
    margin-top: 1.5rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0.8rem 1.15rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 700;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

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

.button--primary {
    background: var(--accent);
    color: var(--button-text);
}

.button--primary:hover {
    background: var(--accent-hover);
}

.button--secondary {
    border-color: var(--border-strong);
    background: transparent;
    color: var(--text);
}

.button--secondary:hover {
    background: var(--surface-2);
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--grid-gap);
}

.bento-grid > .card {
    padding: 1.5rem;
}

.span-8 {
    grid-column: span 8;
}

.span-4 {
    grid-column: span 4;
}

.card--feature {
    background:
        linear-gradient(
            180deg,
            rgba(245, 246, 220, 0.22),
            rgba(245, 246, 220, 0)
        ),
        var(--surface);
}

.card--contrast {
    background: var(--surface-contrast);
}

.card--contrast .section-label,
.card--contrast h2,
.card--contrast li {
    color: var(--text-inverse);
}

.stack-list {
    margin: 0;
    padding-left: 1.1rem;
}

.stack-list li + li {
    margin-top: 0.5rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.contact-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-2);
    padding: 1rem;
}

.contact-item__label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-soft);
}

.contact-email-button {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.contact-email-button:hover strong,
.contact-email-button:focus-visible strong {
    text-decoration: underline;
}

.contact-email-button:focus-visible {
    outline: 2px solid var(--border-strong);
    outline-offset: 4px;
    border-radius: 6px;
}

.contact-email-button__status {
    min-width: 3.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
    opacity: 0;
    transform: translateY(2px);
    transition:
        opacity 0.18s ease,
        transform 0.18s ease;
}

.contact-email-button.is-copied .contact-email-button__status {
    opacity: 1;
    transform: translateY(0);
}

.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.25rem;
    padding: 1.1rem 1.4rem;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-nav a:hover {
    text-decoration: underline;
}

.legal-panel-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--overlay);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.18s ease,
        visibility 0.18s ease;
    will-change: opacity;
}

.legal-panel-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.legal-panel {
    width: min(100%, 900px);
    max-height: min(90vh, 960px);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    opacity: 0;
    transform: translateY(8px);
    transition:
        opacity 0.18s ease,
        transform 0.18s ease;
    will-change: opacity, transform;
}

.legal-panel-overlay.is-open .legal-panel {
    opacity: 1;
    transform: translateY(0);
}

.legal-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.legal-panel__header h2,
.legal-panel__section h3 {
    color: var(--text);
}

.legal-panel__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0.8rem 1.15rem;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
}

.legal-panel__close:hover {
    background: var(--surface-2);
}

.legal-panel__body {
    overflow-y: auto;
    padding-top: 1rem;
}

.legal-panel__section + .legal-panel__section {
    margin-top: 1.5rem;
}

.legal-panel__section h3 {
    margin: 0 0 0.6rem;
    font-size: 1rem;
    line-height: 1.3;
}

.legal-panel__section p:last-child,
.legal-panel__section ul:last-child {
    margin-bottom: 0;
}

.theme-toggle-secret {
    cursor: pointer;
    opacity: 0.05;
    font-size: 10px;
    margin-right: auto;
    padding: 0 10px;
    user-select: none;
}

#site-copyright {
    cursor: pointer;
    user-select: none;
    transition: opacity 0.2s ease;
}

#site-copyright:active {
    opacity: 0.6;
}

.hero__logo-container {
    position: relative;
    display: inline-block;
    width: 100%;
}

.logo-hotspot-container {
    position: relative;
    display: inline-block;
    line-height: 0;
}

.theme-hotspot {
    position: absolute;
    top: 11%;
    left: 52%;
    width: 25px;
    height: 25px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    cursor: crosshair;
    z-index: 999;
    transform: translate(-50%, -50%);
}

/* --- Combined Responsive Overrides --- */
@media (max-width: 980px) {
    .hero {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        max-width: none;
    }

    .span-8,
    .span-4 {
        grid-column: span 12;
    }
}

@media (max-width: 640px) {
    .site-shell {
        width: min(calc(100% - 1rem), var(--max-width));
        padding-top: 0.5rem;
    }

    .hero,
    .bento-grid > .card,
    .site-footer {
        padding: 1.1rem;
    }

    .contact-grid,
    .site-footer {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: flex-start;
    }

    .hero__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .button {
        width: 100%;
    }

    .legal-panel {
        max-height: 100vh;
        padding: 1.1rem;
    }

    .legal-panel__header {
        flex-direction: column;
    }

    .legal-panel__close {
        width: 100%;
    }
}
