/* ============================================
   ClarityLB — Main Stylesheet
   Light + Dark Theme
   ============================================ */

/* --- THEME VARIABLES --- */
:root {
    --accent: #00AEEF;
    --accent-hover: #0095cc;
    --accent-glow: rgba(0, 174, 239, 0.5);
    --accent-subtle: rgba(0, 174, 239, 0.08);
    --green: #2ecc71;

    --fs-h1: clamp(2.5rem, 5vw + 1rem, 3.5rem);
    --fs-h2: clamp(1.5rem, 3vw + 0.8rem, 2rem);
    --fs-h3: clamp(1.1rem, 2vw + 0.6rem, 1.3rem);
    --fs-body: clamp(0.9rem, 1vw + 0.7rem, 1.05rem);
    --max-width: 1100px;
    --section-padding: clamp(4rem, 8vw, 7rem);
    --radius: 12px;
    --radius-sm: 8px;

    /* Legacy compat (legal pages) */
    --container-padding: clamp(1.5rem, 4vw, 2.5rem);
    --section-spacing: clamp(3rem, 6vw, 5rem);
    --primary-blue: #00AEEF;
    --primary-green: #2ecc71;
}

/* Dark theme (default) */
[data-theme="dark"] {
    --bg-1: #0a0f14;
    --bg-2: #0e1520;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(0, 174, 239, 0.2);
    --text-1: #e8eaed;
    --text-2: #9aa0a6;
    --text-3: #5f6368;
    --nav-bg: rgba(10, 15, 20, 0.92);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-card-hover: 0 8px 32px rgba(0, 0, 0, 0.4);
    --input-bg: rgba(255, 255, 255, 0.05);
    --input-border: rgba(255, 255, 255, 0.12);
    --logo-filter: drop-shadow(0 0 8px var(--accent-glow));
    --logo-filter-hover: drop-shadow(0 0 20px var(--accent-glow));
    --badge-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --dark-bg: #0a0f14;
    --text-light: #e8eaed;
    --text-medium: #9aa0a6;
    --glow-color: rgba(0, 174, 239, 0.5);
}

/* Light theme */
[data-theme="light"] {
    --bg-1: #ffffff;
    --bg-2: #f4f6f9;
    --bg-card: #ffffff;
    --bg-card-hover: #ffffff;
    --border: #e2e5e9;
    --border-hover: var(--accent);
    --text-1: #1a1d21;
    --text-2: #5a6270;
    --text-3: #8c929a;
    --nav-bg: rgba(255, 255, 255, 0.92);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);
    --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.08), 0 8px 32px rgba(0, 0, 0, 0.06);
    --input-bg: #f4f6f9;
    --input-border: #d1d5db;
    --logo-filter: drop-shadow(0 2px 8px rgba(0, 174, 239, 0.2));
    --logo-filter-hover: drop-shadow(0 4px 16px rgba(0, 174, 239, 0.3));
    --badge-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --dark-bg: #ffffff;
    --text-light: #1a1d21;
    --text-medium: #5a6270;
    --glow-color: rgba(0, 174, 239, 0.3);
}

/* --- RESET & BASE --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-1);
    color: var(--text-1);
    font-size: var(--fs-body);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a { color: inherit; }

/* ============================================
   NAVIGATION
   ============================================ */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1.1rem 2rem;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
}

.main-nav.scrolled {
    background-color: var(--nav-bg);
    box-shadow: 0 1px 16px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 0.65rem 2rem;
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-1);
    font-weight: 700;
    font-size: 1.1rem;
}

.nav-brand .highlight {
    color: var(--accent);
}

.nav-logo {
    height: 28px;
    width: auto;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-2);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: color 0.2s ease;
    position: relative;
}

.nav-links a:hover {
    color: var(--text-1);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.25s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Theme toggle */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-2);
    font-size: 0.95rem;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.theme-toggle .fa-sun { display: none; }
.theme-toggle .fa-moon { display: none; }

[data-theme="dark"] .theme-toggle .fa-sun { display: block; }
[data-theme="light"] .theme-toggle .fa-moon { display: block; }

/* Mobile toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-1);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.open span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   HERO
   ============================================ */
.hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 7rem 2rem 5rem;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 30%, var(--accent-subtle) 0%, transparent 60%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 650px;
}

.hero-logo {
    width: 100px;
    height: auto;
    margin-bottom: 2rem;
    filter: var(--logo-filter);
    animation: gentlePulse 4s ease-in-out infinite alternate;
}

@keyframes gentlePulse {
    0% { filter: var(--logo-filter); }
    100% { filter: var(--logo-filter-hover); }
}

.hero h1 {
    font-size: var(--fs-h1);
    font-weight: 700;
    letter-spacing: 3px;
    margin-bottom: 0.75rem;
    color: var(--text-1);
}

.hero h1 .highlight {
    color: var(--accent);
}

.hero-tagline {
    color: var(--text-2);
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 1.5px;
    margin-bottom: 1.75rem;
}

.hero-description {
    color: var(--text-2);
    font-size: var(--fs-body);
    line-height: 1.8;
    max-width: 50ch;
    margin: 0 auto;
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
    padding: var(--section-padding) 2rem;
    background-color: var(--bg-1);
    transition: background-color 0.3s ease;
}

.section--alt {
    background-color: var(--bg-2);
}

.section-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.section-inner h2 {
    font-size: var(--fs-h2);
    font-weight: 300;
    color: var(--accent);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 1rem;
    text-align: center;
}

