/* rational.today - Hexagonal Honeycomb + Inflated 3D + Jewel Tones */

/* ============================================================
   CSS Custom Properties
   ============================================================ */
:root {
    /* Primary Jewel Tones */
    --deep-sapphire: #1a3f5c;
    --rich-amethyst: #6b4d8a;
    --emerald: #2d7a4a;
    --ruby-red: #8b3a3a;

    /* Secondary Neutrals */
    --cream: #f5f0e8;
    --warm-stone: #c9bfb0;
    --deep-charcoal: #2b2520;

    /* Tertiary Accents */
    --soft-gold: #d4af37;
    --pale-pearl: #f9f7f5;
    --translucent-overlay: rgba(26, 63, 92, 0.08);

    /* Typography */
    --font-headline: 'Space Grotesk', sans-serif;
    --font-body: 'Lora', serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-accent: 'Playfair Display', serif;

    /* Hex dimensions */
    --hex-size-large: 420px;
    --hex-size-medium: 320px;
    --hex-size-small: 240px;
    --hex-size-dense: 200px;
    --hex-size-nav: 120px;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    background-color: var(--cream);
    color: var(--deep-charcoal);
    line-height: 1.7;
    overflow-x: hidden;
    position: relative;
}

/* ============================================================
   Marble Canvas Background
   ============================================================ */
#marble-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.18;
}

/* ============================================================
   Geometric Layer (Floating 3D elements)
   ============================================================ */
.geometric-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.geo-sphere,
.geo-cube,
.geo-polyhedron,
.geo-torus {
    position: absolute;
    border-radius: 50%;
    will-change: transform;
}

/* Spheres - inflated 3D look with internal glow */
.geo-sphere {
    background: radial-gradient(circle at 35% 35%, var(--pale-pearl), var(--rich-amethyst) 60%, var(--deep-sapphire));
    box-shadow: 0 0 6px 2px rgba(212, 175, 55, 0.15), inset 0 -8px 20px rgba(0, 0, 0, 0.15);
    animation: float-breathe 8s ease-in-out infinite;
}

.sphere-1 {
    width: 60px;
    height: 60px;
    top: 15%;
    left: 8%;
    animation-delay: 0s;
}

.sphere-2 {
    width: 40px;
    height: 40px;
    top: 55%;
    right: 12%;
    background: radial-gradient(circle at 35% 35%, var(--pale-pearl), var(--emerald) 60%, var(--deep-sapphire));
    animation-delay: -2.5s;
}

.sphere-3 {
    width: 50px;
    height: 50px;
    bottom: 20%;
    left: 18%;
    background: radial-gradient(circle at 35% 35%, var(--pale-pearl), var(--soft-gold) 50%, var(--ruby-red));
    animation-delay: -5s;
}

/* Cubes - represented as rotated squares with depth */
.geo-cube {
    border-radius: 4px;
    background: linear-gradient(135deg, rgba(106, 77, 138, 0.3), rgba(26, 63, 92, 0.5));
    border: 1px solid rgba(212, 175, 55, 0.2);
    backdrop-filter: blur(2px);
    animation: cube-rotate 20s linear infinite;
}

.cube-1 {
    width: 35px;
    height: 35px;
    top: 30%;
    right: 6%;
    animation-delay: 0s;
}

.cube-2 {
    width: 25px;
    height: 25px;
    bottom: 35%;
    left: 5%;
    animation-delay: -8s;
}

/* Polyhedra - hexagonal shapes with glow */
.geo-polyhedron {
    border-radius: 0;
    background: linear-gradient(60deg, rgba(45, 122, 74, 0.25), rgba(212, 175, 55, 0.3));
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    box-shadow: 0 0 5px 1px rgba(212, 175, 55, 0.2);
    animation: poly-spin 15s linear infinite;
}

.poly-1 {
    width: 45px;
    height: 45px;
    top: 70%;
    right: 20%;
    animation-delay: 0s;
}

.poly-2 {
    width: 30px;
    height: 30px;
    top: 10%;
    right: 35%;
    animation-delay: -5s;
}

.poly-3 {
    width: 38px;
    height: 38px;
    bottom: 10%;
    right: 45%;
    animation-delay: -10s;
}

