/* ============================================================
   nanohana.stream — Ocean Deep × Anti-Design
   Palette: #0A1628 #0D2137 #00B4CC #7FFFD4 #00FFD1 #F0FFFC #B2EDE7 #003D4F
   Fonts: Nunito (800/700/600), Nunito Sans (400)
   ============================================================ */

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

:root {
    --abyss:       #0A1628;
    --trench:      #0D2137;
    --teal:        #00B4CC;
    --frame-teal:  #00CED1;
    --riptide:     #7FFFD4;
    --bio:         #00FFD1;
    --white:       #F0FFFC;
    --mist:        #B2EDE7;
    --kelp:        #003D4F;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--abyss);
    color: var(--white);
    font-family: 'Nunito Sans', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    overflow-x: hidden;
    padding: 0;
    margin: 0;
}

/* --- Drifting Leaf Fixtures (fixed, always visible) --------- */
@keyframes floatLeaf {
    0%   { transform: translate(-10vw, 110vh) rotate(-20deg); }
    100% { transform: translate(110vw, -10vh) rotate(15deg); }
}

.leaf-float-1 {
    position: fixed;
    z-index: 5;
    pointer-events: none;
    width: 80px;
    opacity: 0.12;
    animation: floatLeaf 28s linear infinite;
    bottom: 0;
    left: 0;
}

.leaf-float-2 {
    position: fixed;
    z-index: 5;
    pointer-events: none;
    width: 52px;
    opacity: 0.09;
    animation: floatLeaf 34s linear infinite reverse;
    animation-delay: -17s;
    bottom: 0;
    left: 0;
}

/* --- Section Labels ----------------------------------------- */
.section-label {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--bio);
}

/* ============================================================
   SECTION 1 — The Signal (Hero)
   Violation: Text overflows into the video frame
   ============================================================ */
.section-hero {
    background-color: var(--trench);
    position: relative;
    height: 100vh;
    overflow: hidden;
}

/* Leaf-clip boundary at section bottom */
.section-hero::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 80px;
    background: var(--abyss);
    clip-path: polygon(0 100%, 100% 100%, 100% 40%, 85% 0%, 50% 20%, 15% 0%, 0 40%);
    z-index: 20;
}

.stream-frame {
    width: 80vw;
    height: 80vh;
    position: absolute;
    left: 15vw;
    top: 10vh;
    border: 3px solid #00CED1;
    z-index: 2;
    background: var(--abyss);
    overflow: hidden;
}

.stream-inner {
    position: relative;
    width: 100%;
    height: 100%;
}

.stream-placeholder {
    width: 100%;
    height: 100%;
}

.stream-svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Live indicator — sonar ping */
.live-indicator {
    position: absolute;
    top: 18px;
    left: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10;
}

.live-dot {
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bio);
    position: relative;
    flex-shrink: 0;
}

@keyframes sonarRing {
    0%   { transform: scale(1);   opacity: 0.8; }
    100% { transform: scale(2.5); opacity: 0; }
}

.live-ring {
    display: block;
    position: absolute;
    border-radius: 50%;
    border: 1.5px solid var(--bio);
    pointer-events: none;
    left: 0;
    top: 0;
}

.live-indicator {
    position: absolute;
    top: 18px;
    left: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10;
}

/* Dot + rings container */
.live-indicator .live-dot,
.live-indicator .live-ring {
    position: absolute;
}

.live-indicator {
    position: absolute;
    top: 18px;
    left: 18px;
    z-index: 10;
}

/* Restructure live indicator */
.live-indicator {
    position: absolute;
    top: 18px;
    left: 18px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 12px;
}

.live-pulse-wrap {
    position: relative;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.live-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bio);
}

.live-ring-outer {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    margin-top: -5px;
    margin-left: -5px;
    border-radius: 50%;
    border: 1.5px solid var(--bio);
    animation: sonarRing 2s ease-out infinite;
}

.live-ring-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    margin-top: -5px;
    margin-left: -5px;
    border-radius: 50%;
    border: 1px solid var(--bio);
    animation: sonarRing 2s ease-out infinite;
    animation-delay: -1s;
}

.live-label {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.15em;
    color: var(--bio);
    text-transform: uppercase;
}

.stream-location {
    position: absolute;
    bottom: 14px;
    right: 16px;
    font-family: 'Nunito', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--mist);
    opacity: 0.8;
}

