/* tanso.day — Carbon Allotrope Pop-Art Experience */

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

:root {
    --cream: #fffef8;
    --rose: #d4566a;
    --charcoal: #1a1a1e;
    --red: #e8432a;
    --gold: #e8a634;
    --orange: #f28b30;
    --graphite: #3d3a3c;
    --parchment: #f5efe6;
}

html {
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    background: var(--charcoal);
    color: var(--cream);
    overflow-x: hidden;
}

/* Navigation */
.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 3rem;
    mix-blend-mode: difference;
}

.nav-logo {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: 1.5rem;
    letter-spacing: 0.1em;
    color: var(--cream);
}

.nav-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    font-style: italic;
    color: var(--cream);
    opacity: 0.7;
}

/* Phase Sections */
.phase {
    position: relative;
    width: 100vw;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
    align-items: center;
    scroll-snap-align: start;
    overflow: hidden;
    padding: 4rem 3rem;
}

.phase-number {
    position: absolute;
    top: 2rem;
    right: 3rem;
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(6rem, 15vw, 12rem);
    color: var(--cream);
    opacity: 0.06;
    line-height: 1;
    pointer-events: none;
}

/* Phase Content */
.phase-content {
    z-index: 2;
    max-width: 540px;
}

.phase-content--left {
    grid-column: 1;
    justify-self: start;
    padding-left: 2rem;
}

.phase-content--right {
    grid-column: 2;
    justify-self: end;
    padding-right: 2rem;
    text-align: right;
}

.phase-content--center {
    grid-column: 1 / -1;
    justify-self: center;
    text-align: center;
}

.phase-title {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(4rem, 12vw, 10rem);
    letter-spacing: -0.03em;
    line-height: 0.88;
    text-transform: uppercase;
    color: var(--cream);
    margin-bottom: 1.5rem;
}

.phase-description {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    line-height: 1.6;
    color: var(--parchment);
    opacity: 0.85;
}

/* Phase Visuals */
.phase-visual {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    pointer-events: none;
}

