/* ================================================================
   SEEDBiomed — Homepage Visual Enhancement
   Loaded exclusively on index.html (after main.css).
   Fixes mobile layout bugs and refines the visual design.
   ================================================================ */

/* ── CSS Custom Properties ────────────────────────────────────── */
:root {
    --seed-teal:    #059598;
    --seed-dark:    #013f54;
    --seed-orange:  #f69318;
    --seed-gray:    #c2bdbd;
    --seed-surface: #f4fafa;
    --seed-white:   #ffffff;
    --r-sm:  8px;
    --r-md:  16px;
    --r-lg:  28px;
    --r-pill: 50px;
    --sh-sm: 0 2px 12px rgba(1, 63, 84, 0.08);
    --sh-md: 0 8px 32px rgba(1, 63, 84, 0.12);
    --sh-lg: 0 20px 56px rgba(1, 63, 84, 0.18);
}

/* ── NAVIGATION ───────────────────────────────────────────────── */
#nav {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background-color: rgba(255, 255, 255, 0.97) !important;
    box-shadow: 0 1px 0 rgba(5, 149, 152, 0.1), 0 4px 20px rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid rgba(5, 149, 152, 0.08);
}

/* ── BANNER ───────────────────────────────────────────────────── */
#banner {
    /* Rich directional gradient – deep ocean to teal */
    background:
        radial-gradient(ellipse at 15% 55%, rgba(246, 147, 24, 0.14) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 20%, rgba(5, 149, 152, 0.22) 0%, transparent 52%),
        linear-gradient(140deg, #010f1d 0%, #012a3a 25%, #013f54 50%, #045c60 75%, #059598 100%);
    position: relative;
    overflow: hidden;
}

/* Molecular dot-grid texture */
#banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
    background-size: 38px 38px;
    pointer-events: none;
    z-index: 0;
}

/* Warm accent glow – bottom-right */
#banner::after {
    content: '';
    position: absolute;
    bottom: -40px;
    right: -40px;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(246, 147, 24, 0.12) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

#banner .content {
    position: relative;
    z-index: 1;
    background: transparent;
    padding: 5.5em 3em 5em;
    max-width: 900px;
    margin: 0 auto;
}

#banner .content h2 {
    font-size: 2.35em !important;
    color: rgba(255, 255, 255, 0.96) !important;
    letter-spacing: 0.04em;
    line-height: 1.25;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.25);
    margin: 0 0 0.5em 0 !important;
}

#banner .content img {
    max-width: 160px;
    width: 160px;
    margin: 0.5em auto 1.1em;
    display: block;
    opacity: 1;
}

#banner .content p {
    font-size: 1.05em;
    color: rgba(246, 147, 24, 0.95);
    letter-spacing: 0.12em;
    margin-bottom: 2.25em !important;
}


/* ── MISSION STRIP ───────────────────────────────────────────── */
#mission-strip {
    background: #ffffff;
    border-top: 3px solid var(--seed-teal);
    border-bottom: 1px solid rgba(5, 149, 152, 0.12);
    padding: 2.2em 2em;
    text-align: center;
    margin-bottom: 0;
}

.mission-inner {
    max-width: 820px;
    margin: 0 auto;
}

.mission-preamble {
    font-family: 'Open Sans Condensed', sans-serif;
    font-weight: 700;
    font-size: 0.78em;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.9em;
}

.mission-pillars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5em;
    flex-wrap: wrap;
}

.mission-pillar {
    font-family: 'Open Sans Condensed', sans-serif;
    font-weight: 700;
    font-size: 1.05em;
    color: var(--seed-dark);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1.35;
    max-width: 300px;
}

.mission-divider {
    font-family: 'Open Sans Condensed', sans-serif;
    font-weight: 700;
    font-size: 1.4em;
    color: var(--seed-orange);
    flex-shrink: 0;
    line-height: 1;
}

@media screen and (max-width: 736px) {
    #mission-strip {
        padding: 1.8em 1.25em;
    }

    .mission-pillars {
        flex-direction: column;
        gap: 0.6em;
    }

    .mission-pillar {
        font-size: 0.95em;
        max-width: 100%;
    }

    .mission-divider {
        font-size: 1.1em;
    }
}

