/* ============================================
   REGULUS - Apple-Inspired Design System
   ============================================ */

/* --- Background Cinema (scroll-reveal images) --- */
.bg-cinema {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

.bg-cinema .bg-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity;
}

.bg-cinema .bg-slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--cinema-overlay);
}

.bg-cinema .bg-slide.active {
    opacity: 1;
    animation: bg-ken-burns 20s ease-in-out forwards;
}

@keyframes bg-ken-burns {
    0% { transform: scale(1); }
    100% { transform: scale(1.08); }
}

/* Section overrides when bg-cinema is active.
   Everything except .section-green and nav/footer adapts to the active theme. */
.bg-page .hero-gradient {
    background: var(--bg-accent-hero);
}

.bg-page .hero-dark,
.bg-page .page-hero.hero-dark {
    background: var(--bg-section-accent);
}

.bg-page .section-dark {
    background: var(--bg-section-accent);
}

.bg-page .section-gray {
    background: var(--bg-section-gray);
}

.bg-page .section-green {
    background: linear-gradient(135deg, rgba(51, 204, 102, 0.85) 0%, rgba(43, 163, 81, 0.85) 100%);
}

.bg-page .section:not(.section-dark):not(.section-gray):not(.section-green):not(.hero):not(.hero-gradient):not(.page-hero) {
    background: var(--bg-section);
}

