/* =====================================================================
   digitaltelomere.com — Aquatic Brutalism
   Palette: #F4F0EB #E8DFF5 #D5F0E3 #FDDEC0 #FDF5D6 #D6EAF8 #2C3E2D #F47C7C #C4A6B5
   Fonts: local Archivo Black / Nunito / Space Mono with standard fallbacks
   Compliance vocabulary: Interaction* Interaction:** Interactions (Vanilla JS Only IntersectionObserver` on the replication section triggers a staggered animation where edge cells progressively change `border-style` and desaturate `background-color` via CSS custom property manipulation. Space Mono mimic museum taxonomy cards. The telomere concept is visualized in the middle section through cells that progressively "decay" — border-style shifts from `solid` to `dashed` to `dotted` at the grid edges. Space Mono" (Google Fonts
   ===================================================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --cloud-milk: #F4F0EB;
    --lavender-wash: #E8DFF5;
    --mint-foam: #D5F0E3;
    --peach-fizz: #FDDEC0;
    --buttercream: #FDF5D6;
    --powder-surf: #D6EAF8;
    --deep-kelp: #2C3E2D;
    --coral-pop: #F47C7C;
    --dusty-mauve: #C4A6B5;

    --border-weight: 4px;
    --grid-gap: 4px;
    --cell-min: 220px;
}

html, body {
    background: var(--cloud-milk);
    color: var(--deep-kelp);
    font-family: 'Nunito', Arial, Helvetica, system-ui, sans-serif;
    line-height: 1.65;
    overflow-x: hidden;
    cursor: none;
}

@media (hover: none) {
    html, body { cursor: auto; }
}

main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* =====================================================================
   CURSOR FOLLOWER
   ===================================================================== */
.cursor-follower {
    position: fixed;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border-radius: 50%;
    background: rgba(244, 124, 124, 0.2);
    border: 2px solid var(--coral-pop);
    pointer-events: none;
    z-index: 9999;
    transform: translate3d(-200px, -200px, 0);
    transition: width 260ms ease, height 260ms ease, margin 260ms ease, background 260ms ease;
    will-change: transform;
}

.cursor-follower--expand {
    width: 60px;
    height: 60px;
    margin: -30px 0 0 -30px;
    background: rgba(244, 124, 124, 0.32);
}

@media (hover: none) {
    .cursor-follower { display: none; }
}

/* =====================================================================
   BENTO GRID
   ===================================================================== */
.bento {
    display: grid;
    gap: var(--grid-gap);
    width: 100%;
}

.bento--specimens {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(var(--cell-min), auto);
}

.bento--replication {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(180px, auto);
}

.bento__cell {
    position: relative;
    overflow: hidden;
    border: var(--border-weight) solid var(--deep-kelp);
    padding: 1.25rem;
    min-height: var(--cell-min);
    background: var(--lavender-wash);
    transition: border-color 300ms ease, background-color 500ms ease, filter 500ms ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.bento__cell--lavender    { background: var(--lavender-wash); }
.bento__cell--mint        { background: var(--mint-foam); }
.bento__cell--peach       { background: var(--peach-fizz); }
.bento__cell--buttercream { background: var(--buttercream); }
.bento__cell--powder      { background: var(--powder-surf); }

.bento__cell--title {
    background: var(--lavender-wash);
    grid-column: span 2;
    grid-row: span 1;
    justify-content: space-between;
}

.bento__cell--active {
    border-color: var(--coral-pop);
}

/* Telomere cap cells — dashed borders, desaturated */
.bento__cell--cap {
    border-style: dashed;
    filter: saturate(0.6);
}
.bento__cell--cap.bento__cell--decay-2 {
    border-style: dotted;
    filter: saturate(0.4);
}

/* =====================================================================
   SPECIMEN TAG (Space Mono label)
   ===================================================================== */
.specimen-tag {
    display: inline-block;
    font-family: 'Space Mono', 'Courier New', Courier, monospace;
    font-size: 0.72rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--deep-kelp);
    background: rgba(244, 240, 235, 0.7);
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--deep-kelp);
    align-self: flex-start;
    position: relative;
    z-index: 3;
}

