/* ============================================
   tanso.group — Y2K-Futurist Carbon Descent
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background: #0a0e1a;
    color: #c8d0e0;
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.7;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* --- Typography --- */
.display-text {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(2.8rem, 6vw, 5.5rem);
    letter-spacing: -0.03em;
    line-height: 1.05;
    color: #c8d0e0;
}

.display-text em {
    font-style: italic;
    color: #8fa8d4;
}

.display-text .gold {
    color: #b8a472;
}

.display-text sub {
    font-size: 0.6em;
    vertical-align: baseline;
    position: relative;
    bottom: -0.2em;
}

.display-text-sm {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: #c8d0e0;
}

.body-text {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.7;
    color: #6b7fa3;
    margin-top: 0.75rem;
}

.mono-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.7rem, 0.85vw, 0.85rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5a8a6a;
    display: block;
    margin-bottom: 0.5rem;
}

/* --- Zone Navigation --- */
.zone-nav {
    position: fixed;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.nav-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: #1e2740;
    transform: translateX(-50%);
    z-index: -1;
}

.zone-marker {
    display: block;
    font-size: 12px;
    color: #6b7fa3;
    text-decoration: none;
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
}

.zone-marker.active {
    color: #8fa8d4;
    text-shadow: 0 0 12px rgba(143, 168, 212, 0.6), 0 0 24px rgba(143, 168, 212, 0.3);
    transform: scale(1.4);
}

@keyframes marker-pulse {
    0%, 100% { text-shadow: 0 0 12px rgba(143, 168, 212, 0.6), 0 0 24px rgba(143, 168, 212, 0.3); }
    50% { text-shadow: 0 0 18px rgba(143, 168, 212, 0.8), 0 0 36px rgba(143, 168, 212, 0.4); }
}

.zone-marker.active {
    animation: marker-pulse 3s ease-in-out infinite;
}

/* --- Chrome Orbs --- */
.chrome-orbs-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.chrome-orb {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #c8d0e0, #6b7fa3, #1e2740);
    opacity: 0.15;
}

.orb-1 {
    width: 48px; height: 48px;
    top: 12%; left: 78%;
    animation: orbDrift1 28s ease-in-out infinite alternate;
}
.orb-2 {
    width: 32px; height: 32px;
    top: 35%; left: 88%;
    animation: orbDrift2 35s ease-in-out infinite alternate;
}
.orb-3 {
    width: 56px; height: 56px;
    top: 60%; left: 72%;
    animation: orbDrift3 20s ease-in-out infinite alternate;
}
.orb-4 {
    width: 40px; height: 40px;
    top: 80%; left: 82%;
    animation: orbDrift1 32s ease-in-out infinite alternate-reverse;
}
.orb-5 {
    width: 36px; height: 36px;
    top: 20%; left: 65%;
    animation: orbDrift2 25s ease-in-out infinite alternate;
}
.orb-6 {
    width: 64px; height: 64px;
    top: 50%; left: 90%;
    animation: orbDrift3 40s ease-in-out infinite alternate-reverse;
    opacity: 0.08;
}

@keyframes orbDrift1 {
    0% { transform: translate(0, 0) scale(0.95); }
    33% { transform: translate(-30px, 20px) scale(1.02); }
    66% { transform: translate(15px, -25px) scale(0.98); }
    100% { transform: translate(-10px, 35px) scale(1.05); }
}
@keyframes orbDrift2 {
    0% { transform: translate(0, 0) scale(1.0); }
    50% { transform: translate(25px, -30px) scale(1.05); }
    100% { transform: translate(-20px, 15px) scale(0.95); }
}
@keyframes orbDrift3 {
    0% { transform: translate(0, 0) scale(1.05); }
    50% { transform: translate(-35px, -20px) scale(0.95); }
    100% { transform: translate(20px, 30px) scale(1.02); }
}

/* --- Frost Card --- */
.frost-card {
    background: rgba(20, 27, 45, 0.6);
    backdrop-filter: blur(20px) saturate(1.3);
    -webkit-backdrop-filter: blur(20px) saturate(1.3);
    border: 1px solid transparent;
    border-image: linear-gradient(135deg, #8fa8d4 0%, #c8d0e0 25%, #b8a472 50%, #8fa8d4 75%, #c8d0e0 100%) 1;
    padding: 2rem 2.5rem;
    position: relative;
}

.frost-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, #8fa8d4 0%, #c8d0e0 25%, #b8a472 50%, #8fa8d4 75%, #c8d0e0 100%);
    background-size: 400% 400%;
    animation: shimmer 12s ease-in-out infinite;
    z-index: -1;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
    padding: 1px;
}

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

