/* ============================================
   paragram.dev — Styles
   Neomorphic Aquarium Design
   ============================================ */

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

body {
    font-family: 'DM Sans', sans-serif;
    background: #e8ecf1;
    color: #4a5568;
    font-size: 16px;
    line-height: 1.7;
    overflow-x: hidden;
    /* Dot grid pattern */
    background-image: radial-gradient(circle, #d2d6db 1px, transparent 1px);
    background-size: 24px 24px;
    background-attachment: fixed;
}

/* --- Neomorphic Utility Classes --- */
.neo-raised {
    background: #e8ecf1;
    border-radius: 20px;
    box-shadow: 8px 8px 16px #c8ccd0, -8px -8px 16px #ffffff;
}

.neo-inset {
    background: #e2e8ec;
    border-radius: 12px;
    box-shadow: inset 4px 4px 8px #c8ccd0, inset -4px -4px 8px #ffffff;
}

/* --- Hero Section --- */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: grid;
    place-items: center;
    background: #e8ecf1;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #38b2ac 0%, #805ad5 50%, #48bb78 100%);
    opacity: 0.06;
    background-size: 300% 300%;
    animation: auroraShift 20s ease infinite;
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, #d2d6db 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.3;
}

@keyframes auroraShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.hero-title {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: clamp(3.5rem, 10vw, 8rem);
    color: #1a202c;
    letter-spacing: -0.02em;
    text-shadow: 2px 2px 4px #c8ccd0, -2px -2px 4px #ffffff;
    line-height: 1.1;
}

.hero-tagline {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: 1.2rem;
    color: #4a5568;
    margin-top: 1.5rem;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 1.5s ease 0.8s forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Angelfish Swimming --- */
.angelfish-swim {
    position: absolute;
    top: 60%;
    right: -100px;
    z-index: 3;
    animation: swimAcross 25s linear infinite;
}

@keyframes swimAcross {
    0% {
        transform: translateX(0) rotate(-2deg);
    }
    25% {
        transform: translateX(calc(-25vw - 40px)) rotate(3deg);
    }
    50% {
        transform: translateX(calc(-50vw - 80px)) rotate(-2deg);
    }
    75% {
        transform: translateX(calc(-75vw - 120px)) rotate(3deg);
    }
    100% {
        transform: translateX(calc(-100vw - 160px)) rotate(-2deg);
    }
}

/* --- Timeline Section --- */
.timeline-section {
    position: relative;
    padding: 100px 0 60px;
    min-height: 100vh;
}

.timeline {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 33%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #38b2ac;
}

/* --- Timeline Entry --- */
.timeline-entry {
    position: relative;
    display: flex;
    align-items: flex-start;
    margin-bottom: 200px;
    padding-left: 33%;
}

.timeline-entry:last-child {
    margin-bottom: 80px;
}

/* --- Timeline Node --- */
.timeline-node {
    position: absolute;
    left: 33%;
    top: 30px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #e8ecf1;
    box-shadow: 6px 6px 12px #c8ccd0, -6px -6px 12px #ffffff;
    transform: translateX(-50%);
    z-index: 5;
}

.timeline-entry.visible .timeline-node {
    animation: nodePulse 3s ease-in-out infinite;
}

@keyframes nodePulse {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.08); }
}

/* --- Timeline Card --- */
.timeline-card {
    margin-left: 40px;
    padding: 36px;
    width: min(55vw, 600px);
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.timeline-entry.visible .timeline-card {
    opacity: 1;
    transform: translateX(0);
}

.timeline-card h3 {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: #1a202c;
    margin-bottom: 12px;
}

.timeline-card p {
    font-size: 1rem;
    line-height: 1.7;
    color: #4a5568;
    margin-bottom: 16px;
}

/* --- Card Icon --- */
.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin-bottom: 16px;
}

/* --- Code Block --- */
.code-block {
    padding: 14px 18px;
    overflow-x: auto;
}

