@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Playfair+Display:wght@700;800;900&display=swap');

:root {
    --bg-cream: #FDFBF7;
    --text-cocoa: #3C2A21;
    --text-muted: #6D5D55;
    --accent-gold: #D4AF37;
    --glass-white: rgba(255, 255, 255, 0.45);
    --glass-border: rgba(60, 42, 33, 0.1);
    --shadow-soft: 0 12px 30px rgba(60, 42, 33, 0.04);
    --section-gap: 4rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-cream);
    color: var(--text-cocoa);
    font-family: 'Inter', system-ui, sans-serif;
    /* Clean Sans fallback for technical data */
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* --- Radiant Spotlight Effect --- */
#cursor-spotlight {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
    background: radial-gradient(600px circle at var(--x, 50%) var(--y, 50%),
            rgba(255, 255, 255, 0.4) 0%,
            transparent 100%);
}

h1,
h2,
h3 {
    font-family: 'Playfair Display', serif;
}

/* --- Gourmet UI Button (Frosted Cocoa & Amber) --- */
.gourmet-btn {
    position: relative;
    padding: 14px 36px;
    background: #3C2A21;
    color: #FDFBF7;
    font-size: 1rem;
    font-weight: 700;
    border: 1px solid #D4AF37;
    /* Golden-Amber Border */
    border-radius: 12px;
    cursor: pointer;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease-in-out;
    overflow: visible;
}

.gourmet-btn span {
    position: relative;
    z-index: 5;
}

.gourmet-btn:hover {
    background: #5D4037;
    /* Mocha Hover */
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
    /* Amber Radial Glow */
}

/* Active State for Model Selectors */
.gourmet-btn.active {
    border: 2px solid #D4AF37 !important;
    background: #5D4037 !important;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
}

/* Specific Variants */
.gourmet-btn.outline {
    background: rgba(253, 251, 247, 0.6) !important;
    color: var(--text-cocoa) !important;
    backdrop-filter: blur(10px);
}

.gourmet-btn.dark {
    background: #1A120B !important;
    border-color: #8B6F3A;
}

/* --- Layout Components --- */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    background:
        linear-gradient(rgba(253, 251, 247, 0.6), rgba(253, 251, 247, 0.6)),
        url('public/hero.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.hero-title {
    font-size: 5.5rem;
    margin-bottom: 20px;
    letter-spacing: -2px;
    color: var(--text-cocoa);
    font-weight: 900;
}

.hero-subtitle {
    font-size: 1.4rem;
    color: var(--text-muted);
    max-width: 700px;
    margin-bottom: 50px;
    font-weight: 500;
}

.quest-milestones {
    display: flex;
    gap: 40px;
    padding: 30px 60px;
    background: white;
    border-radius: 100px;
    box-shadow: 0 15px 50px rgba(60, 42, 33, 0.1);
    border: 1px solid rgba(60, 42, 33, 0.05);
}

.milestone {
    text-align: left;
}

.milestone .label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    font-weight: 700;
}

.milestone .value {
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-cocoa);
}

.milestone.active .value {
    color: var(--accent-emerald);
}

/* --- Experimental Contenders --- */
.section-container {
    padding: var(--section-gap) 5%;
    max-width: 1300px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

.section-title {
    font-family: 'Playfair Display', serif;
    /* Falling back to Playfair for high-end serif */
    font-size: 3.5rem;
    text-align: center;
    margin-bottom: 3.5rem;
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1.1;
    color: var(--text-cocoa);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
}

.contender-card {
    background: var(--glass-white);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2.5rem;
    text-align: center;
    transform-style: preserve-3d;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.contender-card:hover {
    transform: translateY(-15px) rotateX(5deg) rotateY(-2deg);
    box-shadow: 0 30px 60px rgba(60, 42, 33, 0.12);
}

.contender-card * {
    transform: translateZ(20px);
}

.contender-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 24px;
    transition: transform 0.5s ease;
    transform: translateZ(40px);
}

.contender-card:hover img {
    transform: translateZ(60px) scale(1.05);
}

.contender-card h3 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.card-accuracy {
    font-family: 'Playfair Display', serif;
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--text-cocoa);
    margin-bottom: 15px;
}

/* --- Technical Foundation --- */
.foundation-section {
    padding: var(--section-gap) 5%;
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 5;
    margin-top: -2rem;
}

.foundation-card {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(60, 42, 33, 0.1);
    border-radius: 24px;
    padding: 60px;
    max-width: 1100px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(60, 42, 33, 0.05);
    text-align: center;
}

