/* ============================================================
   Merit Molecular — Mobile-First Responsive Stylesheet
   ============================================================ */

:root {
    --primary:    #34424e;
    --secondary:  #1a6cb4;
    --accent:     #6dbb47;
    --text-dark:  #2d3748;
    --text-mid:   #4a5568;
    --bg-light:   #f4f7f9;
    --border:     #e2e8f0;
    --white:      #ffffff;
    --radius:     8px;
    --shadow:     0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg:  0 12px 32px rgba(0,0,0,0.12);
    --transition: 0.25s ease;
    --max-w:      1200px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; }
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; color: var(--text-dark); line-height: 1.65; background: var(--white); overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ── Container ── */
.container { width: 92%; max-width: var(--max-w); margin: 0 auto; }

/* ── Buttons ── */
.btn {
    display: inline-block;
    background: var(--secondary);
    color: var(--white);
    padding: 14px 30px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}
.btn:hover, .btn:focus { background: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow); outline: none; }
.btn:active { transform: translateY(0); }
.btn-block { width: 100%; display: block; }

/* ══════════════════════════════════════════
   HEADER / NAV
══════════════════════════════════════════ */
header {
    background: var(--white);
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0;
}
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    padding: 0 4%;
    max-width: var(--max-w);
    margin: 0 auto;
}
.logo img { height: 54px; width: auto; object-fit: contain; }

/* Desktop nav links */
.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav-links a {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 8px 14px;
    border-radius: var(--radius);
    transition: color var(--transition), background var(--transition);
}
.nav-links a:hover { color: var(--secondary); background: var(--bg-light); }
.btn-nav {
    background: var(--primary);
    color: var(--white) !important;
    padding: 10px 20px !important;
    border-radius: var(--radius) !important;
}
.btn-nav:hover { background: var(--secondary) !important; }

/* Hamburger button */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius);
    -webkit-tap-highlight-color: transparent;
}
.hamburger span {
    display: block;
    width: 24px;
    height: 2.5px;
    background: var(--primary);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}
.hamburger.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* Mobile nav drawer */
.mobile-nav {
    display: none;
    flex-direction: column;
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 12px 0 16px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
    color: var(--primary);
    font-weight: 600;
    font-size: 1rem;
    padding: 14px 6%;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}
.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav a:hover, .mobile-nav a:active { background: var(--bg-light); color: var(--secondary); }
.mobile-nav .btn-nav-mobile {
    margin: 12px 6% 0;
    background: var(--primary);
    color: var(--white);
    text-align: center;
    padding: 14px;
    border-radius: var(--radius);
    display: block;
    font-size: 1rem;
}
.mobile-nav .btn-nav-mobile:hover { background: var(--secondary); }

/* ══════════════════════════════════════════
   HERO
══════════════════════════════════════════ */
.hero {
    padding: 64px 0 56px;
    background: linear-gradient(140deg, #f7fafc 0%, #edf2f7 100%);
}
.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 48px;
    align-items: center;
}
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #e2e8f0;
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}
.hero-text h1 {
    font-size: clamp(1.8rem, 4vw, 2.7rem);
    color: var(--primary);
    line-height: 1.2;
    margin-bottom: 18px;
    font-weight: 800;
}
.hero-text p {
    font-size: clamp(1rem, 2vw, 1.12rem);
    color: var(--text-mid);
    margin-bottom: 28px;
    max-width: 520px;
}
.hero-image img {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    object-fit: cover;
}

/* ══════════════════════════════════════════
   ABOUT
══════════════════════════════════════════ */
.about { padding: 80px 0; background: var(--white); }
.about-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 56px;
    align-items: center;
}
.about h2 { font-size: clamp(1.6rem, 3vw, 2rem); color: var(--primary); margin-bottom: 16px; font-weight: 800; }
.lead { font-size: 1.15rem; font-weight: 600; color: var(--primary); margin-bottom: 14px; }
.about p { color: var(--text-mid); margin-bottom: 14px; }
.mission-card {
    background: var(--bg-light);
    border-left: 5px solid var(--accent);
    padding: 28px;
    border-radius: 0 var(--radius) var(--radius) 0;
}
.mission-card h3 { color: var(--primary); margin-bottom: 10px; font-size: 1.1rem; }
.mission-card p { font-style: italic; color: var(--text-mid); margin: 0; }

