/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --nightshade: #2d1b4e;
    --root-violet: #1a0f2e;
    --orchid-stem: #6b4d8e;
    --living-coral: #e8736f;
    --petal-blush: #f2d4e0;
    --lavender-mist: #d8c8e8;
    --deep-amethyst: #3d2a5e;
    --frosted-plum: rgba(45, 27, 78, 0.6);
    --sunset-coral: #ff9a8b;
    --void-violet: #0f0a1a;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--void-violet);
    font-family: 'Roboto Slab', serif;
    font-weight: 300;
    color: var(--lavender-mist);
    line-height: 1.65;
    overflow-x: hidden;
}

/* ===== CRT OVERLAY ===== */
.crt-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 100;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 3px,
        rgba(255,255,255,0.02) 3px,
        rgba(255,255,255,0.02) 4px
    );
    opacity: 0;
    animation: crt-fade-in 0.5s ease 0.3s forwards;
}

.crt-overlay::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(232, 115, 111, 0.08);
    animation: glitch-bar 4s steps(1) infinite;
}

@keyframes crt-fade-in {
    to { opacity: 1; }
}

@keyframes glitch-bar {
    0% { top: 15%; }
    25% { top: 67%; }
    50% { top: 32%; }
    75% { top: 85%; }
    100% { top: 45%; }
}

/* ===== PETAL DRIFT ===== */
.petal {
    position: fixed;
    width: 12px;
    height: 12px;
    background: var(--petal-blush);
    opacity: 0.35;
    border-radius: 50% 0 50% 0;
    pointer-events: none;
    z-index: 50;
}

.petal-1 { top: -20px; left: 10%; animation: drift-1 22s linear infinite; }
.petal-2 { top: -20px; left: 25%; animation: drift-2 28s linear infinite; width: 8px; height: 8px; }
.petal-3 { top: -20px; left: 40%; animation: drift-3 18s linear infinite; }
.petal-4 { top: -20px; left: 55%; animation: drift-4 25s linear infinite; width: 10px; height: 10px; }
.petal-5 { top: -20px; left: 70%; animation: drift-5 20s linear infinite; }
.petal-6 { top: -20px; left: 85%; animation: drift-6 30s linear infinite; width: 14px; height: 14px; }
.petal-7 { top: -20px; left: 15%; animation: drift-7 24s linear infinite; width: 9px; height: 9px; }
.petal-8 { top: -20px; left: 60%; animation: drift-8 17s linear infinite; }
.petal-9 { top: -20px; left: 35%; animation: drift-9 26s linear infinite; width: 11px; height: 11px; }
.petal-10 { top: -20px; left: 78%; animation: drift-10 21s linear infinite; width: 7px; height: 7px; }

@keyframes drift-1 { to { transform: translate(-100px, 110vh) rotate(360deg); } }
@keyframes drift-2 { to { transform: translate(-80px, 110vh) rotate(-270deg); } }
@keyframes drift-3 { to { transform: translate(-120px, 110vh) rotate(300deg); } }
@keyframes drift-4 { to { transform: translate(-60px, 110vh) rotate(-360deg); } }
@keyframes drift-5 { to { transform: translate(-90px, 110vh) rotate(240deg); } }
@keyframes drift-6 { to { transform: translate(-110px, 110vh) rotate(-300deg); } }
@keyframes drift-7 { to { transform: translate(-70px, 110vh) rotate(330deg); } }
@keyframes drift-8 { to { transform: translate(-130px, 110vh) rotate(-240deg); } }
@keyframes drift-9 { to { transform: translate(-85px, 110vh) rotate(280deg); } }
@keyframes drift-10 { to { transform: translate(-95px, 110vh) rotate(-320deg); } }

/* ===== HERO / CANOPY ===== */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--nightshade) 0%, var(--living-coral) 100%);
    opacity: 0;
    animation: hero-bg-in 1.2s ease-out 0.8s forwards;
    overflow: hidden;
    will-change: transform;
}

@keyframes hero-bg-in {
    to { opacity: 1; }
}

.hero-content {
    text-align: center;
    z-index: 10;
}

.logotype {
    font-family: 'Alfa Slab One', serif;
    font-weight: 400;
    font-size: clamp(2.4rem, 5vw, 4.5rem);
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, #f2d4e0, #e8736f, #6b4d8e, #d8c8e8);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: chrome-shift 8s ease-in-out infinite alternate, logo-enter 0.8s cubic-bezier(0.16, 1, 0.3, 1) 1.5s both;
    transform: scale(0.8);
    opacity: 0;
}

@keyframes chrome-shift {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

@keyframes logo-enter {
    to { transform: scale(1); opacity: 1; }
}

.subtitle {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.7rem, 1.2vw, 0.85rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--lavender-mist);
    margin-top: 1.5rem;
    opacity: 0;
    animation: fade-in 0.6s ease 2.2s forwards;
}

.subtitle .coral {
    color: var(--living-coral);
}

@keyframes fade-in {
    to { opacity: 1; }
}

/* Hero leaves */
.hero-leaf {
    position: absolute;
    opacity: 0.3;
    animation: leaf-drift 20s ease-in-out infinite alternate;
}

.hero-leaf-1 { width: 80px; top: 15%; left: 8%; animation-duration: 18s; }
.hero-leaf-2 { width: 100px; top: 60%; right: 10%; animation-duration: 22s; animation-delay: -5s; }
.hero-leaf-3 { width: 60px; bottom: 20%; left: 20%; animation-duration: 25s; animation-delay: -10s; }

@keyframes leaf-drift {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(20px, -15px) rotate(5deg); }
}