/* ── MAIN CONTENT AREA ───────────────────────────────────────── */
#main {
    background: linear-gradient(180deg, var(--seed-surface) 0%, #ffffff 30%);
    border-top: none;
    border-bottom: none;
    padding: 5em 0;
}

/* ── GLOBAL BUTTONS ─ refined sizing & shape ────────────────── */
input[type="button"],
input[type="submit"],
input[type="reset"],
.button {
    border-radius: var(--r-pill);
    font-size: 0.85em;
    padding: 0.8em 1.9em;
    letter-spacing: 0.07em;
    box-shadow: 0 4px 14px rgba(5, 149, 152, 0.22);
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

input[type="button"]:hover,
input[type="submit"]:hover,
input[type="reset"]:hover,
.button:hover {
    box-shadow: 0 8px 24px rgba(246, 147, 24, 0.3);
    transform: translateY(-2px);
}

/* ── FIX: MOBILE BUTTONS — no more full-width anchors ───────── */
/*
   main.css at ≤736px forces button / .button to display:block; width:100%
   which turns every anchor-button into a giant bar.
   We override anchor buttons specifically; the spoiler <button> keeps its
   own display:flex; width:100% via its own higher-specificity rule.
*/
@media screen and (max-width: 736px) {
    a.button {
        display: inline-block;
        width: auto;
        max-width: 88vw;
    }

    /* If a <button> element has class .button but is NOT .spoiler-btn */
    button.button:not(.spoiler-btn) {
        display: inline-block;
        width: auto;
        max-width: 88vw;
    }
}

/* ── SPOILER BUTTON — always full-width flex ─────────────────── */
.spoiler-btn {
    border-radius: var(--r-sm) !important;
    font-size: 1.05em !important;
    padding: 1rem 2rem !important;
    display: flex !important;
    width: 100% !important;
}

/* ── MISSION / HIGHLIGHT BOX ──────────────────────────────────── */
.box.highlight {
    background: linear-gradient(145deg, #f2fafa 0%, #e5f4f4 60%, #ecf8f8 100%);
    border: 1px solid rgba(5, 149, 152, 0.16);
    border-radius: var(--r-md);
    box-shadow: var(--sh-md);
    padding: 3.5em 2.5em;
}

.box.highlight h2 {
    font-size: 1.85em;
    color: var(--seed-dark);
    line-height: 1.3;
}

.box.highlight header > p {
    color: var(--seed-teal);
    font-size: 1.05em;
}

.box.highlight .button {
    border-radius: var(--r-pill);
    font-size: 0.82em;
    padding: 0.85em 2.2em;
    letter-spacing: 0.08em;
}

/* Discipline icons – gradient fill */
ul.special li a:before {
    background: linear-gradient(135deg, var(--seed-teal) 0%, var(--seed-dark) 100%);
    box-shadow: 0 8px 22px rgba(5, 149, 152, 0.22);
}

ul.special li:hover a:before {
    background: linear-gradient(135deg, var(--seed-orange) 0%, #c47208 100%);
    box-shadow: 0 8px 22px rgba(246, 147, 24, 0.3);
}

/* ── SECTION HEADERS ─────────────────────────────────────────── */
h2.major {
    border-top-width: 2px;
    border-top-color: rgba(5, 149, 152, 0.22);
    letter-spacing: 0.04em;
}

h2.major span {
    border-radius: 6px;
    color: var(--seed-dark);
}

h3.major {
    position: relative;
    border-top: 2px solid rgba(5, 149, 152, 0.18);
    font-size: 1.15em;
    text-align: center;
    margin: 2em 0 2em;
    top: 0.775em;
    letter-spacing: 0.06em;
    color: var(--seed-dark);
}

h3.major span {
    background: #fff;
    position: relative;
    display: inline-block;
    top: -0.775em;
    padding: 0 1em;
}

/* ── MEMBER / EXPLORER CARDS ─────────────────────────────────── */
.box.feature {
    background: var(--seed-white);
    border: 1px solid rgba(5, 149, 152, 0.1);
    border-radius: var(--r-md);
    box-shadow: var(--sh-sm);
    overflow: hidden;
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
    padding: 0 0 1.25em;
}

.box.feature:hover {
    background: var(--seed-white);
    transform: translateY(-6px);
    box-shadow: var(--sh-lg);
    border-color: rgba(5, 149, 152, 0.28);
}

.box.feature .image.featured {
    border-radius: 0;
    margin-bottom: 1em;
    overflow: hidden;
}

.box.feature .image.featured img {
    border-radius: 0;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.4s ease;
}

.box.feature:hover .image.featured img {
    transform: scale(1.04);
}

.box.feature h4 {
    font-size: 0.88em;
    color: var(--seed-dark);
    padding: 0 1em;
    margin-bottom: 0.4em;
    line-height: 1.3;
}

.box.feature h4 a {
    color: var(--seed-dark);
    text-decoration: none;
}

.box.feature h4 a:hover {
    color: var(--seed-teal);
}

.box.feature p {
    font-size: 0.78em;
    color: #777;
    padding: 0 1em;
    line-height: 1.55;
    margin-bottom: 0;
}

/* 2-column grid on mobile (override col-12-small → 50%) */
@media screen and (max-width: 736px) {
    #featuresRow .col-12-small,
    .col-12-small {
        width: 50% !important;
    }
}

@media screen and (max-width: 380px) {
    #featuresRow .col-12-small,
    .col-12-small {
        width: 100% !important;
    }
}

/* ── COLLABORATION NETWORK SECTION ──────────────────────────── */
#collab-network {
    background: linear-gradient(145deg, #f0f9f9 0%, #e4f3f3 60%, #f0f9f9 100%);
    border: 1px solid rgba(5, 149, 152, 0.15);
    border-top: 3px solid var(--seed-teal);
    border-radius: var(--r-md);
    box-shadow: var(--sh-sm);
    padding: 2.5em 2em 2em;
    margin-top: 1.25em;
}

#collab-network h2.major span {
    background: linear-gradient(145deg, #f0f9f9 0%, #e4f3f3 100%);
}

#graph-container {
    width: 100%;
    height: 560px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.75);
    border-radius: var(--r-sm);
    border: 1px solid rgba(5, 149, 152, 0.1);
    box-shadow: inset 0 1px 4px rgba(1, 63, 84, 0.06), 0 2px 12px rgba(1, 63, 84, 0.07);
    overflow: hidden;
}

#graph-container svg {
    width: 100%;
    height: 100%;
    display: block;
}

