/* ============================================================
   bada.news // The Aquarium Terminal
   Creamy-pastel wire-feed design. Dashed lines only.
   ============================================================ */

:root {
    --bleached-shell: #F5EDE0;
    --warm-parchment: #EDE3D0;
    --driftwood: #8A7E6B;
    --reef-sage: #9ECFCF;
    --coral-blush: #E8A0A0;
    --tide-ink: #3B3A36;
    --sea-glass: #B5D8C7;
    --phosphor-amber: #D4B483;
    --sand-line: #C2B8A3;
}

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

html {
    scroll-behavior: smooth;
    font-size: 17px;
    background-color: #F5EDE0;
}

body {
    background-color: var(--bleached-shell);
    color: var(--tide-ink);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    line-height: 1.7;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Typography helper */
.dm-mono {
    font-family: 'DM Mono', monospace;
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 0.02em;
}

/* ============================================================
   Wire Header
   ============================================================ */

.wire-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background-color: var(--bleached-shell);
    border-bottom: 1px dashed var(--driftwood);
    z-index: 100;
    display: flex;
    align-items: center;
}

.header-inner {
    width: 100%;
    max-width: 640px;
    margin-left: 30%;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.callsign {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--tide-ink);
    text-decoration: none;
    transition: color 220ms ease;
}

.callsign:hover {
    color: var(--driftwood);
}

.header-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.signal-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--phosphor-amber);
    box-shadow: 0 0 0 2px var(--bleached-shell), 0 0 0 3px var(--phosphor-amber);
    animation: signal-pulse 2s steps(1) infinite;
}

@keyframes signal-pulse {
    0%, 60% { opacity: 1; }
    61%, 100% { opacity: 0.25; }
}

.timestamp {
    font-family: 'DM Mono', monospace;
    font-weight: 400;
    font-size: 13px;
    color: var(--driftwood);
    white-space: nowrap;
}

.cursor-blink {
    color: var(--phosphor-amber);
    font-size: 14px;
    line-height: 1;
    animation: cursor-blink 1.6s steps(1) infinite;
}

@keyframes cursor-blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* ============================================================
   Fish Layer (persistent aquarium overlay)
   ============================================================ */

.fish-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    overflow: hidden;
}

.fish {
    position: absolute;
    width: 60px;
    height: auto;
    will-change: transform;
}

/* Foreground angelfish swimming right */
.fish-1 {
    top: 15%;
    width: 58px;
    opacity: 0.55;
    animation: swim-right 32s linear infinite, bob 3.2s ease-in-out infinite;
    animation-delay: -8s, 0s;
}

/* Midground clownfish swimming left */
.fish-2 {
    top: 40%;
    width: 66px;
    opacity: 0.4;
    animation: swim-left 38s linear infinite, bob 2.8s ease-in-out infinite;
    animation-delay: -15s, -1s;
}

/* Midground tang swimming right */
.fish-3 {
    top: 65%;
    width: 60px;
    opacity: 0.5;
    animation: swim-right 28s linear infinite, bob 3.5s ease-in-out infinite;
    animation-delay: -5s, -0.5s;
}

/* Background butterflyfish swimming left */
.fish-4 {
    top: 25%;
    width: 42px;
    opacity: 0.22;
    animation: swim-left 45s linear infinite, bob 4s ease-in-out infinite;
    animation-delay: -20s, -2s;
}

/* Foreground wrasse swimming right */
.fish-5 {
    top: 80%;
    width: 78px;
    opacity: 0.6;
    animation: swim-right 22s linear infinite, bob 2.5s ease-in-out infinite;
    animation-delay: -3s, -1.5s;
}

/* Slow seahorse drifting right */
.fish-6 {
    top: 50%;
    width: 36px;
    opacity: 0.35;
    animation: swim-right 50s linear infinite, bob 5s ease-in-out infinite;
    animation-delay: -25s, -3s;
}

/* Background angelfish swimming left */
.fish-7 {
    top: 72%;
    width: 48px;
    opacity: 0.25;
    animation: swim-left 35s linear infinite, bob 3.8s ease-in-out infinite;
    animation-delay: -12s, -2.5s;
}