/* ===== ATRIUM / MASONRY ===== */
.atrium {
    padding: 80px 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.masonry {
    column-count: 3;
    column-gap: 16px;
}

.tile {
    break-inside: avoid;
    margin-bottom: 16px;
    padding: 28px;
    border-radius: 12px;
    background: var(--frosted-plum);
    backdrop-filter: blur(8px) saturate(1.4);
    position: relative;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tile:hover {
    transform: scale(1.04);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tile h2 {
    font-family: 'Alfa Slab One', serif;
    font-weight: 400;
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--petal-blush);
    margin-bottom: 12px;
    text-shadow: 0 0 20px rgba(232, 115, 111, 0.3);
}

.tile p {
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    color: var(--lavender-mist);
}

.tile p.small {
    font-size: clamp(0.8rem, 1.4vw, 0.95rem);
    margin-top: 8px;
    opacity: 0.8;
}

.tile .mono, .tile cite.mono {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.7rem, 1.2vw, 0.85rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--living-coral);
}

/* Tile Wide */
.tile-wide {
    column-span: all;
}

/* Tile Tall */
.tile-tall {
    min-height: 340px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* Tile 1 bg leaf */
.tile-bg-leaf {
    position: absolute;
    width: 200px;
    height: 300px;
    right: 10px;
    top: -20px;
    pointer-events: none;
}

/* Tile 2: Decorative chrome circles */
.tile-decorative {
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.chrome-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d8c8e8 0%, #6b4d8e 40%, #e8736f 70%, #f2d4e0 100%);
    box-shadow: inset 0 1px 3px rgba(255,255,255,0.2), 0 4px 12px rgba(26,15,46,0.4);
    animation: chrome-pulse 4s ease-in-out infinite alternate;
}

.chrome-circle-2 { width: 45px; height: 45px; animation-delay: -1.3s; }
.chrome-circle-3 { width: 55px; height: 55px; animation-delay: -2.6s; }

@keyframes chrome-pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.02); }
}

.vine-svg {
    position: absolute;
    height: 100%;
    width: 60px;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    pointer-events: none;
    opacity: 0.6;
}

/* Tile 3: Carbon hexagon */
.carbon-hexagon {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 50px;
    height: 50px;
}

.carbon-hexagon span {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--living-coral);
    top: 50%;
    left: 50%;
}

.carbon-hexagon span:nth-child(1) { transform: rotate(0deg) translateX(18px) translate(-50%, -50%); }
.carbon-hexagon span:nth-child(2) { transform: rotate(60deg) translateX(18px) translate(-50%, -50%); }
.carbon-hexagon span:nth-child(3) { transform: rotate(120deg) translateX(18px) translate(-50%, -50%); }
.carbon-hexagon span:nth-child(4) { transform: rotate(180deg) translateX(18px) translate(-50%, -50%); }
.carbon-hexagon span:nth-child(5) { transform: rotate(240deg) translateX(18px) translate(-50%, -50%); }
.carbon-hexagon span:nth-child(6) { transform: rotate(300deg) translateX(18px) translate(-50%, -50%); }

/* Tile 4: Mixed media */
.tile-mixed {
    background: linear-gradient(180deg, var(--root-violet), var(--nightshade));
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flower-motif {
    position: relative;
    width: 100px;
    height: 100px;
}

.petal-shape {
    position: absolute;
    width: 36px;
    height: 14px;
    background: var(--orchid-stem);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform-origin: 0% 50%;
}

.petal-shape:nth-child(1) { transform: translate(0, -50%) rotate(0deg); }
.petal-shape:nth-child(2) { transform: translate(0, -50%) rotate(72deg); }
.petal-shape:nth-child(3) { transform: translate(0, -50%) rotate(144deg); }
.petal-shape:nth-child(4) { transform: translate(0, -50%) rotate(216deg); }
.petal-shape:nth-child(5) { transform: translate(0, -50%) rotate(288deg); }

.text-fragments {
    position: absolute;
    right: 24px;
    top: 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--orchid-stem);
}

/* Tile 5: Fern */
.fern-svg {
    width: 100%;
    height: 120px;
    margin-bottom: 16px;
}

/* Tile: Quote */
.tile-quote {
    text-align: center;
    padding: 36px 24px;
}

.tile-quote blockquote {
    font-family: 'Roboto Slab', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    font-style: italic;
    color: var(--petal-blush);
    margin-bottom: 12px;
}

/* Tile 9: Decorative 2 */
.tile-decorative-2 {
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.small-flower {
    width: 50px;
    height: 50px;
}

.small-flower .petal-shape {
    width: 18px;
    height: 7px;
    background: var(--sunset-coral);
}

.flower-2 {
    position: absolute;
    top: 20px;
    right: 30px;
    opacity: 0.6;
}

.tile-decorative-2 .label {
    position: absolute;
    bottom: 16px;
    left: 24px;
}

/* Tile atmospheric */
.tile-atmospheric p:first-of-type {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    color: var(--living-coral);
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

/* Lotus SVG in tile 7 */
.lotus-svg {
    width: 80px;
    height: 140px;
    margin-bottom: 16px;
}

/* ===== FOOTER / ROOT SYSTEM ===== */
.root-system {
    background: var(--root-violet);
    padding: 40px 0 20px;
    overflow: hidden;
}

.marquee {
    overflow: hidden;
    white-space: nowrap;
    margin-bottom: 16px;
}

.marquee-inner {
    display: inline-block;
    animation: marquee-scroll 20s linear infinite;
}

.marquee-inner span {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.7rem, 1.2vw, 0.85rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--orchid-stem);
    margin-right: 3rem;
}

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

.footer-copy {
    text-align: center;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: var(--orchid-stem);
    letter-spacing: 0.05em;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .masonry {
        column-count: 2;
    }
}

@media (max-width: 600px) {
    .masonry {
        column-count: 1;
    }
    .tile-wide {
        column-span: none;
    }
}
