:root {
    --gold: #C4954A;
    --gold-bright: #E8C872;
    --bg-deep: #1A0F0A;
    --bg-mid: #2C1810;
    --text-primary: #C9B896;
    --text-secondary: #8B7355;
    --accent-red: #8B3A2A;
    --accent-teal: #2A6B5E;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-deep);
    color: var(--text-primary);
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.85rem, 1.2vw, 1.1rem);
    letter-spacing: 0.04em;
    line-height: 1.7;
    overflow-x: hidden;
}

/* ===== SCROLL TO TOP DIAMOND ===== */
#scroll-top {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: spin 20s linear infinite;
}

#scroll-top:hover {
    animation-duration: 10s;
}

#scroll-top:hover .diamond-icon {
    box-shadow: 0 0 12px var(--gold-bright);
}

.diamond-icon {
    width: 18px;
    height: 18px;
    background: var(--gold);
    transform: rotate(45deg);
    border: 1px solid var(--gold-bright);
    transition: box-shadow 0.3s;
}

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

/* ===== SECTION 1: VAULT DOOR ===== */
#vault-door {
    position: relative;
    width: 100%;
    height: 100vh;
    background: radial-gradient(ellipse at center, var(--bg-mid) 0%, var(--bg-deep) 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.sunburst-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.sunburst-lines line {
    stroke: var(--gold);
    stroke-width: 0.5;
    opacity: 0.15;
}

.vault-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.hero-title {
    font-family: 'Poiret One', cursive;
    font-size: clamp(4rem, 14vw, 12rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    line-height: 1.0;
    color: var(--gold);
    margin-bottom: 2rem;
}

.hero-title .letter {
    display: inline-block;
    opacity: 0;
    animation: letterIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: calc(var(--i) * 0.08s);
}

@keyframes letterIn {
    0% {
        opacity: 0;
        transform: translateY(-60px) rotateX(90deg);
    }
    60% {
        transform: translateY(8px) rotateX(-5deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}

.hero-title .scan-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.tagline {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.85rem, 1.5vw, 1.2rem);
    color: var(--text-primary);
    letter-spacing: 0.06em;
    opacity: 0;
}

.tagline.typing {
    opacity: 1;
}

.tagline .cursor {
    display: inline-block;
    width: 2px;
    height: 1.1em;
    background: var(--gold);
    vertical-align: text-bottom;
    animation: blink 0.7s step-end infinite;
    margin-left: 2px;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* Hero scan line */
.hero-scanline {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gold-bright);
    opacity: 0.3;
    animation: heroScan 1.2s ease-in-out forwards;
    animation-delay: 0.8s;
    pointer-events: none;
}

@keyframes heroScan {
    0% { top: 0; opacity: 0.3; }
    100% { top: 100%; opacity: 0; }
}

/* ===== SECTION 2: DOSSIER ===== */
#dossier {
    position: relative;
    width: 100%;
    min-height: 150vh;
    background: var(--bg-deep);
    padding: 8vh 0;
}

.dossier-grid {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    width: 100%;
    min-height: 130vh;
    position: relative;
}

.dossier-badges {
    grid-column: 1 / 7;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6vh;
    padding: 4vh 2vw;
}

.iso-badge {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: slowRotateY 12s linear infinite;
    animation-delay: calc(var(--delay) * 2s);
}

@keyframes slowRotateY {
    0% { transform: perspective(600px) rotateY(0deg); }
    100% { transform: perspective(600px) rotateY(360deg); }
}

.iso-container {
    transform: rotateX(55deg) rotateZ(45deg);
    width: 80px;
    height: 80px;
    position: relative;
}

/* Chevron Badge */
.chevron {
    position: absolute;
    left: 50%;
    border-left: 3px solid;
    border-bottom: 3px solid;
    transform: translate(-50%, 0) rotate(-45deg);
}
.chevron.c1 { width: 60px; height: 60px; bottom: 10px; border-color: var(--gold); }
.chevron.c2 { width: 44px; height: 44px; bottom: 18px; border-color: var(--gold-bright); }
.chevron.c3 { width: 28px; height: 28px; bottom: 26px; border-color: var(--text-primary); }

/* Pyramid Badge */
.step {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gold);
    height: 14px;
}
.step.s1 { width: 70px; bottom: 0; }
.step.s2 { width: 52px; bottom: 16px; background: var(--gold-bright); }
.step.s3 { width: 36px; bottom: 32px; }
.step.s4 { width: 20px; bottom: 48px; background: var(--gold-bright); }

/* Sunburst Seal Badge */
.seal {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid var(--gold);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    clip-path: polygon(50% 0%, 61% 15%, 79% 2%, 75% 22%, 98% 22%, 85% 38%, 100% 50%, 85% 62%, 98% 78%, 75% 78%, 79% 98%, 61% 85%, 50% 100%, 39% 85%, 21% 98%, 25% 78%, 2% 78%, 15% 62%, 0% 50%, 15% 38%, 2% 22%, 25% 22%, 21% 2%, 39% 15%);
    background: var(--gold);
    opacity: 0.8;
}

/* Deco Divider */
.deco-divider {
    grid-column: 7 / 8;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.divider-line {
    width: 1px;
    height: 100%;
    background: var(--gold);
    opacity: 0.6;
}

.divider-diamond {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--gold);
    transform: rotate(45deg);
}
.divider-diamond.d1 { top: 20%; }
.divider-diamond.d2 { top: 50%; }
.divider-diamond.d3 { top: 80%; }

.travel-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--gold-bright);
    border-radius: 50%;
    left: 50%;
    transform: translateX(-50%);
    animation: travelDot 4s ease-in-out infinite;
    box-shadow: 0 0 8px var(--gold-bright);
}

