/* chrono.games - Styles */
/* Colors: #0d1117, #bf8040, #2d3a6e, #5c3a21, #f0e6d2, #c9a84c, #a33225 */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #0d1117;
    color: #f0e6d2;
    font-family: 'Source Serif 4', serif;
    font-size: 18px;
    line-height: 1.72;
    overflow-x: hidden;
}

/* Navigation Compass */
#compass-rose {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 1000;
    width: 64px;
    height: 64px;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

#compass-rose:hover {
    transform: scale(1.15);
}

#compass-rose .compass-segment {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#compass-rose:hover .compass-segment {
    opacity: 1;
}

/* Scene 1: Chronosphere */
#chronosphere {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 3.2vw;
}

.hex-boundary {
    position: relative;
    width: min(80vw, 80vh);
    height: min(80vw, 80vh);
    clip-path: polygon(50% 0%, 93.3% 25%, 93.3% 75%, 50% 100%, 6.7% 75%, 6.7% 25%);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0d1117;
}

#wire-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.wire-path {
    stroke-dasharray: 3000;
    stroke-dashoffset: 3000;
    animation: drawWire 1.2s cubic-bezier(0.25, 0.1, 0.25, 1) 0.4s forwards;
}

.wire-path.inner {
    animation-delay: 0.8s;
}

@keyframes drawWire {
    to { stroke-dashoffset: 0; }
}

/* Isometric City */
.isometric-city {
    position: absolute;
    bottom: 30%;
    left: 50%;
    transform: translateX(-50%) rotateX(35deg) rotateY(30deg);
    transform-style: preserve-3d;
    perspective: 800px;
    z-index: 2;
    width: 200px;
    height: 120px;
}