.bg-page .footer {
    background: rgba(29, 29, 31, 0.93);  /* footer stays dark across themes */
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ==============================================================
   DESIGN TOKENS
   - Raw palette is theme-independent (brand colors)
   - Semantic tokens switch per theme via [data-theme] on <html>
   - Default (no attribute) = light mode.
   ============================================================== */
:root {
    /* --- Raw palette (theme-independent) --- */
    --green: #33CC66;
    --green-dark: #2ba351;
    --green-light: #4ade80;
    --black: #1d1d1f;
    --gray-dark: #333336;
    --gray: #6e6e73;
    --gray-light: #86868b;
    --gray-bg: #f5f5f7;
    --white: #fbfbfd;
    --pure-white: #ffffff;

    --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --transition: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --nav-height: 52px;

    /* --- Semantic tokens: LIGHT MODE (default) --- */
    --bg:               #ffffff;
    --bg-alt:           #f5f5f7;
    --bg-section:       rgba(255, 255, 255, 0.88);
    --bg-section-gray:  rgba(245, 245, 247, 0.88);

    --text:             #1d1d1f;
    --text-muted:       #6e6e73;
    --text-subtle:      #86868b;

    --border:           rgba(0, 0, 0, 0.08);
    --border-soft:      rgba(0, 0, 0, 0.06);
    --divider:          rgba(0, 0, 0, 0.05);

    --card-bg:          #ffffff;
    --card-border:      rgba(0, 0, 0, 0.06);
    --card-shadow:      rgba(0, 0, 0, 0.08);
    --card-shadow-lg:   rgba(0, 0, 0, 0.12);

    --input-bg:         #ffffff;
    --input-border:     rgba(0, 0, 0, 0.12);

    --tile-hover-bg:    rgba(51, 204, 102, 0.03);

    /* Nav + footer stay visually dark in light mode (brand consistency), */
    /* so their tokens don't change per theme.                             */
    --nav-bg:           rgba(29, 29, 31, 0.92);
    --nav-border:       rgba(255, 255, 255, 0.08);
    --nav-text:         rgba(255, 255, 255, 0.8);
    --nav-text-strong:  #ffffff;
    --dropdown-bg:      rgba(29, 29, 31, 0.96);
    --dropdown-border:  rgba(255, 255, 255, 0.1);
    --dropdown-hover:   rgba(255, 255, 255, 0.06);

    --footer-bg:        #1d1d1f;
    --footer-text:      rgba(255, 255, 255, 0.6);
    --footer-heading:   #ffffff;
    --footer-border:    rgba(255, 255, 255, 0.08);

    --cinema-overlay:         rgba(0, 0, 0, 0.35);
    --cinema-overlay-strong:  rgba(0, 0, 0, 0.4);

    /* Logo image swap */
    --logo-src:  url('/images/logo-dark.png');  /* used in nav (dark bg) — always white-text-logo */
}

/* Tokens for "accent/contrast" sections (section-dark, hero-dark) — they flip
   per theme so light mode actually reads as light.                            */
:root, [data-theme="light"] {
    --bg-accent:          #ebebef;
    --bg-accent-text:     #1d1d1f;
    --bg-accent-muted:    #6e6e73;
    --bg-accent-hero:     linear-gradient(180deg, #f0f0f3 0%, #e4e4e9 40%, #d8d8df 70%, #e4e4e9 100%);
    --bg-section-accent:  rgba(235, 235, 239, 0.88);

    /* Overlays used by children of accent/hero sections (tiles, feature cards,
       vendor logos). Dark overlay on light accent in light mode; light overlay
       on dark accent in dark mode.                                             */
    --accent-overlay:         rgba(0, 0, 0, 0.04);
    --accent-overlay-hover:   rgba(0, 0, 0, 0.07);
    --accent-overlay-border:  rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] {
    --bg:               #1d1d1f;
    --bg-alt:           #2a2a2c;
    --bg-section:       rgba(29, 29, 31, 0.88);
    --bg-section-gray:  rgba(42, 42, 44, 0.88);

    --text:             #ffffff;
    --text-muted:       rgba(255, 255, 255, 0.7);
    --text-subtle:      rgba(255, 255, 255, 0.55);

    --border:           rgba(255, 255, 255, 0.1);
    --border-soft:      rgba(255, 255, 255, 0.08);
    --divider:          rgba(255, 255, 255, 0.08);

    --card-bg:          #2a2a2c;
    --card-border:      rgba(255, 255, 255, 0.08);
    --card-shadow:      rgba(0, 0, 0, 0.4);
    --card-shadow-lg:   rgba(0, 0, 0, 0.55);

    --input-bg:         rgba(255, 255, 255, 0.06);
    --input-border:     rgba(255, 255, 255, 0.14);

    --tile-hover-bg:    rgba(51, 204, 102, 0.08);

    --cinema-overlay:         rgba(0, 0, 0, 0.55);
    --cinema-overlay-strong:  rgba(0, 0, 0, 0.65);

    /* Accent/hero sections: dark in dark mode */
    --bg-accent:          #0b0b0d;
    --bg-accent-text:     #ffffff;
    --bg-accent-muted:    var(--gray-light);
    --bg-accent-hero:     linear-gradient(180deg, #000000 0%, #0a1a10 40%, #0d2618 70%, #0a1a10 100%);
    --bg-section-accent:  rgba(11, 11, 13, 0.88);

    --accent-overlay:         rgba(255, 255, 255, 0.05);
    --accent-overlay-hover:   rgba(255, 255, 255, 0.08);
    --accent-overlay-border:  rgba(255, 255, 255, 0.10);
}

[data-theme="light"] {
    --green: #1a7a3a;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    transition: background-color 0.25s ease, color 0.25s ease;
}

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

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

/* --- Typography --- */
.headline-large {
    font-size: clamp(40px, 7vw, 80px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.05;
}

.headline-medium {
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.1;
}

.headline-small {
    font-size: clamp(24px, 3.5vw, 40px);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.subhead {
    font-size: clamp(18px, 2vw, 24px);
    font-weight: 400;
    color: var(--text-muted);
    line-height: 1.4;
}

.body-large {
    font-size: clamp(17px, 1.5vw, 21px);
    font-weight: 400;
    line-height: 1.58;
    color: var(--text);
}

.label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--green);
}

/* --- Navigation --- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--nav-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    z-index: 9999;
    border-bottom: 1px solid var(--nav-border);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
    color: var(--pure-white);
    letter-spacing: 0.02em;
}

.nav-logo img {
    height: 26px;
    width: auto;
}

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

.nav-links a {
    color: var(--nav-text);
    font-size: 13px;
    font-weight: 400;
    transition: color 0.3s;
    white-space: nowrap;
}

.nav-links a:hover {
    color: var(--nav-text-strong);
}

.nav-links .dropdown {
    position: relative;
}

.nav-links .dropdown-menu {
    position: absolute;
    top: calc(100% + 16px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--dropdown-bg);
    backdrop-filter: saturate(180%) blur(20px);
    border-radius: 12px;
    padding: 8px 0;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    border: 1px solid var(--dropdown-border);
}

.nav-links .dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    top: calc(100% + 8px);
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    font-size: 13px;
    color: var(--nav-text);
    transition: all 0.2s;
}

.dropdown-menu a:hover {
    color: var(--nav-text-strong);
    background: var(--dropdown-hover);
}

.nav-cta {
    background: var(--green);
    color: var(--pure-white) !important;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 13px !important;
    transition: background 0.3s;
}

.nav-cta:hover {
    background: var(--green-dark) !important;
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--pure-white);
    margin: 5px 0;
    transition: var(--transition);
    border-radius: 1px;
    pointer-events: none;
}

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

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

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

/* --- Theme toggle button (sun / moon) --- */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--nav-border);
    color: var(--nav-text);
    cursor: pointer;
    font-size: 13px;
    margin-left: 8px;
    padding: 0;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.theme-toggle:hover {
    color: var(--nav-text-strong);
    border-color: var(--nav-text);
    background: rgba(255, 255, 255, 0.06);
}

.theme-toggle:active { transform: scale(0.92); }

.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: inline-block; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: inline-block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* --- Hero Sections --- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: calc(var(--nav-height) + 60px) 24px 80px;
    overflow: hidden;
}

.hero-dark {
    background: var(--bg-accent);
    color: var(--bg-accent-text);
}

.hero-dark .subhead {
    color: var(--bg-accent-muted);
}

.hero-gradient {
    background: var(--bg-accent-hero);
    color: var(--bg-accent-text);
}

.hero-gradient .subhead {
    color: var(--bg-accent-muted);
}

.hero-content {
    max-width: 900px;
    margin-inline: auto;
    z-index: 2;
}

.hero-content .label {
    margin-bottom: 16px;
}

.hero-content .headline-large {
    margin-bottom: 20px;
}

.hero-content .subhead {
    margin-bottom: 40px;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

/* Animated grid background */
.hero-bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(51, 204, 102, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(51, 204, 102, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: 0;
}

.hero-bg-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(51, 204, 102, 0.12) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    animation: glow-pulse 6s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: 980px;
    font-size: 17px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--green);
    color: var(--pure-white);
}

.btn-primary:hover {
    background: var(--green-dark);
    transform: scale(1.02);
}

.btn-secondary {
    background: transparent;
    color: var(--green);
    border: 1.5px solid var(--green);
}

.btn-secondary:hover {
    background: rgba(51, 204, 102, 0.08);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.1);
    color: var(--pure-white);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.15);
}

