/* ============================================
   PRIMEBIM — TECHNICAL THEME
   "Drawing set" aesthetic: drafting grids, mono
   annotations, navy + amber, sharp corners.
   Light & dark mode (system + manual toggle).
   ============================================ */

/* ============================================
   CSS VARIABLES - LIGHT THEME (Default)
   ============================================ */
:root {
    /* Surfaces */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f7fb;
    --bg-tertiary: #eaeef6;
    --bg-card: #ffffff;
    --bg-dark: #0b1730;

    /* Brand — from the PrimeBIM logo */
    --brand-primary: #1b3764;   /* logo navy */
    --brand-secondary: #2d7dd2; /* logo blue */
    --brand-light: #e3edf9;
    --brand-dark: #12274a;

    /* Accent — construction amber */
    --accent: #c96a10;
    --accent-soft: #faf0e1;

    /* Status */
    --accent-success: #0e7c5b;
    --accent-warning: #c96a10;

    /* Text */
    --text-primary: #142339;
    --text-secondary: #44546b;
    --text-tertiary: #64748b;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;

    /* Lines */
    --border-light: #dde4ee;
    --border-medium: #c3cedd;
    --grid-line: rgba(27, 55, 100, 0.07);

    /* Shadows — kept subtle; lines do the work */
    --shadow-sm: 0 1px 2px rgba(20, 35, 57, 0.06);
    --shadow-md: 0 3px 10px -2px rgba(20, 35, 57, 0.1);
    --shadow-lg: 0 12px 28px -10px rgba(20, 35, 57, 0.16);
    --shadow-xl: 0 24px 48px -16px rgba(20, 35, 57, 0.22);

    /* Typography */
    --font-display: 'Space Grotesk', 'Inter', sans-serif;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
    --space-3xl: 6rem;

    /* Corners — sharp, technical */
    --radius-sm: 2px;
    --radius-md: 4px;
    --radius-lg: 8px;
    --radius-xl: 12px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
}

/* ============================================
   CSS VARIABLES - DARK THEME (System Preference)
   ============================================ */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-primary: #0c1526;
        --bg-secondary: #111d33;
        --bg-tertiary: #1a2a45;
        --bg-card: #111d33;
        --bg-dark: #070e1c;

        --brand-primary: #6ea8e8;
        --brand-secondary: #8fc0f5;
        --brand-light: #1a2f50;
        --brand-dark: #4a8ad8;

        --accent: #e8943a;
        --accent-soft: #2b2113;

        --accent-success: #2eb88a;
        --accent-warning: #e8943a;

        --text-primary: #ecf1f8;
        --text-secondary: #b8c4d6;
        --text-tertiary: #8b9bb3;
        --text-muted: #5d6d85;
        --text-inverse: #0c1526;

        --border-light: #233651;
        --border-medium: #34496a;
        --grid-line: rgba(143, 192, 245, 0.06);

        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 3px 10px -2px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 12px 28px -10px rgba(0, 0, 0, 0.5);
        --shadow-xl: 0 24px 48px -16px rgba(0, 0, 0, 0.6);
    }
}

/* ============================================
   CSS VARIABLES - MANUAL DARK THEME OVERRIDE
   ============================================ */
:root[data-theme="dark"] {
    --bg-primary: #0c1526;
    --bg-secondary: #111d33;
    --bg-tertiary: #1a2a45;
    --bg-card: #111d33;
    --bg-dark: #070e1c;
    --brand-primary: #6ea8e8;
    --brand-secondary: #8fc0f5;
    --brand-light: #1a2f50;
    --brand-dark: #4a8ad8;
    --accent: #e8943a;
    --accent-soft: #2b2113;
    --accent-success: #2eb88a;
    --accent-warning: #e8943a;
    --text-primary: #ecf1f8;
    --text-secondary: #b8c4d6;
    --text-tertiary: #8b9bb3;
    --text-muted: #5d6d85;
    --text-inverse: #0c1526;
    --border-light: #233651;
    --border-medium: #34496a;
    --grid-line: rgba(143, 192, 245, 0.06);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 3px 10px -2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 28px -10px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 24px 48px -16px rgba(0, 0, 0, 0.6);
}