.graph-caption {
    margin: 0.75em 0 0;
    font-size: 0.8em;
    color: #7a9aaa;
    font-style: italic;
    text-align: center;
}

@media screen and (max-width: 736px) {
    #collab-network {
        padding: 1.75em 1em 1.25em;
    }

    #graph-container {
        height: 380px;
    }
}

/* ── PUBLICATIONS COUNT BADGE ────────────────────────────────── */
#total-pubs-count {
    color: var(--seed-dark);
    font-weight: 700;
}

/* ── LATEST PUBLICATIONS SECTION ────────────────────────────── */
#latest-publications {
    background: linear-gradient(145deg, #f2fafa 0%, #e7f4f4 100%);
    border: 1px solid rgba(5, 149, 152, 0.14);
    border-radius: var(--r-md);
    box-shadow: var(--sh-sm);
}

.publication-item {
    border-left-color: var(--seed-teal);
    border-radius: var(--r-sm);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.publication-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--sh-md);
}

/* ── VIDEO SCROLL BUTTONS ─ flat arrow style (no oval) ───────── */
/*
   main.css gives these border-radius:50% + font-size:2rem inside a 45px
   circle → looks oval. We flatten them completely: square icon buttons
   with soft corners, explicit dimensions locked with !important to prevent
   the mobile `button { width:100% }` rule from inflating them.
*/
.scroll-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    padding: 0 !important;
    margin-bottom: 0 !important;
    border-radius: 6px !important;
    border: 1px solid rgba(5, 149, 152, 0.35) !important;
    background: rgba(255, 255, 255, 0.9) !important;
    color: var(--seed-teal) !important;
    font-size: 1.15rem !important;
    line-height: 1 !important;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08) !important;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease,
                box-shadow 0.2s ease !important;
}