.section-description {
    max-width: 60ch;
    margin: 0 auto 2.5rem;
    color: var(--text-2);
    line-height: 1.8;
    text-align: center;
}

/* ============================================
   PRODUCT GRID — Test & Measurement
   ============================================ */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.product-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
    background-color: var(--bg-card-hover);
}

.product-card.featured {
    border-color: var(--accent);
}

.product-card img {
    width: 100%;
    height: 140px;
    object-fit: contain;
    margin-bottom: 16px;
}

.product-card h3 {
    font-size: var(--fs-h3);
    color: var(--text-1);
    margin-bottom: 8px;
}

.product-card .product-description {
    color: var(--text-2);
    line-height: 1.7;
    margin-bottom: 20px;
    flex-grow: 1;
}

.status-badge {
    position: absolute;
    top: 20px;
    right: -32px;
    padding: 4px 36px;
    background-color: var(--accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    transform: rotate(45deg);
    text-align: center;
    box-shadow: var(--badge-shadow);
}

.product-card:not(.featured) .status-badge {
    background-color: var(--text-3);
}

.learn-more-btn {
    display: inline-block;
    padding: 10px 24px;
    border: 1px solid var(--accent);
    color: var(--accent);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    transition: background-color 0.25s ease, color 0.25s ease;
    margin-top: auto;
    text-align: center;
}

.learn-more-btn:hover {
    background-color: var(--accent);
    color: #fff;
}

.learn-more-btn.disabled {
    border-color: var(--text-3);
    color: var(--text-3);
    cursor: not-allowed;
}

.learn-more-btn.disabled:hover {
    background-color: transparent;
    color: var(--text-3);
}

/* ============================================
   DIVISION GRID — AI & Digital Products
   ============================================ */
.division-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.division-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 24px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: var(--shadow-card);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}

.division-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--border-hover);
    background-color: var(--bg-card-hover);
}

.division-card .card-logo {
    width: 100px;
    height: 100px;
    object-fit: cover;
    margin-bottom: 16px;
    background-color: #fff;
    border-radius: var(--radius-sm);
}

.division-card h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-1);
    margin-bottom: 6px;
}

.division-card .card-tagline {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 14px;
    line-height: 1.4;
}

.division-card .card-tagline a {
    color: var(--accent);
    text-decoration: none;
}

.division-card .card-tagline a:hover {
    text-decoration: underline;
}

.division-card p {
    font-size: 0.82rem;
    color: var(--text-2);
    line-height: 1.7;
}

.division-card .card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding-top: 16px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    transition: gap 0.2s ease;
}

.division-card .card-link:hover {
    gap: 10px;
}

.division-card .card-link i {
    font-size: 0.7em;
    transition: transform 0.2s ease;
}

.division-card .card-link:hover i {
    transform: translateX(2px);
}

.division-card .card-link.coming-soon {
    color: var(--text-3);
    cursor: default;
    pointer-events: none;
}

/* ============================================
   SUBSCRIBE
   ============================================ */
.subscribe-content {
    max-width: 520px;
    margin: 0 auto;
    text-align: center;
}

.subscribe-content .section-description {
    margin-bottom: 1.5rem;
}

.subscribe-form {
    display: flex;
    gap: 12px;
}

.subscribe-form input[type="email"] {
    padding: 12px 18px;
    border: 1px solid var(--input-border);
    background-color: var(--input-bg);
    color: var(--text-1);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    flex: 1;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.subscribe-form input[type="email"]::placeholder {
    color: var(--text-3);
}

.subscribe-form input[type="email"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.12);
}

.subscribe-form button {
    padding: 12px 28px;
    background-color: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
}

.subscribe-form button:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

/* ============================================
   SCROLL REVEAL
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ============================================
   FOOTER
   ============================================ */
footer {
    background-color: var(--bg-2);
    padding: 4rem 2rem 1.5rem;
    border-top: 1px solid var(--border);
    transition: background-color 0.3s ease;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 2.5rem;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-brand-logo {
    height: 36px;
    width: auto;
    align-self: flex-start;
}

.footer-brand p {
    color: var(--text-2);
    font-size: 0.85rem;
    line-height: 1.6;
}

.social-icons {
    display: flex;
    gap: 14px;
}

.social-icons a {
    color: var(--text-2);
    font-size: 1.15rem;
    transition: color 0.2s ease;
}

.social-icons a:hover {
    color: var(--accent);
}

.footer-column h4 {
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.footer-column address {
    font-style: normal;
    color: var(--text-2);
    font-size: 0.85rem;
    line-height: 1.7;
}

.footer-column .footer-link {
    display: block;
    color: var(--text-2);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 4px 0;
    transition: color 0.2s ease;
}

.footer-column .footer-link:hover {
    color: var(--accent);
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.footer-bottom p,
.footer-bottom a {
    color: var(--text-2);
    font-size: 0.78rem;
}

.footer-bottom a {
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-bottom a:hover {
    color: var(--accent);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .division-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 260px;
        height: 100vh;
        background: var(--bg-1);
        flex-direction: column;
        padding: 5rem 2rem 2rem;
        gap: 1.5rem;
        transition: right 0.3s ease, background-color 0.3s ease;
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.15);
        z-index: 101;
    }

    .nav-links.open {
        right: 0;
    }

    .hero {
        min-height: 75vh;
        padding-top: 5rem;
    }

    .product-grid,
    .division-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .subscribe-form {
        flex-direction: column;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 400px) {
    .hero-logo {
        width: 72px;
    }

    .section {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .main-nav {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
}