/* Dark mode logo - render white */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .logo-img {
        filter: brightness(0) invert(1);
    }
}
:root[data-theme="dark"] .logo-img {
    filter: brightness(0) invert(1);
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--brand-secondary);
    color: white;
}

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

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

/* ============================================
   CONTAINER
   ============================================ */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

@media (min-width: 1800px) {
    .container {
        max-width: 1440px;
    }
}

@media (min-width: 2400px) {
    .container {
        max-width: 1680px;
        padding: 0 3rem;
    }

    html {
        font-size: 18px;
    }
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
h4 { font-size: 1.125rem; }

p {
    color: var(--text-secondary);
    line-height: 1.7;
}

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

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

/* Mono annotation label — the "drawing note" voice */
.mono-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    font-family: var(--font-family);
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: var(--text-inverse);
}

.btn-primary:hover {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border-medium);
}

.btn-secondary:hover {
    border-color: var(--brand-secondary);
    color: var(--brand-secondary);
}

.btn-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn-accent:hover {
    filter: brightness(0.92);
}

.btn svg {
    width: 18px;
    height: 18px;
}

/* ============================================
   NAVIGATION
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: color-mix(in srgb, var(--bg-primary) 85%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-light);
    z-index: 1000;
    transition: var(--transition-base);
}

.navbar.scrolled {
    box-shadow: var(--shadow-md);
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

@media (min-width: 1800px) {
    .nav-wrapper {
        max-width: 1440px;
    }
}

@media (min-width: 2400px) {
    .nav-wrapper {
        max-width: 1680px;
        padding: 0 3rem;
        height: 80px;
    }
}

.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo-img {
    height: 44px;
    width: auto;
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.nav-link.active {
    color: var(--brand-primary);
    background: var(--brand-light);
}

.nav-icon {
    width: 18px;
    height: 18px;
}

.nav-tag {
    font-family: var(--font-mono);
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    padding: 0.1875rem 0.5rem;
    background: color-mix(in srgb, var(--accent-success) 12%, transparent);
    color: var(--accent-success);
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}

.nav-cta {
    margin-left: 1rem;
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 6px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--bg-secondary);
}

.theme-toggle svg {
    width: 16px;
    height: 16px;
    stroke: var(--text-muted);
    transition: var(--transition-fast);
}

.theme-toggle:hover svg {
    stroke: var(--text-secondary);
}

.theme-icon-sun {
    display: none;
}

.theme-icon-moon {
    display: block;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.mobile-menu-toggle:hover {
    background: var(--bg-secondary);
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition-fast);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   SECTION HEADER PATTERN
   ============================================ */
.section-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.section-label {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin-bottom: 1rem;
}

.section-label::before,
.section-label::after {
    content: '';
    width: 28px;
    height: 1px;
    background: var(--border-medium);
}

.section-title {
    max-width: 640px;
    margin: 0 auto 1rem;
}

.section-description {
    max-width: 600px;
    margin: 0 auto;
    color: var(--text-secondary);
}

/* ============================================
   HERO — drafting sheet
   ============================================ */
.hero {
    padding: 9rem 0 6rem;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

/* Drafting grid, fading toward the bottom */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 36px 36px;
    -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
    pointer-events: none;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: var(--space-2xl);
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 1.5rem;
}

.hero-eyebrow::before {
    content: '';
    width: 8px;
    height: 8px;
    border: 1.5px solid var(--accent);
    transform: rotate(45deg);
}

.hero-title {
    margin-bottom: 1.5rem;
}

.hero-title .line {
    display: block;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 540px;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.hero-stats {
    display: flex;
    gap: 0;
    border-top: 1px solid var(--border-light);
}

.stat-item {
    text-align: left;
    padding: 1.5rem 2rem 0 0;
}

.stat-item + .stat-item {
    padding-left: 2rem;
    border-left: 1px solid var(--border-light);
}

.stat-number {
    font-family: var(--font-display);
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--brand-primary);
    line-height: 1;
}