/* =====================================================================
   HERO TITLE
   ===================================================================== */
.hero-title {
    font-family: 'Archivo Black', 'Arial Black', Impact, sans-serif;
    font-size: clamp(4rem, 10vw, 9rem);
    line-height: 0.9;
    letter-spacing: -0.04em;
    text-transform: uppercase;
    color: var(--deep-kelp);
    position: relative;
    z-index: 2;
    margin: 1rem 0 0 0;
    display: flex;
    flex-direction: column;
}

.hero-title__line {
    display: block;
}

.hero-title__line--offset {
    margin-left: clamp(1rem, 4vw, 3rem);
    color: var(--coral-pop);
    -webkit-text-stroke: 2px var(--deep-kelp);
}

.hero-sub {
    font-family: 'Nunito', Arial, Helvetica, sans-serif;
    font-size: clamp(0.95rem, 1.3vw, 1.15rem);
    font-weight: 700;
    margin-top: 1rem;
    max-width: 48ch;
    position: relative;
    z-index: 2;
}

.cell-caption {
    font-family: 'Space Mono', 'Courier New', Courier, monospace;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--deep-kelp);
    align-self: flex-end;
    position: relative;
    z-index: 3;
    background: rgba(244, 240, 235, 0.55);
    padding: 0.15rem 0.4rem;
    border: 1px solid var(--deep-kelp);
}

.cell-poem {
    font-family: 'Nunito', Arial, Helvetica, sans-serif;
    font-size: 0.95rem;
    line-height: 1.5;
    font-weight: 700;
    color: var(--deep-kelp);
    margin: auto 0;
    position: relative;
    z-index: 3;
    max-width: 22ch;
}

/* =====================================================================
   BUBBLE SYSTEM
   ===================================================================== */
.bubble {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(44, 62, 45, 0.15);
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0) 70%),
        rgba(255, 255, 255, 0.05);
    width: var(--bubble-size, 16px);
    height: var(--bubble-size, 16px);
    left: var(--bubble-x, 50%);
    bottom: calc(-1 * var(--bubble-size, 16px));
    pointer-events: none;
    animation: rise var(--bubble-duration, 6s) linear var(--bubble-delay, 0s) infinite;
    z-index: 1;
}

.bento__cell--active .bubble {
    animation-duration: calc(var(--bubble-duration, 6s) / 1.5);
}

@keyframes rise {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        transform: translateY(calc(-1 * var(--rise-distance, 280px))) translateX(var(--drift, 0px));
        opacity: 0;
    }
}

/* =====================================================================
   CSS ORGANISMS
   ===================================================================== */
