/* === PALETTE: #6B6BFF (indigo accent) used in gradient borders === */

/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    background: #FAFAFA;
    color: #1A1A1A;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.7;
    overflow-x: hidden;
}

/* === THE PRISM SECTION === */
.prism-section {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FAFAFA;
    overflow: hidden;
}

.prism-center {
    position: relative;
    text-align: center;
    z-index: 2;
}

.prism-line-h {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 1px;
    background: #E0E0E0;
    animation: lineExpand 0.6s ease 0.3s forwards;
}

@keyframes lineExpand {
    to { width: 320px; }
}

.prism-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 72px;
    font-weight: 300;
    letter-spacing: 0.05em;
    opacity: 0;
    animation: fadeIn 0.8s ease 0.6s forwards;
    margin-bottom: 4px;
}

.prism-title .letter {
    display: inline-block;
    transition: color 1.2s ease;
}

.prism-title.spectral .letter {
    color: var(--spectral-color);
}

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

.prism-dev {
    font-family: 'Inter', sans-serif;
    font-size: 32px;
    font-weight: 400;
    color: #6A6A6A;
    opacity: 0;
    animation: fadeIn 0.6s ease 1.5s forwards;
}

.prism-cycle {
    margin-top: 16px;
    height: 20px;
    position: relative;
}

.cycle-word {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #6A6A6A;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.8s ease;
}

.cycle-word.active {
    opacity: 1;
}

/* Refraction lines */
.refraction-lines {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.refraction-line {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 1px;
    background: var(--line-color);
    opacity: 0.3;
    transform-origin: center center;
    transform: translate(-50%, -50%) rotate(var(--angle));
    animation: refractionExpand 1.5s ease 1.8s forwards;
}

@keyframes refractionExpand {
    to { width: 200vw; }
}

.scroll-hint {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
}

.scroll-hint-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, #E0E0E0, transparent);
    animation: scrollPulse 2s ease infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* === THE LATTICE SECTION === */
.lattice-section {
    position: relative;
    padding: 40px 0;
}

.bento-grid {
    max-width: 1360px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1px;
    background: #E0E0E0;
    border: 1px solid #E0E0E0;
}

.bento-box {
    background: linear-gradient(var(--facet-angle), #FAFAFA, #F0F0F0);
    padding: 28px 24px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-hue, #E0E0E0);
    border-color: color-mix(in srgb, var(--border-hue) 30%, #E0E0E0);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.4s ease, transform 0.4s ease, border-color 0.3s ease;
}

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

/* Facet highlight on hover */
.bento-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent 40%, var(--border-hue) 50%, transparent 60%);
    opacity: 0.08;
    transition: left 0.6s ease;
    pointer-events: none;
}

.bento-box:hover::after {
    left: 100%;
}

.bento-box:hover {
    border-color: var(--border-hue);
}

/* Box sizes */
.box-4x2 { grid-column: span 4; grid-row: span 2; }
.box-4x1 { grid-column: span 4; }
.box-3x1 { grid-column: span 3; }
.box-2x2 { grid-column: span 2; grid-row: span 2; }
.box-2x1 { grid-column: span 2; }
.box-1x1 { grid-column: span 1; }

/* Spectrum bands */
.spectrum-band {
    grid-column: span 12;
    padding: 32px 40px;
    background: #FAFAFA;
    border-bottom: 2px solid var(--band-color, #E0E0E0);
    position: relative;
}

.spectrum-band::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, #FF6B6B, #FFB347, #FFE066, #6BCB77, #4ECDC4, #6B6BFF, #6B9BFF, #9B6BFF);
    opacity: 0.4;
}

.spectrum-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 16px;
    font-weight: 300;
    color: #6A6A6A;
    margin-bottom: 16px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.spectrum-items {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.spectrum-item {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: var(--item-color);
    padding: 8px 16px;
    border: 1px solid var(--item-color);
    border-radius: 0;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    cursor: default;
}

.spectrum-item:hover {
    opacity: 1;
}

/* Typography */
.box-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 24px;
    font-weight: 500;
    line-height: 1.15;
    color: #1A1A1A;
    margin-bottom: 12px;
}

.box-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 16px;
    font-weight: 300;
    line-height: 1.3;
    color: #1A1A1A;
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.box-body {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.7;
    color: #3A3A3A;
}

.box-caption {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    color: #6A6A6A;
}

/* === PRISMATIC REFRACTION LINES ON SECTIONS === */
.lattice-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(15deg, transparent 49.5%, rgba(255, 107, 107, 0.2) 49.5%, rgba(255, 107, 107, 0.2) 50.5%, transparent 50.5%),
        linear-gradient(25deg, transparent 49.5%, rgba(255, 179, 71, 0.2) 49.5%, rgba(255, 179, 71, 0.2) 50.5%, transparent 50.5%),
        linear-gradient(35deg, transparent 49.5%, rgba(255, 224, 102, 0.2) 49.5%, rgba(255, 224, 102, 0.2) 50.5%, transparent 50.5%);
    pointer-events: none;
    z-index: 0;
}