.stat-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    color: var(--text-tertiary);
    margin-top: 0.375rem;
}

.hero-visual {
    position: relative;
    z-index: 1;
}

/* ----- 3D model viewer (Three.js) ----- */
.model-viewer {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.model-viewer[hidden] {
    display: none;
}

.viewer-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-secondary);
}

.viewer-dots {
    display: flex;
    gap: 5px;
}

.viewer-dots i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--border-medium);
}

.viewer-file {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    text-transform: uppercase;
}

.viewer-badge {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid currentColor;
    border-radius: var(--radius-sm);
    padding: 0.1rem 0.45rem;
}

.viewer-canvas {
    aspect-ratio: 4 / 3;
    position: relative;
}

/* Loading state: mono annotation centered in the empty slot,
   fades away as the canvas fades in */
.viewer-canvas::before {
    content: 'INITIALIZING MODEL \2026';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    color: var(--text-muted);
    transition: opacity 0.5s ease;
}

.model-viewer.live .viewer-canvas::before {
    opacity: 0;
}

/* Live canvas fills the same 4:3 slot and cross-fades in
   once the first frame is rendered — no popping */
.viewer-canvas canvas {
    display: block;
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    cursor: grab;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.model-viewer.live .viewer-canvas canvas {
    opacity: 1;
}

.viewer-canvas canvas:active {
    cursor: grabbing;
}

/* Element property card — appears when hovering a model element,
   styled like a drawing-set annotation */
.viewer-tip {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 3;
    min-width: 172px;
    max-width: 250px;
    padding: 0.625rem 0.75rem;
    background: color-mix(in srgb, var(--bg-card) 94%, transparent);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid var(--border-medium);
    border-left: 2px solid var(--accent);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.12s ease;
    will-change: transform;
}

.viewer-tip.on {
    opacity: 1;
}

.viewer-tip strong {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.viewer-tip em {
    display: block;
    font-style: normal;
    font-family: var(--font-mono);
    font-size: 0.625rem;
    letter-spacing: 0.04em;
    color: var(--accent);
    margin-bottom: 0.375rem;
}

.tip-rows {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.125rem 1rem;
    border-top: 1px solid var(--border-light);
    padding-top: 0.375rem;
}

.tip-rows span {
    font-family: var(--font-mono);
    font-size: 0.5625rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    line-height: 1.7;
}

.tip-rows b {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: right;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
}

.viewer-controls[hidden],
.viewer-hint[hidden] {
    display: none;
}

.viewer-controls {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    padding: 0.875rem 1rem;
    border-top: 1px solid var(--border-light);
    background: var(--bg-secondary);
    max-height: 240px;
    overflow: hidden;
    transition: max-height 0.45s ease, padding 0.45s ease, opacity 0.35s ease 0.15s;
}

/* Collapsed until the scene goes live so the panel grows smoothly
   instead of jumping ~90px when the controls appear */
.model-viewer:not(.live) .viewer-controls:not([hidden]),
.model-viewer:not(.live) .viewer-hint:not([hidden]) {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    border-top-width: 0;
}

.viewer-slider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 180px;
}

.viewer-slider span {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.viewer-slider input[type="range"] {
    flex: 1;
    accent-color: var(--accent);
    cursor: pointer;
}

.viewer-layers {
    display: flex;
    gap: 0.5rem;
}

.layer-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    user-select: none;
    transition: var(--transition-fast);
}

.layer-chip:has(input:not(:checked)) {
    opacity: 0.4;
}

.layer-chip:hover {
    border-color: var(--brand-secondary);
}

.layer-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.layer-chip .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot-str { background: var(--brand-primary); }
.dot-arc { background: var(--brand-secondary); }
.dot-mep { background: var(--accent); }

.viewer-hint {
    font-family: var(--font-mono);
    font-size: 0.625rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-align: center;
    padding: 0 1rem 0.75rem;
    background: var(--bg-secondary);
    max-height: 60px;
    overflow: hidden;
    transition: max-height 0.45s ease, padding 0.45s ease, opacity 0.35s ease 0.15s;
}

/* ============================================
   PIPELINE — the core story
   ============================================ */
.pipeline {
    padding: var(--space-3xl) 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

.pipeline-track {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    position: relative;
}

/* connector line through the step markers */
.pipeline-track::before {
    content: '';
    position: absolute;
    top: 21px;
    left: calc(12.5% );
    right: calc(12.5%);
    height: 1px;
    background: var(--border-medium);
}

.pipe-step {
    text-align: center;
    padding: 0 0.5rem;
    position: relative;
}

.pipe-marker {
    width: 42px;
    height: 42px;
    margin: 0 auto 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1.5px solid var(--brand-primary);
    border-radius: var(--radius-sm);
    transform: rotate(45deg);
    position: relative;
    z-index: 1;
    transition: var(--transition-base);
}

.pipe-marker span {
    transform: rotate(-45deg);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--brand-primary);
}

.pipe-step:last-child .pipe-marker {
    background: var(--accent);
    border-color: var(--accent);
}

.pipe-step:last-child .pipe-marker span {
    color: #fff;
}

.pipe-step:hover .pipe-marker {
    background: var(--brand-primary);
}

.pipe-step:hover .pipe-marker span {
    color: var(--text-inverse);
}

.pipe-step:last-child:hover .pipe-marker {
    background: var(--accent);
}

.pipe-step:last-child:hover .pipe-marker span {
    color: #fff;
}

.pipe-step h3 {
    font-size: 1.125rem;
    margin-bottom: 0.625rem;
}

.pipe-step p {
    font-size: 0.9075rem;
    color: var(--text-secondary);
}

.pipe-note {
    margin-top: var(--space-2xl);
    text-align: center;
}

.pipe-note p {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    border: 1px dashed var(--border-medium);
    border-radius: var(--radius-sm);
    padding: 0.625rem 1.25rem;
}

.pipe-note strong {
    color: var(--accent);
    font-weight: 600;
}

/* ============================================
   AUDIENCE — two doors
   ============================================ */
.audience {
    padding: var(--space-3xl) 0;
    background: var(--bg-primary);
}

.audience-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: stretch;
}