/* Torus - ring shapes */
.geo-torus {
    border-radius: 50%;
    background: transparent;
    border: 3px solid rgba(106, 77, 138, 0.25);
    box-shadow: 0 0 4px rgba(212, 175, 55, 0.15), inset 0 0 4px rgba(212, 175, 55, 0.1);
    animation: torus-drift 12s ease-in-out infinite;
}

.torus-1 {
    width: 50px;
    height: 50px;
    top: 45%;
    left: 3%;
    animation-delay: 0s;
}

.torus-2 {
    width: 35px;
    height: 35px;
    bottom: 50%;
    right: 3%;
    animation-delay: -4s;
}

/* ============================================================
   Animations for Geometric Elements
   ============================================================ */
@keyframes float-breathe {
    0%, 100% {
        transform: translateY(0) scale(0.95);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-15px) scale(1.05);
        opacity: 0.85;
    }
}

@keyframes cube-rotate {
    0% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(90deg) scale(1.05); }
    50% { transform: rotate(180deg) scale(1); }
    75% { transform: rotate(270deg) scale(0.95); }
    100% { transform: rotate(360deg) scale(1); }
}

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

@keyframes torus-drift {
    0%, 100% {
        transform: translateX(0) translateY(0) rotate(0deg);
    }
    33% {
        transform: translateX(10px) translateY(-8px) rotate(120deg);
    }
    66% {
        transform: translateX(-5px) translateY(5px) rotate(240deg);
    }
}

/* ============================================================
   Honeycomb Sections
   ============================================================ */
.honeycomb-section {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.hex-cluster {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 20px;
    max-width: 1200px;
    width: 100%;
}

/* ============================================================
   Hexagon Base Styles
   ============================================================ */
.hexagon {
    position: relative;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.4s ease,
                filter 0.4s ease;
    will-change: transform;
    opacity: 0;
    transform: rotate(8deg) scale(0.85);
}

.hexagon.visible {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.hex-inner {
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hex-content {
    padding: 25px 20px;
    text-align: center;
    max-width: 90%;
}

/* Hexagon hover - lift, shadow deepen, gold glow */
.hexagon:hover {
    transform: translateY(-10px) scale(1.02);
    filter: brightness(1.15);
    cursor: default;
}

.hexagon::after {
    content: '';
    position: absolute;
    inset: -2px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: transparent;
    transition: background 0.4s ease;
    z-index: -1;
    pointer-events: none;
}

.hexagon:hover::after {
    background: rgba(212, 175, 55, 0.15);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

/* Depth layers */
.hex-depth-front {
    z-index: 3;
}

.hex-depth-mid {
    z-index: 2;
}

.hex-depth-back {
    z-index: 1;
    opacity: 0;
}

.hex-depth-back.visible {
    opacity: 0.85;
}

/* ============================================================
   Hexagon Size Variants
   ============================================================ */

/* Hero hexagon */
.hex-hero {
    width: var(--hex-size-large);
    height: var(--hex-size-large);
    background: linear-gradient(145deg, var(--deep-sapphire), rgba(26, 63, 92, 0.9));
    flex-shrink: 0;
}

.hex-hero .hex-inner {
    background: linear-gradient(145deg, rgba(26, 63, 92, 0.95), rgba(106, 77, 138, 0.2));
}

/* Large */
.hex-large {
    width: var(--hex-size-large);
    height: var(--hex-size-large);
    background: linear-gradient(145deg, var(--deep-sapphire), rgba(45, 122, 74, 0.3));
}

.hex-large .hex-inner {
    background: linear-gradient(145deg, rgba(26, 63, 92, 0.9), rgba(45, 122, 74, 0.15));
}

/* Medium */
.hex-medium {
    width: var(--hex-size-medium);
    height: var(--hex-size-medium);
}

.hex-medium .hex-inner {
    background: rgba(26, 63, 92, 0.06);
}

/* Small */
.hex-small {
    width: var(--hex-size-small);
    height: var(--hex-size-small);
}

.hex-small .hex-inner {
    background: rgba(106, 77, 138, 0.06);
}

/* Dense (deep dive) */
.hex-dense {
    width: var(--hex-size-dense);
    height: var(--hex-size-dense);
}

.hex-dense .hex-inner {
    background: rgba(26, 63, 92, 0.08);
}

/* Nav hexagons */
.hex-nav {
    width: var(--hex-size-nav);
    height: var(--hex-size-nav);
    background: linear-gradient(145deg, var(--warm-stone), var(--cream));
}

.hex-nav .hex-inner {
    background: rgba(249, 247, 245, 0.7);
}

/* ============================================================
   Marble-themed hexagon backgrounds
   ============================================================ */
[data-marble="sapphire"] {
    background: linear-gradient(145deg,
        rgba(26, 63, 92, 0.12),
        var(--cream),
        rgba(26, 63, 92, 0.08));
}

[data-marble="sapphire"] .hex-inner {
    background: linear-gradient(145deg,
        rgba(245, 240, 232, 0.92),
        rgba(26, 63, 92, 0.05));
}

[data-marble="amethyst"] {
    background: linear-gradient(145deg,
        rgba(106, 77, 138, 0.12),
        var(--cream),
        rgba(106, 77, 138, 0.08));
}

[data-marble="amethyst"] .hex-inner {
    background: linear-gradient(145deg,
        rgba(245, 240, 232, 0.92),
        rgba(106, 77, 138, 0.05));
}

[data-marble="emerald"] {
    background: linear-gradient(145deg,
        rgba(45, 122, 74, 0.12),
        var(--cream),
        rgba(45, 122, 74, 0.08));
}

[data-marble="emerald"] .hex-inner {
    background: linear-gradient(145deg,
        rgba(245, 240, 232, 0.92),
        rgba(45, 122, 74, 0.05));
}

/* ============================================================
   Hero Section
   ============================================================ */
.hero-section {
    min-height: 100vh;
    padding-top: 80px;
    padding-bottom: 80px;
}

.hero-cluster {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 15px;
    min-height: 600px;
}

.hero-polyhedron {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    animation: hero-poly-rotate 20s linear infinite;
}

.polyhedron-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.4));
}

@keyframes hero-poly-rotate {
    0% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(90deg) scale(1.03); }
    50% { transform: rotate(180deg) scale(1); }
    75% { transform: rotate(270deg) scale(0.97); }
    100% { transform: rotate(360deg) scale(1); }
}

