/* tanso.bar - Art Deco carbon laboratory */

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

:root {
    --carbon-black: #0a0a0a;
    --graphite: #1a1a1a;
    --anthracite: #2a2a2a;
    --diamond-white: #e0e0e0;
    --neon-green: #39ff14;
    --neon-magenta: #ff1493;
    --neon-cyan: #00e5ff;
    --burnished-gold: #c9a84c;
    --subdued: #808080;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--carbon-black);
    color: #c0c0c0;
    font-family: 'Raleway', sans-serif;
    font-size: 16px;
    font-weight: 300;
    line-height: 1.7;
    overflow-x: hidden;
}

/* ---- Noise Texture ---- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
    background-size: 256px 256px;
}

/* ---- Gateway Section ---- */
.gateway-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--carbon-black);
}

.hex-lattice-bg {
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100'%3E%3Cpath d='M28 66L0 50L0 16L28 0L56 16L56 50L28 66L28 100' fill='none' stroke='%2339ff14' stroke-width='1'/%3E%3Cpath d='M28 0L28 34L0 50L0 84L28 100L56 84L56 50L28 34' fill='none' stroke='%2339ff14' stroke-width='1'/%3E%3C/svg%3E");
    pointer-events: none;
}

.deco-arch {
    width: 80%;
    max-width: 600px;
    height: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.arch-seg {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    animation: drawSeg 0.3s ease forwards;
}

.arch-seg:nth-child(1) { animation-delay: 0.1s; }
.arch-seg:nth-child(2) { animation-delay: 0.2s; }
.arch-seg:nth-child(3) { animation-delay: 0.4s; }
.arch-seg:nth-child(4) { animation-delay: 0.5s; }
.arch-seg:nth-child(5) { animation-delay: 0.7s; }
.arch-seg:nth-child(6) { animation-delay: 0.9s; }
.arch-seg:nth-child(7) { animation-delay: 1.0s; }
.arch-seg:nth-child(8) { animation-delay: 1.1s; }
.arch-seg:nth-child(9) { animation-delay: 1.3s; }
.arch-seg:nth-child(10) { animation-delay: 1.4s; }
.arch-seg:nth-child(11) { animation-delay: 1.5s; }
.arch-seg:nth-child(12) { animation-delay: 1.6s; }
.arch-seg:nth-child(13) { animation-delay: 1.7s; }

@keyframes drawSeg {
    to { stroke-dashoffset: 0; }
}

.gateway-title {
    font-family: 'Poiret One', cursive;
    font-size: clamp(4rem, 12vw, 10rem);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--diamond-white);
    position: relative;
    z-index: 2;
    text-align: center;
}

.gateway-title span {
    display: inline-block;
    opacity: 0;
    animation: charFade 0.3s ease forwards;
}

.gateway-title span:nth-child(1) { animation-delay: 1.5s; }
.gateway-title span:nth-child(2) { animation-delay: 1.58s; }
.gateway-title span:nth-child(3) { animation-delay: 1.66s; }
.gateway-title span:nth-child(4) { animation-delay: 1.74s; }
.gateway-title span:nth-child(5) { animation-delay: 1.82s; }
.gateway-title span:nth-child(6) { animation-delay: 1.9s; }
.gateway-title span:nth-child(7) { animation-delay: 1.98s; }
.gateway-title span:nth-child(8) { animation-delay: 2.06s; }
.gateway-title span:nth-child(9) { animation-delay: 2.14s; }

@keyframes charFade {
    to { opacity: 1; }
}

.gateway-sub {
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    color: var(--neon-green);
    letter-spacing: 0.06em;
    position: relative;
    z-index: 2;
    margin-top: 16px;
    opacity: 0;
    animation: fadeIn 0.5s ease forwards 2.5s;
}

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

/* ---- Masonry Section ---- */
.masonry-section {
    padding: 60px 20px;
    max-width: 1100px;
    margin: 0 auto;
}

.masonry-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    align-items: start;
}

.masonry-block {
    position: relative;
    background: var(--graphite);
    overflow: hidden;
}

.block-tall { min-height: 350px; }
.block-medium { min-height: 260px; }
.block-short { min-height: 180px; }

/* ---- Deco Border Treatments ---- */
.deco-border-green {
    border: 2px solid var(--neon-green);
    box-shadow: 0 0 8px rgba(57, 255, 20, 0.2);
}

.deco-border-cyan {
    border: 2px solid var(--neon-cyan);
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.2);
}

.deco-border-magenta {
    border: 2px solid var(--neon-magenta);
    box-shadow: 0 0 8px rgba(255, 20, 147, 0.2);
}

/* ---- Stepped Corners ---- */
.stepped-corner {
    position: absolute;
    width: 16px;
    height: 16px;
}

.sc-tl {
    top: 6px;
    left: 6px;
    border-left: 4px solid var(--burnished-gold);
    border-top: 4px solid var(--burnished-gold);
}

.sc-tl::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 8px;
    height: 8px;
    border-left: 3px solid var(--burnished-gold);
    border-top: 3px solid var(--burnished-gold);
}

.sc-tr {
    top: 6px;
    right: 6px;
    border-right: 4px solid var(--burnished-gold);
    border-top: 4px solid var(--burnished-gold);
}