.panel {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: var(--transition-base);
}

.panel:hover {
    border-color: var(--brand-secondary);
    box-shadow: var(--shadow-lg);
}

.panel-tag {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.25rem;
}

.panel-tag::before {
    content: '// ';
    color: var(--text-muted);
}

.panel h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.panel > p {
    margin-bottom: 1.75rem;
}

.panel-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    margin-bottom: 2rem;
}

.panel-list li {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.panel-list li svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
    stroke: var(--accent-success);
}

.panel-list li strong {
    color: var(--text-primary);
    font-weight: 600;
}

.panel-cta {
    margin-top: auto;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.panel-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--brand-secondary);
    transition: var(--transition-fast);
}

.panel-link:hover {
    gap: 0.75rem;
}

.panel-link svg {
    width: 16px;
    height: 16px;
}

/* offer blocks inside the firms panel */
.offer {
    border: 1px solid var(--border-light);
    border-left: 3px solid var(--brand-primary);
    border-radius: var(--radius-sm);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    background: var(--bg-secondary);
}

.offer.offer-accent {
    border-left-color: var(--accent);
}

.offer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.offer-head h4 {
    font-size: 1.0625rem;
}

.offer-tag {
    font-family: var(--font-mono);
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    white-space: nowrap;
}

.offer-tag.premium {
    background: var(--brand-light);
    color: var(--brand-primary);
}

.offer-tag.enterprise {
    background: var(--accent-soft);
    color: var(--accent);
}