/* Deep-background clownfish swimming right */
.fish-8 {
    top: 33%;
    width: 45px;
    opacity: 0.2;
    animation: swim-right 42s linear infinite, bob 4.2s ease-in-out infinite;
    animation-delay: -18s, -3.5s;
}

@keyframes swim-right {
    0% { transform: translateX(-120px) scale(1); }
    100% { transform: translateX(calc(100vw + 120px)) scale(1); }
}

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

@keyframes bob {
    0%, 100% { margin-top: 0; }
    50% { margin-top: -8px; }
}

/* Scale variation via per-fish specific rules to avoid clashing with translateX */
.fish-4 { transform-origin: center; }
.fish-5 svg, .fish-5 { }

/* Use width to fake scale differences so transform stays clean */

/* ============================================================
   Feed Stream
   ============================================================ */

.feed-stream {
    max-width: 640px;
    margin-left: 30%;
    padding: 120px 24px 60px;
    position: relative;
    z-index: 10;
}

/* Story Blocks */
.story-block {
    padding: 34px 0;
    transition: transform 280ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
}

.story-block:hover {
    transform: scale(1.008);
}

.story-block::after {
    content: '';
    position: absolute;
    right: -90px;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 70 45' xmlns='http://www.w3.org/2000/svg'><ellipse cx='35' cy='22' rx='28' ry='16' fill='%239ECFCF' stroke='%233B3A36' stroke-width='1.5'/><path d='M60 22 L70 15 L68 22 L70 29 Z' fill='%239ECFCF' stroke='%233B3A36' stroke-width='1.5'/><path d='M20 15 Q30 10 38 15' stroke='%238A7E6B' stroke-width='1.5' fill='none'/><circle cx='18' cy='22' r='2' fill='%233B3A36'/></svg>");
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 320ms ease, transform 320ms ease;
    pointer-events: none;
}

.story-block:hover::after {
    opacity: 0.35;
    transform: translate(8px, -50%);
}

.story-alt {
    background-color: var(--warm-parchment);
    margin-left: -24px;
    margin-right: -24px;
    padding-left: 24px;
    padding-right: 24px;
}

/* Dateline */
.dateline {
    margin-bottom: 10px;
    color: var(--driftwood);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.flash-tag {
    display: inline-block;
    background-color: var(--coral-blush);
    color: var(--tide-ink);
    padding: 2px 8px;
    margin-right: 6px;
    font-weight: 500;
    letter-spacing: 0.12em;
}

/* Slug Lines */
.slug-line {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 24px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.3;
    margin-bottom: 16px;
    color: var(--tide-ink);
}

.flash-slug {
    color: var(--coral-blush);
    font-size: 28px;
}

.story-flash {
    border-left: 3px dashed var(--coral-blush);
    padding-left: 18px;
}

/* Lede paragraphs */
.lede {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.7;
    color: var(--tide-ink);
    margin-bottom: 20px;
}

.transmission-note {
    font-family: 'DM Mono', monospace;
    font-size: 13px;
    color: var(--driftwood);
    line-height: 1.9;
    padding: 14px 18px;
    border: 1px dashed var(--sand-line);
    background-color: rgba(245, 237, 224, 0.6);
}

/* Wire Photos */
.wire-photo {
    width: 100%;
    aspect-ratio: 3 / 2;
    border: 1px dashed var(--driftwood);
    margin-top: 18px;
    overflow: hidden;
    position: relative;
    background-color: var(--bleached-shell);
}

.wire-photo svg {
    width: 100%;
    height: 100%;
    display: block;
}

.photo-caption {
    position: absolute;
    bottom: 6px;
    left: 8px;
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--tide-ink);
    background-color: rgba(245, 237, 224, 0.85);
    padding: 2px 6px;
    letter-spacing: 0.08em;
}

/* Wire Divider */
.wire-divider {
    border: none;
    border-top: 1px dashed var(--sand-line);
    margin: 0;
}

/* ============================================================
   Reef Footer
   ============================================================ */