/* ══════════════════════════════════════════
   CAPABILITIES
══════════════════════════════════════════ */
.capabilities { padding: 80px 0; background: var(--bg-light); }
.section-title {
    text-align: center;
    margin-bottom: 48px;
    color: var(--primary);
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    font-weight: 800;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.card {
    background: var(--white);
    padding: 32px 28px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-icon { font-size: 2rem; color: var(--secondary); margin-bottom: 16px; }
.card h3 { color: var(--primary); margin-bottom: 10px; font-size: 1.1rem; }
.card p { color: var(--text-mid); font-size: 0.93rem; line-height: 1.6; }

/* ══════════════════════════════════════════
   DIAGNOSTIC PANELS
══════════════════════════════════════════ */
.panels { padding: 80px 0; background: var(--white); }

.panel-row {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 56px;
    align-items: center;
    margin-bottom: 80px;
    padding-bottom: 80px;
    border-bottom: 1px solid var(--border);
}
.panel-row:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }

/* Alternate image side */
.panel-row.reverse .panel-img  { order: -1; }
.panel-row.reverse .panel-text { order: 1; }

.panel-badge {
    display: inline-block;
    color: var(--secondary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 1.2px;
    margin-bottom: 8px;
}
.panel-text h3 {
    font-size: clamp(1.3rem, 2.5vw, 1.75rem);
    color: var(--primary);
    margin-bottom: 12px;
    font-weight: 800;
    line-height: 1.25;
}
.panel-text > p { color: var(--text-mid); margin-bottom: 18px; }
.panel-text ul li {
    padding: 10px 0 10px 28px;
    position: relative;
    font-size: 0.93rem;
    color: var(--text-mid);
    border-bottom: 1px solid #f0f4f8;
    line-height: 1.5;
}
.panel-text ul li:last-child { border-bottom: none; }
.panel-text ul li::before {
    content: "✓";
    color: var(--accent);
    position: absolute;
    left: 0;
    font-weight: 900;
    font-size: 1rem;
}
.panel-img {
    width: 100%;
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    background: var(--bg-light);
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
}
.panel-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.fallback-icon-box {
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--secondary);
    width: 100%;
    height: 260px;
}

/* ══════════════════════════════════════════
   CONTACT
══════════════════════════════════════════ */
.contact {
    padding: 80px 0;
    background: var(--bg-light);
    border-top: 1px solid var(--border);
}
.contact-grid {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: 56px;
    align-items: start;
}
.contact-info h2 { font-size: clamp(1.6rem, 3vw, 2rem); color: var(--primary); margin-bottom: 12px; font-weight: 800; }
.contact-info > p { color: var(--text-mid); margin-bottom: 32px; font-size: 0.97rem; }
.info-link {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: box-shadow var(--transition);
}
.info-link:hover { box-shadow: var(--shadow); }
.info-link i {
    color: var(--secondary);
    font-size: 1.1rem;
    margin-top: 2px;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    background: #e8f2fc;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.info-link h4 { color: var(--primary); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 3px; }
.info-link a, .info-link span { color: var(--text-mid); font-size: 0.93rem; font-weight: 500; }
.info-link a { color: var(--secondary); font-weight: 600; }
.info-link a:hover { text-decoration: underline; }

.form-container {
    background: var(--white);
    padding: 36px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.form-container h3 { margin-bottom: 6px; color: var(--primary); font-size: 1.35rem; }
.form-container > p { color: var(--text-mid); font-size: 0.9rem; margin-bottom: 24px; }
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.83rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-dark);
    background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(26,108,180,0.12);
}
.form-group textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-status {
    display: none;
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.93rem;
    line-height: 1.4;
    text-align: center;
}
.form-status.success { background: #e6f4ea; color: #137333; border: 1px solid #c3e6cb; }
.form-status.error   { background: #fce8e6; color: #c5221f; border: 1px solid #f5c6cb; }

/* ══════════════════════════════════════════
   FOOTER
══════════════════════════════════════════ */
footer {
    background: var(--primary);
    color: rgba(255,255,255,0.75);
    padding: 28px 0;
    text-align: center;
    font-size: 0.87rem;
}
footer a { color: var(--accent); }

/* ══════════════════════════════════════════
   SCROLL ANIMATIONS
══════════════════════════════════════════ */
.fade-up {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* ══════════════════════════════════════════
   RESPONSIVE — TABLET (max 900px)
══════════════════════════════════════════ */
@media (max-width: 900px) {
    /* Nav */
    .nav-links { display: none; }
    .hamburger { display: flex; }

    /* Hero */
    .hero { padding: 48px 0 40px; }
    .hero-grid { grid-template-columns: 1fr; gap: 32px; }
    .hero-text { text-align: center; }
    .hero-text p { margin: 0 auto 24px; }
    .badge { margin: 0 auto 18px; }
    .hero-text .btn { width: 100%; max-width: 340px; }

    /* About */
    .about { padding: 64px 0; }
    .about-grid { grid-template-columns: 1fr; gap: 32px; }

    /* Capabilities */
    .grid-3 { grid-template-columns: 1fr 1fr; gap: 16px; }

    /* Panels */
    .panel-row {
        grid-template-columns: 1fr;
        gap: 28px;
        margin-bottom: 56px;
        padding-bottom: 56px;
    }
    .panel-row.reverse .panel-img  { order: 0; }
    .panel-row.reverse .panel-text { order: 0; }
    .panel-img { aspect-ratio: 16/9; max-height: 280px; }

    /* Contact */
    .contact-grid { grid-template-columns: 1fr; gap: 36px; }
    .form-container { padding: 24px; }
}

/* ══════════════════════════════════════════
   RESPONSIVE — MOBILE (max 600px)
══════════════════════════════════════════ */
@media (max-width: 600px) {
    .container { width: 94%; }

    /* Nav */
    .nav-container { padding: 0 4%; }
    .logo img { height: 46px; }

    /* Hero */
    .hero { padding: 40px 0 36px; }
    .hero-text h1 { font-size: 1.7rem; }
    .hero-text p { font-size: 0.97rem; }

    /* Sections */
    .about, .capabilities, .panels, .contact { padding: 52px 0; }
    .section-title { font-size: 1.5rem; margin-bottom: 32px; }

    /* Capabilities — single column on small phones */
    .grid-3 { grid-template-columns: 1fr; gap: 14px; }
    .card { padding: 24px 20px; }

    /* Panels */
    .panel-row { gap: 24px; margin-bottom: 48px; padding-bottom: 48px; }
    .panel-text h3 { font-size: 1.25rem; }
    .panel-img { aspect-ratio: 4/3; max-height: 240px; }

    /* Contact */
    .form-container { padding: 20px 16px; }
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .info-link { padding: 12px; gap: 12px; }

    /* Footer */
    footer { padding: 20px 0; font-size: 0.82rem; }
}

/* ══════════════════════════════════════════
   UTILITY
══════════════════════════════════════════ */
@media (max-width: 360px) {
    .hero-text h1 { font-size: 1.5rem; }
    .logo img { height: 40px; }
}
