/* sora.garden - Gilded Herbarium */

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

:root {
    --bg-dark: #1A1408;
    --bg-light: #F5ECD4;
    --gold: #FFD700;
    --gold-dark: #B8860B;
    --gold-pale: #E8D48A;
    --text-light: #D4C8A0;
    --text-dark: #3A2E18;
    --green: #4A7A4E;
    --rose: #C4686A;
    --glitch: #FFE44D;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: 'Crimson Text', serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.75;
    overflow-x: hidden;
}

/* Glitch Bands */
.glitch-bands {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.glitch-band {
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--glitch);
    opacity: 0;
}

.glitch-band.flash {
    animation: glitchFlash 0.15s ease-out forwards;
}

@keyframes glitchFlash {
    0% { opacity: 0.2; }
    100% { opacity: 0; }
}

/* Gate Section */
.gate {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.gate__title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2.5rem, 5vw, 5rem);
    color: var(--gold);
    letter-spacing: 0.15em;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.gate__title.visible {
    opacity: 1;
}

.gate__subtitle {
    font-family: 'Crimson Text', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 1.125rem;
    color: var(--gold-dark);
    margin-top: 0.75rem;
    opacity: 0;
    transition: opacity 0.6s ease 0.4s;
}

.gate__subtitle.visible {
    opacity: 1;
}

/* Gold Leaf */
.gold-leaf {
    position: relative;
    display: inline-block;
    background: var(--gold);
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.2);
}

.gold-leaf--gate {
    width: 24px;
    height: 10px;
    margin-top: 1.5rem;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.6s ease 0.8s, transform 0.6s ease 0.8s;
}

.gold-leaf--gate.visible {
    opacity: 0.8;
    transform: translateY(0);
}

.gold-leaf--small {
    position: absolute;
    width: 16px;
    height: 8px;
    opacity: 0.6;
}

.gold-leaf--1 { bottom: 16px; right: 20px; }
.gold-leaf--2 { top: 20px; left: 24px; }

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px 80px;
    position: relative;
    z-index: 1;
}

/* Bento Cell */
.bento-cell {
    position: relative;
    padding: 32px;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.bento-cell.visible {
    opacity: 1;
    transform: translateY(0);
}

.bento-cell--dark {
    background-color: var(--bg-dark);
    box-shadow: 0 0 8px rgba(184, 134, 11, 0.12);
}

.bento-cell--light {
    background-color: var(--bg-light);
}

.bento-cell--tall {
    grid-row: span 2;
    min-height: 496px;
}

.bento-cell--wide {
    grid-column: span 2;
}

.bento-cell--feature {
    grid-column: span 3;
    flex-direction: row;
    gap: 32px;
    min-height: 320px;
    padding: 48px;
}

.bento-cell--final {
    grid-column: span 3;
    min-height: 300px;
    text-align: center;
    flex-direction: column;
    align-items: center;
}

/* Glitch effect on cells */
.bento-cell.glitch-active {
    animation: cellGlitch 0.3s ease-out;
}

@keyframes cellGlitch {
    0% { transform: translateY(0) skewX(0deg) translateX(0); }
    30% { transform: translateY(0) skewX(2deg) translateX(4px); }
    60% { transform: translateY(0) skewX(-1deg) translateX(-2px); }
    100% { transform: translateY(0) skewX(0deg) translateX(0); }
}

.bento-cell.glitch-active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--gold);
    opacity: 0.3;
    animation: glitchLine 0.3s ease-out;
}

@keyframes glitchLine {
    0% { opacity: 0.3; }
    100% { opacity: 0; }
}

/* Sharp Angles */
.sharp-angle {
    position: absolute;
    width: 60px;
    height: 60px;
    pointer-events: none;
}

.sharp-angle--tl {
    top: 0;
    left: 0;
    border-top: 1px solid var(--gold-dark);
    border-left: 1px solid var(--gold-dark);
    opacity: 0.4;
    transform: rotate(-15deg);
    transform-origin: top left;
}

.sharp-angle--br {
    bottom: 0;
    right: 0;
    border-bottom: 1px solid var(--gold-dark);
    border-right: 1px solid var(--gold-dark);
    opacity: 0.4;
    transform: rotate(-15deg);
    transform-origin: bottom right;
}

/* Typography */
.bento-heading {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--gold);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.bento-heading--dark {
    color: var(--text-dark);
}

.bento-text {
    font-family: 'Crimson Text', serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text-light);
}

.bento-text--dark {
    color: var(--text-dark);
}

.botanical-label {
    font-family: 'Crimson Text', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 0.8125rem;
    color: var(--gold-dark);
    display: block;
    margin-top: 0.75rem;
}

/* Botanical SVG */
.botanical-svg {
    width: 160px;
    height: 160px;
}

.botanical-svg--tall {
    width: 160px;
    height: 320px;
}

.botanical-svg--shell {
    width: 280px;
    height: 200px;
    flex-shrink: 0;
}

.shell-path {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    transition: stroke-dashoffset 3s ease-in-out;
}

.bento-cell--feature.visible .shell-path {
    stroke-dashoffset: 0;
}

.feature-text {
    max-width: 360px;
}

/* Final Cell */
.final-kanji {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 6rem;
    color: var(--gold);
    animation: kanjiPulse 4s ease-in-out infinite;
}

@keyframes kanjiPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.final-domain {
    font-family: 'Crimson Text', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 0.875rem;
    color: var(--gold-dark);
    margin-top: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }

    .bento-cell--wide,
    .bento-cell--feature,
    .bento-cell--final {
        grid-column: span 1;
    }

    .bento-cell--tall {
        grid-row: span 1;
        min-height: 320px;
    }

    .bento-cell--feature {
        flex-direction: column;
        padding: 32px;
    }

    .botanical-svg--shell {
        width: 200px;
        height: 150px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.3s !important;
    }

    .bento-cell {
        opacity: 1;
        transform: none;
    }

    .gate__title,
    .gate__subtitle,
    .gold-leaf--gate {
        opacity: 1;
        transform: none;
    }

    .shell-path {
        stroke-dashoffset: 0;
    }
}