.reef-footer {
    position: relative;
    min-height: 420px;
    overflow: hidden;
    z-index: 10;
    margin-top: 40px;
}

.footer-gradient {
    height: 300px;
    background: linear-gradient(
        to bottom,
        var(--bleached-shell) 0%,
        #DCE4D9 45%,
        var(--reef-sage) 100%
    );
}

.footer-scene {
    position: relative;
    height: 200px;
    background-color: var(--reef-sage);
    overflow: hidden;
}

/* Seaweed */
.seaweed {
    position: absolute;
    bottom: 0;
    width: 26px;
    height: 100px;
    transform-origin: bottom center;
}

.seaweed-1 {
    left: 8%;
    height: 110px;
    animation: sway 4s ease-in-out infinite;
}

.seaweed-2 {
    left: 22%;
    height: 85px;
    animation: sway 4.5s ease-in-out infinite;
    animation-delay: -1s;
}

.seaweed-3 {
    left: 40%;
    height: 120px;
    animation: sway 3.8s ease-in-out infinite;
    animation-delay: -2s;
}

.seaweed-4 {
    left: 58%;
    height: 90px;
    animation: sway 4.2s ease-in-out infinite;
    animation-delay: -0.5s;
}

.seaweed-5 {
    left: 74%;
    height: 95px;
    animation: sway 4.8s ease-in-out infinite;
    animation-delay: -3s;
}

.seaweed-6 {
    left: 88%;
    height: 105px;
    animation: sway 4.3s ease-in-out infinite;
    animation-delay: -1.5s;
}

@keyframes sway {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}

/* Coral */
.coral {
    position: absolute;
    bottom: 0;
}

.coral-1 {
    left: 30%;
    width: 110px;
    height: 60px;
}

.coral-2 {
    right: 12%;
    width: 85px;
    height: 50px;
}

.coral-3 {
    left: 50%;
    width: 65px;
    height: 45px;
}

/* Footer Fish */
.footer-fish {
    position: absolute;
    width: 62px;
    top: 30%;
    animation: swim-right 25s linear infinite, bob 3s ease-in-out infinite;
    animation-delay: -10s, 0s;
    opacity: 0.75;
}

/* Footer Text */
.footer-text {
    background-color: var(--reef-sage);
    padding: 30px 20px 44px;
    text-align: center;
    border-top: 1px dashed var(--driftwood);
}

.footer-tagline {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.08em;
    color: var(--tide-ink);
    margin-bottom: 12px;
    text-transform: lowercase;
}

.footer-credit {
    font-family: 'DM Mono', monospace;
    font-weight: 400;
    font-size: 12px;
    color: var(--tide-ink);
    letter-spacing: 0.08em;
    opacity: 0.8;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1200px) {
    .feed-stream {
        margin-left: 22%;
        margin-right: 5%;
    }
    .header-inner {
        margin-left: 22%;
    }
}

@media (max-width: 1024px) {
    .feed-stream {
        margin-left: 15%;
        margin-right: 5%;
    }
    .header-inner {
        margin-left: 15%;
    }
    .story-block::after {
        right: -70px;
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 768px) {
    .feed-stream {
        margin-left: 6%;
        margin-right: 6%;
        padding-top: 110px;
    }
    .header-inner {
        margin-left: 6%;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding-right: 12px;
    }
    .wire-header {
        height: auto;
        padding: 10px 0;
    }
    .callsign {
        font-size: 14px;
    }
    .timestamp {
        font-size: 11px;
    }
    .slug-line {
        font-size: 20px;
    }
    .flash-slug {
        font-size: 22px;
    }
    .story-block::after {
        display: none;
    }
    .story-alt {
        margin-left: -16px;
        margin-right: -16px;
        padding-left: 16px;
        padding-right: 16px;
    }
    .fish {
        opacity: 0.3 !important;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 16px;
    }
    .slug-line {
        font-size: 18px;
        letter-spacing: 0.06em;
    }
    .flash-slug {
        font-size: 20px;
    }
    .lede {
        font-size: 16px;
    }
}