.foundation-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.8rem;
    color: var(--text-cocoa);
    margin-bottom: 40px;
    letter-spacing: -0.5px;
}

.legacy-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 40px;
    text-align: left;
    margin-bottom: 40px;
}

@media (max-width: 900px) {
    .legacy-content {
        grid-template-columns: 1fr;
    }
}

.legacy-text p {
    margin-bottom: 20px;
    line-height: 1.8;
    color: var(--text-muted);
}

.legacy-text em {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    color: var(--text-cocoa);
    font-weight: 700;
}

.legacy-stats {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stat-box {
    background: rgba(60, 42, 33, 0.03);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid var(--text-cocoa);
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--text-cocoa);
}

.stat-desc {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-cocoa);
}

.cocoa-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--text-cocoa), transparent);
    opacity: 0.2;
    margin: 40px 0;
}

.mission-statement {
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--text-cocoa);
    max-width: 850px;
    margin: 0 auto;
}

.mission-statement b {
    color: var(--accent-emerald);
    font-weight: 900;
}

/* --- Architecture Lab --- */
.lab-container {
    max-width: 1100px;
    margin: 0 auto;
    background: white;
    border-radius: 4rem;
    padding: 80px;
    box-shadow: 0 40px 120px rgba(60, 42, 33, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.model-selector-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin-bottom: 60px;
    width: 100%;
}

.selector-btn {
    padding: 12px 24px;
    font-size: 0.9rem;
    background: #0a0a0a;
}

.tech-card {
    background: #fdfbf7;
    width: 100%;
    padding: 60px;
    border-radius: 3rem;
    border: 1px solid rgba(60, 42, 33, 0.05);
    box-shadow: 0 20px 60px rgba(60, 42, 33, 0.03);
    text-align: center;
    display: none;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tech-title {
    font-size: 2.8rem;
    color: var(--text-cocoa);
    margin-bottom: 15px;
}

.tech-desc {
    color: var(--text-muted);
    font-size: 1.2rem;
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.metrics-suite {
    text-align: left;
    background: white;
    padding: 40px;
    border-radius: 2.5rem;
    box-shadow: 0 10px 30px rgba(60, 42, 33, 0.03);
}

.metrics-suite h4 {
    color: var(--accent-emerald);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 2px;
    margin-bottom: 25px;
    font-family: 'Inter', sans-serif;
}

.metrics-table {
    width: 100%;
    border-collapse: collapse;
}

.metrics-table td {
    padding: 20px 0;
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    color: var(--text-cocoa);
    border-bottom: 1px solid rgba(60, 42, 33, 0.05);
}

/* --- Reveal Animations --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.reveal.active-reveal {
    opacity: 1;
    transform: translateY(0);
}

footer {
    padding: 4rem 5%;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.metrics-table tr:last-child td {
    border-bottom: none;
}

/* --- Modal --- */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(60, 42, 33, 0.5);
    backdrop-filter: blur(12px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 60px;
    border-radius: 4rem;
    width: 90%;
    max-width: 1000px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}

pre {
    background: #f8f5f2;
    padding: 35px;
    border-radius: 2.5rem;
    font-family: 'monospace';
    font-size: 1rem;
    color: #333;
    border: 1px solid rgba(60, 42, 33, 0.08);
    overflow-x: auto;
}

.close-btn {
    position: absolute;
    top: 40px;
    right: 45px;
    font-size: 3rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}

/* --- Hierarchy Modal & List Styles --- */
.hierarchy-content {
    max-width: 800px !important;
    padding: 50px !important;
}

.hierarchy-scroll-container {
    background: #fdfbf7;
    border-radius: 2rem;
    padding: 20px;
    height: 500px;
    overflow-y: auto;
    border: 1px solid rgba(60, 42, 33, 0.08);
    box-shadow: inset 0 5px 20px rgba(60, 42, 33, 0.03);
}

.layer-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.layer-item {
    display: flex;
    align-items: center;
    padding: 18px 25px;
    border-radius: 1.2rem;
    background: white;
    box-shadow: 0 4px 10px rgba(60, 42, 33, 0.02);
    border: 1px solid rgba(60, 42, 33, 0.03);
    transition: transform 0.2s ease;
}

.layer-item:hover {
    transform: translateX(15px);
    border-color: var(--accent-gold);
    background: linear-gradient(90deg, white 0%, rgba(212, 175, 55, 0.05) 100%);
}

.layer-item::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 50%;
    width: 10px;
    height: 2px;
    background: var(--accent-gold);
    opacity: 0;
    transition: all 0.3s ease;
}

.layer-item:hover::before {
    opacity: 1;
    left: -5px;
}

.layer-index {
    width: 35px;
    height: 35px;
    background: var(--bg-cream);
    color: var(--text-muted);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    margin-right: 20px;
    border: 1px solid rgba(60, 42, 33, 0.05);
}

.layer-info {
    flex: 1;
}

.layer-type {
    display: block;
    font-weight: 800;
    color: var(--text-cocoa);
    font-size: 1.05rem;
    margin-bottom: 2px;
}

.layer-params {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: 'Space Mono', monospace;
}

.hierarchy-scroll-container::-webkit-scrollbar {
    width: 8px;
}

.hierarchy-scroll-container::-webkit-scrollbar-track {
    background: transparent;
}

.hierarchy-scroll-container::-webkit-scrollbar-thumb {
    background: rgba(60, 42, 33, 0.1);
    border-radius: 10px;
}

.hierarchy-scroll-container::-webkit-scrollbar-thumb:hover {
    background: rgba(60, 42, 33, 0.2);
}

/* --- Model Wrapper (Groups Card + Insight) --- */
.model-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* --- Architectural Insight Box (Distinct Frosted Pane) --- */
.insight-box {
    display: block;
    background: rgba(245, 235, 210, 0.35);
    /* Warm Parchment Glass */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(139, 111, 58, 0.2);
    border-radius: 16px;
    padding: 24px;
    margin-top: 24px !important;
    /* Force Separation */
    font-size: 0.95rem;
    color: var(--text-cocoa);
    line-height: 1.6;
    text-align: center;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
    /* Elevated Shadow */
    position: relative;
    z-index: 10;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.insight-box:hover {
    transform: translateY(-5px);
    background: rgba(245, 235, 210, 0.5);
    border-color: rgba(139, 111, 58, 0.3);
    box-shadow: 0 12px 24px rgba(60, 42, 33, 0.12);
}

.insight-box strong {
    color: var(--text-cocoa);
    font-weight: 800;
    font-family: 'Playfair Display', serif;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 5px;
    font-size: 1rem;
}

.site-footer {
    padding: 6rem 5% 4rem;
    text-align: center;
    background-color: var(--bg-cream);
    color: var(--text-cocoa);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.footer-founder {
    font-family: 'Playfair Display', serif;
    font-variant: small-caps;
    font-size: 1.2rem;
    letter-spacing: 2px;
    font-weight: 700;
}

.footer-identity {
    font-size: 1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.footer-mission {
    font-size: 0.85rem;
    color: var(--text-muted);
    opacity: 0.7;
    letter-spacing: 0.5px;
}

/* --- Info Icon with Pure CSS Tooltip --- */
.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    font-size: 0.85rem;
    color: var(--accent-gold);
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 50%;
    cursor: help;
    transition: all 0.3s ease;
    margin-left: 8px;
    vertical-align: middle;
    font-style: normal;
    position: relative;
    z-index: 100;
}

.info-icon:hover {
    background: rgba(212, 175, 55, 0.4);
    color: var(--text-cocoa);
    transform: scale(1.15);
}

/* --- Premium Specification Card Tooltip --- */
.info-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 130%;
    right: -10px;
    transform: translateY(5px);

    /* Dark Glass Theme */
    background: rgba(40, 36, 30, 0.95);
    border: 1px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);

    /* Typography */
    color: #FDFBF7;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.8;
    text-align: left;
    white-space: pre-line;

    /* Layout */
    width: 220px;
    padding: 14px 16px;
    border-radius: 12px;

    /* Animation & Layering */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    z-index: 9999;
    pointer-events: none;
}

/* Tooltip Safety Arrow (pointing down to icon) */
.info-icon::before {
    content: '';
    position: absolute;
    bottom: 115%;
    right: 0;
    transform: translateY(5px);
    border: 10px solid transparent;
    border-top-color: rgba(40, 36, 30, 0.95);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    z-index: 9999;
}

/* Show tooltip on hover with slide-up animation */
.info-icon:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.info-icon:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* --- Info Tooltip (Dark Glassmorphism) --- */
.info-tooltip {
    position: absolute;
    display: none;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 99999;
    max-width: 320px;
    font-size: 0.85rem;
    color: #ffffff;
    line-height: 1.7;
    text-align: left;
}

.info-tooltip.visible {
    display: block;
    animation: tooltipFadeIn 0.2s ease-out;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.info-tooltip strong {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 1.05rem;
    margin-bottom: 10px;
    color: #D4AF37;
}

.info-tooltip .spec-line {
    display: block;
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.9);
}

.info-tooltip .spec-label {
    font-weight: 600;
    color: #D4AF37;
}

/* ============================================================
   DEDICATED MOBILE CSS BLOCK — screens ≤ 768px
   Desktop layout is UNTOUCHED above this block
   ============================================================ */
@media (max-width: 768px) {

    /* --- 1. GLOBAL OVERFLOW GUARD (prevents horizontal scroll from glows) --- */
    html,
    body {
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* Contain spotlight so it never bleeds sideways */
    #cursor-spotlight {
        display: none;
        /* finger-driven device — cursor spotlight irrelevant */
    }

    /* --- 2. HERO --- */
    .hero {
        min-height: 70vh;
        padding: 60px 20px 50px;
        background-attachment: scroll;
        /* fixed bg causes perf issues on mobile */
    }

    .hero-title {
        font-size: 3rem !important;
        letter-spacing: -1px;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 35px;
    }

    /* Milestone pills: stack vertically, full-width pill */
    .quest-milestones {
        flex-direction: column;
        gap: 20px;
        padding: 24px 28px;
        border-radius: 24px;
        width: 100%;
        max-width: 340px;
    }

    .milestone .value {
        font-size: 1.6rem;
    }

    /* --- 3. SECTION SPACING --- */
    .section-container {
        padding: 2rem 4%;
    }

    .section-title {
        font-size: 2.2rem;
        margin-bottom: 2rem;
    }

    /* --- 4. GRID — SINGLE COLUMN VERTICAL STACK --- */
    .card-grid {
        grid-template-columns: 1fr !important;
        gap: 28px;
    }

    /* Full-width ConvNeXt champion card (it uses grid-column: 1 / -1 already) */
    .model-wrapper[style*="grid-column"] {
        max-width: 100% !important;
        margin: 0 !important;
    }

    .contender-card {
        padding: 1.8rem;
    }

    /* Disable heavy 3D hover on mobile — can cause jank */
    .contender-card:hover {
        transform: translateY(-6px) !important;
    }

    /* Card image — slightly shorter on mobile */
    .contender-card img {
        height: 180px;
    }

    .contender-card h3 {
        font-size: 1.4rem;
    }

    .card-accuracy {
        font-size: 2.2rem;
    }

    /* ConvNeXt champion big number */
    .card-accuracy[style*="5rem"] {
        font-size: 3.5rem !important;
    }

    /* --- 5. DEEPFOOD FOUNDATION CARD (full-width with healthy margins) --- */
    .foundation-section {
        padding: 2rem 4%;
        margin-top: 0;
    }

    .foundation-card {
        padding: 2rem 1.5rem !important;
        border-radius: 18px;
        width: 100%;
        /* healthy side margins handled by parent padding */
    }

    /* Stack the inline flex row (text + image) vertically */
    .foundation-card>div>div[style*="display: flex"] {
        flex-direction: column !important;
        gap: 24px !important;
    }

    /* DeepFood image — full width, reasonable height */
    .foundation-card div[style*="width: 300px"] {
        width: 100% !important;
        height: 220px !important;
    }

    .foundation-title {
        font-size: 1.9rem;
    }

    .mission-statement {
        font-size: 1rem;
    }

    /* --- 6. LABORATORY --- */
    .lab-container {
        padding: 2rem 1.5rem;
        border-radius: 2rem;
    }

    .model-selector-grid {
        gap: 12px;
        margin-bottom: 36px;
    }

    /* Selector buttons — larger tap targets */
    .selector-btn {
        padding: 14px 18px;
        font-size: 0.85rem;
        min-height: 48px;
    }

    .tech-card {
        padding: 2rem 1.2rem;
        border-radius: 1.5rem;
    }

    .tech-title {
        font-size: 1.8rem;
    }

    .tech-desc {
        font-size: 1rem;
    }

    /* Action buttons — full-width, large thumb targets */
    .action-buttons {
        flex-direction: column;
        gap: 14px;
        align-items: stretch;
        margin-bottom: 36px;
    }

    .action-buttons .gourmet-btn {
        width: 100%;
        padding: 16px 20px !important;
        font-size: 0.95rem;
        min-height: 52px;
    }

    /* Scale metrics font so values don't wrap */
    .metrics-table td {
        font-size: 0.9rem;
        padding: 14px 0;
    }

    .metrics-suite {
        padding: 24px 18px;
        border-radius: 1.5rem;
    }

    /* --- 7. MODALS --- */
    .modal-content {
        padding: 2rem 1.5rem;
        border-radius: 2rem;
        width: 95%;
        max-height: 88vh;
        overflow-y: auto;
    }

    .hierarchy-content {
        max-width: 100% !important;
        padding: 1.8rem 1.2rem !important;
    }

    /* Backbone scroll container — fixed height so it never pushes modal off screen */
    .hierarchy-scroll-container {
        height: 300px !important;
        max-height: 300px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .close-btn {
        top: 20px;
        right: 24px;
        font-size: 2.2rem;
    }

    pre {
        font-size: 0.78rem;
        padding: 20px;
        border-radius: 1.2rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* --- 8. INFO TOOLTIP — reposition so it doesn't bleed off screen --- */
    .info-icon::after {
        right: auto;
        left: 50%;
        transform: translateX(-50%) translateY(5px);
        width: 190px;
        font-size: 0.75rem;
    }

    .info-icon:hover::after {
        transform: translateX(-50%) translateY(0);
    }

    .info-icon::before {
        right: auto;
        left: 50%;
        transform: translateX(-50%) translateY(5px);
    }

    .info-icon:hover::before {
        transform: translateX(-50%) translateY(0);
    }

    /* --- 9. INSIGHT BOXES --- */
    .insight-box {
        padding: 18px;
        font-size: 0.9rem;
    }

    /* --- 10. FOOTER — centered & legible --- */
    .site-footer {
        padding: 3rem 6% 2.5rem;
        gap: 1rem;
        text-align: center;
        align-items: center;
    }

    .footer-founder {
        font-size: 1rem;
        letter-spacing: 1.5px;
    }

    .footer-identity {
        font-size: 0.8rem;
    }

    .footer-mission {
        font-size: 0.75rem;
    }

    /* --- 11. GOURMET BUTTON GLOBAL SIZING on mobile --- */
    .gourmet-btn {
        padding: 13px 26px;
        font-size: 0.9rem;
    }

    /* --- 12. GENERAL GLOW CONTAINMENT (no horizontal overflow) --- */
    .contender-card,
    .foundation-card,
    .lab-container,
    .tech-card,
    .insight-box {
        max-width: 100%;
    }

    /* ── 13. CODE BLOCK CONTAINMENT ────────────────────────────────
       The <pre> inside the arch modal is capped and masked so it
       never pushes the modal off-screen or forces horizontal scroll. */
    .modal-content pre {
        max-height: 400px;
        overflow-y: auto;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
        /* Fade-mask: code dissolves into the cream background at bottom */
        -webkit-mask-image: linear-gradient(to bottom,
                black 0%,
                black 70%,
                transparent 100%);
        mask-image: linear-gradient(to bottom,
                black 0%,
                black 70%,
                transparent 100%);
    }

    /* ── 14. HERO TITLE — 30% reduction (stays single-line) ────── */
    /* Desktop is 5.5rem → 30% less = ~3.85rem, but we already set
       3rem earlier; bump slightly to match the 30%-of-desktop spec. */
    .hero-title,
    .hero h1 {
        font-size: 2.8rem !important;
        letter-spacing: -0.5px;
        line-height: 1.1;
    }

    /* ── 15. CARD IMAGES — consistent 200px gallery height ─────── */
    .contender-card img {
        height: 200px !important;
        object-fit: cover !important;
    }

    /* ── 16. TEXT CONTAINER SIDE PADDING ───────────────────────── */
    /* Ensures DeepFood summary and body text never kisses screen edges */
    .foundation-card p,
    .hero-subtitle,
    .mission-statement,
    .tech-desc {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }

    .section-container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .foundation-section {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    /* ── 17. MILESTONE PULSE ANIMATION (driven by JS on mobile) ── */
    @keyframes milestoneReveal {
        0% {
            opacity: 0;
            transform: translate3d(0, 18px, 0) scale(0.92);
        }

        60% {
            opacity: 1;
            transform: translate3d(0, -4px, 0) scale(1.03);
        }

        100% {
            opacity: 1;
            transform: translate3d(0, 0px, 0) scale(1);
        }
    }

    .milestone-animate {
        animation: milestoneReveal 0.55s cubic-bezier(0.23, 1, 0.32, 1) both;
    }
}