.offer p {
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.offer .panel-link {
    font-size: 0.875rem;
}

/* free tools chip in professionals panel */
.tools-chip {
    border: 1px dashed var(--border-medium);
    border-radius: var(--radius-sm);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    background: var(--bg-secondary);
}

.tools-chip .offer-head {
    margin-bottom: 0.375rem;
}

.offer-tag.free {
    background: rgba(14, 124, 91, 0.1);
    color: var(--accent-success);
}

:root[data-theme="dark"] .offer-tag.free {
    background: rgba(46, 184, 138, 0.15);
}

.tools-chip p {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

/* ============================================
   ABOUT SECTION
   ============================================ */
.about {
    padding: var(--space-3xl) 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
    align-items: center;
}

.about-content .section-label {
    margin-bottom: 1rem;
}

.about-content .section-label::after {
    display: none;
}

.about-content h2 {
    margin-bottom: 1.5rem;
}

.about-content > p {
    margin-bottom: 2rem;
}

.about-features {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.feature-item {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    transition: var(--transition-base);
}

.feature-item:hover {
    border-color: var(--brand-secondary);
}

.feature-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: var(--brand-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-primary);
}

.feature-icon svg {
    width: 22px;
    height: 22px;
}

.feature-content h4 {
    margin-bottom: 0.25rem;
}

.feature-content p {
    font-size: 0.875rem;
    margin: 0;
}

/* About Visual */
.about-visual {
    position: relative;
}

.about-image-wrapper {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    aspect-ratio: 4/3;
    border: 1px solid var(--border-light);
}

.about-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: linear-gradient(135deg, var(--brand-light) 0%, var(--bg-tertiary) 100%);
}

/* Stats Card */
.about-stats-card {
    position: absolute;
    bottom: -1.5rem;
    right: -1rem;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    border: 1px solid var(--border-light);
}

.about-stat {
    text-align: center;
}

.about-stat strong {
    display: block;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--brand-primary);
    line-height: 1;
}

.about-stat span {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    color: var(--text-tertiary);
}

/* ============================================
   CTA SECTION
   ============================================ */
.cta {
    padding: var(--space-3xl) 0;
    background: var(--bg-primary);
}

.cta-card {
    background: var(--bg-dark);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl) var(--space-xl);
    text-align: center;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

/* drafting grid inside the dark card */
.cta-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(143, 192, 245, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(143, 192, 245, 0.07) 1px, transparent 1px);
    background-size: 36px 36px;
    -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
    mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
    pointer-events: none;
}

.cta-content {
    position: relative;
    z-index: 1;
}

.cta-content .mono-label {
    color: rgba(255, 255, 255, 0.45);
    display: block;
    margin-bottom: 1rem;
}

.cta-content h2 {
    color: white;
    margin-bottom: 1rem;
}

.cta-content p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 1.125rem;
    max-width: 540px;
    margin: 0 auto 2rem;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.cta .btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

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

.cta .btn-secondary {
    background: transparent;
    color: white;
    border-color: rgba(255, 255, 255, 0.35);
}

.cta .btn-secondary:hover {
    border-color: rgba(255, 255, 255, 0.7);
    color: white;
}

/* ============================================
   CONTACT SECTION
   ============================================ */
.contact {
    padding: var(--space-3xl) 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
    align-items: stretch;
}

.contact-content h2 {
    margin-bottom: 1rem;
}

.contact-content > p {
    margin-bottom: 2rem;
}

/* Contact index — drawing-set style directory */
.contact-index {
    margin-top: 0.5rem;
    border-top: 1px solid var(--border-light);
}

.index-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.25rem;
    align-items: center;
    padding: 1.125rem 0.375rem;
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition-fast);
}

.index-row:hover {
    background: var(--bg-primary);
}

.index-num {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
}