/* Hero title — anti-design: overlaps the video frame */
.hero-title-block {
    position: absolute;
    right: 0;
    top: 20vh;
    width: 28vw;
    z-index: 10;
    padding-right: 2vw;
}

.hero-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: clamp(32px, 5vw, 96px);
    color: var(--white);
    transform: rotate(-4deg);
    transform-origin: right center;
    line-height: 1.05;
    /* Anti-design violation: left bleeding into the frame */
    margin-left: -40px;
    position: relative;
    left: -40px;
    word-break: break-all;
}

.title-dot {
    color: var(--bio);
}

.hero-sub {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 14px;
    color: var(--mist);
    margin-top: 12px;
    letter-spacing: 0.05em;
    padding-left: 4px;
    opacity: 0.85;
}

/* ============================================================
   SECTION 2 — Now Live (Feed Grid)
   Violation: Left/right thumbnails bleed past viewport
   ============================================================ */
.section-feed {
    background-color: var(--abyss);
    position: relative;
    padding: 80px 0;
    overflow: hidden;
}

.section-feed::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 70px;
    background: var(--kelp);
    clip-path: polygon(0 100%, 100% 100%, 100% 50%, 85% 5%, 50% 25%, 15% 5%, 0 50%);
    z-index: 2;
}

.feed-header {
    padding: 0 40px 20px 40px;
    position: relative;
    z-index: 3;
}

.feed-grid {
    display: flex;
    align-items: flex-start;
    gap: 0;
    /* Overflow hidden on parent to clip bleeding thumbs */
    overflow: hidden;
    position: relative;
    z-index: 3;
}

.feed-item {
    flex: 1;
    position: relative;
}

/* Left thumbnail bleeds 40px past left edge */
.feed-left {
    margin-left: -40px;
}

/* Right thumbnail bleeds 40px past right edge */
.feed-right {
    margin-right: -40px;
}

/* Center thumbnail is taller */
.feed-center .thumb-inner {
    height: 280px;
}

.feed-left .thumb-inner,
.feed-right .thumb-inner {
    height: 240px;
}

.thumb-inner {
    position: relative;
    overflow: hidden;
    clip-path: polygon(0 0, 100% 0, 100% 90%, 85% 100%, 50% 95%, 15% 100%, 0 90%);
    background: var(--trench);
}

.thumb-svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Stream titles — anti-design: overlap top boundary with negative margin */
.thumb-label {
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--riptide);
    background: linear-gradient(to bottom, rgba(13,33,55,0.85) 0%, transparent 100%);
    padding: 10px 14px 24px;
    margin-top: -18px;
}

/* Live badge on thumbnails */
.live-badge {
    position: absolute;
    top: 10px;
    right: 12px;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.12em;
    color: var(--bio);
    display: flex;
    align-items: center;
    gap: 6px;
}

.badge-dot {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--bio);
    flex-shrink: 0;
    position: relative;
}

.badge-ring {
    display: block;
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: 1px solid var(--bio);
    animation: sonarRing 2s ease-out infinite;
}

/* ============================================================
   SECTION 3 — Archive (Progressive Disclosure)
   Violation: Alternating indent sizes
   ============================================================ */
.section-archive {
    background-color: var(--kelp);
    position: relative;
    padding: 80px 0 100px;
}

.section-archive::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 70px;
    background: var(--abyss);
    clip-path: polygon(0 100%, 100% 100%, 100% 40%, 85% 0%, 50% 20%, 15% 0%, 0 40%);
    z-index: 2;
}

.archive-inner {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 40px;
    position: relative;
    z-index: 1;
}

.archive-heading {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 28px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--riptide);
    margin-bottom: 32px;
}

.archive-list {
    list-style: none;
    margin-bottom: 0;
}

/* Anti-design: odd items — 16px left indent + thin Riptide border */
.archive-item.archive-odd {
    padding: 10px 0 10px 16px;
    border-left: 2px solid var(--riptide);
    margin-bottom: 2px;
}

/* Anti-design: even items — 32px left indent, no border */
.archive-item.archive-even {
    padding: 10px 0 10px 32px;
    border-left: none;
    margin-bottom: 2px;
}

.archive-date {
    font-family: 'Nunito', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--bio);
    text-transform: uppercase;
    margin-right: 16px;
    opacity: 0.8;
}

.archive-title {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 15px;
    color: var(--mist);
    line-height: 1.5;
}

.archive-item:hover .archive-title {
    color: var(--white);
}

