/* =============================================
   logical.day -- Styles
   Ethereal meditation on logical reasoning
   ============================================= */

/* Color reference (design compliance):
   #0d1b3a - Aurora navy
   #1a3a6a - Aurora blue
   #3a1a5a - Aurora violet
   #1a5a3a - Aurora teal
   #f0f0ff - Luminous white
   #a78bfa - Luminous glow
   #34d399 - Generative line
   #e0d0ff - Sharp-angle accent
*/

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Lora', serif;
    font-weight: 400;
    color: #f0f0ff;
    background-color: #0d1b3a;
    overflow-x: hidden;
    line-height: 1.75;
    font-size: clamp(15px, 1.5vw, 18px);
}

/* =============================================
   Aurora Gradient Background
   ============================================= */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: linear-gradient(
        135deg,
        #0d1b3a 0%,
        #1a3a6a 25%,
        #3a1a5a 50%,
        #1a5a3a 75%,
        #0d1b3a 100%
    );
    background-size: 400% 400%;
    animation: auroraShift 20s ease infinite;
}

@keyframes auroraShift {
    0% { background-position: 0% 50%; }
    25% { background-position: 100% 50%; }
    50% { background-position: 100% 0%; }
    75% { background-position: 0% 100%; }
    100% { background-position: 0% 50%; }
}

/* =============================================
   Geometric Overlays (sharp-angle lines)
   ============================================= */
#geometric-overlays {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.geo-line {
    position: absolute;
    background: #e0d0ff;
    opacity: 0.05;
}

.geo-line-1 {
    width: 1px;
    height: 200%;
    top: -50%;
    left: 20%;
    transform: rotate(45deg);
    transform-origin: top left;
}

.geo-line-2 {
    width: 1px;
    height: 200%;
    top: -50%;
    right: 25%;
    transform: rotate(-45deg);
    transform-origin: top right;
}

.geo-line-3 {
    width: 200%;
    height: 1px;
    top: 35%;
    left: -50%;
    transform: rotate(45deg);
}

.geo-line-4 {
    width: 1px;
    height: 200%;
    top: -50%;
    left: 55%;
    transform: rotate(45deg);
    transform-origin: top left;
}

.geo-line-5 {
    width: 200%;
    height: 1px;
    top: 70%;
    left: -50%;
    transform: rotate(-45deg);
}

.geo-line-6 {
    width: 1px;
    height: 200%;
    top: -50%;
    left: 80%;
    transform: rotate(-45deg);
    transform-origin: top right;
}

/* =============================================
   Hero Section
   ============================================= */
.hero-section {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

/* Hexagon frame using clip-path */
.hexagon-frame {
    position: relative;
    width: clamp(280px, 50vw, 600px);
    height: clamp(240px, 43vw, 520px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hexagon-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: transparent;
    opacity: 0;
    animation: borderFadeIn 800ms ease-out forwards;
}

.hexagon-border::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.3), rgba(52, 211, 153, 0.2));
    animation: borderPulse 3s ease-in-out infinite;
}

.hexagon-border::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: transparent;
}

@keyframes borderFadeIn {
    from { opacity: 0; }
    to { opacity: 0.3; }
}

@keyframes borderPulse {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.5; }
}

.hero-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(48px, 10vw, 140px);
    letter-spacing: 0.15em;
    text-align: center;
    color: #f0f0ff;
    position: relative;
    z-index: 1;
}

.hero-title .letter {
    display: inline-block;
    opacity: 0;
    animation: letterFadeIn 400ms ease-out forwards;
    text-shadow:
        0 0 20px rgba(167, 139, 250, 0.4),
        0 0 60px rgba(167, 139, 250, 0.15);
}

.hero-title .letter[data-index="0"] { animation-delay: 0ms; }
.hero-title .letter[data-index="1"] { animation-delay: 100ms; }
.hero-title .letter[data-index="2"] { animation-delay: 200ms; }
.hero-title .letter[data-index="3"] { animation-delay: 300ms; }
.hero-title .letter[data-index="4"] { animation-delay: 400ms; }
.hero-title .letter[data-index="5"] { animation-delay: 500ms; }
.hero-title .letter[data-index="6"] { animation-delay: 600ms; }

@keyframes letterFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(18px, 3vw, 36px);
    letter-spacing: 0.5em;
    text-transform: uppercase;
    color: #f0f0ff;
    opacity: 0;
    animation: subtitleFadeIn 600ms ease-out 900ms forwards;
    text-shadow:
        0 0 15px rgba(167, 139, 250, 0.3),
        0 0 40px rgba(167, 139, 250, 0.1);
}

@keyframes subtitleFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 0.8;
        transform: translateY(0);
    }
}

/* =============================================
   Principles Section (Honeycomb)
   ============================================= */
.principles-section {
    position: relative;
    padding: clamp(40px, 6vw, 80px) clamp(20px, 4vw, 60px);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.principles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    max-width: 900px;
    width: 100%;
}

