/* ==============================================
   masugomi.com — Media Dissection Laboratory
   Palette:
     Lab Dark:        #0A0E14
     Clinical White:  #E8E0D8
     Analytical Grey: #B0B8C0
     Gradient Blue:   #2040A0
     Gradient Teal:   #20A0A0
     Alert Amber:     #E8A040
     Star White:      #F0F0F0
   Fonts:
     Display: Bebas Neue
     Body: Noto Sans JP
   ============================================== */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background: #0A0E14;
    color: #B0B8C0;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.8;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ============ PARALLAX LAYERS ============ */

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

.parallax-bg {
    z-index: 0;
}

.parallax-fg {
    z-index: 2;
}

/* Analytical Grid Background */
.analytical-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 200%;
    background-image:
        linear-gradient(rgba(32, 64, 160, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(32, 64, 160, 0.08) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.analytical-grid.visible {
    opacity: 1;
}

/* Gradient Mesh */
.gradient-mesh {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(32, 64, 160, 0.05) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 70%, rgba(32, 160, 160, 0.05) 0%, transparent 60%);
}

/* Star Field */
.star-field {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 200%;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #F0F0F0;
    border-radius: 50%;
    opacity: 0;
    animation: starTwinkle var(--twinkle-duration, 3s) ease-in-out var(--twinkle-delay, 0s) infinite;
}

@keyframes starTwinkle {
    0%, 100% { opacity: 0.1; }
    50% { opacity: 0.6; }
}

/* Foreground Indicators */
.indicator {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 2s ease;
}

.indicator.visible {
    opacity: 1;
}

.indicator-1 {
    top: 15%;
    left: 8%;
    background: #20A0A0;
    box-shadow: 0 0 12px rgba(32, 160, 160, 0.6);
    animation: pulseGlow 2s ease-in-out infinite;
}

.indicator-2 {
    top: 35%;
    right: 12%;
    background: #E8A040;
    box-shadow: 0 0 12px rgba(232, 160, 64, 0.6);
    animation: pulseGlow 2s ease-in-out 0.4s infinite;
}

.indicator-3 {
    top: 60%;
    left: 15%;
    background: #20A0A0;
    box-shadow: 0 0 12px rgba(32, 160, 160, 0.6);
    animation: pulseGlow 2s ease-in-out 0.8s infinite;
}

.indicator-4 {
    top: 78%;
    right: 6%;
    background: #E8A040;
    box-shadow: 0 0 12px rgba(232, 160, 64, 0.6);
    animation: pulseGlow 2s ease-in-out 1.2s infinite;
}

.indicator-5 {
    top: 90%;
    left: 50%;
    background: #20A0A0;
    box-shadow: 0 0 12px rgba(32, 160, 160, 0.6);
    animation: pulseGlow 2s ease-in-out 1.6s infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 8px rgba(32, 160, 160, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 20px rgba(32, 160, 160, 0.8);
        transform: scale(1.3);
    }
}

/* ============ SECTIONS ============ */

.section {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 80px 40px;
}

/* Oversized Background Text */
.oversized-bg-text {
    position: absolute;
    font-family: 'Bebas Neue', cursive;
    font-size: clamp(8rem, 15vw, 18rem);
    color: rgba(232, 224, 216, 0.03);
    white-space: nowrap;
    user-select: none;
    pointer-events: none;
    z-index: 0;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    letter-spacing: 0.05em;
}

/* ============ HERO SECTION ============ */

.hero-section {
    min-height: 100vh;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.hero-content {
    text-align: center;
    z-index: 1;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s ease 0.5s, transform 1.2s ease 0.5s;
}

.hero-content.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-title {
    font-family: 'Bebas Neue', cursive;
    font-size: clamp(4rem, 12vw, 10rem);
    color: #E8E0D8;
    letter-spacing: 0.15em;
    line-height: 1;
    margin-bottom: 16px;
    text-shadow: 0 0 60px rgba(32, 64, 160, 0.3);
}

.hero-subtitle {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 300;
    font-size: clamp(0.8rem, 1.5vw, 1rem);
    color: #B0B8C0;
    letter-spacing: 0.4em;
    text-transform: uppercase;
}

.hero-grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(rgba(32, 64, 160, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(32, 64, 160, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 2s ease 1s;
}

.hero-grid-overlay.visible {
    opacity: 1;
}

/* Pulse Indicators */
.pulse-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.pulse-teal {
    background: #20A0A0;
    box-shadow: 0 0 8px rgba(32, 160, 160, 0.6);
    animation: pulseTeal 2s ease-in-out infinite;
}

.pulse-amber {
    background: #E8A040;
    box-shadow: 0 0 8px rgba(232, 160, 64, 0.6);
    animation: pulseAmber 2s ease-in-out infinite;
}

@keyframes pulseTeal {
    0%, 100% { box-shadow: 0 0 6px rgba(32, 160, 160, 0.3); }
    50% { box-shadow: 0 0 20px rgba(32, 160, 160, 0.8); }
}

@keyframes pulseAmber {
    0%, 100% { box-shadow: 0 0 6px rgba(232, 160, 64, 0.3); }
    50% { box-shadow: 0 0 20px rgba(232, 160, 64, 0.8); }
}

/* ============ SECTION HEADINGS ============ */

.section-heading {
    font-family: 'Bebas Neue', cursive;
    font-size: clamp(3rem, 8vw, 6rem);
    color: #E8E0D8;
    letter-spacing: 0.08em;
    text-align: center;
    margin-bottom: 60px;
}

.section-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1200px;
}

/* ============ SPECIMEN PANELS ============ */

.specimen-panels {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.specimen-panel {
    background: linear-gradient(135deg, rgba(32, 64, 160, 0.08), rgba(32, 160, 160, 0.04));
    border: 1px solid rgba(232, 224, 216, 0.08);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.specimen-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(32, 160, 160, 0.4), transparent);
}

.specimen-panel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(232, 224, 216, 0.02) 0%, transparent 40%);
    pointer-events: none;
}

.specimen-panel.revealed {
    opacity: 1;
    transform: translateY(0);
}

.specimen-panel[data-reveal="left"] {
    transform: translateX(-40px);
}

.specimen-panel[data-reveal="left"].revealed {
    transform: translateX(0);
}

.specimen-panel[data-reveal="right"] {
    transform: translateX(40px);
}

.specimen-panel[data-reveal="right"].revealed {
    transform: translateX(0);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(232, 224, 216, 0.05);
}

.panel-id {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    color: #20A0A0;
    letter-spacing: 0.15em;
}

.panel-body {
    padding: 24px 20px;
}

.media-icon {
    width: 48px;
    height: 48px;
    color: #B0B8C0;
    margin-bottom: 16px;
    opacity: 0.6;
}

.panel-title {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 500;
    font-size: 1.1rem;
    color: #E8E0D8;
    margin-bottom: 12px;
}

.panel-text {
    font-weight: 300;
    font-size: 0.9rem;
    color: #B0B8C0;
    line-height: 1.7;
    margin-bottom: 20px;
}

.data-bar {
    width: 100%;
    height: 3px;
    background: rgba(232, 224, 216, 0.06);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.data-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #2040A0, #20A0A0);
    border-radius: 2px;
    transition: width 1.5s ease;
}

.data-label {
    font-size: 0.7rem;
    font-weight: 300;
    color: #20A0A0;
    letter-spacing: 0.1em;
}

/* ============ DECONSTRUCTION SECTION ============ */

.deconstruction-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.decon-block {
    padding: 40px;
    border: 1px solid rgba(232, 224, 216, 0.06);
    border-radius: 4px;
    background: rgba(10, 14, 20, 0.6);
    position: relative;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.decon-block.revealed {
    opacity: 1;
    transform: translateY(0);
}

.decon-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, #2040A0, #20A0A0);
    opacity: 0.6;
}

.decon-number {
    font-family: 'Bebas Neue', cursive;
    font-size: 3rem;
    color: rgba(232, 160, 64, 0.15);
    line-height: 1;
    margin-bottom: 12px;
}

.decon-title {
    font-family: 'Bebas Neue', cursive;
    font-size: 1.5rem;
    color: #E8E0D8;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

.decon-text {
    font-weight: 300;
    font-size: 0.9rem;
    color: #B0B8C0;
    line-height: 1.7;
}

/* ============ METRICS SECTION ============ */

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.metric-panel {
    text-align: center;
    padding: 40px 20px;
    border: 1px solid rgba(232, 224, 216, 0.06);
    border-radius: 4px;
    background: linear-gradient(180deg, rgba(32, 64, 160, 0.06), rgba(10, 14, 20, 0.8));
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.metric-panel.revealed {
    opacity: 1;
    transform: translateY(0);
}

.metric-panel[data-reveal="left"] {
    transform: translateX(-30px);
}

.metric-panel[data-reveal="left"].revealed {
    transform: translateX(0);
}

.metric-panel[data-reveal="right"] {
    transform: translateX(30px);
}

.metric-panel[data-reveal="right"].revealed {
    transform: translateX(0);
}

.metric-value {
    font-family: 'Bebas Neue', cursive;
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: #E8A040;
    line-height: 1;
    margin-bottom: 8px;
}

.metric-label {
    font-weight: 300;
    font-size: 0.8rem;
    color: #B0B8C0;
    letter-spacing: 0.1em;
    margin-bottom: 20px;
}

.metric-bar-container {
    width: 100%;
    height: 2px;
    background: rgba(232, 224, 216, 0.06);
    border-radius: 1px;
    overflow: hidden;
}

.metric-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #E8A040, #20A0A0);
    border-radius: 1px;
    transition: width 1.5s ease;
}

/* ============ LABORATORY SECTION ============ */

.lab-display {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.lab-panel-large {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.lab-panel-large.revealed {
    opacity: 1;
    transform: translateX(0);
}

.holographic-readout {
    border: 1px solid rgba(32, 160, 160, 0.2);
    border-radius: 4px;
    background: linear-gradient(135deg, rgba(32, 64, 160, 0.1), rgba(32, 160, 160, 0.05));
    overflow: hidden;
    position: relative;
}

.holographic-readout::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #20A0A0, transparent);
}

.holographic-readout::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(32, 160, 160, 0.015) 2px,
        rgba(32, 160, 160, 0.015) 4px
    );
    pointer-events: none;
}

.readout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid rgba(32, 160, 160, 0.15);
}

