/* thesecond.quest - Art-deco coastal voyage */

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

:root {
    --deep-teal: #1A4A42;
    --seafoam: #4A7B73;
    --coastal-sage: #6B9E94;
    --warm-sand: #F5EDE3;
    --cool-mist: #E8F0EC;
    --sunburst-gold: #C4A34D;
    --coral-accent: #C47A6E;
    --pearl-white: #FAFAF7;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.6vw, 1.125rem);
    line-height: 1.75;
    color: var(--deep-teal);
    background-color: var(--warm-sand);
    overflow-x: hidden;
}

/* === Top Navigation === */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    background-color: var(--deep-teal);
    z-index: 100;
}

.nav-brand {
    font-family: 'Commissioner', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--warm-sand);
    letter-spacing: 0.01em;
}

.nav-links {
    display: flex;
    gap: 24px;
}

.nav-link {
    font-family: 'Commissioner', sans-serif;
    font-weight: 500;
    font-size: 0.8125rem;
    color: var(--coastal-sage);
    text-decoration: none;
    letter-spacing: 0.04em;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    right: 50%;
    height: 2px;
    background-color: var(--sunburst-gold);
    transition: left 0.3s ease, right 0.3s ease;
}

.nav-link.active {
    color: var(--warm-sand);
}

.nav-link.active::after {
    left: 0;
    right: 0;
}

/* === Hero Band === */
.hero-band {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background-color: var(--warm-sand);
    padding-top: 56px;
    overflow: hidden;
}

.sunburst {
    position: absolute;
    pointer-events: none;
}

.sunburst-hero {
    width: 800px;
    height: 800px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.15;
    animation: slowRotate 120s linear infinite;
}

@keyframes slowRotate {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 10;
    opacity: 0;
    animation: fadeIn 1s 0.3s ease forwards;
}

.hero-title {
    font-family: 'Commissioner', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: var(--deep-teal);
    letter-spacing: 0.01em;
    margin-bottom: 16px;
}

.hero-tagline {
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--seafoam);
}

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

.hero-chevron {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    animation: pulse 2s ease-in-out infinite;
    z-index: 10;
}

.hero-chevron svg {
    width: 40px;
    height: 24px;
}

@keyframes pulse {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 1; }
    50% { transform: translateX(-50%) translateY(6px); opacity: 0.6; }
}

/* === Deco Dividers === */
.deco-divider {
    height: 24px;
    overflow: hidden;
}

.zigzag-svg {
    width: 100%;
    height: 24px;
}

.zigzag-path {
    stroke-dasharray: 3000;
    stroke-dashoffset: 3000;
    transition: stroke-dashoffset 0.8s ease-out;
}

.deco-divider.visible .zigzag-path {
    stroke-dashoffset: 0;
}

/* === Chapter Bands === */
.chapter-band {
    min-height: 80vh;
    display: flex;
    align-items: flex-start;
    padding: 80px 48px 80px 64px;
    position: relative;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.chapter-band.visible {
    opacity: 1;
    transform: translateY(0);
}

.chapter-warm {
    background-color: var(--warm-sand);
}

.chapter-cool {
    background-color: var(--cool-mist);
}

.chapter-content {
    max-width: 65%;
    flex: 1;
}

.chapter-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.chapter-number {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: 0.8125rem;
    color: var(--coastal-sage);
    letter-spacing: 0.04em;
}

.speed-lines {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.speed-lines span {
    display: block;
    height: 1px;
    background-color: var(--coastal-sage);
}

.speed-lines span:nth-child(1) { width: 60px; }
.speed-lines span:nth-child(2) { width: 45px; }
.speed-lines span:nth-child(3) { width: 30px; }

.chapter-title {
    font-family: 'Commissioner', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 4.5vw, 3.5rem);
    color: var(--deep-teal);
    letter-spacing: 0.01em;
    margin-bottom: 24px;
}

.chapter-intro {
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.6vw, 1.125rem);
    line-height: 1.75;
    color: var(--deep-teal);
    margin-bottom: 32px;
}

/* === Accordions === */
.accordion {
    border: 1px solid var(--seafoam);
    margin-bottom: 12px;
}

.accordion-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    cursor: pointer;
    list-style: none;
    transition: background-color 0.3s ease;
}

.accordion-toggle:hover {
    background-color: rgba(74, 123, 115, 0.08);
}

.accordion-toggle::-webkit-details-marker {
    display: none;
}

.accordion-label {
    font-family: 'Commissioner', sans-serif;
    font-weight: 500;
    font-size: 0.9375rem;
    letter-spacing: 0.04em;
    color: var(--deep-teal);
}