.code-block code {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    color: #2d3748;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

/* --- Clownfish Schools --- */
.clownfish-school {
    position: absolute;
    right: -60px;
    top: 20px;
    display: flex;
    gap: 8px;
    opacity: 0.7;
}

.clownfish-school.school-2 {
    right: auto;
    left: calc(33% - 80px);
    top: auto;
    bottom: -40px;
}

.clownfish {
    animation: clownSwim 12s ease-in-out infinite;
}

.cf1 { animation-delay: 0s; }
.cf2 { animation-delay: -2s; }
.cf3 { animation-delay: -4s; }
.cf4 { animation-delay: -1s; }
.cf5 { animation-delay: -3s; }

@keyframes clownSwim {
    0%, 100% { transform: translateY(0) translateX(0); }
    25% { transform: translateY(-8px) translateX(5px); }
    50% { transform: translateY(0) translateX(10px); }
    75% { transform: translateY(8px) translateX(5px); }
}

/* --- Betta Fish --- */
.betta-fish {
    position: absolute;
    left: calc(33% - 150px);
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.8;
}

.betta-tail {
    transform-origin: left center;
    animation: bettaFlow 4s ease-in-out infinite;
}

.betta-tail.t1 { animation-delay: 0s; }
.betta-tail.t2 { animation-delay: -0.5s; }
.betta-tail.t3 { animation-delay: -1s; }

@keyframes bettaFlow {
    0%, 100% { transform: scaleX(1) scaleY(1); }
    50% { transform: scaleX(1.1) scaleY(0.9); }
}

/* --- Coral Transition --- */
.coral-transition {
    position: relative;
    margin-top: -2px;
    line-height: 0;
    background: #e8ecf1;
}

.coral-transition svg {
    display: block;
}

/* --- Reef Floor (Footer) --- */
.reef-floor {
    position: relative;
    background: linear-gradient(180deg, #0d2b3e 0%, #1a0e2e 100%);
    padding: 100px 40px 60px;
    overflow: hidden;
    min-height: 50vh;
}

.reef-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.reef-content h2 {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: #e8ecf1;
    margin-bottom: 20px;
}

.reef-content > p {
    color: #c8ccd0;
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 30px;
}

.reef-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.reef-link {
    color: #38b2ac;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    padding: 10px 24px;
    border-radius: 12px;
    border: 1px solid rgba(56, 178, 172, 0.3);
    transition: background 0.3s, color 0.3s;
}

.reef-link:hover {
    background: #e9d8fd;
    color: #805ad5;
}

.reef-copyright {
    color: #4a5568;
    font-size: 0.85rem;
}

/* --- Discus Fish --- */
.discus {
    position: absolute;
    opacity: 0.5;
}

.discus-1 {
    bottom: 30%;
    left: -60px;
    animation: discusSwim1 18s linear infinite;
}

.discus-2 {
    bottom: 50%;
    right: -50px;
    animation: discusSwim2 22s linear infinite;
    animation-delay: -5s;
}

@keyframes discusSwim1 {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(100vw + 120px)); }
}

@keyframes discusSwim2 {
    0% { transform: translateX(0) scaleX(-1); }
    100% { transform: translateX(calc(-100vw - 120px)) scaleX(-1); }
}

.footer-angelfish {
    position: absolute;
    top: 20%;
    right: 15%;
    opacity: 0.3;
    animation: footerFishDrift 30s linear infinite;
}

@keyframes footerFishDrift {
    0% { transform: translateX(0) rotate(-3deg); }
    50% { transform: translateX(-200px) rotate(3deg); }
    100% { transform: translateX(0) rotate(-3deg); }
}

/* --- Shake Error Animation (for completeness) --- */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.shake-error {
    animation: shake 0.5s ease;
    box-shadow: 8px 8px 16px #c8ccd0, -8px -8px 16px #ffffff, 0 0 0 2px #fc8181;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .timeline::before {
        left: 20px;
    }

    .timeline-entry {
        padding-left: 50px;
    }

    .timeline-node {
        left: 20px;
    }

    .timeline-card {
        width: calc(100vw - 100px);
        margin-left: 20px;
    }

    .clownfish-school,
    .clownfish-school.school-2 {
        display: none;
    }

    .betta-fish {
        display: none;
    }
}
