/* ========================================
   USDA ARS Cotton Ginning Lab — Styles
   Palette: Plum (#4A2C5E) + Amber (#C8956C)
   Fonts: Playfair Display + Lato
======================================== */

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

:root {
    --plum-50: #f5f0f7;
    --plum-100: #ebe0ef;
    --plum-200: #d6bfe0;
    --plum-300: #b896c8;
    --plum-400: #9a6fb0;
    --plum-500: #7d4a95;
    --plum-600: #633a78;
    --plum-700: #4a2c5e;
    --plum-800: #352044;
    --plum-900: #1f1328;
    
    --amber-50: #fdf8f0;
    --amber-100: #f9ecda;
    --amber-200: #f2d8b4;
    --amber-300: #e8bc84;
    --amber-400: #dfaa63;
    --amber-500: #c8956c;
    --amber-600: #b07a52;
    --amber-700: #8a5c3d;
    --amber-800: #6b4730;
    --amber-900: #4a3020;
    
    --neutral-50: #faf9f8;
    --neutral-100: #f5f4f2;
    --neutral-200: #e8e6e2;
    --neutral-300: #d1cec8;
    --neutral-400: #a8a39a;
    --neutral-500: #78716c;
    --neutral-600: #57534e;
    --neutral-700: #44403c;
    --neutral-800: #292524;
    --neutral-900: #1c1917;
    
    --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-sans: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    --shadow-sm: 0 1px 2px rgba(74, 44, 94, 0.05);
    --shadow-md: 0 4px 12px rgba(74, 44, 94, 0.08);
    --shadow-lg: 0 12px 32px rgba(74, 44, 94, 0.12);
    --shadow-xl: 0 20px 48px rgba(74, 44, 94, 0.15);
}

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

body {
    font-family: var(--font-sans);
    color: var(--neutral-800);
    background-color: #ffffff;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a {
    color: var(--plum-600);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--plum-700);
}

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

/* ── Typography ──────────────────────── */
h1, h2, h3, h4 {
    font-family: var(--font-serif);
    font-weight: 600;
    line-height: 1.2;
    color: var(--neutral-900);
}

.section-label {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--amber-600);
    margin-bottom: 12px;
}

.section-label--light {
    color: var(--amber-300);
}

.section-title {
    font-size: clamp(1.875rem, 4vw, 2.75rem);
    margin-bottom: 20px;
    color: var(--neutral-900);
}

.section-title--light {
    color: #ffffff;
}

.text-plum {
    color: var(--plum-700);
}

.text-amber {
    color: var(--amber-600);
}

.lead {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--neutral-600);
    margin-bottom: 20px;
}

.section-subtitle {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--neutral-500);
    max-width: 640px;
}

.section-subtitle--light {
    color: rgba(255, 255, 255, 0.75);
}

/* ── Buttons ─────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 500;
    padding: 14px 28px;
    border-radius: 6px;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
}

.btn--primary {
    background: var(--plum-700);
    color: #ffffff;
    border-color: var(--plum-700);
}

.btn--primary:hover {
    background: var(--plum-800);
    border-color: var(--plum-800);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn--outline-light {
    background: transparent;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.5);
}

.btn--outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #ffffff;
    color: #ffffff;
}

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

/* ── Navigation ──────────────────────── */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--neutral-200);
    transition: box-shadow 0.3s ease;
}

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

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

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--neutral-900);
}

.nav-logo-icon {
    color: var(--plum-700);
}

.nav-logo-text {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 600;
    color: var(--neutral-900);
}

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

.nav-link {
    font-size: 0.9375rem;
    font-weight: 400;
    color: var(--neutral-600);
    text-decoration: none;
    transition: color 0.2s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: var(--plum-700);
    transition: width 0.25s ease;
}

