/* tanso.in - Victorian Scientific Instrument */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --aged-ivory: #F5EDE0;
    --lamp-black: #1A1510;
    --brass: #C8A050;
    --brass-dark: #8A6A30;
    --lens-flare: #F0D868;
    --instrument-blue: #4A6888;
    --text-primary: #2A2018;
    --text-body: #3A3028;
    --text-annotation: #8A7A60;
}
body {
    background: var(--aged-ivory);
    color: var(--text-primary);
    font-family: 'Spectral', serif;
    font-size: 1.0625rem;
    line-height: 1.8;
    font-weight: 400;
    overflow-x: hidden;
    position: relative;
}

/* Grid Lines Background */
.grid-lines {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 80px,
            rgba(200,160,80,0.06) 80px,
            rgba(200,160,80,0.06) 81px
        ),
        repeating-linear-gradient(
            135deg,
            transparent,
            transparent 80px,
            rgba(200,160,80,0.06) 80px,
            rgba(200,160,80,0.06) 81px
        );
}

/* Ornamental Frame */
.ornament-frame {
    position: relative;
    border: 2px solid var(--brass);
    padding: 3rem 4rem;
    display: inline-block;
}
.frame-corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: var(--brass);
    border-style: solid;
}
.frame-tl { top: -4px; left: -4px; border-width: 3px 0 0 3px; }
.frame-tr { top: -4px; right: -4px; border-width: 3px 3px 0 0; }
.frame-bl { bottom: -4px; left: -4px; border-width: 0 0 3px 3px; }
.frame-br { bottom: -4px; right: -4px; border-width: 0 3px 3px 0; }

/* Hero */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}
.hero-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2.5rem, 5vw, 5rem);
    font-weight: 600;
    color: var(--brass);
    text-align: center;
}
.hero-meta {
    font-family: 'Cutive Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    color: var(--text-annotation);
    text-align: center;
    margin-top: 0.75rem;
    opacity: 0;
    animation: fadeIn 0.8s ease 1s forwards;
}
.hero-flare {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    animation: flareBloom 1s ease-out 0.5s forwards;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes flareBloom {
    from { transform: translate(-50%, -50%) scale(0); opacity: 0.4; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 0.15; }
}
@keyframes frameDraw {
    from { opacity: 0; }
    to { opacity: 1; }
}
.ornament-frame {
    animation: frameDraw 0.6s ease forwards;
}

/* Lens Flares */
.lens-flare {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--lens-flare), transparent 70%);
    opacity: 0;
    pointer-events: none;
    z-index: 0;
}
.flare-1 { position: absolute; top: 15%; right: 10%; width: 150px; height: 150px; }
.flare-2 { position: absolute; top: 50%; left: 5%; width: 250px; height: 250px; }
.flare-3 { position: absolute; bottom: 20%; right: 15%; width: 180px; height: 180px; }
.lens-flare.pulse {
    animation: flarePulse 0.8s ease-out forwards;
}
@keyframes flarePulse {
    0% { opacity: 0; }
    50% { opacity: 0.2; }
    100% { opacity: 0.08; }
}

/* Broken Grid */
.broken-grid {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}
.grid-block {
    background: rgba(245,237,224,0.9);
    padding: 2.5rem 2rem;
    position: relative;
}
.block-frame {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.block-frame .frame-corner { border-color: var(--brass-dark); }

.block-a { grid-column: 2 / 8; transform: translateY(-10px); }
.block-b { grid-column: 6 / 12; transform: translateY(20px); }
.block-c { grid-column: 1 / 7; transform: translateY(-15px); }
.block-d { grid-column: 7 / 13; transform: translateY(10px); }
.block-e { grid-column: 2 / 8; transform: translateY(-20px); }
.block-f { grid-column: 5 / 12; transform: translateY(15px); }

.annotation {
    font-family: 'Cutive Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    color: var(--text-annotation);
    display: block;
    margin-bottom: 0.75rem;
}
.block-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}
.block-body {
    font-size: 1.0625rem;
    color: var(--text-body);
    line-height: 1.8;
    margin-bottom: 1rem;
}

/* Section Animation */
.section {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.section.visible {
    opacity: 1;
}
.block-a.visible { transform: translateY(-10px); }
.block-b.visible { transform: translateY(20px); }
.block-c.visible { transform: translateY(-15px); }
.block-d.visible { transform: translateY(10px); }
.block-e.visible { transform: translateY(-20px); }
.block-f.visible { transform: translateY(15px); }

/* Footer */
#footer {
    text-align: center;
    padding: 3rem 2rem;
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(200,160,80,0.2);
}
.footer-text {
    font-family: 'Cutive Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-annotation);
    letter-spacing: 0.05em;
}

/* Responsive */
@media (max-width: 768px) {
    .broken-grid {
        grid-template-columns: 1fr;
    }
    .block-a, .block-b, .block-c,
    .block-d, .block-e, .block-f {
        grid-column: 1 / -1;
        transform: translateY(15px);
    }
    .block-a.visible, .block-b.visible, .block-c.visible,
    .block-d.visible, .block-e.visible, .block-f.visible {
        transform: translateY(0);
    }
    .ornament-frame { padding: 2rem; }
    .lens-flare { display: none; }
}