@keyframes travelDot {
    0% { top: 5%; }
    50% { top: 95%; }
    100% { top: 5%; }
}

/* Dossier Text Blocks */
.dossier-text {
    grid-column: 8 / 17;
    display: flex;
    flex-direction: column;
    gap: 6vh;
    padding: 4vh 4vw 4vh 2vw;
}

.deco-block {
    border: 1px solid var(--gold);
    outline: 1px solid var(--text-secondary);
    outline-offset: 4px;
    padding: 2.5rem 2rem;
    position: relative;
}

.deco-block h2 {
    font-family: 'Poiret One', cursive;
    font-size: clamp(2rem, 6vw, 5rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.0;
    color: var(--gold);
    margin-bottom: 1.2rem;
}

.deco-block p {
    color: var(--text-primary);
}

/* ===== Reveal animation ===== */
.reveal {
    opacity: 0;
    transform: translate3d(0, 40px, 0);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    transition-delay: calc(var(--delay, 0) * 0.1s);
}

.reveal.visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

/* ===== SECTION 3: BADGE FORGE ===== */
#badge-forge {
    position: relative;
    width: 100%;
    min-height: 200vh;
    background: var(--bg-deep);
    padding: 10vh 0;
    overflow: hidden;
}

.hex-grid-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.forge-title {
    font-family: 'Poiret One', cursive;
    font-size: clamp(2rem, 6vw, 5rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.0;
    color: var(--gold);
    text-align: center;
    margin-bottom: 8vh;
    position: relative;
    z-index: 2;
}

.badge-field {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8vh 4vw;
    padding: 0 8vw;
    max-width: none;
}

.badge-tile {
    position: relative;
    border: 1px dashed var(--text-secondary);
    padding: 2rem 1.5rem;
    text-align: center;
    transform: translate(var(--jx, 0), var(--jy, 0));
    transition: transform 0.3s ease-out, border 0.3s ease-out;
    background: rgba(26, 15, 10, 0.8);
    cursor: default;
}

.badge-tile:hover {
    transform: translate(var(--jx, 0), var(--jy, 0)) translateY(-8px);
    border: 1px solid var(--gold);
}

.badge-tile:hover .tile-scanline {
    animation: scanline 0.6s linear forwards;
}

.badge-tile:hover .tile-data {
    opacity: 1;
    transform: translateY(0);
}

/* Tile brackets (targeting reticle corners) */
.tile-brackets {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.bracket {
    position: absolute;
    width: 14px;
    height: 14px;
}

.bracket::before,
.bracket::after {
    content: '';
    position: absolute;
    background: var(--gold);
}

.bracket.tl { top: -1px; left: -1px; }
.bracket.tl::before { width: 14px; height: 1px; top: 0; left: 0; }
.bracket.tl::after { width: 1px; height: 14px; top: 0; left: 0; }

.bracket.tr { top: -1px; right: -1px; }
.bracket.tr::before { width: 14px; height: 1px; top: 0; right: 0; }
.bracket.tr::after { width: 1px; height: 14px; top: 0; right: 0; }

.bracket.bl { bottom: -1px; left: -1px; }
.bracket.bl::before { width: 14px; height: 1px; bottom: 0; left: 0; }
.bracket.bl::after { width: 1px; height: 14px; bottom: 0; left: 0; }

.bracket.br { bottom: -1px; right: -1px; }
.bracket.br::before { width: 14px; height: 1px; bottom: 0; right: 0; }
.bracket.br::after { width: 1px; height: 14px; bottom: 0; right: 0; }

/* Lock-on animation */
.bracket.lock-on {
    animation: lockOn 0.4s ease-out;
}

@keyframes lockOn {
    0% { margin: 0; }
    50% { margin: 4px; }
    100% { margin: 0; }
}

.tile-icon {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.tile-icon .iso-container {
    transform: rotateX(55deg) rotateZ(45deg);
    width: 60px;
    height: 60px;
    position: relative;
}

.tile-label {
    font-family: 'Poiret One', cursive;
    font-size: 1.2rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold);
    border: 1px solid var(--text-secondary);
    padding: 0.4rem 1rem;
    display: inline-block;
}

.tile-scanline {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gold-bright);
    opacity: 0;
    pointer-events: none;
}

@keyframes scanline {
    0% { top: 0; opacity: 0.3; }
    100% { top: 100%; opacity: 0; }
}

.tile-data {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.6rem;
    color: var(--text-secondary);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s 0.1s, transform 0.3s 0.1s;
    margin-top: 0.8rem;
    letter-spacing: 0.06em;
}

/* Badge Forge icon variants */
/* Diamond Rank */
.diamond-rank {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.dr {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 2px solid var(--gold);
    transform: translate(-50%, -50%) rotate(45deg);
}

.d-outer { width: 44px; height: 44px; }
.d-mid { width: 28px; height: 28px; border-color: var(--gold-bright); }
.d-inner { width: 16px; height: 16px; background: var(--gold); }

/* Reticle */
.reticle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
}

.reticle-ring {
    position: absolute;
    border-radius: 50%;
    border: 1.5px solid var(--gold);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.reticle-ring.r1 { width: 44px; height: 44px; }
.reticle-ring.r2 { width: 26px; height: 26px; border-color: var(--gold-bright); }

.reticle-cross::before,
.reticle-cross::after {
    content: '';
    position: absolute;
    background: var(--gold);
}
.reticle-cross::before {
    width: 100%;
    height: 1px;
    top: 50%;
    left: 0;
}
.reticle-cross::after {
    width: 1px;
    height: 100%;
    left: 50%;
    top: 0;
}
.reticle-cross {
    position: absolute;
    width: 50px;
    height: 50px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Chevron icon (forge) */
.chevron-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.ci {
    border-left: 2px solid;
    border-bottom: 2px solid;
    transform: rotate(-45deg);
    position: absolute;
    left: 50%;
}
.ci.c1 { width: 40px; height: 40px; border-color: var(--gold); bottom: -20px; margin-left: -20px; }
.ci.c2 { width: 28px; height: 28px; border-color: var(--gold-bright); bottom: -14px; margin-left: -14px; }
.ci.c3 { width: 16px; height: 16px; border-color: var(--text-primary); bottom: -8px; margin-left: -8px; }

/* Pyramid icon (forge) */
.pyramid-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.pi {
    background: var(--gold);
    height: 10px;
}
.pi.s1 { width: 44px; }
.pi.s2 { width: 30px; background: var(--gold-bright); }
.pi.s3 { width: 16px; }

/* Seal icon (forge) */
.seal-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    clip-path: polygon(50% 0%, 61% 15%, 79% 2%, 75% 22%, 98% 22%, 85% 38%, 100% 50%, 85% 62%, 98% 78%, 75% 78%, 79% 98%, 61% 85%, 50% 100%, 39% 85%, 21% 98%, 25% 78%, 2% 78%, 15% 62%, 0% 50%, 15% 38%, 2% 22%, 25% 22%, 21% 2%, 39% 15%);
    background: var(--gold);
}

/* ===== SECTION 4: MANIFESTO ===== */
#manifesto {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background: radial-gradient(ellipse at center, var(--bg-mid) 0%, var(--bg-deep) 70%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10vh 6vw;
    overflow: hidden;
}

.manifesto-content {
    text-align: center;
    margin: 4vh 0;
}

.manifesto-text {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(3rem, 10vw, 8rem);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.1;
    color: var(--gold);
}

.manifesto-text .word {
    display: inline-block;
    opacity: 0;
    transform: translateY(-50px);
    margin: 0 0.15em;
}

.manifesto-text .word.drop {
    animation: wordDrop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes wordDrop {
    0% {
        opacity: 0;
        transform: translateY(-50px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fan ornaments */
.fan-ornament {
    width: 120px;
    height: 60px;
    overflow: visible;
    transform: scaleX(0);
    transform-origin: bottom center;
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fan-ornament.unfurled {
    transform: scaleX(1);
}

.top-fan {
    transform-origin: bottom center;
}

.bottom-fan {
    transform-origin: top center;
}

.fan-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.deco-rule {
    width: 300px;
    margin-top: 3vh;
}

.rule-svg {
    width: 100%;
    height: auto;
}

/* ===== PREFERS REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