.nav-link:hover {
    color: var(--plum-700);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link--cta {
    color: var(--plum-700);
    font-weight: 500;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--neutral-700);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* ── Hero ────────────────────────────── */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: hidden;
    background: var(--plum-900);
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: 
        linear-gradient(135deg, 
            rgba(31, 19, 40, 0.92) 0%, 
            rgba(74, 44, 94, 0.88) 50%,
            rgba(53, 32, 68, 0.90) 100%
        ),
        url('https://images.pexels.com/photos/1181396/pexels-photo-1181396.jpeg?auto=compress&cs=tinysrgb&fit=crop&w=1920&h=1080') center/cover no-repeat;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(31, 19, 40, 0.4) 0%,
        rgba(31, 19, 40, 0.2) 50%,
        rgba(31, 19, 40, 0.6) 100%
    );
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 120px 24px 80px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--amber-300);
    background: rgba(200, 149, 108, 0.15);
    border: 1px solid rgba(200, 149, 108, 0.3);
    padding: 8px 20px;
    border-radius: 100px;
    margin-bottom: 32px;
}

.hero-headline {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    line-height: 1.1;
    color: #ffffff;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.hero-subheadline {
    font-size: clamp(1rem, 2vw, 1.25rem);
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.8);
    max-width: 600px;
    margin: 0 auto 40px;
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-scroll {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    animation: float 2s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(6px); }
}

/* ── Sections ────────────────────────── */
.section {
    padding: 100px 0;
}

.section--light {
    background: var(--neutral-50);
}

.section-header {
    text-align: center;
    margin-bottom: 64px;
}

/* ── About ───────────────────────────── */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
}

.about-image {
    position: relative;
}

.about-image img {
    width: 100%;
    height: 750px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: var(--shadow-xl);
}

.about-image-accent {
    position: absolute;
    bottom: -20px;
    right: -20px;
    width: 200px;
    height: 200px;
    background: var(--plum-700);
    border-radius: 8px;
    z-index: -1;
    opacity: 0.15;
}

.about-content p {
    color: var(--neutral-600);
    margin-bottom: 16px;
}

.about-stats {
    display: flex;
    gap: 40px;
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--neutral-200);
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-number {
    font-family: var(--font-serif);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--plum-700);
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--neutral-500);
}

/* ── Research ────────────────────────── */
.research-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.research-card {
    background: #ffffff;
    border: 1px solid var(--neutral-200);
    border-radius: 10px;
    padding: 36px 28px;
    transition: all 0.3s ease;
}

.research-card:hover {
    border-color: var(--plum-200);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.research-card-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--plum-50);
    border-radius: 10px;
    color: var(--plum-700);
    margin-bottom: 20px;
}

.research-card-title {
    font-size: 1.1875rem;
    margin-bottom: 12px;
    color: var(--neutral-900);
}

.research-card p {
    font-size: 0.9375rem;
    color: var(--neutral-500);
    line-height: 1.7;
    margin-bottom: 20px;
}

.research-card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--plum-700);
    text-decoration: none;
    transition: gap 0.2s ease;
}

.research-card-link:hover {
    gap: 10px;
}

/* ── Services ────────────────────────── */
.section--plum {
    background: var(--plum-700);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.service-card {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 40px 32px;
    transition: all 0.3s ease;
}

.service-card:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.service-card--light .service-card-number {
    color: rgba(255, 255, 255, 0.3);
}

.service-card-number {
    font-family: var(--font-serif);
    font-size: 3rem;
    font-weight: 700;
    color: var(--plum-200);
    line-height: 1;
    margin-bottom: 16px;
}

.service-card-title {
    font-size: 1.25rem;
    color: #ffffff;
    margin-bottom: 12px;
}

.service-card p {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
}

/* ── Impact ──────────────────────────── */
.impact-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
}

.impact-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 32px;
}

.impact-list li {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    font-size: 0.9375rem;
    color: var(--neutral-600);
    line-height: 1.6;
}

.impact-list li svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--amber-500);
}

.impact-image {
    position: relative;
}

.impact-image img {
    width: 100%;
    height: 600px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: var(--shadow-xl);
}

.impact-image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px;
    background: linear-gradient(to top, rgba(31, 19, 40, 0.9), transparent);
    border-radius: 0 0 8px 8px;
}

.impact-quote {
    font-family: var(--font-serif);
    font-size: 1.125rem;
    font-style: italic;
    color: #ffffff;
    line-height: 1.6;
}

