/* ==========================================================================
   Mildex Optical — shared site styles
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --mx-green:        #16a34a;
    --mx-green-dark:   #14532d;
    --mx-green-mid:    #15803d;
    --mx-ink:          #0f172a;
}

* { scroll-behavior: smooth; }

html { scroll-padding-top: 84px; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #ffffff;
    color: var(--mx-ink);
    -webkit-font-smoothing: antialiased;
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid #22c55e;
    outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
.nav-link { position: relative; }
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px; left: 0;
    width: 0; height: 2px;
    background: var(--mx-green);
    transition: width 0.2s ease;
}
.nav-link:hover::after,
.nav-link.is-active::after { width: 100%; }
.nav-link.is-active { color: var(--mx-ink); font-weight: 600; }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero-bg {
    background: linear-gradient(135deg, #ffffff 0%, #dcfce7 25%, #4ade80 55%, #16a34a 75%, #14532d 100%);
    position: relative;
    overflow: hidden;
}
.hero-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Crect x='20' y='20' width='40' height='40' fill='none' stroke='rgba(255,255,255,0.25)' stroke-width='1.5' transform='rotate(45 40 40)'/%3E%3Crect x='8' y='8' width='64' height='64' fill='none' stroke='rgba(255,255,255,0.12)' stroke-width='1' transform='rotate(45 40 40)'/%3E%3C/svg%3E");
    background-size: 80px 80px;
}
.hero-fade-left {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(255,255,255,0.92) 0%, rgba(255,255,255,0.55) 40%, rgba(255,255,255,0) 70%);
}

/* Compact page banner used on interior pages */
.page-banner {
    background: linear-gradient(135deg, #0f172a 0%, #14532d 100%);
    position: relative;
    overflow: hidden;
}
.page-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Crect x='20' y='20' width='40' height='40' fill='none' stroke='rgba(74,222,128,0.16)' stroke-width='1.5' transform='rotate(45 40 40)'/%3E%3C/svg%3E");
    background-size: 80px 80px;
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.capability-card { transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease; }
.capability-card:hover { transform: translateY(-4px); }

.market-card { transition: all 0.3s ease; }

.res-card { transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
.res-card:hover { transform: translateY(-3px); }
.res-card img { transition: transform 0.3s ease; }
.res-card:hover img { transform: scale(1.03); }

/* Resource library filtering */
.res-item.is-hidden { display: none; }
.filter-chip {
    transition: all 0.18s ease;
    cursor: pointer;
    user-select: none;
}
.filter-chip.is-active {
    background: var(--mx-green-dark);
    border-color: var(--mx-green-dark);
    color: #ffffff;
}

/* --------------------------------------------------------------------------
   Lightbox
   -------------------------------------------------------------------------- */
#lightbox {
    display: none;
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(4px);
    align-items: center; justify-content: center;
}
#lightbox.open { display: flex; }
#lightbox-inner {
    position: relative;
    max-width: 90vw; max-height: 90vh;
    display: flex; flex-direction: column; align-items: center; gap: 12px;
}
#lightbox-img {
    max-width: 90vw; max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.6);
}
#lightbox-close {
    position: absolute; top: -14px; right: -14px;
    width: 34px; height: 34px;
    background: #fff; border: none; border-radius: 50%;
    font-size: 18px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    line-height: 1; color: var(--mx-ink);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
#lightbox-close:hover { background: #f1f5f9; }
#lightbox-bar { display: flex; align-items: center; gap: 16px; }
#lightbox-title { color: #fff; font-size: 14px; font-weight: 600; }
#lightbox-download {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--mx-green); color: #fff;
    padding: 8px 18px; border-radius: 8px;
    font-size: 13px; font-weight: 600;
    text-decoration: none; transition: background 0.2s;
}
#lightbox-download:hover { background: var(--mx-green-mid); }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #475569;
    margin-bottom: 7px;
}
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 14px;
    color: var(--mx-ink);
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    font-family: inherit;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--mx-green);
    box-shadow: 0 0 0 3px rgba(22,163,74,0.12);
}
.form-input::placeholder,
.form-textarea::placeholder { color: #94a3b8; }
.form-textarea { resize: vertical; min-height: 120px; }
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}
.form-hint { font-size: 11px; color: #94a3b8; margin-top: 5px; }
.form-required::after { content: ' *'; color: #dc2626; }

/* Checkbox / radio pill groups */
.check-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    background: #fff;
    transition: all 0.15s ease;
}
.check-pill:hover { border-color: #86efac; background: #f0fdf4; }
.check-pill input { accent-color: var(--mx-green); width: 15px; height: 15px; cursor: pointer; }
.check-pill:has(input:checked) {
    border-color: var(--mx-green);
    background: #f0fdf4;
    color: var(--mx-green-dark);
    font-weight: 600;
}

/* Honeypot */
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

/* --------------------------------------------------------------------------
   Prose (blog articles)
   -------------------------------------------------------------------------- */
.prose-mx h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--mx-ink);
    letter-spacing: -0.01em;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
}
.prose-mx p {
    color: #334155;
    line-height: 1.75;
    margin-bottom: 1rem;
}
.prose-mx ul { margin: 0 0 1rem 1.15rem; }
.prose-mx li { color: #334155; line-height: 1.75; margin-bottom: 0.4rem; list-style: disc; }

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
    .reveal { opacity: 1; transform: none; }
}