/* Details/summary — no chrome, styled as inline text link */
.archive-disclosure {
    display: block;
    margin-top: 8px;
}

.archive-disclosure > summary {
    list-style: none;
    display: inline;
    cursor: pointer;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 15px;
    color: var(--teal);
    text-decoration: underline;
    text-decoration-color: rgba(0, 180, 204, 0.4);
    text-underline-offset: 3px;
    padding: 8px 0;
    display: block;
    margin-top: 12px;
}

.archive-disclosure > summary::-webkit-details-marker {
    display: none;
}

.archive-disclosure > summary::marker {
    content: '';
}

.archive-disclosure > summary:hover {
    color: var(--riptide);
    text-decoration-color: rgba(127, 255, 212, 0.5);
}

/* Smooth height animation for batch reveal */
.archive-batch {
    max-height: 0;
    overflow: hidden;
    transition: max-height 1s ease;
}

.archive-disclosure[open] .archive-batch {
    max-height: 2000px;
}

/* ============================================================
   SECTION 4 — The Signal Map (World View)
   Violation: Map bottom has organic leaf-clip (not rectangular)
   ============================================================ */
.section-map {
    background-color: var(--abyss);
    position: relative;
    padding: 80px 0 0;
    overflow: hidden;
}

.section-map::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 80px;
    background: var(--trench);
    clip-path: polygon(0 100%, 100% 100%, 100% 50%, 85% 5%, 50% 25%, 15% 5%, 0 50%);
    z-index: 3;
}

.map-label-block {
    padding: 0 40px 24px;
    position: relative;
    z-index: 2;
}

.map-sub {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 14px;
    color: var(--mist);
    margin-top: 6px;
    opacity: 0.7;
}

.world-map-container {
    width: 100%;
    position: relative;
    z-index: 2;
    /* Leaf-clip on map bottom edge */
    clip-path: polygon(0 0, 100% 0, 100% 88%, 85% 100%, 50% 94%, 15% 100%, 0 88%);
    padding-bottom: 60px;
}

.world-map-svg {
    width: 100%;
    height: auto;
    display: block;
    max-height: 460px;
}

/* Pulse ring animation for tidal dots */
@keyframes tidalPulse {
    0%   { transform: scale(1);   opacity: 0.7; }
    100% { transform: scale(3);   opacity: 0; }
}

.pulse-ring-a {
    animation: tidalPulse 2s ease-out infinite;
    transform-origin: center;
    transform-box: fill-box;
}

.pulse-ring-b {
    animation: tidalPulse 2s ease-out infinite;
    animation-delay: -1s;
    transform-origin: center;
    transform-box: fill-box;
}

/* ============================================================
   SECTION 5 — About (Raw Statement)
   Violation: Text paragraph wider than safe reading width
   ============================================================ */
.section-about {
    background-color: var(--trench);
    position: relative;
    padding: 80px 0 100px;
    overflow: hidden;
}

.field-texture {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.field-texture svg {
    width: 100%;
    height: 100%;
}

.about-inner {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    padding: 0 40px;
}

/* Anti-design violation: max-width: 110ch instead of 65ch */
.about-statement {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.35;
    color: var(--white);
    text-align: center;
    max-width: 110ch;
    /* Intentional overflow beyond safe reading width */
}

.about-statement em {
    color: var(--riptide);
    font-style: italic;
    font-weight: 600;
}

/* ============================================================
   Responsive adjustments
   ============================================================ */
@media (max-width: 768px) {
    .section-hero,
    .section-feed,
    .section-archive,
    .section-map,
    .section-about {
        padding-top: 40px;
        padding-bottom: 40px;
    }

    .stream-frame {
        width: 92vw;
        left: 4vw;
        height: 55vh;
    }

    .hero-title-block {
        width: 50vw;
        top: 62vh;
        right: 0;
    }

    .hero-title {
        font-size: clamp(24px, 8vw, 48px);
        margin-left: -20px;
        left: -20px;
    }

    .feed-grid {
        flex-direction: column;
        gap: 0;
    }

    .feed-left,
    .feed-right {
        margin-left: 0;
        margin-right: 0;
    }

    .feed-center .thumb-inner,
    .feed-left .thumb-inner,
    .feed-right .thumb-inner {
        height: 200px;
    }

    .archive-inner {
        padding: 0 24px;
    }

    .about-statement {
        font-size: clamp(1.4rem, 6vw, 2.5rem);
    }
}