/* ── CTA Section ─────────────────────── */
.cta-section {
    background: var(--plum-800);
    padding: 80px 0;
    text-align: center;
}

.cta-content {
    max-width: 640px;
    margin: 0 auto;
}

.cta-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    color: #ffffff;
    margin-bottom: 16px;
}

.cta-text {
    font-size: 1.0625rem;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 32px;
    line-height: 1.75;
}

.cta-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* ── Contact ─────────────────────────── */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
}

.contact-description {
    color: var(--neutral-500);
    margin-bottom: 32px;
    font-size: 1rem;
    line-height: 1.75;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.contact-detail {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.contact-detail-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--plum-50);
    border-radius: 8px;
    color: var(--plum-700);
    flex-shrink: 0;
}

.contact-detail strong {
    display: block;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--neutral-700);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.contact-detail p {
    font-size: 0.9375rem;
    color: var(--neutral-500);
    line-height: 1.6;
}

.contact-detail a {
    color: var(--plum-600);
}

.contact-detail a:hover {
    color: var(--plum-700);
    text-decoration: underline;
}

/* ── Contact Form ────────────────────── */
.contact-form-wrapper {
    background: #ffffff;
    border: 1px solid var(--neutral-200);
    border-radius: 12px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.contact-form-title {
    font-size: 1.375rem;
    margin-bottom: 28px;
    color: var(--neutral-900);
}

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

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--neutral-700);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    color: var(--neutral-800);
    background: var(--neutral-50);
    border: 1.5px solid var(--neutral-200);
    border-radius: 6px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--plum-400);
    box-shadow: 0 0 0 3px rgba(74, 44, 94, 0.1);
}

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

.form-success {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    color: #166534;
    font-size: 0.9375rem;
    margin-top: 16px;
}

.form-success svg {
    flex-shrink: 0;
    color: #22c55e;
}

/* ── Map ─────────────────────────────── */
.map-section {
    background: var(--neutral-200);
}

.map-section iframe {
    display: block;
    width: 100%;
    height: 350px;
    filter: grayscale(30%) contrast(1.05);
}

/* ── Footer ──────────────────────────── */
.footer {
    background: var(--neutral-900);
    color: rgba(255, 255, 255, 0.65);
    padding: 64px 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 48px;
    padding-bottom: 48px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 16px;
}

.footer-logo svg {
    color: var(--amber-400);
}

.footer-tagline {
    font-size: 0.9375rem;
    line-height: 1.7;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.footer-notice {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.6;
}

.footer-heading {
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 20px;
}

.footer-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-nav a {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-nav a:hover {
    color: var(--amber-400);
}

.footer-contact p {
    font-size: 0.9375rem;
    margin-bottom: 6px;
}

.footer-contact a {
    color: rgba(255, 255, 255, 0.65);
}

.footer-contact a:hover {
    color: var(--amber-400);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

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

.footer-legal {
    font-size: 0.75rem !important;
}

/* ── Mobile Menu ─────────────────────── */
@media (max-width: 968px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        background: #ffffff;
        flex-direction: column;
        padding: 24px;
        gap: 20px;
        border-bottom: 1px solid var(--neutral-200);
        box-shadow: var(--shadow-lg);
        transform: translateY(-120%);
        opacity: 0;
        transition: all 0.3s ease;
        pointer-events: none;
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }

    .nav-link::after {
        display: none;
    }

    .about-grid,
    .impact-layout,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-image img {
        height: 400px;
    }

    .impact-image img {
        height: 400px;
    }

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

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

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

@media (max-width: 640px) {
    .section {
        padding: 72px 0;
    }

    .hero-content {
        padding: 100px 20px 60px;
    }

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

    .hero-actions .btn {
        width: 100%;
        justify-content: center;
    }

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

    .about-stats {
        flex-direction: column;
        gap: 24px;
    }

    .contact-form-wrapper {
        padding: 24px;
    }

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

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

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

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

/* ── Reduced Motion ──────────────────── */
@media (prefers-reduced-motion: no-preference) {
    .research-card,
    .service-card {
        transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, border-color 0.3s ease;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}