.index-body {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.index-title {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.index-row:hover .index-title {
    color: var(--brand-secondary);
}

.index-desc {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.index-dest {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-tertiary);
    transition: var(--transition-fast);
}

.index-row:hover .index-dest {
    color: var(--brand-secondary);
}

.contact-stamp {
    margin-top: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Contact form card — transmittal sheet */
.contact-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    align-self: start;
}

.contact-form {
    padding: 1.75rem;
}

.contact-form .form-field label {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.form-submit {
    width: 100%;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--bg-dark);
    color: #fff;
    padding: var(--space-2xl) 0 var(--space-md);
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--brand-secondary), var(--accent));
    opacity: 0.6;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand {
    max-width: 280px;
}

.footer-logo {
    height: 36px;
    width: auto;
    filter: brightness(0) invert(1);
    margin-bottom: 1rem;
}

.footer-brand p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
}

.footer-column h4 {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 1rem;
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 0.75rem;
}

.footer-column ul li a {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    transition: var(--transition-fast);
}

.footer-column ul li a:hover {
    color: white;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-bottom p {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   POLICY PAGES (Privacy Policy, Terms & Conditions)
   ============================================ */
.policy-page {
    padding: 120px 0 80px;
    background: var(--bg-secondary);
}

.policy-container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-card);
    padding: 60px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
}

.policy-container h1 {
    color: var(--brand-primary);
    margin-bottom: 12px;
}

.policy-container .last-updated {
    font-family: var(--font-mono);
    color: var(--text-tertiary);
    font-size: 14px;
    margin-bottom: 40px;
}

.policy-container h2 {
    color: var(--brand-primary);
    margin-top: 40px;
    margin-bottom: 20px;
    font-size: 24px;
}

.policy-container h3 {
    color: var(--text-primary);
    margin-top: 28px;
    margin-bottom: 14px;
    font-size: 18px;
}

.policy-container p,
.policy-container li {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 16px;
}

.policy-container ul {
    margin-left: 20px;
    margin-bottom: 20px;
}

.policy-container a {
    color: var(--brand-secondary);
    text-decoration: underline;
}

.policy-container a:hover {
    color: var(--brand-primary);
}

.policy-container hr {
    margin: 40px 0;
    border: none;
    border-top: 1px solid var(--border-light);
}

.policy-back {
    text-align: center;
    margin-top: 40px;
}

.policy-back .btn {
    text-decoration: none;
}

@media (max-width: 768px) {
    .policy-container {
        padding: 40px 24px;
    }
}

/* ============================================
   FORM PRIMITIVES
   ============================================ */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.form-field {
    margin-bottom: 1.25rem;
}

.form-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-field input,
.form-field textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 1rem;
    transition: var(--transition-fast);
}

.form-field input:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--brand-secondary);
    box-shadow: 0 0 0 3px var(--brand-light);
}

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

.form-privacy-note {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-bottom: 1rem;
}

.form-privacy-note a {
    color: var(--brand-secondary);
    text-decoration: underline;
}

/* ============================================
   COOKIE CONSENT
   ============================================ */
.cookie-consent {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(150%);
    width: calc(100% - 3rem);
    max-width: 480px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    z-index: 9999;
    box-shadow: var(--shadow-xl);
    transition: var(--transition-base);
}

.cookie-consent:not(.hidden) {
    transform: translateX(-50%) translateY(0);
}

.cookie-consent.hidden {
    transform: translateX(-50%) translateY(150%);
}

.cookie-content p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.cookie-content p strong {
    color: var(--text-primary);
}

.cookie-content a {
    color: var(--brand-secondary);
    text-decoration: underline;
}

.cookie-buttons {
    display: flex;
    gap: 0.75rem;
}

