/* ============================================
   masugomi.com - Pop-Art Broadsheet Styles
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --broadcast-void: #0b1929;
    --deep-static: #0f1b2d;
    --cathode-mist: #c8dce8;
    --phantom-ink: #8ba7c4;
    --halftone-cyan: #4a90b8;
    --speech-white: #e8f2f8;
    --tabloid-magenta: #c45a7b;
    --newsprint-yellow: #e8d48a;
    --bg-gradient: linear-gradient(175deg, #0b1929 0%, #0f1b2d 40%, #132338 100%);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Libre Baskerville', Georgia, serif;
    background: var(--bg-gradient);
    color: var(--phantom-ink);
    overflow-x: hidden;
    min-height: 100vh;
}

/* --- Broadcast Ticker --- */
#broadcast-ticker {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 36px;
    background: var(--broadcast-void);
    z-index: 100;
    overflow: hidden;
    border-bottom: 1px solid rgba(138, 167, 196, 0.15);
    opacity: 0;
    transition: opacity 0.5s ease;
}

#broadcast-ticker.active {
    opacity: 1;
}

.ticker-track {
    display: inline-flex;
    align-items: center;
    height: 100%;
    white-space: nowrap;
    animation: tickerScroll 60s linear infinite;
}

.ticker-item {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 500;
    font-style: italic;
    font-size: 0.85rem;
    color: var(--phantom-ink);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0 1.5rem;
}

.ticker-sep {
    color: var(--tabloid-magenta);
    font-size: 0.6rem;
    opacity: 0.6;
}

@keyframes tickerScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* --- Canvas Layers --- */
#benday-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    mix-blend-mode: screen;
    transition: opacity 0.6s ease;
}

#benday-canvas.visible {
    opacity: 1;
}

#noise-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    opacity: 0.03;
    mix-blend-mode: overlay;
}

#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}

/* --- Channel Change Flash --- */
#channel-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 90;
    pointer-events: none;
    background: rgba(200, 220, 232, 0.15);
    opacity: 0;
    transition: opacity 0.05s ease;
}

#channel-flash.flash {
    opacity: 1;
}

/* --- Segments (General) --- */
.segment {
    position: relative;
    z-index: 10;
    min-height: 80vh;
}

/* --- Hero Section --- */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 36px;
}

.hero-inner {
    text-align: center;
    position: relative;
    max-width: 900px;
    width: 90%;
}

#broadcast-line {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(200, 220, 232, 0.5);
    transform: scaleX(0);
    transform-origin: center;
    z-index: -1;
}

#broadcast-line.animate {
    animation: drawLine 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes drawLine {
    to { transform: scaleX(1); }
}

.hero-title {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 700;
    font-size: clamp(3.2rem, 9vw, 8rem);
    color: var(--cathode-mist);
    letter-spacing: -0.02em;
    line-height: 1.05;
    opacity: 0;
    min-height: 1.2em;
}

.hero-title.visible {
    opacity: 1;
}

.hero-title .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(10px);
}

.hero-title .char.reveal {
    animation: charReveal 0.2s ease-out forwards;
}

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

/* --- Subtitle with Speech Bubble --- */
#subtitle-wrap {
    position: relative;
    display: inline-block;
    margin-top: 0.5rem;
    opacity: 0;
    transition: opacity 0.5s ease;
}

#subtitle-wrap.visible {
    opacity: 1;
}

#speech-bubble-subtitle {
    position: absolute;
    top: -12px;
    left: -20px;
    width: calc(100% + 40px);
    height: calc(100% + 24px);
}

#bubble-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
}

#bubble-path.draw {
    animation: drawBubble 0.8s ease-out forwards;
}

@keyframes drawBubble {
    to { stroke-dashoffset: 0; }
}

#subtitle-text {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 600;
    font-style: italic;
    font-size: clamp(1.6rem, 5vw, 4rem);
    color: var(--tabloid-magenta);
    position: relative;
    z-index: 2;
    display: inline-block;
    padding: 0.2em 0.6em;
}

/* --- Hero Lead Content --- */
#hero-lead {
    margin-top: 2.5rem;
    opacity: 0;
    transform: translateY(30px);
}

#hero-lead.visible {
    animation: slideUp 0.6s ease-out forwards;
}

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

.lead-headline {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 600;
    font-size: clamp(1.4rem, 3vw, 2.4rem);
    color: var(--cathode-mist);
    letter-spacing: -0.02em;
    line-height: 1.15;
    max-width: 600px;
    margin: 0 auto;
}

.lead-tagline {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-style: italic;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    color: var(--phantom-ink);
    margin-top: 0.8rem;
    opacity: 0;
}

.lead-tagline.visible {
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* --- Scroll Indicator --- */
#scroll-indicator {
    position: absolute;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    animation: pulseArrow 2s ease-in-out infinite;
}

@keyframes pulseArrow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* --- Tear Lines --- */
.tear-line {
    position: relative;
    z-index: 15;
    height: 40px;
    width: 100%;
    margin: -20px 0;
    filter: drop-shadow(0 2px 4px rgba(11, 25, 41, 0.6));
}

.tear-line svg {
    width: 100%;
    height: 100%;
}

/* --- Broadcast Segments --- */
.broadcast-segment {
    padding: 6rem 0;
    min-height: 80vh;
}