.accordion-chevron {
    width: 24px;
    height: 24px;
    transition: transform 0.4s ease;
    flex-shrink: 0;
}

details[open] .accordion-chevron {
    transform: rotate(180deg);
}

.accordion-content {
    padding: 0 20px 20px;
    background-color: var(--pearl-white);
}

.accordion-content p {
    font-family: 'Lora', serif;
    font-style: italic;
    color: var(--deep-teal);
    line-height: 1.75;
}

/* === 3D Deco Elements === */
.deco-3d {
    position: absolute;
    right: 48px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.6s ease;
}

.deco-3d:hover {
    transform: translateY(-50%) perspective(600px) rotateY(5deg);
}

/* Stepped Pyramid */
.pyramid-3d {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.pyramid-step {
    background: linear-gradient(135deg, var(--sunburst-gold) 0%, #957830 100%);
    box-shadow: 4px 4px 0 rgba(26, 74, 66, 0.15);
}

.step-1 { width: 60px; height: 40px; }
.step-2 { width: 100px; height: 35px; }
.step-3 { width: 140px; height: 30px; }
.step-4 { width: 180px; height: 25px; }

/* Fluted Column */
.column-3d {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 120px;
}

.column-capital {
    width: 120px;
    height: 30px;
    background: linear-gradient(135deg, var(--sunburst-gold) 0%, #957830 100%);
    clip-path: polygon(10% 100%, 0 0, 100% 0, 90% 100%);
}

.column-shaft {
    width: 80px;
    height: 200px;
    background: repeating-linear-gradient(90deg, var(--sunburst-gold) 0px, #957830 4px, var(--sunburst-gold) 8px);
    box-shadow: 3px 0 8px rgba(26, 74, 66, 0.1);
}

.column-base {
    width: 120px;
    height: 20px;
    background: linear-gradient(135deg, #957830 0%, var(--sunburst-gold) 100%);
}

/* Faceted Gem */
.gem-3d {
    width: 200px;
    height: 200px;
    position: absolute;
    right: 48px;
}

.gem-facet {
    position: absolute;
    width: 50%;
    height: 50%;
}

.facet-tl {
    top: 0;
    left: 0;
    background: linear-gradient(135deg, var(--sunburst-gold) 0%, #DAC06E 100%);
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    transform: translate(25%, 0);
}

.facet-tr {
    top: 0;
    right: 0;
    background: linear-gradient(225deg, #957830 0%, var(--sunburst-gold) 100%);
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    transform: translate(-25%, 0);
}

.facet-bl {
    bottom: 0;
    left: 0;
    background: linear-gradient(45deg, #957830 0%, #B8923E 100%);
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    transform: translate(25%, 0);
}

.facet-br {
    bottom: 0;
    right: 0;
    background: linear-gradient(315deg, var(--sunburst-gold) 0%, #7A6228 100%);
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    transform: translate(-25%, 0);
}

/* === Arrival Section === */
.chapter-arrival {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, var(--cool-mist), var(--pearl-white));
    position: relative;
    overflow: hidden;
}

.sunburst-arrival {
    width: 80vw;
    height: 80vw;
    max-width: 800px;
    max-height: 800px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 2s ease;
    animation: slowRotate 120s linear infinite;
}

.chapter-arrival.visible .sunburst-arrival {
    opacity: 0.05;
}

.arrival-content {
    text-align: center;
    max-width: 700px;
    padding: 0 24px;
    position: relative;
    z-index: 10;
}

.arrival-body {
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.6vw, 1.125rem);
    line-height: 1.75;
    color: var(--deep-teal);
    margin-bottom: 48px;
}

.arrival-title {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    color: var(--seafoam);
    margin-bottom: 12px;
}

.arrival-underline {
    height: 2px;
    background-color: var(--sunburst-gold);
    width: 0;
    margin: 0 auto;
    transition: width 1.2s ease;
}

.chapter-arrival.visible .arrival-underline {
    width: 60%;
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
    .sunburst-hero, .sunburst-arrival {
        animation: none;
    }
    .hero-content {
        animation: none;
        opacity: 1;
    }
    .hero-chevron {
        animation: none;
    }
    .zigzag-path {
        stroke-dashoffset: 0;
        transition: none;
    }
    .chapter-band {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* === Responsive === */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    .chapter-band {
        padding: 60px 24px;
        flex-direction: column;
    }
    .chapter-content {
        max-width: 100%;
    }
    .deco-3d {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        margin: 32px auto 0;
    }
    .deco-3d:hover {
        transform: perspective(600px) rotateY(5deg);
    }
    .gem-3d {
        position: relative;
        right: auto;
        margin: 32px auto 0;
    }
}