.cookie-btn {
    flex: 1;
    padding: 0.625rem 1rem;
    font-family: var(--font-family);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.cookie-accept {
    background: var(--brand-primary);
    border: none;
    color: var(--text-inverse);
}

.cookie-accept:hover {
    background: var(--brand-dark);
}

.cookie-essential {
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
}

.cookie-essential:hover {
    background: var(--bg-tertiary);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes spin {
    to { transform: rotate(360deg); }
}

[data-animate] {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate].visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    .hero-visual {
        order: -1;
        max-width: 520px;
        margin: 0 auto;
    }

    .hero-content {
        text-align: center;
    }

    .hero-eyebrow {
        justify-content: center;
    }

    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-cta {
        justify-content: center;
    }

    .hero-stats {
        justify-content: center;
    }

    .pipeline-track {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem 1.5rem;
    }

    .pipeline-track::before {
        display: none;
    }

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

    .about-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    .about-visual {
        order: -1;
        max-width: 500px;
        margin: 0 auto;
    }

    .about-content {
        text-align: center;
    }

    .about-content .section-label::after {
        display: inline-block;
    }

    .about-stats-card {
        position: relative;
        bottom: auto;
        right: auto;
        margin-top: 1.5rem;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-brand {
        grid-column: span 2;
        max-width: none;
        margin-bottom: 1rem;
    }
}

@media (max-width: 1100px) {
    /* Mobile Navigation — kicks in well above the 768px content
       breakpoint so the full desktop nav (logo + 5 links + CTA +
       theme toggle) never has to squeeze into tablet/small-laptop
       widths, where it has no room to fit. */
    .nav-links {
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
        z-index: 1002;
        padding: 0.75rem 1rem 1rem;
        box-shadow: var(--shadow-lg);
        border-top: 1px solid var(--border-light);
        max-height: calc(100vh - 72px);
        overflow-y: auto;
    }

    .nav-links.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .nav-links li {
        width: 100%;
        padding: 0;
    }

    .nav-link {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        font-size: 0.9375rem;
        font-weight: 500;
        padding: 0.75rem 1rem;
        width: 100%;
        border-radius: var(--radius-md);
        color: var(--text-primary);
    }

    .nav-link:hover,
    .nav-link:active {
        background: var(--bg-secondary);
        color: var(--brand-primary);
    }

    .nav-icon {
        width: 18px;
        height: 18px;
        stroke: currentColor;
        flex-shrink: 0;
        opacity: 0.6;
    }

    .nav-tag {
        position: static;
        margin-left: auto;
    }

    .nav-cta {
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid var(--border-light);
        width: 100%;
        margin-left: 0;
    }

    .nav-cta .btn {
        width: 100%;
        justify-content: center;
    }

    .theme-toggle {
        margin-left: auto;
        margin-right: 0.5rem;
    }

    .mobile-menu-toggle {
        display: flex;
        z-index: 1001;
    }

    /* Cheaper compositing on phones: near-opaque bar, lighter blur */
    .navbar {
        background: color-mix(in srgb, var(--bg-primary) 96%, transparent);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 7rem 0 4rem;
    }

    .hero-stats {
        flex-direction: column;
        align-items: center;
    }

    .stat-item {
        text-align: center;
        padding: 1rem 0 0;
    }

    .stat-item + .stat-item {
        padding-left: 0;
        border-left: none;
    }

    .hero-cta {
        flex-direction: column;
        width: 100%;
    }

    .hero-cta .btn {
        width: 100%;
    }

    .pipeline-track {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .panel {
        padding: 1.75rem;
    }

    /* Model viewer on small screens */
    .viewer-controls {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .viewer-slider {
        min-width: 140px;
    }

    .viewer-bar {
        padding: 0.5rem 0.75rem;
    }

    .about-stats-card {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
        padding: 1rem;
    }

    .about-stat strong {
        font-size: 1.25rem;
    }

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

    .footer-brand {
        grid-column: span 1;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .hero-eyebrow {
        font-size: 0.6875rem;
    }

    .about-stats-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .cookie-buttons {
        flex-direction: column;
    }

    /* Contact index: destination drops under the description */
    .index-row {
        grid-template-columns: auto 1fr;
        row-gap: 0.25rem;
    }

    .index-dest {
        grid-column: 2;
    }

    .contact-form {
        padding: 1.25rem;
    }

    /* Stack viewer controls; keep chips reachable with thumbs */
    .viewer-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .viewer-slider {
        width: 100%;
    }

    .viewer-layers {
        justify-content: center;
    }

    .layer-chip {
        padding: 0.45rem 0.8rem;
    }

    .viewer-file {
        font-size: 0.5625rem;
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}