.editorial-island {
    width: 70%;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

/* --- Segment Headlines (dissolve targets) --- */
.segment-headline {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    color: var(--cathode-mist);
    letter-spacing: -0.02em;
    line-height: 1.05;
    margin-bottom: 3rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.segment-headline.in-view {
    opacity: 1;
    transform: translateY(0) rotate(var(--rotation, 0deg));
}

/* --- Story Blocks (organic flow) --- */
.story-block {
    margin-bottom: 2rem;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.story-block.in-view {
    opacity: 1;
    transform: translateY(0) rotate(var(--rotation, 0deg));
}

/* --- Speech Bubbles --- */
.speech-bubble {
    position: relative;
    padding: 2rem 2.5rem;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.speech-bubble:hover {
    transform: translateY(-4px) rotate(0deg);
    filter: drop-shadow(0 8px 24px rgba(11, 25, 41, 0.4));
}

.bubble-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.bubble-draw {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke 0.3s ease;
}

.bubble-draw.drawn {
    animation: drawBubbleFrame 0.6s ease-out forwards;
}

.speech-bubble:hover .bubble-draw {
    stroke: var(--halftone-cyan);
}

@keyframes drawBubbleFrame {
    to { stroke-dashoffset: 0; }
}

.bubble-content {
    position: relative;
    z-index: 2;
}

.bubble-content h3 {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 600;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: var(--cathode-mist);
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 0.8rem;
}

.body-text {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    color: var(--phantom-ink);
    line-height: 1.72;
    letter-spacing: 0.01em;
}

/* --- Tags --- */
.tag {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: clamp(0.65rem, 1vw, 0.8rem);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.25em 0.7em;
    border-radius: 2px;
    display: inline-block;
    margin-top: 0.8rem;
}

.breaking-tag {
    background: var(--tabloid-magenta);
    color: var(--speech-white);
}

/* --- Stat Card --- */
.stat-card {
    text-align: center;
    padding: 2rem;
    border: 1px solid rgba(138, 167, 196, 0.2);
    position: relative;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stat-card:hover {
    transform: translateY(-4px) rotate(0deg);
    box-shadow: 0 8px 24px rgba(11, 25, 41, 0.4);
    border-color: var(--halftone-cyan);
}

.stat-number {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 700;
    font-size: clamp(3rem, 6vw, 5rem);
    color: var(--newsprint-yellow);
    line-height: 1;
}

.stat-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: clamp(0.75rem, 1.2vw, 0.9rem);
    color: var(--phantom-ink);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 0.5rem;
}

/* --- Pull Quotes --- */
.pull-quote-block {
    max-width: 500px;
}

.pull-quote {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 500;
    font-style: italic;
    font-size: clamp(1.3rem, 2.5vw, 1.8rem);
    color: var(--speech-white);
    line-height: 1.4;
    padding: 1.5rem 0;
    border-left: 3px solid var(--halftone-cyan);
    padding-left: 1.5rem;
}

.quote-mark {
    font-size: 2em;
    color: var(--tabloid-magenta);
    line-height: 0;
    vertical-align: -0.2em;
}

.pull-quote cite {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-style: normal;
    font-size: clamp(0.75rem, 1.2vw, 0.85rem);
    color: var(--phantom-ink);
    margin-top: 0.8rem;
    letter-spacing: 0.04em;
}

.featured-quote {
    border-left-color: var(--tabloid-magenta);
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    color: var(--newsprint-yellow);
}

/* --- Expert Quotes --- */
.quote-head {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 600;
    font-style: italic;
    font-size: clamp(1.2rem, 2.5vw, 1.6rem) !important;
    color: var(--speech-white) !important;
    line-height: 1.3 !important;
}

.expert-name {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: clamp(0.75rem, 1.2vw, 0.85rem);
    color: var(--phantom-ink);
    margin-top: 0.6rem;
    letter-spacing: 0.04em;
}

/* --- Editorial Content --- */
.editorial-content {
    padding: 2rem;
    border: 1px solid rgba(138, 167, 196, 0.1);
    position: relative;
}

.editorial-drop::first-letter {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 700;
    font-size: 3.5em;
    float: left;
    color: var(--cathode-mist);
    line-height: 0.8;
    margin-right: 0.1em;
    margin-top: 0.1em;
}

.editorial-content .body-text {
    margin-bottom: 1.2rem;
}

.editorial-content .body-text:last-child {
    margin-bottom: 0;
}

/* --- Footer --- */
#gomi-footer {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 4rem 0;
}

.footer-inner {
    text-align: center;
    position: relative;
    z-index: 10;
}

#gomi-constellation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.gomi-icon {
    position: absolute;
    opacity: 0.3;
    color: var(--phantom-ink);
    transition: opacity 0.3s ease;
    pointer-events: auto;
    cursor: default;
}

.gomi-icon:hover {
    opacity: 0.8;
}

@keyframes gomiFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.footer-text {
    position: relative;
    z-index: 5;
}

.footer-domain {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--cathode-mist);
    letter-spacing: -0.02em;
}

.footer-tagline {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-style: italic;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    color: var(--phantom-ink);
    margin-top: 0.5rem;
}

.footer-japanese {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: clamp(0.75rem, 1.2vw, 0.9rem);
    color: var(--halftone-cyan);
    margin-top: 1rem;
    letter-spacing: 0.06em;
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
    .editorial-island {
        width: 90%;
    }

    .story-block {
        margin-left: 0 !important;
    }

    .speech-bubble {
        padding: 1.5rem;
    }

    .broadcast-segment {
        padding: 3rem 0;
    }

    #broadcast-ticker {
        height: 30px;
    }

    .ticker-item {
        font-size: 0.72rem;
    }

    #hero {
        padding-top: 30px;
    }
}

@media (max-width: 480px) {
    .editorial-island {
        width: 95%;
    }

    .pull-quote {
        padding-left: 1rem;
    }
}