.hero-title {
    font-family: var(--font-headline);
    font-size: clamp(2.0rem, 6vw, 5.2rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.25;
    color: var(--pale-pearl);
    margin-bottom: 16px;
}

.title-dot {
    color: var(--soft-gold);
}

.hero-subtitle {
    font-family: var(--font-accent);
    font-size: clamp(1.2rem, 3vw, 2rem);
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--soft-gold);
    margin-bottom: 12px;
    opacity: 0.9;
}

.hero-caption {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    letter-spacing: 0.03em;
    color: rgba(249, 247, 245, 0.6);
}

/* Nav hexagons positioning around hero */
.hex-nav-1 { margin-top: -30px; }
.hex-nav-2 { margin-top: 10px; }
.hex-nav-3 { margin-top: -20px; }
.hex-nav-4 { margin-top: 15px; }
.hex-nav-5 { margin-top: -10px; }
.hex-nav-6 { margin-top: 5px; }

.nav-label {
    font-family: var(--font-headline);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--deep-sapphire);
    text-transform: uppercase;
}

/* ============================================================
   Exploration Section
   ============================================================ */
.exploration-section {
    min-height: 300vh;
    padding: 100px 20px;
}

.exploration-cluster {
    gap: 25px;
    max-width: 1100px;
}

.hex-title {
    font-family: var(--font-headline);
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.25;
    color: var(--deep-sapphire);
    margin-bottom: 12px;
}

.hex-body {
    font-family: var(--font-body);
    font-size: clamp(0.85rem, 2vw, 1rem);
    font-weight: 400;
    letter-spacing: 0.01em;
    line-height: 1.7;
    color: var(--deep-charcoal);
    margin-bottom: 10px;
}

.hex-caption {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    color: var(--soft-gold);
    display: block;
    margin-top: 8px;
}

/* ============================================================
   Pull Quote
   ============================================================ */
.pull-quote-container {
    width: 100%;
    max-width: 800px;
    margin: 80px auto;
    text-align: center;
    position: relative;
}

.pull-quote p {
    font-family: var(--font-accent);
    font-size: clamp(1.4rem, 4vw, 3rem);
    font-weight: 700;
    letter-spacing: 0.05em;
    line-height: 1.4;
    color: var(--rich-amethyst);
    position: relative;
}

