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

html, body {
    width: 100%;
    min-height: 100vh;
    background: #0a0a14;
    color: #e0dfe6;
    font-family: 'Zilla Slab', serif;
    overflow-x: hidden;
}

/* Scan Lines */
.scan-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(200,192,216,0.02) 2px,
        rgba(200,192,216,0.02) 3px
    );
}

/* Water Gradient */
.water-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(ellipse at 50% 120%, rgba(155,89,182,0.06) 0%, transparent 60%);
    animation: waterShift 30s ease-in-out infinite;
}

/* Grid Dots */
.grid-dots {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    background: radial-gradient(circle, rgba(200,192,216,0.06) 1px, transparent 1px);
    background-size: 24px 24px;
}

/* Chrome Frame */
.chrome-frame {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    border: 2px solid rgba(200,192,216,0.15);
    margin: 16px;
    padding: 40px;
    opacity: 0;
    animation: fadeIn 0.8s ease-out 0.5s forwards;
}

.lotus-icon {
    position: fixed;
    top: 28px;
    left: 28px;
    z-index: 50;
    animation: slowRotate 120s linear infinite;
}

/* Bubbles */
.bubbles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(200,192,216,0.12);
    background: radial-gradient(circle at 30% 30%, rgba(94,196,200,0.1), transparent);
    animation: bubbleDrift var(--bubble-duration) linear infinite;
    transform: translateY(100vh) scale(var(--bubble-scale));
    opacity: 0;
    animation-delay: var(--bubble-delay);
}

.bubble-kanji {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    color: rgba(200,192,216,0.6);
}

/* Masonry Grid */
.masonry {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 0;
}

/* Tiles */
.tile {
    background: linear-gradient(135deg, #2a2440 0%, #1a1a2e 50%, #2a2440 100%);
    border: 1px solid rgba(200,192,216,0.1);
    border-radius: 4px;
    padding: 32px;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(15px);
    transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1), box-shadow 0.4s ease;
}

.tile.revealed {
    animation: fadeReveal 1.2s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

.tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(155,89,182,0.12);
}

.tile::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(105deg, rgba(200,192,216,0.08) 0%, rgba(200,192,216,0) 50%, rgba(200,192,216,0.05) 100%);
    background-size: 200% 100%;
    background-position: -200% 0;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.tile:hover::after {
    opacity: 1;
    animation: sheenSweep 1.5s ease forwards;
}

/* Hero Tile */
.tile-hero {
    grid-column: span 2;
    grid-row: span 2;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.tile-lotus-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.6;
    pointer-events: none;
}

.hero-title {
    font-family: 'Roboto Slab', serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 6rem);
    line-height: 1;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
}

.hero-title span {
    display: block;
}

.hero-subtitle {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.9rem;
    color: #b8b4c4;
    margin-top: 16px;
    position: relative;
    z-index: 2;
}

/* Chrome Fragments */
.chrome-fragment {
    position: absolute;
    background: linear-gradient(135deg, rgba(200,192,216,0.12), rgba(200,192,216,0.03));
    pointer-events: none;
}

.cf-1 {
    width: 120px;
    height: 20px;
    top: 30px;
    right: 40px;
    transform: rotate(3deg);
}

.cf-2 {
    width: 80px;
    height: 14px;
    bottom: 50px;
    left: 20px;
    transform: rotate(-2deg);
}

.cf-3 {
    width: 160px;
    height: 24px;
    top: 40px;
    left: 30px;
    transform: rotate(4deg);
}

.cf-4 {
    width: 100px;
    height: 18px;
    top: 120px;
    right: 20px;
    transform: rotate(-3deg);
}

.cf-5 {
    width: 140px;
    height: 20px;
    bottom: 60px;
    left: 50%;
    transform: rotate(2deg);
}

/* Philosophy Tile */
.tile-philosophy {
    grid-column: span 1;
    line-height: 1.7;
    font-size: 1rem;
    color: #b8b4c4;
}

