/* ============================================
   prototype.moe — styles.css
   Avant-garde Moe / Magazine-spread layout
   ============================================ */

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

:root {
    --deep-space: #0a0e1a;
    --midnight: #141c2e;
    --void: #1a1040;
    --moe-pink: #ff4757;
    --bubble-cyan: #4de8d0;
    --warm-gold: #ffd479;
    --moe-blush: #ff6b9d;
    --slate: #7b8ba3;
    --cloud: #e8edf5;
    --font-display: 'Nunito', sans-serif;
    --font-body: 'Karla', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background: var(--deep-space);
    color: var(--cloud);
    font-family: var(--font-body);
    font-weight: 300;
    line-height: 1.7;
    overflow-x: hidden;
    position: relative;
}

/* --- Blueprint Grid Overlay --- */
.blueprint-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background-image:
        linear-gradient(rgba(77, 232, 208, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(77, 232, 208, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* --- Bubbles --- */
#bubbles-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 30%, rgba(255,255,255,0.25), transparent 60%),
        radial-gradient(circle at 80% 80%, rgba(255,71,87,0.15), rgba(77,232,208,0.1) 50%, transparent);
    border: 1px solid rgba(77, 232, 208, 0.12);
    box-shadow:
        inset 0 0 20px rgba(77, 232, 208, 0.05),
        0 0 30px rgba(77, 232, 208, 0.03);
    backdrop-filter: blur(1px);
    animation: bubbleFloat linear infinite;
}

@keyframes bubbleFloat {
    0% {
        transform: translateY(100vh) translateX(0) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-120vh) translateX(var(--drift, 40px)) scale(var(--end-scale, 1.1));
        opacity: 0;
    }
}

/* --- HERO --- */
.hero {
    position: relative;
    z-index: 3;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2rem;
    padding: 8vh 6vw;
    align-content: center;
}

.hero-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-domain {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(4rem, 10vw, 9rem);
    line-height: 0.95;
    letter-spacing: -0.03em;
    margin-bottom: 2rem;
}

.domain-proto {
    color: var(--cloud);
    display: block;
}

.domain-dot {
    color: var(--moe-pink);
}

.domain-moe {
    color: var(--bubble-cyan);
    position: relative;
}

.domain-moe::after {
    content: '萌え';
    position: absolute;
    top: -1.5rem;
    right: -3rem;
    font-size: 0.9rem;
    font-family: var(--font-mono);
    color: var(--warm-gold);
    opacity: 0.7;
    font-weight: 400;
}

.hero-tagline {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: var(--slate);
    letter-spacing: 0.06em;
    text-transform: lowercase;
}

.hero-right {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
    padding-left: 3vw;
    border-left: 1px solid rgba(77, 232, 208, 0.15);
}

.hero-annotation {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.annotation-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--slate);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.annotation-value {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--warm-gold);
}

.hero-sketch-lines {
    margin-top: 1rem;
}

.sketch-svg {
    width: 100%;
    max-width: 300px;
    height: auto;
}

.sketch-line {
    stroke: var(--bubble-cyan);
    stroke-width: 1;
    opacity: 0.3;
    stroke-dasharray: 8 4;
}

.sketch-rect {
    stroke: var(--moe-pink);
    stroke-width: 1;
    fill: none;
    opacity: 0.25;
    stroke-dasharray: 6 3;
}

.sketch-circle {
    stroke: var(--warm-gold);
    stroke-width: 1;
    fill: none;
    opacity: 0.25;
    stroke-dasharray: 4 4;
}

.scroll-indicator {
    position: absolute;
    bottom: 4vh;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 5;
}

.scroll-text {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--slate);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.scroll-arrow {
    width: 1px;
    height: 30px;
    background: linear-gradient(to bottom, var(--bubble-cyan), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
    50% { opacity: 1; transform: scaleY(1); }
}

/* --- Spread Sections --- */
.spread {
    position: relative;
    z-index: 3;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4vw;
    padding: 10vh 6vw;
    align-content: center;
}

.spread-number {
    position: absolute;
    top: 6vh;
    left: 6vw;
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(5rem, 12vw, 10rem);
    color: rgba(77, 232, 208, 0.04);
    line-height: 1;
    pointer-events: none;
}

.spread-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
}

.spread-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3.5rem);
    color: var(--cloud);
    letter-spacing: -0.02em;
}

.spread-body {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    color: var(--slate);
    line-height: 1.8;
    max-width: 500px;
}

.spread-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.meta-tag {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--moe-pink);
}

.meta-divider {
    color: var(--slate);
    opacity: 0.4;
}

.meta-desc {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--slate);
    letter-spacing: 0.1em;
}

.spread-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* --- Incubation Orb --- */
.incubation-orb {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, var(--bubble-cyan), var(--void));
    box-shadow:
        0 0 80px rgba(77, 232, 208, 0.2),
        0 0 160px rgba(77, 232, 208, 0.05);
    animation: orbPulse 4s ease-in-out infinite;
    position: relative;
    z-index: 2;
}