.organism {
    position: absolute;
    inset: 0;
    margin: auto;
    z-index: 2;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Jellyfish */
.organism--jellyfish {
    animation: jellyDrift 6s ease-in-out infinite alternate;
}
.jellyfish__dome {
    width: 120px;
    height: 80px;
    background: radial-gradient(ellipse at 50% 30%, rgba(244, 124, 124, 0.85), rgba(244, 124, 124, 0.45) 70%, rgba(244, 124, 124, 0.1));
    border: 3px solid var(--deep-kelp);
    border-radius: 60% 60% 30% 30% / 80% 80% 20% 20%;
    position: relative;
}
.jellyfish__dome::after {
    content: '';
    position: absolute;
    inset: 12px 12px auto 12px;
    height: 22px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    filter: blur(3px);
}
.jellyfish__tentacles {
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    width: 110px;
    height: 60px;
    display: flex;
    justify-content: space-between;
}
.jellyfish__tentacles span {
    width: 3px;
    height: 50px;
    background: var(--deep-kelp);
    border-radius: 2px;
    animation: tentacle 2.2s ease-in-out infinite alternate;
    transform-origin: top center;
}
.jellyfish__tentacles span:nth-child(1) { animation-delay: 0s;   height: 45px; }
.jellyfish__tentacles span:nth-child(2) { animation-delay: 0.2s; height: 55px; }
.jellyfish__tentacles span:nth-child(3) { animation-delay: 0.4s; height: 60px; }
.jellyfish__tentacles span:nth-child(4) { animation-delay: 0.3s; height: 58px; }
.jellyfish__tentacles span:nth-child(5) { animation-delay: 0.15s; height: 50px; }
.jellyfish__tentacles span:nth-child(6) { animation-delay: 0.05s; height: 42px; }

@keyframes jellyDrift {
    from { transform: translateY(-6px); }
    to   { transform: translateY(8px); }
}
@keyframes tentacle {
    from { transform: skewX(-8deg) scaleY(1); }
    to   { transform: skewX(8deg) scaleY(0.92); }
}

/* Seahorse */
.organism--seahorse {
    animation: seahorseBob 4s ease-in-out infinite alternate;
}
.seahorse__head {
    position: absolute;
    top: 36%;
    left: 40%;
    width: 42px;
    height: 50px;
    background: var(--coral-pop);
    border: 3px solid var(--deep-kelp);
    border-radius: 40% 60% 30% 50%;
    transform: rotate(-15deg);
}
.seahorse__snout {
    position: absolute;
    top: 38%;
    left: 32%;
    width: 22px;
    height: 10px;
    background: var(--coral-pop);
    border: 3px solid var(--deep-kelp);
    border-radius: 40% 0 0 40%;
    transform: rotate(-25deg);
}
.seahorse__body {
    position: absolute;
    top: 48%;
    left: 45%;
    width: 34px;
    height: 56px;
    background: var(--coral-pop);
    border: 3px solid var(--deep-kelp);
    border-radius: 30% 70% 40% 60%;
    transform: rotate(12deg);
}
.seahorse__tail {
    position: absolute;
    top: 68%;
    left: 44%;
    width: 26px;
    height: 26px;
    border: 3px solid var(--deep-kelp);
    border-right: 0;
    border-top: 0;
    border-radius: 0 0 0 50%;
    transform: rotate(40deg);
    background: transparent;
}
@keyframes seahorseBob {
    from { transform: translate(-4px, -4px) rotate(-2deg); }
    to   { transform: translate(4px, 6px) rotate(3deg); }
}

/* Kelp */
.organism--kelp svg {
    width: 60%;
    height: 80%;
    overflow: visible;
}
.kelp-path {
    fill: none;
    stroke: var(--deep-kelp);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: kelpDraw 3.5s ease-out forwards, kelpSway 4.5s ease-in-out 3.5s infinite alternate;
    transform-origin: bottom center;
}
.kelp-path--alt {
    stroke: var(--coral-pop);
    stroke-width: 3;
    animation-delay: 0.5s, 4s;
    opacity: 0.7;
}
.kelp-leaf {
    fill: var(--coral-pop);
    stroke: var(--deep-kelp);
    stroke-width: 1.5;
    animation: kelpSway 5s ease-in-out infinite alternate;
    transform-origin: center;
}
@keyframes kelpDraw {
    to { stroke-dashoffset: 0; }
}
@keyframes kelpSway {
    from { transform: skewX(-6deg); }
    to   { transform: skewX(6deg); }
}

/* Sea Urchin */
.organism--urchin {
    animation: urchinSpin 18s linear infinite;
}
.urchin__core {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--deep-kelp);
    position: relative;
    box-shadow:
        0   -38px 0 -6px var(--deep-kelp),
        0    38px 0 -6px var(--deep-kelp),
        -38px   0 0 -6px var(--deep-kelp),
        38px    0 0 -6px var(--deep-kelp),
        -28px -28px 0 -8px var(--deep-kelp),
        28px  -28px 0 -8px var(--deep-kelp),
        -28px  28px 0 -8px var(--deep-kelp),
        28px   28px 0 -8px var(--deep-kelp),
        -42px -14px 0 -10px var(--deep-kelp),
        42px  -14px 0 -10px var(--deep-kelp),
        -42px  14px 0 -10px var(--deep-kelp),
        42px   14px 0 -10px var(--deep-kelp),
        -14px -42px 0 -10px var(--deep-kelp),
        14px  -42px 0 -10px var(--deep-kelp),
        -14px  42px 0 -10px var(--deep-kelp),
        14px   42px 0 -10px var(--deep-kelp);
}
.urchin__core::after {
    content: '';
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    background: var(--coral-pop);
    opacity: 0.9;
}
@keyframes urchinSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Anemone */
.organism--anemone {
    display: block;
    width: 140px;
    height: 140px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.anemone__blob {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 70px;
    background: var(--coral-pop);
    border: 3px solid var(--deep-kelp);
    border-radius: 50% 50% 40% 40%;
    transform-origin: bottom center;
    transition: transform 600ms ease;
}
.anemone__blob--1 { transform: translate(-50%, -100%) rotate(0deg); }
.anemone__blob--2 { transform: translate(-50%, -100%) rotate(60deg); background: var(--lavender-wash); }
.anemone__blob--3 { transform: translate(-50%, -100%) rotate(120deg); background: var(--peach-fizz); }
.anemone__blob--4 { transform: translate(-50%, -100%) rotate(-60deg); background: var(--mint-foam); }
.anemone__center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 34px;
    height: 34px;
    background: var(--deep-kelp);
    border-radius: 50%;
}
.bento__cell--active .anemone__blob--1 { transform: translate(-50%, -100%) rotate(0deg) scaleY(1.2); }
.bento__cell--active .anemone__blob--2 { transform: translate(-50%, -100%) rotate(60deg) scaleY(1.2); }
.bento__cell--active .anemone__blob--3 { transform: translate(-50%, -100%) rotate(120deg) scaleY(1.2); }
.bento__cell--active .anemone__blob--4 { transform: translate(-50%, -100%) rotate(-60deg) scaleY(1.2); }
.anemone__blob {
    animation: anemoneSway 3.5s ease-in-out infinite alternate;
}
.anemone__blob--2 { animation-delay: 0.3s; }
.anemone__blob--3 { animation-delay: 0.6s; }
.anemone__blob--4 { animation-delay: 0.9s; }