.sc-tr::before {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    border-right: 3px solid var(--burnished-gold);
    border-top: 3px solid var(--burnished-gold);
}

/* ---- Chevron Band ---- */
.chevron-band {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: repeating-linear-gradient(
        90deg,
        transparent 0px,
        transparent 6px,
        var(--burnished-gold) 6px,
        transparent 12px
    );
    background-size: 12px 6px;
}

/* ---- Zigzag Bottom ---- */
.zigzag-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(135deg, var(--neon-green) 25%, transparent 25%) -4px 0,
                linear-gradient(225deg, var(--neon-green) 25%, transparent 25%) -4px 0,
                linear-gradient(315deg, var(--neon-green) 25%, transparent 25%),
                linear-gradient(45deg, var(--neon-green) 25%, transparent 25%);
    background-size: 8px 8px;
    opacity: 0.3;
}

/* ---- Block Content ---- */
.block-title-bar {
    padding: 16px 20px 8px;
}

.block-label {
    font-family: 'Fira Code', monospace;
    font-size: 11px;
    color: var(--subdued);
    letter-spacing: 0.06em;
    display: block;
    margin-bottom: 4px;
}

.masonry-block h2 {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--diamond-white);
}

.block-content {
    padding: 0 20px 20px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s ease-out, opacity 0.3s ease 0.2s;
}

.expand-block.expanded .block-content {
    max-height: 400px;
    opacity: 1;
}

.tech-label {
    display: block;
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    color: var(--neon-green);
    letter-spacing: 0.06em;
    margin-top: 10px;
}

/* ---- Tree Ring Background ---- */
.tree-ring-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 70% 60%, rgba(42,42,42,0.5) 20px, transparent 21px),
                radial-gradient(circle at 70% 60%, rgba(42,42,42,0.3) 40px, transparent 41px),
                radial-gradient(circle at 70% 60%, rgba(42,42,42,0.2) 60px, transparent 61px),
                radial-gradient(circle at 70% 60%, rgba(42,42,42,0.1) 80px, transparent 81px);
    pointer-events: none;
}

/* ---- Diamond Interlude ---- */
.diamond-interlude {
    padding: 100px 20px;
    text-align: center;
    position: relative;
    background: var(--carbon-black);
    overflow: hidden;
}

.diamond-shape {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    transform: translate(-50%, -50%) rotate(45deg);
    background: rgba(0, 229, 255, 0.06);
    animation: diamondRotate 30s linear infinite;
}

@keyframes diamondRotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.diamond-text {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: clamp(1.2rem, 3vw, 2rem);
    color: var(--diamond-white);
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.6;
}

.chevron-ornament-top, .chevron-ornament-bottom {
    width: 120px;
    height: 12px;
    margin: 20px auto;
    background: repeating-linear-gradient(
        90deg,
        transparent 0px,
        transparent 8px,
        var(--burnished-gold) 8px,
        transparent 16px
    );
    background-size: 16px 12px;
}

/* ---- Deep Carbon ---- */
.deep-carbon .masonry-block {
    background: var(--anthracite);
}

/* ---- Plinth Footer ---- */
.plinth-footer {
    background: var(--graphite);
    padding: 0 20px 40px;
    position: relative;
}

.plinth-crown {
    width: 100%;
    height: 20px;
    background:
        linear-gradient(to right, var(--burnished-gold) 0%, var(--burnished-gold) 5%, transparent 5%, transparent 10%,
            var(--burnished-gold) 10%, var(--burnished-gold) 15%, transparent 15%, transparent 20%,
            var(--burnished-gold) 20%, var(--burnished-gold) 25%, transparent 25%, transparent 30%,
            var(--burnished-gold) 30%, var(--burnished-gold) 35%, transparent 35%, transparent 40%,
            var(--burnished-gold) 40%, var(--burnished-gold) 45%, transparent 45%, transparent 50%,
            var(--burnished-gold) 50%, var(--burnished-gold) 55%, transparent 55%, transparent 60%,
            var(--burnished-gold) 60%, var(--burnished-gold) 65%, transparent 65%, transparent 70%,
            var(--burnished-gold) 70%, var(--burnished-gold) 75%, transparent 75%, transparent 80%,
            var(--burnished-gold) 80%, var(--burnished-gold) 85%, transparent 85%, transparent 90%,
            var(--burnished-gold) 90%, var(--burnished-gold) 95%, transparent 95%);
    opacity: 0.3;
    margin-bottom: 40px;
}

.plinth-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    max-width: 900px;
    margin: 0 auto 40px;
}

.plinth-col h3 {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--diamond-white);
    margin-bottom: 12px;
}

.plinth-col p {
    font-size: 14px;
    color: var(--subdued);
}

.plinth-col ul {
    list-style: none;
}

.plinth-col li {
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    color: var(--subdued);
    margin-bottom: 6px;
}

.hex-pulse {
    width: 30px;
    height: 30px;
    margin: 0 auto;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: var(--neon-green);
    animation: hexPulse 2s ease-in-out infinite;
}

@keyframes hexPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

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

    .plinth-grid {
        grid-template-columns: 1fr;
    }

    .deco-arch {
        width: 95%;
    }

    .gateway-title {
        font-size: clamp(3rem, 10vw, 6rem);
    }
}