@keyframes orbPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 80px rgba(77,232,208,0.2), 0 0 160px rgba(77,232,208,0.05); }
    50% { transform: scale(1.05); box-shadow: 0 0 100px rgba(77,232,208,0.3), 0 0 200px rgba(77,232,208,0.08); }
}

.incubation-rings {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(77, 232, 208, 0.1);
    animation: ringExpand 6s ease-out infinite;
}

.ring-1 { width: 220px; height: 220px; animation-delay: 0s; }
.ring-2 { width: 280px; height: 280px; animation-delay: 2s; }
.ring-3 { width: 340px; height: 340px; animation-delay: 4s; }

@keyframes ringExpand {
    0% { transform: scale(0.8); opacity: 0.5; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* --- Iteration --- */
.iteration-versions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.version-block {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(123, 139, 163, 0.2);
    color: var(--slate);
    border-radius: 4px;
    transition: all 0.4s ease;
}

.version-block.v4 {
    border-color: var(--bubble-cyan);
    color: var(--bubble-cyan);
    box-shadow: 0 0 20px rgba(77, 232, 208, 0.1);
}

.graph-svg {
    width: 100%;
    max-width: 400px;
    height: auto;
    overflow: visible;
}

.graph-line {
    fill: none;
    stroke: var(--bubble-cyan);
    stroke-width: 2;
    stroke-linecap: round;
    opacity: 0.6;
}

.graph-dot {
    fill: var(--warm-gold);
    opacity: 0.8;
}

/* --- Emergence --- */
.emergence-visual {
    perspective: 800px;
}

.emergence-form {
    position: relative;
    width: 250px;
    height: 250px;
    transform-style: preserve-3d;
    animation: emergeRotate 20s linear infinite;
}

@keyframes emergeRotate {
    from { transform: rotateY(0deg) rotateX(5deg); }
    to { transform: rotateY(360deg) rotateX(5deg); }
}

.emergence-layer {
    position: absolute;
    inset: 0;
    border-radius: 30%;
    border: 1px solid;
    animation: layerBreathe 3s ease-in-out infinite alternate;
}

.layer-1 {
    border-color: rgba(255, 71, 87, 0.3);
    transform: translateZ(30px) scale(0.9);
    animation-delay: 0s;
}

.layer-2 {
    border-color: rgba(77, 232, 208, 0.3);
    transform: translateZ(60px) scale(0.8);
    animation-delay: 1s;
}

.layer-3 {
    border-color: rgba(255, 212, 121, 0.3);
    transform: translateZ(90px) scale(0.7);
    animation-delay: 2s;
}

@keyframes layerBreathe {
    from { opacity: 0.3; }
    to { opacity: 0.8; }
}

.emergence-core {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--moe-pink), var(--void));
    box-shadow: 0 0 40px rgba(255, 71, 87, 0.4);
    transform: translateZ(50px);
}

/* --- Manifesto --- */
.manifesto {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10vh 8vw;
}

.manifesto .spread-number {
    left: 50%;
    transform: translateX(-50%);
}

.manifesto-content {
    max-width: 700px;
    position: relative;
    z-index: 3;
}

.manifesto-quote {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    color: var(--cloud);
    line-height: 1.6;
    border: none;
    position: relative;
}

.manifesto-quote::before {
    content: '\201C';
    position: absolute;
    top: -2rem;
    left: -1.5rem;
    font-size: 5rem;
    color: var(--moe-blush);
    opacity: 0.15;
    font-family: var(--font-display);
    font-weight: 900;
    line-height: 1;
}

.manifesto-attribution {
    margin-top: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.attribution-dash {
    color: var(--bubble-cyan);
    font-size: 1.2rem;
}

.attribution-source {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--warm-gold);
    letter-spacing: 0.1em;
}

/* --- Footer --- */
.site-footer {
    position: relative;
    z-index: 3;
    padding: 6vh 6vw;
    border-top: 1px solid rgba(77, 232, 208, 0.08);
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-domain {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--slate);
}

.footer-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--bubble-cyan);
    animation: statusBlink 2s ease-in-out infinite;
}

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

.status-text {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--slate);
    letter-spacing: 0.1em;
}

.footer-coordinates {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.coord-label {
    font-size: 0.85rem;
    color: var(--moe-pink);
}

.coord-value {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--slate);
}

/* --- Scroll Reveal --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero {
        grid-template-columns: 1fr;
        padding: 6vh 5vw;
    }

    .hero-right {
        border-left: none;
        border-top: 1px solid rgba(77, 232, 208, 0.15);
        padding-left: 0;
        padding-top: 2rem;
    }

    .spread {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .domain-moe::after {
        display: none;
    }

    .incubation-orb {
        width: 120px;
        height: 120px;
    }

    .ring-1 { width: 160px; height: 160px; }
    .ring-2 { width: 200px; height: 200px; }
    .ring-3 { width: 240px; height: 240px; }

    .emergence-form {
        width: 180px;
        height: 180px;
    }
}
