/* Concrete noise texture via SVG data URI */
:root {
    --concrete-dark: #2a2a2e;
    --concrete-light: #3d3d42;
    --concrete-surface: #8a8a90;
    --neon-magenta: #ff2d7b;
    --neon-cyan: #00f0ff;
    --neon-lime: #b8ff00;
    --neon-amber: #ffb300;
    --text-primary: #f0ebe3;
    --text-muted: rgba(240, 235, 227, 0.5);
}

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

body {
    background-color: var(--concrete-dark);
    color: var(--text-primary);
    font-family: 'Caveat', cursive;
    overflow-x: hidden;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}

/* Top Glyph */
.top-glyph {
    position: fixed;
    top: 1rem;
    left: 1rem;
    font-family: 'Noto Serif JP', serif;
    font-weight: 900;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
    z-index: 100;
    transition: transform 300ms ease;
}

.top-glyph:hover {
    animation: pulse-glyph 300ms ease;
}

@keyframes pulse-glyph {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--concrete-dark);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}

.hero-title {
    font-family: 'Permanent Marker', cursive;
    font-size: clamp(5rem, 15vw, 11rem);
    color: var(--neon-magenta);
    opacity: 0;
    animation: fadeInGlow 1.5s ease 3s forwards;
}

.hero-romaji {
    font-family: 'Caveat', cursive;
    font-size: 1.5rem;
    color: var(--neon-cyan);
    opacity: 0;
    animation: fadeIn 1.5s ease 4.5s forwards;
}

.hero-subtitle {
    font-family: 'Caveat', cursive;
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-muted);
    opacity: 0;
    animation: fadeIn 1.5s ease 6s forwards;
}

@keyframes fadeInGlow {
    to {
        opacity: 1;
        text-shadow: 0 0 7px var(--neon-magenta), 0 0 20px var(--neon-magenta), 0 0 42px var(--neon-magenta), 0 0 80px var(--neon-magenta);
    }
}

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

/* Masonry Grid */
.masonry-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    padding: 2rem 0;
}

/* Panels */
.panel {
    background-color: var(--concrete-dark);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    box-shadow: inset 0 0 0 1px rgba(138, 138, 144, 0.4);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 400ms ease, transform 400ms ease, box-shadow 600ms ease;
    overflow: hidden;
    position: relative;
}

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

.panel:hover {
    box-shadow: inset 0 0 30px rgba(255, 45, 123, 0.08), inset 0 0 0 1px rgba(138, 138, 144, 0.4);
}

/* Panel sizing */
[data-col="full"] {
    grid-column: span 3;
}

[data-col="wide"] {
    grid-column: span 2;
}

[data-col="single"] {
    grid-column: span 1;
}

/* Theory Blocks */
[data-type="theory"] {
    padding: 3rem 2rem 2rem;
    display: flex;
    align-items: flex-end;
    min-height: 180px;
}

.theory-text {
    font-family: 'Caveat', cursive;
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: 700;
    line-height: 1.55;
    color: var(--text-primary);
    transition: text-shadow 400ms ease;
}

[data-type="theory"]:hover .theory-text {
    text-shadow: 0 0 15px var(--neon-cyan);
}

/* Neon Statement Blocks */
[data-type="neon"] {
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

.neon-text {
    font-family: 'Permanent Marker', cursive;
    font-size: clamp(4rem, 12vw, 9rem);
    letter-spacing: 0.04em;
    line-height: 0.9;
    text-align: center;
}

.neon-magenta { color: var(--neon-magenta); }
.neon-cyan { color: var(--neon-cyan); }
.neon-lime { color: var(--neon-lime); }
.neon-amber { color: var(--neon-amber); }

.panel.visible .neon-text {
    text-shadow: 0 0 7px currentColor, 0 0 20px currentColor, 0 0 42px currentColor, 0 0 80px currentColor;
}

/* Watercolor Splash Blocks */
[data-type="splash"] {
    min-height: 280px;
    padding: 1rem;
}

.watercolor-container {
    position: relative;
    width: 100%;
    height: 250px;
    mix-blend-mode: screen;
}

.wc-layer {
    position: absolute;
    inset: 0;
    filter: blur(25px);
    animation: breathe 10s ease-in-out infinite;
    animation-play-state: paused;
}

.panel.visible .wc-layer {
    animation-play-state: running;
}

.wc-layer:nth-child(2) { animation-delay: -3s; }
.wc-layer:nth-child(3) { animation-delay: -6s; }

@keyframes breathe {
    0%, 100% { transform: scale(0.97); }
    50% { transform: scale(1.03); }
}

.drip-svg {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
}

.drip-path {
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
    transition: stroke-dashoffset 1.5s ease;
}

.panel.visible .drip-path {
    stroke-dashoffset: 0;
}

/* Annotation Blocks */
[data-type="annotation"] {
    background-color: var(--concrete-light);
    padding: 2rem 1.5rem;
    min-height: 250px;
    display: flex;
    align-items: flex-start;
}

.annotation-text {
    font-family: 'Caveat', cursive;
    font-size: clamp(0.85rem, 1.4vw, 1.05rem);
    font-weight: 400;
    line-height: 1.65;
    color: var(--text-muted);
}

/* City Fragment Blocks */
[data-type="fragment"] {
    padding: 2rem;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.city-svg {
    width: 100%;
    height: 100%;
    max-height: 200px;
}

.draw-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 3s ease;
}

.panel.visible .draw-path {
    stroke-dashoffset: 0;
}

/* Responsive */
@media (max-width: 900px) {
    .masonry-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    [data-col="full"] { grid-column: span 2; }
    [data-col="wide"] { grid-column: span 2; }
    [data-col="single"] { grid-column: span 1; }
}

@media (max-width: 600px) {
    .masonry-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    [data-col="full"],
    [data-col="wide"],
    [data-col="single"] {
        grid-column: span 1;
    }
    .neon-text {
        font-size: clamp(2.5rem, 10vw, 5rem);
    }
}