/* Graphite Phase */
.phase-graphite {
    background: linear-gradient(135deg, var(--charcoal) 0%, #2a2a2e 100%);
}

.hex-grid {
    position: relative;
    width: 300px;
    height: 300px;
}

.hex-layer {
    position: absolute;
    width: 200px;
    height: 200px;
    border: 2px solid var(--graphite);
    opacity: 0.4;
    transform: rotate(30deg);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: repeating-linear-gradient(
        60deg,
        transparent,
        transparent 10px,
        rgba(61, 58, 60, 0.3) 10px,
        rgba(61, 58, 60, 0.3) 11px
    );
}

.hex-layer-1 { top: 20%; left: 30%; }
.hex-layer-2 { top: 35%; left: 45%; opacity: 0.3; transform: rotate(30deg) scale(0.8); }
.hex-layer-3 { top: 50%; left: 35%; opacity: 0.2; transform: rotate(30deg) scale(0.6); }

/* Diamond Phase */
.phase-diamond {
    background: linear-gradient(200deg, var(--charcoal) 0%, #222226 100%);
}

.diamond-lattice {
    position: relative;
    width: 350px;
    height: 350px;
}

.diamond-facet {
    position: absolute;
    background: linear-gradient(135deg, rgba(212, 86, 106, 0.15), rgba(232, 67, 42, 0.1));
    border: 1.5px solid var(--rose);
    opacity: 0.5;
}

.facet-1 {
    width: 120px; height: 120px;
    top: 30%; left: 40%;
    clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
    transform: rotate(15deg);
}

.facet-2 {
    width: 80px; height: 80px;
    top: 20%; left: 55%;
    clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
    transform: rotate(-20deg);
    opacity: 0.3;
}

.facet-3 {
    width: 100px; height: 100px;
    top: 55%; left: 35%;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    transform: rotate(45deg);
    opacity: 0.4;
}

.facet-4 {
    width: 60px; height: 60px;
    top: 15%; left: 30%;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    transform: rotate(10deg);
    opacity: 0.25;
}

.facet-5 {
    width: 140px; height: 140px;
    top: 40%; left: 50%;
    clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
    transform: rotate(35deg);
    opacity: 0.2;
}

/* Fullerene Phase */
.phase-fullerene {
    background: radial-gradient(circle at 50% 50%, #2a2228 0%, var(--charcoal) 100%);
}

.buckyball {
    position: relative;
    width: 300px;
    height: 300px;
}

.bucky-ring {
    position: absolute;
    border: 2px solid var(--orange);
    border-radius: 50%;
    opacity: 0.4;
}

.bucky-ring-1 {
    width: 250px; height: 250px;
    top: 10%; left: 10%;
    transform: rotateX(60deg);
}

.bucky-ring-2 {
    width: 200px; height: 200px;
    top: 20%; left: 20%;
    transform: rotateY(60deg);
    border-color: var(--gold);
}

.bucky-ring-3 {
    width: 220px; height: 220px;
    top: 15%; left: 15%;
    transform: rotateX(30deg) rotateZ(45deg);
    border-color: var(--rose);
    opacity: 0.3;
}

.bucky-pentagon {
    position: absolute;
    width: 80px; height: 80px;
    top: 38%; left: 38%;
    clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
    border: 2px solid var(--orange);
    background: rgba(242, 139, 48, 0.08);
}

/* Graphene Phase */
.phase-graphene {
    background: linear-gradient(160deg, #1e1e22 0%, var(--charcoal) 100%);
}

.graphene-sheet {
    width: 400px;
    height: 400px;
    transform: perspective(800px) rotateX(30deg) rotateZ(-5deg);
    opacity: 0.6;
}

.graphene-svg {
    width: 100%;
    height: 100%;
}

/* Lonsdaleite Phase */
.phase-lonsdaleite {
    background: linear-gradient(300deg, #1a1a1e 0%, #251a1e 100%);
}

.meteor-crystal {
    position: relative;
    width: 350px;
    height: 350px;
}

.crystal-shard {
    position: absolute;
    background: linear-gradient(135deg, rgba(232, 67, 42, 0.12), rgba(212, 86, 106, 0.08));
    border: 1px solid var(--red);
    opacity: 0.5;
}

.shard-1 {
    width: 60px; height: 180px;
    top: 20%; left: 45%;
    clip-path: polygon(50% 0%, 100% 30%, 80% 100%, 20% 100%, 0% 30%);
    transform: rotate(5deg);
}

.shard-2 {
    width: 50px; height: 150px;
    top: 25%; left: 55%;
    clip-path: polygon(50% 0%, 100% 25%, 85% 100%, 15% 100%, 0% 25%);
    transform: rotate(-12deg);
    opacity: 0.4;
}

.shard-3 {
    width: 40px; height: 120px;
    top: 30%; left: 38%;
    clip-path: polygon(50% 0%, 100% 20%, 90% 100%, 10% 100%, 0% 20%);
    transform: rotate(18deg);
    opacity: 0.35;
}

.shard-4 {
    width: 55px; height: 160px;
    top: 15%; left: 50%;
    clip-path: polygon(50% 0%, 100% 35%, 75% 100%, 25% 100%, 0% 35%);
    transform: rotate(-5deg);
    opacity: 0.3;
}

.shard-5 {
    width: 35px; height: 100px;
    top: 40%; left: 60%;
    clip-path: polygon(50% 0%, 100% 20%, 80% 100%, 20% 100%, 0% 20%);
    transform: rotate(25deg);
    opacity: 0.25;
}

.shard-6 {
    width: 45px; height: 130px;
    top: 22%; left: 42%;
    clip-path: polygon(50% 0%, 100% 28%, 85% 100%, 15% 100%, 0% 28%);
    transform: rotate(-20deg);
    opacity: 0.2;
}

/* Speech Bubbles — Pop Art */
.speech-bubble {
    position: absolute;
    z-index: 3;
    background: var(--cream);
    color: var(--charcoal);
    padding: 1rem 1.5rem;
    border: 3px solid var(--charcoal);
    border-radius: 4px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 4px 4px 0 var(--charcoal);
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.speech-bubble.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 12px solid var(--charcoal);
}

.speech-data {
    display: block;
    color: var(--red);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.speech-value {
    display: block;
    margin-top: 0.25rem;
    color: var(--charcoal);
}

.speech-bubble--graphite { bottom: 20%; left: 10%; }
.speech-bubble--diamond { top: 25%; left: 10%; }
.speech-bubble--fullerene { bottom: 15%; right: 10%; }
.speech-bubble--graphene { bottom: 20%; right: 8%; }
.speech-bubble--lonsdaleite { top: 20%; left: 8%; }

/* Halftone overlay effect */
.phase::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, var(--graphite) 1px, transparent 1px);
    background-size: 8px 8px;
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
}

/* Footer */
.site-footer {
    position: relative;
    padding: 4rem 3rem;
    background: var(--charcoal);
    border-top: 2px solid var(--graphite);
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.footer-logo {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: 2rem;
    letter-spacing: 0.1em;
    color: var(--cream);
}

.footer-tagline {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 1.1rem;
    color: var(--parchment);
    opacity: 0.6;
}

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.7; }
}

.phase.active .hex-layer {
    animation: pulse-glow 3s ease-in-out infinite;
}

.phase.active .diamond-facet {
    animation: pulse-glow 2.5s ease-in-out infinite;
}

.phase.active .bucky-ring {
    animation: float 4s ease-in-out infinite;
}

.phase.active .bucky-ring-2 { animation-delay: 0.5s; }
.phase.active .bucky-ring-3 { animation-delay: 1s; }

.phase.active .crystal-shard {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* Broken grid offsets */
.phase-graphite .phase-content { transform: translateY(-5vh) translateX(2vw); }
.phase-diamond .phase-content { transform: translateY(3vh) translateX(-1vw); }
.phase-fullerene .phase-content { transform: translateY(-2vh); }
.phase-graphene .phase-content { transform: translateY(4vh) translateX(3vw); }
.phase-lonsdaleite .phase-content { transform: translateY(-3vh) translateX(-2vw); }

/* Responsive */
@media (max-width: 768px) {
    .phase {
        grid-template-columns: 1fr;
        padding: 6rem 1.5rem 3rem;
    }

    .phase-content--left,
    .phase-content--right,
    .phase-content--center {
        grid-column: 1;
        justify-self: start;
        text-align: left;
        padding: 0;
    }

    .phase-title {
        font-size: clamp(3rem, 15vw, 5rem);
    }

    .nav-bar {
        padding: 1rem 1.5rem;
    }

    .speech-bubble {
        display: none;
    }
}