/* === THE UNITY SECTION === */
.unity-section {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #FAFAFA;
    overflow: hidden;
}

.convergence-lines {
    position: relative;
    width: 300px;
    height: 60px;
    margin-bottom: 40px;
}

.convergence-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--line-color);
    opacity: 0.6;
    transition: transform 1.5s ease, opacity 1.5s ease;
}

.convergence-line:nth-child(1) { top: 0; }
.convergence-line:nth-child(2) { top: 8px; }
.convergence-line:nth-child(3) { top: 16px; }
.convergence-line:nth-child(4) { top: 24px; }
.convergence-line:nth-child(5) { top: 32px; }
.convergence-line:nth-child(6) { top: 40px; }
.convergence-line:nth-child(7) { top: 48px; }

.convergence-lines.converged .convergence-line {
    transform: translateY(calc(24px - var(--offset, 0px)));
    opacity: 0.9;
}

.convergence-line:nth-child(1) { --offset: 24px; }
.convergence-line:nth-child(2) { --offset: 16px; }
.convergence-line:nth-child(3) { --offset: 8px; }
.convergence-line:nth-child(4) { --offset: 0px; }
.convergence-line:nth-child(5) { --offset: -8px; }
.convergence-line:nth-child(6) { --offset: -16px; }
.convergence-line:nth-child(7) { --offset: -24px; }

.convergence-lines.converged .convergence-line:nth-child(1) { transform: translateY(24px); }
.convergence-lines.converged .convergence-line:nth-child(2) { transform: translateY(16px); }
.convergence-lines.converged .convergence-line:nth-child(3) { transform: translateY(8px); }
.convergence-lines.converged .convergence-line:nth-child(4) { transform: translateY(0); }
.convergence-lines.converged .convergence-line:nth-child(5) { transform: translateY(-8px); }
.convergence-lines.converged .convergence-line:nth-child(6) { transform: translateY(-16px); }
.convergence-lines.converged .convergence-line:nth-child(7) { transform: translateY(-24px); }

.unity-text {
    text-align: center;
    opacity: 0;
    transition: opacity 1s ease 0.5s;
}

.unity-section.visible .unity-text {
    opacity: 1;
}

.unity-word {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 40px;
    font-weight: 700;
    line-height: 1.1;
    color: #1A1A1A;
    margin-bottom: 8px;
}

.unity-meaning {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: #6A6A6A;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(6, 1fr);
        margin: 0 16px;
    }
    .box-4x2 { grid-column: span 3; grid-row: span 2; }
    .box-4x1 { grid-column: span 3; }
    .box-3x1 { grid-column: span 3; }
    .box-2x2 { grid-column: span 3; grid-row: span 2; }
    .box-2x1 { grid-column: span 3; }
    .spectrum-band { grid-column: span 6; }
}

@media (max-width: 640px) {
    .prism-title {
        font-size: 48px;
    }
    .prism-dev {
        font-size: 24px;
    }
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
        margin: 0 8px;
    }
    .box-4x2, .box-4x1, .box-3x1, .box-2x2, .box-2x1 {
        grid-column: span 2;
        grid-row: span 1;
    }
    .spectrum-band {
        grid-column: span 2;
        padding: 24px 16px;
    }
    .spectrum-items {
        gap: 12px;
    }
    .unity-word {
        font-size: 32px;
    }
}
