/* tanso.news - Wabi-Sabi Contemplative News */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --abyss: #0C1A28;
    --deep-current: #142838;
    --twilight: #2A5878;
    --bioluminescence: #48A8C8;
    --foam: #E0D8C8;
    --driftwood: #C8A070;
    --text-primary: #E0D8C8;
    --text-body: #C0B8A8;
    --text-muted: #6A7888;
}
body {
    background: var(--abyss);
    color: var(--text-primary);
    font-family: 'Libre Baskerville', serif;
    font-size: 1rem;
    line-height: 1.85;
    font-weight: 400;
    overflow-x: hidden;
}

/* Water Bubbles */
.bubbles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.bubble {
    position: absolute;
    width: var(--size);
    height: var(--size);
    left: var(--left);
    bottom: -60px;
    border-radius: 50%;
    border: 1px solid rgba(72,168,200,0.15);
    background: radial-gradient(circle at 30% 30%, rgba(72,168,200,0.08), transparent);
    animation: bubbleFloat var(--dur) ease-in-out var(--delay) infinite;
}
@keyframes bubbleFloat {
    0% { transform: translateY(0) translateX(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-110vh) translateX(20px); opacity: 0; }
}

/* Hero */
#hero {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    padding: 4rem 2rem;
}
.bio-glow {
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--bioluminescence), transparent 70%);
    opacity: 0.12;
    animation: glowPulse 4s ease-in-out infinite;
}
@keyframes glowPulse {
    0%, 100% { opacity: 0.12; transform: scale(1); }
    50% { opacity: 0.2; transform: scale(1.05); }
}
.hero-card {
    perspective: 800px;
}
.hero-title {
    font-family: 'Libre Baskerville', serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    color: var(--foam);
    animation: flipIn 0.8s ease forwards;
    transform-origin: center bottom;
}
@keyframes flipIn {
    from { transform: rotateX(90deg); opacity: 0; }
    to { transform: rotateX(0); opacity: 1; }
}
.hero-meta {
    font-family: 'Azeret Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 1rem;
    opacity: 0;
    animation: fadeIn 0.6s ease 0.8s forwards;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* News Grid */
.news-grid {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2rem;
    position: relative;
    z-index: 1;
}

/* News Cards */
.news-card {
    perspective: 800px;
    grid-column: span 4;
    transform: translate(var(--ox, 0), var(--oy, 0));
}
.news-card:nth-child(1) { grid-column: 1 / 6; }
.news-card:nth-child(2) { grid-column: 4 / 9; }
.news-card:nth-child(3) { grid-column: 1 / 5; }
.news-card:nth-child(4) { grid-column: 3 / 9; }
.news-card:nth-child(5) { grid-column: 1 / 6; }
.news-card:nth-child(6) { grid-column: 4 / 9; }

.card-flip {
    position: relative;
    width: 100%;
    min-height: 220px;
    transition: transform 0.6s ease;
    transform-style: preserve-3d;
    cursor: pointer;
}
.card-flip.flipped {
    transform: rotateY(180deg);
}
.card-front, .card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    padding: 2rem;
    border-radius: 4px 6px 3px 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15),
                0 8px 24px rgba(0,0,0,0.1),
                0 24px 48px rgba(0,0,0,0.05);
}
.card-front {
    background: var(--deep-current);
}
.card-back {
    background: var(--deep-current);
    transform: rotateY(180deg);
    display: flex;
    align-items: center;
}
.dateline {
    font-family: 'Azeret Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.75rem;
}
.card-headline {
    font-family: 'Libre Baskerville', serif;
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--foam);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}
.card-lede {
    font-size: 0.95rem;
    color: var(--text-body);
    line-height: 1.75;
    margin-bottom: 0.75rem;
}
.card-abstract {
    font-size: 0.9rem;
    color: var(--text-body);
    line-height: 1.8;
}

/* Section Animation */
.section {
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.section.visible {
    opacity: 1;
}

/* Footer */
#footer {
    text-align: center;
    padding: 3rem 2rem;
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(72,168,200,0.1);
}
.footer-text {
    font-family: 'Azeret Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.06em;
}

/* Responsive */
@media (max-width: 768px) {
    .news-grid {
        grid-template-columns: 1fr;
    }
    .news-card,
    .news-card:nth-child(1),
    .news-card:nth-child(2),
    .news-card:nth-child(3),
    .news-card:nth-child(4),
    .news-card:nth-child(5),
    .news-card:nth-child(6) {
        grid-column: 1 / -1;
        transform: none;
    }
    .card-front, .card-back {
        position: relative;
        inset: auto;
    }
    .card-back { display: none; }
    .card-flip.flipped .card-front { display: none; }
    .card-flip.flipped .card-back {
        display: block;
        transform: none;
    }
}