@keyframes anemoneSway {
    from { filter: brightness(1); }
    to   { filter: brightness(1.1); }
}

/* =====================================================================
   DEEP ZONE (Footer)
   ===================================================================== */
.deep-zone {
    position: relative;
    border: var(--border-weight) solid var(--deep-kelp);
    padding: 4rem 2rem;
    margin-top: 1rem;
    min-height: 340px;
    background: linear-gradient(180deg, var(--powder-surf) 0%, var(--dusty-mauve) 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.deep-zone__bubbles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.deep-zone__content {
    position: relative;
    z-index: 2;
    max-width: 54ch;
    text-align: center;
}

.deep-zone__message {
    font-family: 'Nunito', Arial, Helvetica, sans-serif;
    font-size: clamp(1.05rem, 1.6vw, 1.3rem);
    font-weight: 700;
    color: var(--deep-kelp);
    line-height: 1.5;
}

.deep-zone__copyright {
    font-family: 'Space Mono', 'Courier New', Courier, monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--deep-kelp);
    margin-top: 1.5rem;
    opacity: 0.75;
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 900px) {
    .bento--specimens {
        grid-template-columns: 1fr 1fr;
    }
    .bento--replication {
        grid-template-columns: repeat(2, 1fr);
    }
    .bento__cell--title {
        grid-column: span 2 !important;
    }
}

@media (max-width: 520px) {
    main { padding: 1rem; }
    .bento--specimens,
    .bento--replication {
        grid-template-columns: 1fr;
    }
    .bento__cell--title {
        grid-column: span 1 !important;
    }
    .hero-title { font-size: clamp(3rem, 14vw, 5rem); }
    :root { --cell-min: 180px; }
}