[data-theme="light"] .btn-ghost {
    background: rgba(0, 0, 0, 0.07);
    color: var(--text);
    border-color: rgba(0, 0, 0, 0.18);
}

[data-theme="light"] .btn-ghost:hover {
    background: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .btn-primary {
    color: var(--pure-white);
}

.btn-link {
    background: none;
    color: var(--green);
    padding: 0;
    font-size: 17px;
    font-weight: 500;
}

.btn-link::after {
    content: '\203A';
    margin-left: 4px;
    font-size: 1.2em;
    transition: margin-left 0.2s;
}

.btn-link:hover::after {
    margin-left: 8px;
}

.btn-group {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* --- Sections --- */
.section {
    padding: 120px 24px;
}

.section-dark {
    background: var(--bg-accent);
    color: var(--bg-accent-text);
}

.section-dark .subhead,
.section-dark .body-large {
    color: var(--bg-accent-muted);
}

/* Light-mode overrides: a lot of pages use inline `style="color: white"` or
   `color: var(--gray-light)` inside section-dark/hero-dark/hero-gradient because
   those sections used to always be dark. Now that they adapt, remap those inline
   colors to the accent tokens so text reads correctly in light mode. */
[data-theme="light"] .section-dark [style*="color: white"],
[data-theme="light"] .section-dark [style*="color:white"],
[data-theme="light"] .section-dark [style*="color: #fff"],
[data-theme="light"] .hero-dark [style*="color: white"],
[data-theme="light"] .hero-dark [style*="color:white"],
[data-theme="light"] .hero-gradient [style*="color: white"],
[data-theme="light"] .hero-gradient [style*="color:white"] {
    color: var(--bg-accent-text) !important;
}

[data-theme="light"] .section-dark [style*="color: var(--gray-light)"],
[data-theme="light"] .section-dark [style*="color: rgba(255,255,255,"],
[data-theme="light"] .section-dark [style*="color: rgba(255, 255, 255,"],
[data-theme="light"] .hero-dark [style*="color: var(--gray-light)"],
[data-theme="light"] .hero-dark [style*="color: rgba(255,255,255,"],
[data-theme="light"] .hero-gradient [style*="color: var(--gray-light)"],
[data-theme="light"] .hero-gradient [style*="color: rgba(255,255,255,"] {
    color: var(--bg-accent-muted) !important;
}

/* And tile/card inline backgrounds that assumed "light-on-dark" overlay. */
[data-theme="light"] .section-dark [style*="background: rgba(255,255,255,"],
[data-theme="light"] .section-dark [style*="background: rgba(255, 255, 255,"] {
    background: var(--accent-overlay) !important;
}

[data-theme="light"] .section-dark [style*="border: 1px solid rgba(255,255,255,"],
[data-theme="light"] .section-dark [style*="border: 1px solid rgba(255, 255, 255,"],
[data-theme="light"] .section-dark [style*="border-color: rgba(255,255,255,"],
[data-theme="light"] .section-dark [style*="border-color: rgba(255, 255, 255,"] {
    border-color: var(--accent-overlay-border) !important;
}

.section-gray {
    background: var(--bg-alt);
}

.section-green {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    color: var(--pure-white);
}

.section-green .subhead {
    color: rgba(255, 255, 255, 0.85);
}

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

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
}

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

.section-header {
    margin-bottom: 80px;
}

.section-header .label {
    margin-bottom: 12px;
}

.section-header .headline-medium {
    margin-bottom: 16px;
}

/* --- Product Cards --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 60px;
}

.product-card {
    background: var(--card-bg);
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.4s ease;
    border: 1px solid var(--card-border);
    text-decoration: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px var(--card-shadow-lg);
}

.product-card-image {
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

.product-card-image.bg-dark {
    background: linear-gradient(145deg, #1a1a1a 0%, #2a2a2a 100%);
}

.product-card-image.bg-green {
    background: linear-gradient(145deg, #1a3a25 0%, #0d2618 100%);
}

.product-card-image.bg-blue {
    background: linear-gradient(145deg, #0a1a2e 0%, #162d50 100%);
}

.product-card-image img {
    max-height: 180px;
    max-width: 80%;
    object-fit: contain;
    position: relative;
    z-index: 1;
}

.product-card-image .card-glow {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(51, 204, 102, 0.2) 0%, transparent 70%);
    z-index: 0;
}

.product-card-body {
    padding: 32px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card-body .label {
    margin-bottom: 8px;
}

.product-card-body h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.product-card-body p {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.5;
    flex: 1;
}

.product-card-body .btn-link {
    margin-top: 20px;
    font-size: 15px;
}

/* --- Feature Grid --- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.feature-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 48px 40px;
    border: 1px solid var(--card-border);
    transition: all 0.3s ease;
}

/* .section-dark adapts per theme; overlays flip direction via tokens. */
.section-dark .feature-card {
    background: var(--accent-overlay);
    border-color: var(--accent-overlay-border);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px var(--card-shadow);
}

.section-dark .feature-card:hover {
    background: var(--accent-overlay-hover);
    box-shadow: 0 12px 40px var(--card-shadow-lg);
}

.feature-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(51, 204, 102, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 16px;
    color: var(--green);
}

.section-dark .feature-icon {
    background: rgba(51, 204, 102, 0.12);
}

.feature-card h3 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.feature-card p {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.6;
}

.section-dark .feature-card p {
    color: var(--bg-accent-muted);
}

/* --- Vendor Logo Grid --- */
.vendor-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-top: 48px;
}

