/* rational.today -- Surreal Gallery of Reason */
:root {
    --void: #0D0B1A;
    --panel-bg: #1A1730;
    --accent: #C8AAFF;
    --amber: #FFB86B;
    --warm-glow: #FF7B8A;
    --text-primary: #E8D5FF;
    --text-body: #B8A8D0;
    --subtle-border: #2A2444;
}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Source Sans 3', sans-serif; font-weight: 400; font-size: 16px; line-height: 1.78; color: var(--text-body); background: var(--void); overflow-x: hidden; }

/* Floating geometric solids */
.geo-float {
    position: fixed;
    pointer-events: none;
    z-index: 0;
    opacity: 0.06;
}
.geo-1 {
    width: 80px; height: 80px;
    background: var(--accent);
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    top: 20%; left: 10%;
    animation: drift-1 40s linear infinite;
}
.geo-2 {
    width: 60px; height: 60px;
    background: var(--accent);
    clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
    top: 60%; right: 8%;
    animation: drift-2 35s linear infinite;
}
.geo-3 {
    width: 50px; height: 50px;
    background: var(--accent);
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    bottom: 15%; left: 20%;
    animation: drift-3 45s linear infinite;
}
@keyframes drift-1 { 0% { transform: translate(0,0) rotate(0deg); } 100% { transform: translate(80px,-120px) rotate(360deg); } }
@keyframes drift-2 { 0% { transform: translate(0,0) rotate(0deg); } 100% { transform: translate(-60px,100px) rotate(-360deg); } }
@keyframes drift-3 { 0% { transform: translate(0,0) rotate(0deg); } 100% { transform: translate(100px,-80px) rotate(360deg); } }

/* Radial nav */
.radial-nav { position: fixed; top: 24px; left: 24px; z-index: 50; }
.nav-trigger {
    width: 24px; height: 24px;
    border: 1px solid var(--accent);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}
.nav-trigger:hover { background: rgba(200,170,255,0.15); }
.nav-menu {
    position: absolute;
    top: 32px;
    left: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transform: scale(0);
    transform-origin: top left;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.nav-menu.open { transform: scale(1); }
.nav-item {
    font-family: 'Inconsolata', monospace;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    text-decoration: none;
    opacity: 0.6;
    white-space: nowrap;
    transition: opacity 0.2s, text-shadow 0.2s;
}
.nav-item:hover { opacity: 1; text-shadow: 0 0 12px rgba(200,170,255,0.4); }

/* Hero */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}
.staircase {
    width: 300px;
    height: 300px;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 1.2s cubic-bezier(0.16,1,0.3,1), transform 1.2s cubic-bezier(0.16,1,0.3,1);
}
.staircase.visible { opacity: 1; transform: scale(1); }
.staircase svg { animation: staircase-rotate 60s linear infinite; }
@keyframes staircase-rotate { from { transform: rotate3d(0,1,0.2,0deg); } to { transform: rotate3d(0,1,0.2,360deg); } }

.hero-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700;
    font-style: italic;
    font-size: 44px;
    color: var(--text-primary);
    letter-spacing: 0.01em;
    margin-top: 24px;
    opacity: 0;
    transition: opacity 0.5s ease-out;
}
.hero-title.visible { opacity: 1; }

.hero-sub {
    font-family: 'Inconsolata', monospace;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    opacity: 0.6;
    margin-top: 12px;
    opacity: 0;
    transition: opacity 0.4s ease-out;
}
.hero-sub.visible { opacity: 0.6; }

/* Thread line */
.thread-line {
    position: fixed;
    left: 50%;
    top: 0;
    width: 2px;
    height: 100vh;
    transform: translateX(-50%);
    z-index: 0;
    pointer-events: none;
}
.thread-line svg { width: 2px; height: 100%; }
.thread-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 1.5s ease-out;
}
.thread-path.drawn { stroke-dashoffset: 0; }

/* Gallery */
.gallery {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 40px 120px;
}

/* Tilt panels */
.tilt-panel {
    background: var(--panel-bg);
    border: 1px solid rgba(200,170,255,0.12);
    box-shadow: 0 24px 80px rgba(13,11,26,0.6);
    padding: 48px 56px;
    max-width: 720px;
    margin-bottom: 120px;
    position: relative;
    opacity: 0;
    filter: blur(8px);
    transition: opacity 0.5s cubic-bezier(0.16,1,0.3,1), filter 0.5s cubic-bezier(0.16,1,0.3,1), transform 0.5s cubic-bezier(0.16,1,0.3,1), border-color 0.2s;
}
.tilt-panel.visible { opacity: 1; filter: blur(0); }
.tilt-panel:hover { border-color: rgba(200,170,255,0.3); }

.tilt-cw { transform: rotate(2deg) translateX(-80px); }
.tilt-cw.visible { transform: rotate(2deg) translateX(-80px); }
.tilt-cw:hover { transform: rotate(2.5deg) translateX(-80px); }

.tilt-ccw { transform: rotate(-2deg) translateX(80px); margin-left: auto; }
.tilt-ccw.visible { transform: rotate(-2deg) translateX(80px); }
.tilt-ccw:hover { transform: rotate(-2.5deg) translateX(80px); }

.tilt-center { transform: rotate(0deg); margin: 0 auto; text-align: center; }
.tilt-center.visible { transform: rotate(0deg); }

/* Panel typography */
.panel-label {
    font-family: 'Inconsolata', monospace;
    font-weight: 400;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    opacity: 0.6;
    display: block;
    margin-bottom: 16px;
}
.panel-heading {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700;
    font-style: italic;
    font-size: 28px;
    color: var(--text-primary);
    letter-spacing: 0.01em;
    line-height: 1.3;
    margin-bottom: 16px;
}
.panel-body { color: var(--text-body); margin-bottom: 16px; }
.panel-body:last-child { margin-bottom: 0; }

/* Melting clock */
.melt-clock {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
}
.clock-face {
    width: 100%;
    height: 100%;
    border: 1px solid var(--accent);
    border-radius: 60% 40% 70% 30% / 50% 60% 40% 50%;
    opacity: 0.3;
    animation: clock-pulse 4s ease-in-out infinite;
}
@keyframes clock-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.clock-face::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1px;
    height: 12px;
    background: var(--accent);
    transform-origin: bottom;
    transform: translateX(-50%) rotate(0deg);
    opacity: 0.4;
    animation: clock-hand 8s linear infinite;
}
@keyframes clock-hand { from { transform: translateX(-50%) rotate(0deg); } to { transform: translateX(-50%) rotate(360deg); } }

@media (max-width: 768px) {
    .tilt-cw, .tilt-ccw, .tilt-center { transform: rotate(0deg) translateX(0); max-width: 100%; }
    .tilt-cw.visible, .tilt-ccw.visible { transform: rotate(0deg) translateX(0); }
    .tilt-cw:hover, .tilt-ccw:hover { transform: rotate(0deg) translateX(0); }
    .tilt-panel { padding: 32px 24px; margin-bottom: 60px; }
    .hero-title { font-size: 32px; }
    .panel-heading { font-size: 24px; }
    .gallery { padding: 0 16px 60px; }
    .staircase { width: 200px; height: 200px; }
}