/* Hexagonal cell */
.hex-cell {
    position: relative;
    width: 100%;
    padding-bottom: 115%;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    cursor: pointer;
    transition: filter 0.2s ease;
}

.hex-cell::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
        rgba(13, 27, 58, 0.6),
        rgba(26, 58, 106, 0.4),
        rgba(58, 26, 90, 0.3)
    );
    border: 1px solid rgba(255, 255, 255, 0.3);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    transition: all 0.2s ease;
    box-shadow:
        inset 0 0 20px rgba(167, 139, 250, 0.1),
        0 0 15px rgba(167, 139, 250, 0.1);
}

.hex-cell:hover::before {
    background: linear-gradient(135deg,
        rgba(13, 27, 58, 0.8),
        rgba(26, 58, 106, 0.6),
        rgba(58, 26, 90, 0.5)
    );
    box-shadow:
        inset 0 0 30px rgba(167, 139, 250, 0.25),
        0 0 25px rgba(167, 139, 250, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
}

.hex-cell:hover {
    filter: brightness(1.3);
}

.hex-cell.dimmed {
    filter: brightness(0.7);
}

.hex-cell.dimmed::before {
    box-shadow:
        inset 0 0 10px rgba(167, 139, 250, 0.05),
        0 0 5px rgba(167, 139, 250, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

.hex-cell-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20%;
    text-align: center;
    z-index: 1;
}

.principle-name {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(14px, 2.5vw, 28px);
    color: #f0f0ff;
    margin-bottom: 8px;
    text-shadow: 0 0 12px rgba(167, 139, 250, 0.3);
    line-height: 1.2;
}

.principle-def {
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: clamp(10px, 1.2vw, 14px);
    color: rgba(240, 240, 255, 0.7);
    line-height: 1.5;
}

/* Offset rows for honeycomb tessellation */
.hex-cell:nth-child(4),
.hex-cell:nth-child(5),
.hex-cell:nth-child(6) {
    transform: translateX(50%) translateY(-12%);
}

.hex-cell:nth-child(7),
.hex-cell:nth-child(8),
.hex-cell:nth-child(9) {
    transform: translateY(-24%);
}

/* =============================================
   Proof Garden Section
   ============================================= */
.proof-garden-section {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    border-top: 1px solid transparent;
    border-image: linear-gradient(to right, transparent, #34d399, #a78bfa, transparent) 1;
}

#proof-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* =============================================
   Clarity Section (Closing)
   ============================================= */
.clarity-section {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(13, 27, 58, 0.5) 30%,
        rgba(13, 27, 58, 0.9) 100%
    );
}

.clarity-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.therefore-symbol {
    font-family: 'Fira Code', monospace;
    font-weight: 400;
    font-size: clamp(80px, 20vw, 280px);
    color: #f0f0ff;
    text-shadow:
        0 0 20px rgba(167, 139, 250, 0.6),
        0 0 60px rgba(167, 139, 250, 0.3),
        0 0 100px rgba(52, 211, 153, 0.2),
        0 0 140px rgba(26, 58, 106, 0.3),
        0 0 200px rgba(58, 26, 90, 0.2);
    animation: thereforeGlow 4s ease-in-out infinite;
}

@keyframes thereforeGlow {
    0%, 100% {
        text-shadow:
            0 0 20px rgba(167, 139, 250, 0.6),
            0 0 60px rgba(167, 139, 250, 0.3),
            0 0 100px rgba(52, 211, 153, 0.2),
            0 0 140px rgba(26, 58, 106, 0.3),
            0 0 200px rgba(58, 26, 90, 0.2);
    }
    50% {
        text-shadow:
            0 0 30px rgba(167, 139, 250, 0.8),
            0 0 80px rgba(167, 139, 250, 0.5),
            0 0 120px rgba(52, 211, 153, 0.3),
            0 0 160px rgba(26, 58, 106, 0.4),
            0 0 240px rgba(58, 26, 90, 0.3);
    }
}

.clarity-domain {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(12px, 1.2vw, 16px);
    letter-spacing: 0.3em;
    color: rgba(240, 240, 255, 0.5);
    text-transform: lowercase;
}

/* =============================================
   Responsive adjustments
   ============================================= */
@media (max-width: 768px) {
    .principles-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 500px;
    }

    .hex-cell:nth-child(3),
    .hex-cell:nth-child(4) {
        transform: translateX(50%) translateY(-12%);
    }

    .hex-cell:nth-child(5),
    .hex-cell:nth-child(6) {
        transform: translateY(-24%);
    }

    .hex-cell:nth-child(7),
    .hex-cell:nth-child(8) {
        transform: translateX(50%) translateY(-36%);
    }

    .hex-cell:nth-child(9) {
        transform: translateY(-48%);
    }

    .hex-cell-inner {
        padding: 15%;
    }
}

@media (max-width: 480px) {
    .principles-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 340px;
    }

    .principle-def {
        font-size: 10px;
    }
}
