/* ==========================================================================
   Biology theme for the public homepage (index.php)
   Floating cells & DNA in the hero, leaf-vine section dividers,
   biology icons on class cards, and the "Science of Life" facts strip.
   All decoration is inline SVG + CSS (no images, no extra libraries).
   ========================================================================== */

/* ─── Hero: floating micro-life layer ───────────────────────────────────── */
.bio-hero-layer {
    position: absolute;
    inset: 0;
    z-index: 1;            /* above the green overlay, below the text (z-index 2) */
    pointer-events: none;
    overflow: hidden;
}

.bio-float {
    position: absolute;
    color: #b8f27c;        /* pale leaf green, used via currentColor */
    opacity: 0.22;
    animation: bioDrift 18s ease-in-out infinite;
}
.bio-float svg { width: 100%; height: 100%; display: block; }

/* Positions / sizes / timing of each micro-organism */
.bio-f1 { width: 120px; height: 120px; top: 12%;  left: 6%;   animation-duration: 20s; }
.bio-f2 { width: 70px;  height: 70px;  top: 62%;  left: 12%;  animation-duration: 16s; animation-delay: -4s; color: #d8ffb0; }
.bio-f3 { width: 110px; height: 55px;  top: 22%;  right: 9%;  animation-duration: 22s; animation-delay: -8s; }
.bio-f4 { width: 90px;  height: 90px;  bottom: 30%; right: 16%; animation-duration: 19s; animation-delay: -2s; opacity: 0.18; }
.bio-f5 { width: 60px;  height: 60px;  top: 8%;   left: 44%;  animation-duration: 24s; animation-delay: -10s; opacity: 0.14; }
.bio-f6 { width: 80px;  height: 80px;  bottom: 38%; left: 32%; animation-duration: 21s; animation-delay: -6s; opacity: 0.12; }

@keyframes bioDrift {
    0%   { transform: translate(0, 0) rotate(0deg); }
    25%  { transform: translate(18px, -22px) rotate(8deg); }
    50%  { transform: translate(-10px, -38px) rotate(-6deg); }
    75%  { transform: translate(-22px, -12px) rotate(5deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

/* Cells gently "breathe" */
.bio-pulse { animation: bioPulse 6s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
@keyframes bioPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.06); }
}

/* ─── Hero: rotating DNA double helix ───────────────────────────────────── */
.bio-dna {
    position: absolute;
    top: 50%;
    width: 90px;
    height: 420px;
    margin-top: -210px;
    opacity: 0.35;
}
.bio-dna-left  { left: 2%; }
.bio-dna-right { right: 2%; transform: scaleY(-1); }
.bio-dna svg { width: 100%; height: 100%; overflow: visible; }

/* Each base pair spins around the helix axis: the bond line shrinks and the two
   bases slide past each other (staying round). Staggered delays (--d) create the twist. */
.bio-rung line,
.bio-rung circle {
    animation-duration: 4s;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    animation-delay: var(--d, 0s);
}
.bio-rung line {
    stroke: rgba(255, 255, 255, 0.55);
    stroke-width: 2;
    transform-box: fill-box;
    transform-origin: center;
    animation-name: bioTwist;
}
.bio-rung .bio-a { fill: #8cc63f; animation-name: bioSwapA; }   /* strand 1 */
.bio-rung .bio-b { fill: #e6ffd0; animation-name: bioSwapB; }   /* strand 2 */
@keyframes bioTwist {
    0%, 100% { transform: scaleX(1); }
    50%      { transform: scaleX(-1); }
}
@keyframes bioSwapA {
    0%, 100% { transform: translateX(0); }
    50%      { transform: translateX(60px); }
}
@keyframes bioSwapB {
    0%, 100% { transform: translateX(0); }
    50%      { transform: translateX(-60px); }
}

/* ─── Leaf-vine section dividers ────────────────────────────────────────── */
.bio-divider {
    position: relative;
    height: 90px;
    line-height: 0;
    background: var(--bio-from, #fff);
    overflow: hidden;
}
.bio-divider svg { width: 100%; height: 100%; display: block; }
.bio-divider .bio-wave  { fill: var(--bio-to, #f8f9fa); }
.bio-divider .bio-vine  { fill: none; stroke: #4f9a2c; stroke-width: 2.5; stroke-linecap: round; }
.bio-divider .bio-tendril { fill: none; stroke: #6fb33d; stroke-width: 1.6; stroke-linecap: round; }
.bio-divider .bio-leaf  { fill: #8cc63f; transform-box: fill-box; transform-origin: 0% 50%; animation: bioSway 5s ease-in-out infinite; }
.bio-divider .bio-leaf.bio-dark { fill: #4f9a2c; }
.bio-divider .bio-leaf-vein { stroke: rgba(0, 60, 25, 0.35); stroke-width: 0.8; fill: none; }
.bio-divider .bio-bud   { fill: #f6c945; }
.bio-divider .bio-leaf:nth-of-type(2n) { animation-delay: -1.5s; }
.bio-divider .bio-leaf:nth-of-type(3n) { animation-delay: -3s; }
@keyframes bioSway {
    0%, 100% { transform: rotate(0deg); }
    50%      { transform: rotate(9deg); }
}

/* "The Teacher's Message" heading reuses .hero-title, which landing.css forces to white
   (!important) - invisible on the white About section. Give it the brand green there. */
.director-section .hero-title { color: var(--primary, #006838) !important; }

/* ─── Class cards: biology icon + growing leaf on hover ─────────────────── */
.course-card { position: relative; }
.bio-card-icon {
    position: absolute;
    right: 20px;
    bottom: -26px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--white, #fff);
    color: var(--primary, #006838);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: 0 8px 20px rgba(0, 104, 56, 0.18);
    border: 3px solid #e8f6dc;
    transition: transform 0.4s ease;
    z-index: 2;
}
.bio-card-icon svg { width: 32px; height: 32px; }
.course-card:hover .bio-card-icon { transform: rotate(-12deg) scale(1.08); }
.course-card .card-body { position: relative; }

/* Soft "petri dish" dots behind the card text */
.course-card .card-body::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(140, 198, 63, 0.10) 1.5px, transparent 1.6px);
    background-size: 18px 18px;
    pointer-events: none;
}
.course-card .card-body > * { position: relative; }

/* A small leaf sprouts in the corner on hover */
.course-card::after {
    content: "";
    position: absolute;
    left: 14px;
    bottom: 14px;
    width: 34px;
    height: 34px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M4 36 C 6 18 18 6 36 4 C 34 22 22 34 4 36 Z' fill='%238cc63f'/%3E%3Cpath d='M4 36 L 26 14' stroke='%23006838' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / contain;
    transform: scale(0) rotate(-40deg);
    transform-origin: bottom left;
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}
.course-card:hover::after { transform: scale(1) rotate(0deg); }

/* ─── "The Science of Life" facts strip ─────────────────────────────────── */
.bio-facts {
    position: relative;
    padding: 70px 0 80px;
    /* Solid #003d20 at the edges (matches the dividers) with a soft glow inside */
    /* "closest-side" makes each glow fade out before it reaches the top/bottom edge */
    background:
        radial-gradient(ellipse closest-side at 25% 50%, rgba(34, 130, 64, 0.55), transparent),
        radial-gradient(ellipse closest-side at 80% 50%, rgba(140, 198, 63, 0.16), transparent),
        #003d20;
    color: #fff;
    overflow: hidden;
}
.bio-facts > .container { position: relative; z-index: 1; }
.bio-facts .bio-float { opacity: 0.10; }
.bio-facts .bio-f4 { top: auto; bottom: 6%; right: 3%; }   /* keep clear of the fact cards */
.bio-facts-eyebrow {
    color: #b8f27c;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.85rem;
}
.bio-facts h2 { color: #fff; }
.bio-facts-sub { color: rgba(255, 255, 255, 0.75); max-width: 640px; margin: 0 auto; }

.bio-fact {
    height: 100%;
    text-align: center;
    padding: 30px 20px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(184, 242, 124, 0.18);
    transition: transform 0.3s ease, background 0.3s ease;
}
.bio-fact:hover { transform: translateY(-6px); background: rgba(255, 255, 255, 0.10); }
.bio-fact-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: rgba(140, 198, 63, 0.18);
    color: #b8f27c;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}
.bio-fact-icon svg { width: 38px; height: 38px; }
.bio-fact-value {
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1.1;
    color: #fff;
}
.bio-fact-unit { font-size: 1.1rem; font-weight: 600; color: #b8f27c; margin-left: 4px; }
.bio-fact-label { color: rgba(255, 255, 255, 0.78); margin: 8px 0 0; font-size: 0.95rem; }

/* ─── Small screens ─────────────────────────────────────────────────────── */
@media (max-width: 991px) {
    .bio-dna { display: none; }               /* keep the hero text clear */
    .bio-f4, .bio-f5, .bio-f6 { display: none; }
    .bio-divider { height: 60px; }
    .bio-fact-value { font-size: 2.1rem; }
}

/* ─── Respect "reduce motion" device settings ───────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .bio-float, .bio-pulse, .bio-rung line, .bio-rung circle, .bio-divider .bio-leaf { animation: none !important; }
    .course-card::after { transition: none; }
}

/* ==========================================================================
   About the Teacher (homepage #about)
   Photo inside a "cell": slowly turning dashed membrane + orbiting organelles.
   ========================================================================== */
.bio-about-photo {
    position: relative;
    width: 100%;
    max-width: 440px;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    padding: 30px;
}
.bio-about-img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 22%;
    border-radius: 50%;
    border: 6px solid #fff;
    box-shadow: 0 18px 40px rgba(0, 77, 42, 0.25);
}
.bio-about-ring {
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    border: 2px dashed rgba(0, 146, 69, 0.45);
    animation: bioSpin 50s linear infinite;
}
.bio-about-orbit {
    position: absolute;
    inset: 0;
    animation: bioSpin 22s linear infinite;
}
.bio-about-orbit span {
    position: absolute;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.bio-about-orbit span:nth-child(1) { width: 18px; height: 18px; top: 2px; left: 50%; margin-left: -9px; background: #8cc63f; }
.bio-about-orbit span:nth-child(2) { width: 12px; height: 12px; bottom: 18%; right: 2px; background: #f6c945; }
.bio-about-orbit span:nth-child(3) { width: 14px; height: 14px; bottom: 14%; left: 4px; background: #f4a3c4; }
@keyframes bioSpin { to { transform: rotate(360deg); } }

.bio-about-badge {
    position: absolute;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(0, 43, 23, 0.16);
    line-height: 1.2;
}
.bio-about-badge i {
    width: 38px; height: 38px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: #e8f6dc;
    color: var(--primary, #006838);
    font-size: 1.15rem;
}
.bio-about-badge b { display: block; color: var(--text-dark, #1a2b21); font-size: 0.95rem; }
.bio-about-badge span { color: var(--text-muted, #5a7063); font-size: 0.78rem; }
.bio-about-badge-1 { left: -6px; bottom: 9%; }
.bio-about-badge-2 { right: -6px; top: 10%; }

.bio-about-role { color: var(--primary, #006838); font-weight: 600; margin-bottom: 14px; }
.bio-about-quote {
    position: relative;
    margin: 0 0 24px;
    padding: 18px 20px 18px 54px;
    border-radius: 16px;
    background: #f4f9f4;
    border-left: 4px solid var(--secondary, #8cc63f);
}
.bio-about-quote i {
    position: absolute;
    left: 14px; top: 8px;
    font-size: 2rem;
    color: var(--secondary, #8cc63f);
}
.bio-about-quote p { margin: 0; font-style: italic; color: #2f4a3a; }

.bio-about-feature {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    height: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid #e3f0dc;
    transition: border-color 0.25s, transform 0.25s;
}
.bio-about-feature:hover { border-color: var(--secondary, #8cc63f); transform: translateY(-2px); }
.bio-about-feature i {
    width: 40px; height: 40px;
    flex-shrink: 0;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: #e8f6dc;
    color: var(--primary, #006838);
    font-size: 1.2rem;
}
.bio-about-feature b { display: block; color: var(--text-dark, #1a2b21); }
.bio-about-feature span { color: var(--text-muted, #5a7063); font-size: 0.88rem; }

@media (max-width: 576px) {
    .bio-about-photo { max-width: 320px; padding: 22px; }
    .bio-about-badge { padding: 8px 10px; }
    .bio-about-badge i { width: 30px; height: 30px; font-size: 0.95rem; }
    .bio-about-badge b { font-size: 0.85rem; }
    .bio-about-badge-1 { left: -4px; }
    .bio-about-badge-2 { right: -4px; }
}

/* ==========================================================================
   Footer: canvas animation (assets/js/bio-footer.js) behind the content
   ========================================================================== */
.bio-footer {
    position: relative;
    overflow: hidden;
    padding-top: 110px;
}
.bio-footer-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}
.bio-footer > .container { position: relative; z-index: 1; }

@media (prefers-reduced-motion: reduce) {
    .bio-about-ring, .bio-about-orbit { animation: none; }
    .bio-about-feature { transition: none; }
}