/* --- Hexagonal Grid Overlay --- */
.hex-grid-overlay {
    position: absolute;
    inset: -100px;
    opacity: 0.08;
    transform: rotate(7deg);
    pointer-events: none;
    z-index: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='86.6'%3E%3Cpolygon points='50,0 100,25 100,75 50,100 0,75 0,25' fill='none' stroke='%231e2740' stroke-width='0.5'/%3E%3C/svg%3E");
    background-size: 100px 86.6px;
}

/* --- Sumi Strokes --- */
.sumi-stroke {
    position: absolute;
    z-index: 2;
    pointer-events: none;
    opacity: 0.7;
}

.sumi-stroke svg {
    width: 100%;
    height: 100%;
}

.sumi-path {
    filter: drop-shadow(0 0 8px rgba(143, 168, 212, 0.3));
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.sumi-stroke.drawn .sumi-path {
    stroke-dashoffset: 0;
}

.sumi-diamond { top: 5%; left: 5%; width: 300px; height: 150px; }
.sumi-graphene { top: 8%; right: 5%; left: auto; width: 280px; height: 140px; }
.sumi-nanotube { bottom: 10%; left: 8%; width: 260px; height: 130px; }
.sumi-fullerene { top: 5%; right: 8%; left: auto; width: 300px; height: 150px; }

/* --- Wireframes --- */
.wireframe {
    position: absolute;
    pointer-events: none;
    z-index: 0;
}

.wireframe-diamond {
    width: 400px;
    height: 400px;
    bottom: -50px;
    right: -50px;
    opacity: 0.5;
}

.wireframe-nanotube {
    width: 90%;
    height: 200px;
    bottom: 20px;
    left: 5%;
    opacity: 0.4;
}

.wireframe-fullerene {
    width: 350px;
    height: 350px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.3;
}

/* --- Zones Common --- */
.zone {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* --- DIAMOND ZONE --- */
.zone-diamond {
    background: linear-gradient(165deg, #0a0e1a 0%, #141b2d 40%, #1e2740 70%, #141b2d 100%);
    padding: 6rem 4rem 4rem 80px;
}

.diamond-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 2rem;
    max-width: 1100px;
    width: 100%;
    position: relative;
    z-index: 3;
}

.diamond-node {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.zone-diamond.in-view .diamond-node {
    opacity: 1;
    transform: translateY(0);
}

.node-top {
    grid-column: 1 / -1;
    text-align: left;
    max-width: 700px;
}

.node-left { grid-column: 1; }
.node-right { grid-column: 2; }

.node-bottom {
    grid-column: 1 / -1;
    max-width: 500px;
    justify-self: center;
}

/* --- GRAPHENE ZONE --- */
.zone-graphene {
    background: linear-gradient(180deg, #141b2d 0%, #0a0e1a 50%, #141b2d 100%);
    padding: 4rem 4rem 4rem 80px;
}

.graphene-layout {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 1200px;
    width: 100%;
    position: relative;
    z-index: 3;
}

.hex-cell {
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hex-cell::before {
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}

.hex-cell:hover {
    transform: scale(1.03);
}

.hex-large {
    grid-column: 1 / -1;
    clip-path: none;
    padding: 3rem;
    text-align: left;
    align-items: flex-start;
}

.hex-large::before {
    clip-path: none;
}

.hex-medium {
    grid-column: span 1;
}

/* --- NANOTUBE ZONE --- */
.zone-nanotube {
    background: linear-gradient(180deg, #0a0e1a 0%, #141b2d 30%, #0a0e1a 100%);
    padding: 4rem 2rem 4rem 80px;
    flex-direction: column;
    align-items: flex-start;
}

.nanotube-wrapper {
    width: 100%;
    position: relative;
    z-index: 3;
}

.nanotube-label {
    margin-bottom: 2rem;
    padding-left: 1rem;
}

.nanotube-strip {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2rem 1rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    perspective: 1200px;
}

.nanotube-strip::-webkit-scrollbar {
    height: 4px;
}

.nanotube-strip::-webkit-scrollbar-track {
    background: #0a0e1a;
}

.nanotube-strip::-webkit-scrollbar-thumb {
    background: #1e2740;
    border-radius: 2px;
}

.tube-card {
    min-width: 320px;
    max-width: 360px;
    flex-shrink: 0;
    scroll-snap-align: start;
    transform: rotateY(-2deg);
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.tube-card:hover {
    transform: rotateY(0deg);
}

/* --- FULLERENE ZONE --- */
.zone-fullerene {
    background: linear-gradient(165deg, #141b2d 0%, #0a0e1a 50%, #1e2740 100%);
    padding: 4rem;
    min-height: 100vh;
}

.fullerene-layout {
    width: 100%;
    max-width: 900px;
    position: relative;
    z-index: 3;
}

.fullerene-sphere {
    position: relative;
    width: 100%;
    min-height: 80vh;
    perspective: 1200px;
}

.sphere-node {
    position: absolute;
    max-width: 340px;
    transition: transform 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.sphere-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 400px;
    z-index: 2;
    text-align: center;
}

.sphere-n {
    top: 5%;
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    opacity: 0.85;
}

.sphere-e {
    top: 40%;
    right: 0;
    transform: scale(0.85);
    opacity: 0.8;
}

.sphere-s {
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    opacity: 0.85;
}

.sphere-w {
    top: 40%;
    left: 0;
    transform: scale(0.85);
    opacity: 0.8;
}

@keyframes fullerene-rotate {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

.zone-fullerene.in-view .fullerene-sphere {
    animation: fullerene-rotate 60s linear infinite;
    transform-style: preserve-3d;
}

.zone-fullerene.in-view .sphere-node {
    animation: none;
}

/* Counter-rotate children to keep text readable */
.zone-fullerene.in-view .sphere-center { animation: fullerene-counter 60s linear infinite; }
.zone-fullerene.in-view .sphere-n { animation: fullerene-counter 60s linear infinite; }
.zone-fullerene.in-view .sphere-e { animation: fullerene-counter 60s linear infinite; }
.zone-fullerene.in-view .sphere-s { animation: fullerene-counter 60s linear infinite; }
.zone-fullerene.in-view .sphere-w { animation: fullerene-counter 60s linear infinite; }

@keyframes fullerene-counter {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(-360deg); }
}

/* --- AMORPHOUS ZONE --- */
.zone-amorphous {
    background: #0a0e1a;
    padding: 4rem 4rem 4rem 80px;
    min-height: 100vh;
}

.amorphous-layout {
    width: 100%;
    max-width: 1200px;
    min-height: 80vh;
    position: relative;
    z-index: 3;
}

.drift-element {
    position: absolute;
}

.drift-1 {
    top: 5%;
    left: 10%;
    max-width: 400px;
    animation: drift1 25s ease-in-out infinite alternate;
}

.drift-2 {
    top: 30%;
    right: 5%;
    max-width: 320px;
    animation: drift2 30s ease-in-out infinite alternate;
}

.drift-3 {
    bottom: 20%;
    left: 25%;
    max-width: 350px;
    animation: drift3 22s ease-in-out infinite alternate;
}

.drift-4 {
    top: 60%;
    left: 5%;
    animation: drift1 35s ease-in-out infinite alternate-reverse;
}

.drift-5 {
    top: 15%;
    right: 20%;
    animation: drift2 28s ease-in-out infinite alternate-reverse;
}

.drift-6 {
    bottom: 8%;
    right: 15%;
    animation: drift3 32s ease-in-out infinite alternate;
}

@keyframes drift1 {
    0% { transform: translate(0, 0); }
    33% { transform: translate(15px, -20px); }
    66% { transform: translate(-10px, 15px); }
    100% { transform: translate(20px, 10px); }
}

@keyframes drift2 {
    0% { transform: translate(0, 0); }
    50% { transform: translate(-25px, 18px); }
    100% { transform: translate(12px, -22px); }
}

@keyframes drift3 {
    0% { transform: translate(0, 0); }
    33% { transform: translate(18px, 12px); }
    66% { transform: translate(-15px, -18px); }
    100% { transform: translate(-8px, 25px); }
}

/* --- Zone transition morphing --- */
.zone {
    opacity: 0.4;
    transition: opacity 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.zone.in-view {
    opacity: 1;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .zone-nav {
        left: 12px;
        gap: 18px;
    }

    .zone-diamond,
    .zone-graphene,
    .zone-nanotube,
    .zone-amorphous {
        padding-left: 50px;
        padding-right: 1.5rem;
    }

    .diamond-layout {
        grid-template-columns: 1fr;
    }

    .node-top,
    .node-bottom {
        grid-column: 1;
    }

    .graphene-layout {
        grid-template-columns: 1fr;
    }

    .hex-cell {
        clip-path: none;
        padding: 2rem 1.5rem;
    }

    .hex-cell::before {
        clip-path: none;
    }

    .tube-card {
        min-width: 280px;
    }

    .sphere-node {
        position: relative;
        max-width: 100%;
        top: auto; left: auto; right: auto; bottom: auto;
        transform: none;
        opacity: 1;
        margin-bottom: 1.5rem;
    }

    .sphere-center {
        transform: none;
    }

    .fullerene-sphere {
        display: flex;
        flex-direction: column;
        min-height: auto;
    }

    .zone-fullerene.in-view .fullerene-sphere {
        animation: none;
    }

    .zone-fullerene.in-view .sphere-node {
        animation: none;
    }

    .drift-element {
        position: relative;
        top: auto; left: auto; right: auto; bottom: auto;
        max-width: 100%;
        margin-bottom: 2rem;
    }

    .amorphous-layout {
        min-height: auto;
        display: flex;
        flex-direction: column;
    }

    .frost-card {
        padding: 1.5rem;
    }

    .wireframe-diamond,
    .wireframe-fullerene {
        display: none;
    }
}