.building {
    position: absolute;
    transform-style: preserve-3d;
    opacity: 0;
    animation: buildingRise 0.6s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

.building-1 { left: 0; bottom: 0; animation-delay: 0.8s; }
.building-2 { left: 40px; bottom: 0; animation-delay: 0.88s; }
.building-3 { left: 80px; bottom: 0; animation-delay: 0.96s; }
.building-4 { left: 120px; bottom: 0; animation-delay: 1.6s; }
.building-5 { left: 20px; bottom: 30px; animation-delay: 1.04s; }
.building-6 { left: 60px; bottom: 30px; animation-delay: 1.12s; }
.building-7 { left: 100px; bottom: 30px; animation-delay: 1.2s; }
.building-8 { left: 140px; bottom: 30px; animation-delay: 1.28s; }

@keyframes buildingRise {
    from { opacity: 0; transform: translateZ(-40px); }
    to { opacity: 1; transform: translateZ(0); }
}

.building .face {
    position: absolute;
}

.building .face.top {
    width: 30px;
    height: 30px;
    background: #2d3a6e;
    transform: rotateX(90deg) translateZ(15px);
}

.building .face.left {
    width: 30px;
    height: 50px;
    background: #1a2340;
    transform: rotateY(-90deg) translateZ(15px);
}

.building .face.right {
    width: 30px;
    height: 50px;
    background: #bf8040;
    transform: translateZ(15px);
}

.building-1 .face.right { height: 60px; background: #5c3a21; }
.building-1 .face.left { height: 60px; }
.building-2 .face.right { height: 40px; }
.building-2 .face.left { height: 40px; }
.building-3 .face.right { height: 70px; background: #bf8040; }
.building-3 .face.left { height: 70px; }
.building-4 .face.right { height: 90px; background: #2d3a6e; }
.building-4 .face.left { height: 90px; background: #0d1117; }
.building-5 .face.right { height: 35px; background: #5c3a21; }
.building-5 .face.left { height: 35px; }
.building-6 .face.top { background: #bf8040; border-radius: 50%; }
.building-6 .face.right { height: 45px; }
.building-6 .face.left { height: 45px; }
.building-7 .face.right { height: 55px; background: #5c3a21; }
.building-7 .face.left { height: 55px; }
.building-8 .face.right { height: 30px; }
.building-8 .face.left { height: 30px; }

.clock-tower .clock-face {
    position: absolute;
    width: 30px;
    height: 30px;
    top: -35px;
    left: 0;
    z-index: 5;
}

#clock-hour {
    transform-origin: 20px 20px;
    animation: rotateHour 43200s linear infinite;
}

#clock-minute {
    transform-origin: 20px 20px;
    animation: rotateMinute 3600s linear infinite;
}

@keyframes rotateHour {
    to { transform: rotate(360deg); }
}

@keyframes rotateMinute {
    to { transform: rotate(360deg); }
}

.antenna .signal-ring {
    position: absolute;
    top: -20px;
    left: 5px;
    width: 20px;
    height: 20px;
    border: 1px solid #c9a84c;
    border-radius: 50%;
    opacity: 0;
    animation: pulse 3s ease-in-out infinite;
}

.antenna .ring-2 {
    width: 30px;
    height: 30px;
    left: 0;
    top: -25px;
    animation-delay: 1s;
}

@keyframes pulse {
    0%, 100% { opacity: 0; transform: scale(0.5); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

/* Hero Text */
.hero-text {
    position: relative;
    z-index: 10;
    text-align: center;
    margin-top: 10%;
}

#title-chrono {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(3rem, 8vw, 7.5rem);
    letter-spacing: 0.08em;
    color: #bf8040;
    text-shadow: 4px 4px 0 rgba(13, 17, 23, 0.8);
    opacity: 0;
    animation: fadeInLetters 1s cubic-bezier(0.25, 0.1, 0.25, 1) 1.8s forwards;
}

#title-games {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(1rem, 3vw, 2rem);
    letter-spacing: 0.12em;
    color: #c9a84c;
    text-shadow: 0 0 8px rgba(191, 128, 64, 0.3);
    display: block;
    opacity: 0;
    animation: flickerOn 0.8s steps(4) 2.4s forwards;
}

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

@keyframes flickerOn {
    0% { opacity: 0; }
    25% { opacity: 0.6; }
    50% { opacity: 0.2; }
    75% { opacity: 0.8; }
    100% { opacity: 1; }
}

/* Scene 2: Time Grid */
#time-grid {
    padding: 3.2vw;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.honeycomb {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 900px;
    gap: 4px;
}

.hex-card {
    width: clamp(120px, 15vw, 180px);
    height: clamp(138px, 17.3vw, 207px);
    perspective: 800px;
    margin-bottom: -20px;
}

.hex-card:nth-child(6),
.hex-card:nth-child(7),
.hex-card:nth-child(8),
.hex-card:nth-child(9),
.hex-card:nth-child(10) {
    margin-left: calc(clamp(60px, 7.5vw, 90px) + 2px);
}

.hex-card:nth-child(6) {
    margin-left: calc(clamp(60px, 7.5vw, 90px) + 2px);
}

.hex-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.7s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.hex-card:hover .hex-card-inner {
    transform: rotateY(180deg);
}

.hex-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    padding: 20px;
}

.hex-face.front {
    background: #0d1117;
    border: none;
    box-shadow: inset 0 0 0 1px #c9a84c;
}

.hex-face.front svg {
    width: 60px;
    height: 60px;
}

.hex-face.back {
    background: #2d3a6e;
    transform: rotateY(180deg);
    text-align: center;
}

.hex-face.back p {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 0.08em;
    color: #f0e6d2;
    margin-bottom: 8px;
}

.hex-face.back .mono-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.12em;
    color: #c9a84c;
    text-shadow: 0 0 8px rgba(191, 128, 64, 0.3);
}

/* Hex card reveal animation */
.hex-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1), transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.hex-card.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Scene 3: Descent Line */
#descent-line {
    height: 40vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 3.2vw;
}

.timeline-container {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    padding: 40px 0;
}

.timeline-wire {
    position: absolute;
    left: 50%;
    top: 0;
    width: 1px;
    height: 0%;
    background: #c9a84c;
    transform: translateX(-50%);
    transition: height 1.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.timeline-wire.grown {
    height: 100%;
}

.timeline-marker {
    display: flex;
    align-items: center;
    gap: 16px;
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.timeline-marker.visible {
    opacity: 1;
    transform: translateX(0);
}

.timeline-marker .year {
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    letter-spacing: 0.12em;
    color: #c9a84c;
    text-shadow: 0 0 8px rgba(191, 128, 64, 0.3);
}

.timeline-marker .event {
    font-family: 'Source Serif 4', serif;
    font-size: 14px;
    color: #f0e6d2;
    opacity: 0.8;
}

/* Scene 4: The Vault */
#vault {
    min-height: 100vh;
    background: #5c3a21;
    background-image:
        radial-gradient(ellipse at 30% 40%, rgba(0,0,0,0.15) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 80%, rgba(255,255,255,0.05) 0%, transparent 50%);
    box-shadow: inset 0 0 80px rgba(0,0,0,0.4);
    padding: 80px 3.2vw;
    position: relative;
}

#vault::before,
#vault::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 60px;
    border: 2px dashed #c9a84c;
    border-top: none;
    border-bottom: none;
    opacity: 0.4;
}

#vault::before { left: 3.2vw; border-right: none; }
#vault::after { right: 3.2vw; border-left: none; }

.vault-content {
    max-width: 680px;
    margin: 0 auto;
    background: rgba(240, 230, 210, 0.92);
    padding: 60px 48px;
    color: #0d1117;
}

.vault-headline {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(1.8rem, 4vw, 3.5rem);
    letter-spacing: 0.08em;
    color: #5c3a21;
    text-shadow: 1px 1px 0px #f0e6d2, -1px -1px 0px rgba(0,0,0,0.5);
    margin-bottom: 24px;
    margin-top: 48px;
}

.vault-headline:first-child {
    margin-top: 0;
}

.vault-content p {
    margin-bottom: 24px;
    font-weight: 400;
}

.pull-quote {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    letter-spacing: 0.04em;
    color: #bf8040;
    border-top: 1px solid #c9a84c;
    border-bottom: 1px solid #c9a84c;
    padding: 24px 0;
    margin: 32px 0;
    line-height: 1.3;
}

/* Scene 5: The Seal */
#seal {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0d1117;
    padding: 3.2vw;
}

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

.seal-hex.main {
    width: 240px;
    height: 277px;
    background: #2d3a6e;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.seal-logo {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.5rem;
    letter-spacing: 0.08em;
    color: #c9a84c;
    text-align: center;
    line-height: 1.2;
}

.seal-ring {
    display: flex;
    gap: 8px;
}

.seal-hex.small {
    width: 40px;
    height: 46px;
    background: #0d1117;
    border: 1px solid #c9a84c;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.seal-hex.small span {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1rem;
    color: #bf8040;
}

#live-clock {
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.12em;
    color: #c9a84c;
    text-shadow: 0 0 8px rgba(191, 128, 64, 0.3);
}

.mono-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    letter-spacing: 0.12em;
    color: #c9a84c;
    text-shadow: 0 0 8px rgba(191, 128, 64, 0.3);
}

/* Copper wire circuit nodes */
.honeycomb::after {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background: #c9a84c;
    border-radius: 50%;
    position: absolute;
    animation: pulse 3s ease-in-out infinite;
}