.scroll-btn:hover {
    background: var(--seed-teal) !important;
    color: #fff !important;
    border-color: var(--seed-teal) !important;
    box-shadow: 0 3px 12px rgba(5, 149, 152, 0.28) !important;
    /* Preserve the absolute-positioning translateY(-50%) from main.css */
    transform: translateY(-50%) !important;
}

@media screen and (max-width: 736px) {
    .scroll-btn {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        font-size: 1rem !important;
    }
}

/* ── FOOTER ─────────────────────────────────────────────────── */
#footer {
    background: linear-gradient(180deg, #f2f8f8 0%, #ecf4f4 100%);
    border-top: 1px solid rgba(5, 149, 152, 0.1);
}

#footer h2.major span {
    background: linear-gradient(180deg, #f2f8f8 0%, #ecf4f4 100%);
}

/* Social icons */
ul.contact li a {
    border-radius: 50%;
    background: var(--seed-dark);
    transition: background 0.2s ease, transform 0.2s ease;
}

ul.contact li:hover a {
    transform: scale(1.08);
}

/* Copyright */
#copyright {
    background: rgba(5, 149, 152, 0.07);
    border: 1px solid rgba(5, 149, 152, 0.14);
    color: var(--seed-dark);
}

/* ── BANNER — RESPONSIVE OVERRIDES ───────────────────────────── */

/* Tablet: kill the exaggerated 14em padding */
@media screen and (max-width: 980px) {
    #banner {
        padding: calc(4.5em + 44px) 0 4.5em 0 !important;
    }

    #banner .content {
        padding: 3em 2.5em 3em;
    }

    #banner .content h2 {
        font-size: 1.9em !important;
    }

    #banner .content img {
        max-width: 130px;
        width: 130px;
    }
}

/* Mobile */
@media screen and (max-width: 736px) {
    #banner {
        padding: calc(3em + 44px) 0 3em 0 !important;
    }

    #banner .content {
        padding: 2.5em 1.5em 2.5em;
    }

    #banner .content h2 {
        font-size: 1.5em !important;
        letter-spacing: 0.02em;
    }

    #banner .content img {
        max-width: 90px;
        width: 90px;
    }

    #banner .content p {
        font-size: 0.88em;
        letter-spacing: 0.08em;
    }



    /* Video cards slightly narrower */
    .video-card {
        width: 250px !important;
    }

    /* Tighten main padding */
    #main {
        padding: 3em 0;
    }
}

/* Small phones */
@media screen and (max-width: 480px) {
    #banner .content h2 {
        font-size: 1.3em !important;
    }

    #banner .content img {
        max-width: 75px;
        width: 75px;
    }
}

/* ── FIX: gtr-200 gutter on mobile ──────────────────────────────
   main.css mobile rules target `.row` (specificity 0,1,0) but
   `.row.gtr-200` (0,2,0) wins, keeping the 100px gutter on every
   breakpoint.  We override here in homepage.css (loaded after
   main.css) at the same (0,2,0) specificity so cascade order wins.
   ─────────────────────────────────────────────────────────────── */
@media screen and (max-width: 736px) {
    .row.gtr-200 {
        margin-top:  -20px;
        margin-left: -20px;
    }
    .row.gtr-200 > * {
        padding: 20px 0 0 20px;
    }
    .row.gtr-200.gtr-uniform      { margin-top: -20px; }
    .row.gtr-200.gtr-uniform > *  { padding-top: 20px; }
}

@media screen and (max-width: 480px) {
    .row.gtr-200 {
        margin-top:  -15px;
        margin-left: -15px;
    }
    .row.gtr-200 > * {
        padding: 15px 0 0 15px;
    }
    .row.gtr-200.gtr-uniform      { margin-top: -15px; }
    .row.gtr-200.gtr-uniform > *  { padding-top: 15px; }
}

@media screen and (max-width: 360px) {
    .row.gtr-200 {
        margin-top:  -10px;
        margin-left: -10px;
    }
    .row.gtr-200 > * {
        padding: 10px 0 0 10px;
    }
    .row.gtr-200.gtr-uniform      { margin-top: -10px; }
    .row.gtr-200.gtr-uniform > *  { padding-top: 10px; }
}

/* ── SUBTLE PAGE ENTRY ANIMATION ─────────────────────────────── */
@keyframes seedReveal {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

#banner .content {
    animation: seedReveal 0.7s ease both;
}