.pull-quote p::before {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--soft-gold), transparent);
    margin: 0 auto 20px;
}

.pull-quote p::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--soft-gold));
    margin: 20px auto 0;
}

/* Underline draw animation for pull quotes */
.pull-quote.draw-underline p {
    background-image: linear-gradient(var(--soft-gold), var(--soft-gold));
    background-size: 0% 2px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pull-quote.draw-underline.active p {
    background-size: 100% 2px;
}

/* ============================================================
   Deep Dive Section
   ============================================================ */
.deep-dive-section {
    min-height: 200vh;
    padding: 80px 20px;
}

.deep-cluster {
    gap: 12px;
    max-width: 1000px;
}

.hex-title-sm {
    font-family: var(--font-headline);
    font-size: clamp(0.9rem, 2vw, 1.15rem);
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.25;
    color: var(--deep-sapphire);
    margin-bottom: 6px;
}

.hex-body-sm {
    font-family: var(--font-body);
    font-size: clamp(0.7rem, 1.5vw, 0.85rem);
    font-weight: 400;
    letter-spacing: 0.01em;
    line-height: 1.6;
    color: var(--deep-charcoal);
}

.hex-formula {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    color: var(--soft-gold);
    margin-top: 8px;
    padding: 4px 8px;
    background: rgba(26, 63, 92, 0.06);
    border-radius: 3px;
    display: inline-block;
}

/* ============================================================
   Synthesis Section
   ============================================================ */
.synthesis-section {
    min-height: 100vh;
    padding: 120px 20px 60px;
}

.synthesis-cluster {
    gap: 25px;
    max-width: 1000px;
}

.synthesis-title {
    font-size: clamp(1.5rem, 4vw, 2.4rem);
}

.synthesis-body {
    font-size: clamp(0.95rem, 2.5vw, 1.125rem);
}

.synthesis-quote {
    margin-top: 60px;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
    width: 100%;
    text-align: center;
    padding: 60px 20px 40px;
    margin-top: 40px;
}

.footer-hex {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.footer-text {
    font-family: var(--font-headline);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--deep-sapphire);
}

.footer-caption {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    color: var(--warm-stone);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
    :root {
        --hex-size-large: 300px;
        --hex-size-medium: 250px;
        --hex-size-small: 200px;
        --hex-size-dense: 170px;
        --hex-size-nav: 90px;
    }

    .hex-cluster {
        gap: 10px;
    }

    .hex-content {
        padding: 18px 14px;
    }

    .hero-polyhedron {
        width: 80px;
        height: 80px;
        margin-bottom: 12px;
    }

    .geo-sphere,
    .geo-cube,
    .geo-polyhedron,
    .geo-torus {
        transform: scale(0.7);
    }

    .pull-quote-container {
        margin: 40px auto;
    }
}

@media (max-width: 480px) {
    :root {
        --hex-size-large: 260px;
        --hex-size-medium: 220px;
        --hex-size-small: 180px;
        --hex-size-dense: 150px;
        --hex-size-nav: 75px;
    }

    .hex-content {
        padding: 14px 10px;
    }

    .nav-label {
        font-size: 0.65rem;
    }
}

/* ============================================================
   Scroll-triggered visibility classes
   ============================================================ */
.hexagon {
    transition: opacity 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Sequential animation delays for bloom effect */
.hexagon:nth-child(1) { transition-delay: 0s; }
.hexagon:nth-child(2) { transition-delay: 0.08s; }
.hexagon:nth-child(3) { transition-delay: 0.16s; }
.hexagon:nth-child(4) { transition-delay: 0.24s; }
.hexagon:nth-child(5) { transition-delay: 0.32s; }
.hexagon:nth-child(6) { transition-delay: 0.40s; }
.hexagon:nth-child(7) { transition-delay: 0.48s; }
.hexagon:nth-child(8) { transition-delay: 0.56s; }
.hexagon:nth-child(9) { transition-delay: 0.64s; }

/* ============================================================
   Zoom-pop animation for geometric reveals
   ============================================================ */
@keyframes zoom-pop {
    0% {
        transform: scale(0.6);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.hex-content .hex-formula {
    opacity: 0;
    transform: scale(0.6);
}

.hexagon.visible .hex-content .hex-formula {
    animation: zoom-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: 0.4s;
}