.vendor-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 20px;
    border-radius: 16px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.vendor-logo:hover {
    background: var(--tile-hover-bg);
    border-color: rgba(51, 204, 102, 0.2);
    transform: translateY(-2px);
}

.vendor-logo img {
    height: 28px;
    width: auto;
    max-width: 140px;
    opacity: 0.6;
    transition: opacity 0.3s;
    object-fit: contain;
    border-radius: 4px;
}

.vendor-logo:hover img {
    opacity: 1;
}

.section-gray .vendor-logo,
.vendor-logo-light {
    background: var(--pure-white);
    border-color: rgba(0, 0, 0, 0.06);
}

.section-gray .vendor-logo:hover,
.vendor-logo-light:hover {
    border-color: rgba(51, 204, 102, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.section-gray .vendor-logo img,
.vendor-logo-light img {
    opacity: 0.7;
}

.section-gray .vendor-logo:hover img,
.vendor-logo-light:hover img {
    opacity: 1;
}

.vendor-logo-dark {
    background: #1a1a1a;
    border-color: rgba(255, 255, 255, 0.08);
}

.vendor-logo-dark:hover {
    background: #222;
    border-color: rgba(51, 204, 102, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.vendor-logo-dark img {
    opacity: 0.7;
}

.vendor-logo-dark:hover img {
    opacity: 1;
}

/* vendor-logo-light in dark mode: flip from pure-white tiles to dark tiles
   with inverted (white) logos so they remain legible on dark backgrounds. */
[data-theme="dark"] .vendor-logo-light,
[data-theme="dark"] .section-gray .vendor-logo {
    background: var(--bg-alt);
    border-color: var(--border-soft);
}

[data-theme="dark"] .vendor-logo-light img,
[data-theme="dark"] .section-gray .vendor-logo img {
    filter: brightness(0) invert(1);
    opacity: 0.65;
}

[data-theme="dark"] .vendor-logo-light:hover img,
[data-theme="dark"] .section-gray .vendor-logo:hover img {
    filter: brightness(0) invert(1);
    opacity: 1;
}

/* vendor-logo-light in light mode: SVG logos are white, darken so they're
   visible against the white card background. */
[data-theme="light"] .vendor-logo-light img {
    filter: brightness(0);
    opacity: 0.6;
}

[data-theme="light"] .vendor-logo-light:hover img {
    filter: brightness(0);
    opacity: 0.85;
}

/* Tiles with hardcoded dark backgrounds (e.g. DART preview tiles) that must
   always show white text regardless of the surrounding theme. Children inherit
   white via the cascade; the section-dark color token doesn't apply because
   direct class targeting wins over inherited color. */
.tile-dark-always {
    color: var(--pure-white);
}

/* vendor-logo-text is used mainly inside brand-invariant contexts; make it
   adapt to the surrounding accent surface so it reads in both themes. */
.vendor-logo-text {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--bg-accent-muted);
    background: var(--accent-overlay);
    border-color: var(--accent-overlay-border);
}

.vendor-logo-text:hover {
    color: var(--bg-accent-text);
    background: var(--accent-overlay-hover);
}

@media (max-width: 768px) {
    .vendor-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .vendor-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .vendor-logo {
        padding: 20px 12px;
    }

    .vendor-logo img {
        height: 22px;
    }
}

/* --- Stats Row --- */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-top: 60px;
}

.stat-item {
    text-align: center;
    padding: 40px 20px;
}

.stat-value {
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 700;
    color: var(--green);
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 15px;
    color: var(--text-muted);
    font-weight: 400;
}

.section-dark .stat-label {
    color: var(--bg-accent-muted);
}

/* --- Spec Table --- */
.spec-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 40px;
}

.spec-table th {
    text-align: left;
    padding: 16px 24px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.spec-table td {
    padding: 18px 24px;
    font-size: 15px;
    border-bottom: 1px solid var(--divider);
}

.spec-table tr:hover td {
    background: var(--tile-hover-bg);
}

.spec-table td:first-child {
    font-weight: 600;
    color: var(--text);
    width: 35%;
}

.spec-table td:not(:first-child) {
    color: var(--text-muted);
}

/* --- Comparison Table --- */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 40px;
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 24px var(--card-shadow);
}

/* Comparison-table header stays dark regardless of theme — it's a branded heading band. */
.comparison-table thead th {
    background: var(--black);
    color: var(--pure-white);
    padding: 20px 24px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
}

.comparison-table thead th:first-child {
    text-align: left;
}

.comparison-table tbody td {
    padding: 18px 24px;
    font-size: 15px;
    border-bottom: 1px solid var(--divider);
    text-align: center;
}

.comparison-table tbody td:first-child {
    text-align: left;
    font-weight: 500;
}

.comparison-table .check {
    color: var(--green);
    font-weight: 700;
    font-size: 18px;
}

.comparison-table .dash {
    color: var(--gray-light);
}

/* --- Tile Grid (2-up or 3-up large tiles like Apple) --- */
.tile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.tile {
    border-radius: 24px;
    padding: 36px 40px;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
    overflow: hidden;
    transition: transform 0.4s ease;
}

.tile:hover {
    transform: scale(1.01);
}

.tile-dark {
    background: var(--black);
    color: var(--pure-white);
}

.tile-green {
    background: linear-gradient(145deg, #0d2618 0%, #1a3a25 50%, #0d2618 100%);
    color: var(--pure-white);
}

.tile-light {
    background: var(--gray-bg);
    color: var(--black);
}

.tile .label {
    margin-bottom: 12px;
}

.tile h3 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.tile p {
    font-size: 17px;
    opacity: 0.7;
    line-height: 1.5;
    max-width: 400px;
}

.tile-full {
    grid-column: 1 / -1;
}

/* --- Protocol Badges --- */
.protocol-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.protocol-badge {
    display: inline-block;
    padding: 8px 18px;
    background: rgba(51, 204, 102, 0.08);
    border: 1px solid rgba(51, 204, 102, 0.15);
    border-radius: 980px;
    font-size: 13px;
    font-weight: 500;
    color: var(--green);
    transition: all 0.3s;
}

.protocol-badge:hover {
    background: var(--green);
    color: var(--pure-white);
    border-color: var(--green);
}

.section-dark .protocol-badge {
    background: rgba(51, 204, 102, 0.1);
    border-color: rgba(51, 204, 102, 0.2);
}

/* --- Timeline / Steps --- */
.steps {
    display: flex;
    align-items: flex-start;
    gap: 0;
    margin-top: 60px;
    position: relative;
}

.steps::before {
    content: '';
    position: absolute;
    top: 28px;
    left: 28px;
    right: 28px;
    height: 2px;
    background: rgba(51, 204, 102, 0.2);
}

.step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
}

.step-number {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--green);
    color: var(--pure-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    margin: 0 auto 20px;
}

.step h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.step p {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 200px;
    margin: 0 auto;
}

/* --- CTA Banner --- */
.cta-banner {
    text-align: center;
    padding: 100px 24px;
}

.cta-banner .headline-medium {
    margin-bottom: 16px;
}

.cta-banner .subhead {
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* --- Footer --- */
.footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 60px 24px 30px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 60px;
}

.footer-brand .logo-text {
    color: var(--green);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 16px;
}

.footer-brand img {
    height: 24px;
    width: auto;
    margin-bottom: 16px;
}

.footer-brand p {
    font-size: 14px;
    line-height: 1.6;
    max-width: 280px;
}

.footer-col h4 {
    color: var(--footer-heading);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 20px;
}

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

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul a {
    font-size: 14px;
    color: var(--footer-text);
    transition: color 0.3s;
}

.footer-col ul a:hover {
    color: var(--footer-heading);
}

.footer-bottom {
    max-width: 1200px;
    margin: 40px auto 0;
    padding-top: 20px;
    border-top: 1px solid var(--footer-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    text-align: center;
}

/* --- Scroll Animations --- */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-delay-1 { transition-delay: 0.1s; }
.fade-in-delay-2 { transition-delay: 0.2s; }
.fade-in-delay-3 { transition-delay: 0.3s; }
.fade-in-delay-4 { transition-delay: 0.4s; }

/* --- Responsive --- */

/* Tablet */
@media (max-width: 1024px) {
    .product-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
    }

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

    .stats-row {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .tile-grid {
        grid-template-columns: 1fr !important;
    }

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

    .vendor-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Mobile */
@media (max-width: 768px) {
    :root {
        --nav-height: 48px;
    }

    .section {
        padding: 64px 16px;
    }

    .hero {
        min-height: 90vh;
        min-height: 90svh;
        padding: calc(var(--nav-height) + 32px) 16px 48px;
    }

    .page-hero {
        padding: calc(var(--nav-height) + 48px) 16px 48px;
    }

    /* Mobile nav
       Note: .nav has backdrop-filter, which makes it the containing block
       for position:fixed descendants. Use explicit height (not bottom:0)
       so the menu doesn't collapse to nav's height. */
    .nav-links {
        display: none;
        position: fixed;
        top: var(--nav-height);
        left: 0;
        width: 100vw;
        height: calc(100vh - var(--nav-height));
        height: calc(100svh - var(--nav-height));
        background: rgba(29, 29, 31, 0.98);
        backdrop-filter: saturate(180%) blur(20px);
        -webkit-backdrop-filter: saturate(180%) blur(20px);
        flex-direction: column;
        padding: 16px 20px;
        gap: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-links.open {
        display: flex;
    }

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

    .nav-links a {
        display: block;
        padding: 14px 0;
        font-size: 17px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .nav-links .dropdown-menu {
        position: static;
        transform: none;
        background: transparent;
        border: none;
        padding: 0 0 8px 16px;
        opacity: 1;
        visibility: visible;
        min-width: unset;
    }

    .nav-links .dropdown-menu a {
        padding: 10px 0;
        font-size: 15px;
        color: rgba(255, 255, 255, 0.6);
    }

    .nav-links .nav-cta {
        margin-top: 16px;
        text-align: center;
        display: block;
    }

    .nav-toggle {
        display: block;
    }

    .nav-logo img {
        height: 22px;
    }

    /* Typography */
    .headline-large {
        font-size: 36px;
    }

    .headline-medium {
        font-size: 28px;
    }

    .headline-small {
        font-size: 22px;
    }

    .subhead {
        font-size: 16px;
    }

    .body-large {
        font-size: 16px;
    }

    /* Stats */
    .stats-row {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px;
        margin-top: 32px;
    }

    .stat-item {
        padding: 20px 8px;
    }

    .stat-value {
        font-size: 28px;
    }

    .stat-label {
        font-size: 12px;
    }

    /* Steps / Timeline - vertical on mobile */
    .steps {
        flex-direction: column;
        gap: 32px;
        align-items: flex-start;
        padding-left: 40px;
    }

    .steps::before {
        top: 0;
        bottom: 0;
        left: 16px;
        right: auto;
        width: 2px;
        height: auto;
    }

    .step {
        text-align: left;
        display: flex;
        align-items: flex-start;
        gap: 16px;
    }

    .step-number {
        width: 40px;
        height: 40px;
        min-width: 40px;
        font-size: 16px;
        margin: 0;
        position: relative;
        left: -40px;
    }

    .step h4 {
        font-size: 16px;
        margin-left: -24px;
    }

    .step p {
        display: none;
    }

    /* Cards & Tiles */
    .product-card-image {
        height: 180px;
        padding: 24px;
    }

    .product-card-body {
        padding: 24px;
    }

    .product-card-body h3 {
        font-size: 20px;
    }

    .tile {
        min-height: auto;
        padding: 32px 24px;
    }

    .tile h3 {
        font-size: 24px;
    }

    .tile p {
        font-size: 15px;
    }

    .feature-card {
        padding: 28px 24px;
    }

    .feature-card h3 {
        font-size: 19px;
    }

    .feature-card p {
        font-size: 14px;
    }

    /* Section headers */
    .section-header {
        margin-bottom: 40px;
    }

    /* Tables - horizontal scroll */
    .comparison-table {
        font-size: 13px;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .comparison-table thead th,
    .comparison-table tbody td {
        padding: 12px 10px;
        white-space: nowrap;
    }

    .spec-table {
        font-size: 14px;
    }

    .spec-table th,
    .spec-table td {
        padding: 12px 16px;
    }

    .spec-table td:first-child {
        width: 40%;
    }

    /* Footer */
    .footer {
        padding: 40px 16px 24px;
    }

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

    .footer-brand p {
        max-width: none;
    }

    .footer-col {
        display: none;
    }

    .footer-col:first-of-type {
        display: block;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 8px;
        text-align: center;
        font-size: 12px;
    }

    /* Vendor grid */
    .vendor-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
    }

    .vendor-logo {
        padding: 20px 12px;
    }

    .vendor-logo img {
        height: 22px;
    }

    /* Protocol badges */
    .protocol-grid {
        gap: 6px;
    }

    .protocol-badge {
        font-size: 11px;
        padding: 6px 12px;
    }

    /* CTA */
    .cta-banner {
        padding: 48px 16px;
    }

    /* Buttons */
    .btn {
        padding: 12px 24px;
        font-size: 15px;
        width: 100%;
        justify-content: center;
    }

    .btn-group {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .btn-link {
        width: auto;
    }

    /* Forms */
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px; /* prevents iOS zoom */
        padding: 12px 14px;
    }

    /* Background cinema - slightly darker overlay on mobile for readability */
    .bg-cinema .bg-slide::after {
        background: rgba(0, 0, 0, 0.4);
    }
}

/* Small phones */
@media (max-width: 380px) {
    .headline-large {
        font-size: 30px;
    }

    .headline-medium {
        font-size: 24px;
    }

    .stats-row {
        grid-template-columns: 1fr 1fr !important;
    }

    .stat-value {
        font-size: 24px;
    }

    .vendor-grid {
        grid-template-columns: 1fr 1fr !important;
    }
}

/* --- Utility --- */
.mt-20 { margin-top: 20px; }
.mt-40 { margin-top: 40px; }
.mt-60 { margin-top: 60px; }
.mt-80 { margin-top: 80px; }
.mb-20 { margin-bottom: 20px; }
.mb-40 { margin-bottom: 40px; }
.mb-60 { margin-bottom: 60px; }

/* --- Page Hero (smaller for subpages) --- */
.page-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: calc(var(--nav-height) + 80px) 24px 80px;
    text-align: center;
    overflow: hidden;
}

.page-hero .hero-bg-grid,
.page-hero .hero-bg-glow {
    pointer-events: none;
}

/* --- Contact Form --- */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid var(--input-border);
    border-radius: 12px;
    font-size: 16px;
    font-family: var(--font);
    background: var(--input-bg);
    color: var(--text);
    transition: border-color 0.3s;
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(51, 204, 102, 0.1);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

/* --- Image Showcase --- */
.showcase-image {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px var(--card-shadow-lg);
    margin-top: 60px;
}

.showcase-image img {
    width: 100%;
    display: block;
}

/* --- Build version tag --- */
.version-tag {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 10px;
    letter-spacing: 0.02em;
    opacity: 0.45;
    user-select: all;
}
.footer-bottom .version-tag {
    margin-top: 2px;
}
.version-tag-floating {
    display: block;
    text-align: center;
    padding: 10px 0 14px;
    color: inherit;
}