.drop-cap {
    float: left;
    font-size: 3em;
    line-height: 0.8;
    margin-right: 8px;
    margin-top: 4px;
    color: #9b59b6;
    font-family: 'Roboto Slab', serif;
    font-weight: 700;
}

/* Code Tile */
.tile-code {
    grid-column: span 1;
    border-left: 3px solid #5ec4c8;
    background: linear-gradient(135deg, #2a2440 0%, #1e1835 100%);
}

.tile-code pre {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    color: #5ec4c8;
    line-height: 1.8;
    white-space: pre-wrap;
}

/* Collage Tile */
.tile-collage {
    grid-column: span 2;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.collage-lotus {
    position: relative;
    z-index: 2;
}

.kanji-watermark {
    position: absolute;
    font-family: 'Roboto Slab', serif;
    font-size: 200px;
    color: rgba(200,192,216,0.05);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.collage-bubble {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(200,192,216,0.12);
    background: radial-gradient(circle at 30% 30%, rgba(94,196,200,0.1), transparent);
}

.cb-1 { width: 40px; height: 40px; top: 20%; left: 15%; }
.cb-2 { width: 24px; height: 24px; bottom: 25%; right: 20%; }
.cb-3 { width: 56px; height: 56px; top: 60%; left: 70%; }

/* Signal Tile */
.tile-signal {
    grid-column: span 1;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.signal-row {
    color: #b8b4c4;
    padding: 8px 0;
    border-bottom: 1px solid rgba(200,192,216,0.06);
}

.signal-key {
    color: #5ec4c8;
}

.signal-value {
    color: #e0dfe6;
}

/* Reflection Tile */
.tile-reflection {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.reflection-text {
    font-family: 'Roboto Slab', serif;
    font-size: clamp(1.2rem, 3vw, 2rem);
    font-weight: 700;
    text-align: center;
}

.reflection-mirror {
    font-family: 'Roboto Slab', serif;
    font-size: clamp(1.2rem, 3vw, 2rem);
    font-weight: 700;
    text-align: center;
    transform: scaleY(-1);
    opacity: 0.15;
    mask-image: linear-gradient(to bottom, black, transparent);
    -webkit-mask-image: linear-gradient(to bottom, black, transparent);
    margin-top: 8px;
}

/* Breath Tile */
.tile-breath {
    grid-column: span 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
}

.breath-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #9b59b6;
    animation: breathPulse 4s ease-in-out infinite;
}

/* Keyframes */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeReveal {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes waterShift {
    0%, 100% { background-position: 45% 120%; }
    50% { background-position: 55% 115%; }
}

@keyframes bubbleDrift {
    from { transform: translateY(100vh) scale(var(--bubble-scale)); opacity: 0; }
    10% { opacity: var(--bubble-opacity); }
    90% { opacity: var(--bubble-opacity); }
    to { transform: translateY(-10vh) scale(var(--bubble-scale)); opacity: 0; }
}

@keyframes breathPulse {
    0%, 100% { transform: scale(0.8); opacity: 0.4; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

@keyframes slowRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes sheenSweep {
    from { background-position: -200% 0; }
    to { background-position: 200% 0; }
}

/* Responsive */
@media (max-width: 1200px) {
    .masonry {
        grid-template-columns: repeat(2, 1fr);
    }

    .chrome-frame {
        border-width: 1px;
    }

    .tile-hero {
        grid-column: span 2;
    }

    .tile-collage {
        grid-column: span 2;
    }

    .tile-reflection {
        grid-column: span 2;
    }
}

@media (max-width: 640px) {
    .masonry {
        grid-template-columns: 1fr;
    }

    .chrome-frame {
        border: none;
        margin: 8px;
        padding: 16px;
    }

    .scan-lines {
        display: none;
    }

    .tile-hero,
    .tile-collage,
    .tile-reflection {
        grid-column: span 1;
    }

    .tile-hero {
        grid-row: span 1;
        min-height: 300px;
    }
}