.readout-id {
    font-weight: 500;
    font-size: 0.8rem;
    color: #20A0A0;
    letter-spacing: 0.15em;
}

.readout-status {
    font-size: 0.7rem;
    font-weight: 500;
    color: #E8A040;
    letter-spacing: 0.15em;
    animation: statusBlink 2s ease-in-out infinite;
}

@keyframes statusBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.readout-body {
    padding: 24px;
}

.waveform {
    width: 100%;
    height: 120px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    border-radius: 2px;
    background: rgba(10, 14, 20, 0.4);
}

#waveform-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.readout-text {
    font-weight: 300;
    font-size: 0.9rem;
    color: #B0B8C0;
    line-height: 1.7;
}

.readout-footer {
    display: flex;
    justify-content: space-between;
    padding: 12px 24px;
    border-top: 1px solid rgba(32, 160, 160, 0.1);
}

.readout-metric {
    font-size: 0.7rem;
    font-weight: 500;
    color: #20A0A0;
    letter-spacing: 0.1em;
}

.lab-panel-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.lab-panel-small {
    padding: 20px;
    border: 1px solid rgba(232, 224, 216, 0.06);
    border-radius: 4px;
    background: rgba(10, 14, 20, 0.6);
    flex: 1;
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.lab-panel-small.revealed {
    opacity: 1;
    transform: translateX(0);
}

.lab-panel-small .panel-header {
    padding: 0 0 12px 0;
    border-bottom: 1px solid rgba(232, 224, 216, 0.04);
    margin-bottom: 12px;
}

.lab-panel-small .panel-text {
    font-size: 0.85rem;
    margin-bottom: 0;
}

/* ============ FOOTER ============ */

.footer-section {
    min-height: auto;
    padding: 60px 40px;
    border-top: 1px solid rgba(232, 224, 216, 0.05);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.footer-logo {
    font-family: 'Bebas Neue', cursive;
    font-size: 2rem;
    color: #E8E0D8;
    letter-spacing: 0.1em;
}

.footer-tagline {
    font-size: 0.7rem;
    font-weight: 300;
    color: #B0B8C0;
    letter-spacing: 0.3em;
}

.footer-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.footer-status {
    font-size: 0.7rem;
    font-weight: 300;
    color: #B0B8C0;
    letter-spacing: 0.1em;
}

.status-active {
    color: #20A0A0;
}

.footer-domain {
    font-size: 0.7rem;
    font-weight: 300;
    color: rgba(176, 184, 192, 0.4);
    letter-spacing: 0.1em;
}

.footer-grid-line {
    width: 100%;
    max-width: 1200px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(32, 160, 160, 0.2), transparent);
    margin-top: 40px;
}

/* ============ RESPONSIVE ============ */

@media (max-width: 1024px) {
    .specimen-panels {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .lab-display {
        grid-template-columns: 1fr;
    }

    .deconstruction-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 60px 20px;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        gap: 24px;
        text-align: center;
    }

    .footer-meta {
        align-items: center;
    }

    .hero-title {
        font-size: clamp(3rem, 10vw, 8rem);
    }

    .oversized-bg-text {
        font-size: clamp(5rem, 12vw, 12rem);
    }
}
