/* ============================================
   HHUDDL.com - Cyberpunk Warmth Sanctuary
   ============================================ */

/* CSS Custom Properties */
:root {
    --obsidian: #1A0F0A;
    --terracotta: #3D2B1F;
    --amber: #8B5E3C;
    --copper: #C4783E;
    --gold: #D4A854;
    --neon: #E8B86D;
    --parchment: #F0DCC0;
    --teal: #5A8A7A;
    --rose: #9E6B6B;
    --deep-umber: #2C1810;
    --dark-brown: #5A3D2B;

    --hearth-gradient: linear-gradient(135deg, #1A0F0A 0%, #3D2B1F 40%, #5A3D2B 100%);
    --ember-trail: linear-gradient(90deg, transparent 0%, #C4783E 30%, #D4A854 60%, transparent 100%);
    --neon-fog: radial-gradient(ellipse at center, rgba(232, 184, 109, 0.15) 0%, transparent 70%);

    --letterbox-h: 28px;
    --panel-h: calc(100vh - var(--letterbox-h) * 2);
}

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

html {
    overflow: hidden;
    background: var(--obsidian);
}

body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: var(--obsidian);
    color: var(--parchment);
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Letterbox Bars */
.letterbox {
    position: fixed;
    left: 0;
    width: 100vw;
    height: var(--letterbox-h);
    background: var(--deep-umber);
    z-index: 1000;
}

.letterbox-top {
    top: 0;
}

.letterbox-bottom {
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Panel Indicators */
.panel-indicators {
    display: flex;
    gap: 12px;
    align-items: center;
}

.indicator {
    display: block;
    width: 8px;
    height: 8px;
    background: var(--amber);
    opacity: 0.3;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    transition: opacity 0.6s ease, transform 0.6s ease, background 0.6s ease;
    cursor: pointer;
}

.indicator.active {
    opacity: 1;
    background: var(--gold);
    transform: scale(1.4);
}

/* Grain Overlay */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 900;
    pointer-events: none;
    mix-blend-mode: overlay;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* Ember Canvas */
#emberCanvas {
    position: fixed;
    top: var(--letterbox-h);
    left: 0;
    width: 100vw;
    height: var(--panel-h);
    z-index: 800;
    pointer-events: none;
}

/* Scroll Wrapper */
.scroll-wrapper {
    position: fixed;
    top: var(--letterbox-h);
    left: 0;
    width: 100vw;
    height: var(--panel-h);
    overflow: hidden;
}

.panels-track {
    display: flex;
    flex-direction: row;
    height: 100%;
    will-change: transform;
}

/* Panels Base */
.panel {
    flex: 0 0 100vw;
    width: 100vw;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: var(--hearth-gradient);
}

/* Parallax Layers */
.parallax-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.parallax-far {
    z-index: 1;
}

.parallax-mid {
    z-index: 2;
}

.parallax-near {
    z-index: 3;
}

/* Panel Content */
.panel-content {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Reveal Elements */
.reveal-element {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.reveal-element.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Typography */
.domain-title {
    font-family: 'Poiret One', sans-serif;
    font-size: clamp(3rem, 8vw, 9rem);
    letter-spacing: 0.15em;
    color: var(--parchment);
    text-align: center;
    position: relative;
}

.title-char {
    display: inline-block;
    background: linear-gradient(180deg, var(--copper) 0%, var(--neon) 50%, var(--copper) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: char-glow 4s ease-in-out infinite;
}

.title-char:nth-child(1) { animation-delay: 0s; }
.title-char:nth-child(2) { animation-delay: 0.3s; }
.title-char:nth-child(3) { animation-delay: 0.6s; }
.title-char:nth-child(4) { animation-delay: 0.9s; }
.title-char:nth-child(5) { animation-delay: 1.2s; }
.title-char:nth-child(6) { animation-delay: 1.5s; }

@keyframes char-glow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}

.cinzel-text {
    font-family: 'Cinzel Decorative', serif;
}

.mono-text {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    color: var(--teal);
}

/* Fog Zones */
.fog-zone {
    position: absolute;
    top: 0;
    width: 120px;
    height: 100%;
    z-index: 20;
    pointer-events: none;
}

.fog-left {
    left: 0;
    background: linear-gradient(90deg, var(--terracotta) 0%, transparent 100%);
}

.fog-right {
    right: 0;
    background: linear-gradient(270deg, var(--terracotta) 0%, transparent 100%);
}

/* Data Streams */
.data-stream {
    position: absolute;
    height: 1px;
    background: var(--ember-trail);
    will-change: transform;
    opacity: 0.5;
}

.stream-1 {
    top: 30%;
    left: -100%;
    width: 60%;
    animation: stream-flow 12s linear infinite;
}

.stream-2 {
    top: 55%;
    left: -100%;
    width: 45%;
    animation: stream-flow 9s linear infinite;
    animation-delay: -3s;
    opacity: 0.35;
}

.stream-3 {
    top: 75%;
    left: -100%;
    width: 70%;
    height: 2px;
    animation: stream-flow 15s linear infinite;
    animation-delay: -7s;
    opacity: 0.25;
}

@keyframes stream-flow {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(100vw + 100%)); }
}

/* Corridor streams */
.data-stream-group {
    position: absolute;
    width: 100%;
    height: 100%;
}

.stream-corridor-1 { top: 20%; left: -100%; width: 50%; animation: stream-flow 10s linear infinite; opacity: 0.4; }
.stream-corridor-2 { top: 35%; left: -100%; width: 65%; animation: stream-flow 13s linear infinite; animation-delay: -2s; opacity: 0.3; height: 2px; }
.stream-corridor-3 { top: 50%; left: -100%; width: 40%; animation: stream-flow 8s linear infinite; animation-delay: -5s; opacity: 0.5; }
.stream-corridor-4 { top: 65%; left: -100%; width: 55%; animation: stream-flow 11s linear infinite; animation-delay: -1s; opacity: 0.25; }
.stream-corridor-5 { top: 80%; left: -100%; width: 70%; animation: stream-flow 14s linear infinite; animation-delay: -8s; opacity: 0.35; height: 2px; }

/* Archive streams */
.stream-archive-1 { top: 15%; left: -100%; width: 45%; animation: stream-flow 11s linear infinite; opacity: 0.3; }
.stream-archive-2 { top: 85%; left: -100%; width: 60%; animation: stream-flow 13s linear infinite; animation-delay: -4s; opacity: 0.25; }

/* Horizon streams */
.stream-horizon-1 { top: 25%; left: -100%; width: 80%; animation: stream-flow 15s linear infinite; opacity: 0.2; }
.stream-horizon-2 { top: 50%; left: -100%; width: 50%; animation: stream-flow 10s linear infinite; animation-delay: -3s; opacity: 0.35; height: 2px; }
.stream-horizon-3 { top: 70%; left: -100%; width: 65%; animation: stream-flow 12s linear infinite; animation-delay: -6s; opacity: 0.25; }

/* Circuit Traces */
.circuit-traces {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    background-image:
        linear-gradient(0deg, transparent 49.5%, rgba(90, 138, 122, 0.08) 49.5%, rgba(90, 138, 122, 0.08) 50.5%, transparent 50.5%),
        linear-gradient(90deg, transparent 49.5%, rgba(90, 138, 122, 0.08) 49.5%, rgba(90, 138, 122, 0.08) 50.5%, transparent 50.5%);
    background-size: 80px 80px;
    opacity: 0.5;
}

/* Floating Elements */
.floating-element {
    position: absolute;
    will-change: transform, opacity;
}

/* Float positions and animations */
.float-chevron-1 {
    top: 15%;
    left: 20%;
    width: 60px;
    animation: float-drift 18s ease-in-out infinite;
    animation-delay: -2s;
}

.float-fan-1 {
    top: 60%;
    right: 25%;
    width: 80px;
    animation: float-drift 22s ease-in-out infinite;
    animation-delay: -7s;
}

.float-pyramid-1 {
    top: 35%;
    right: 15%;
    width: 50px;
    animation: float-drift 20s ease-in-out infinite;
    animation-delay: -4s;
}

.float-sunburst-1 {
    top: 25%;
    left: 35%;
    width: 80px;
    animation: float-drift 25s ease-in-out infinite;
    animation-delay: -1s;
}

.float-chevron-2 {
    bottom: 20%;
    right: 20%;
    width: 60px;
    animation: float-drift 19s ease-in-out infinite;
    animation-delay: -5s;
}

.float-fan-2 {
    top: 20%;
    left: 10%;
    width: 80px;
    animation: float-drift 21s ease-in-out infinite;
    animation-delay: -3s;
}

.float-pyramid-2 {
    bottom: 15%;
    right: 12%;
    width: 50px;
    animation: float-drift 17s ease-in-out infinite;
    animation-delay: -9s;
}

.float-chevron-3 {
    top: 20%;
    right: 18%;
    width: 60px;
    animation: float-drift 20s ease-in-out infinite;
    animation-delay: -6s;
}

.float-fan-3 {
    bottom: 25%;
    left: 15%;
    width: 80px;
    animation: float-drift 23s ease-in-out infinite;
    animation-delay: -2s;
}

.float-sunburst-2 {
    top: 10%;
    right: 25%;
    width: 120px;
    animation: float-drift 24s ease-in-out infinite;
    animation-delay: -8s;
}

.float-pyramid-3 {
    bottom: 20%;
    left: 20%;
    width: 50px;
    animation: float-drift 19s ease-in-out infinite;
    animation-delay: -4s;
}

@keyframes float-drift {
    0%, 100% { transform: translate(0, 0) rotate(0deg); opacity: 0.4; }
    25% { transform: translate(12px, -18px) rotate(3deg); opacity: 0.6; }
    50% { transform: translate(-8px, -30px) rotate(-2deg); opacity: 0.5; }
    75% { transform: translate(15px, -12px) rotate(4deg); opacity: 0.65; }
}

/* Lens Flares */
.lens-flare {
    position: absolute;
    pointer-events: none;
}

.flare-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid var(--copper);
    animation: flare-pulse 4s ease-in-out infinite;
    mix-blend-mode: screen;
}

.flare-ring-2 {
    border-color: var(--gold);
    animation-delay: -1s;
}

.flare-ring-3 {
    border-color: var(--neon);
    animation-delay: -2s;
}

@keyframes flare-pulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.08); }
}

/* Threshold flare */
.flare-threshold {
    top: 30%;
    right: 15%;
    width: 200px;
    height: 200px;
}

.flare-threshold .flare-ring {
    width: 100px;
    height: 100px;
    top: 50px;
    left: 50px;
}

.flare-threshold .flare-ring-2 {
    width: 140px;
    height: 140px;
    top: 30px;
    left: 30px;
}

.flare-threshold .flare-ring-3 {
    width: 180px;
    height: 180px;
    top: 10px;
    left: 10px;
}

/* Gathering flare */
.flare-gathering {
    top: 10%;
    left: 10%;
    width: 160px;
    height: 160px;
}

.flare-gathering .flare-ring {
    width: 80px;
    height: 80px;
    top: 40px;
    left: 40px;
}

.flare-gathering .flare-ring-2 {
    width: 130px;
    height: 130px;
    top: 15px;
    left: 15px;
}

/* Archive flare */
.flare-archive {
    bottom: 20%;
    right: 10%;
    width: 180px;
    height: 180px;
}

.flare-archive .flare-ring {
    width: 90px;
    height: 90px;
    top: 45px;
    left: 45px;
}

.flare-archive .flare-ring-2 {
    width: 130px;
    height: 130px;
    top: 25px;
    left: 25px;
}

.flare-archive .flare-ring-3 {
    width: 170px;
    height: 170px;
    top: 5px;
    left: 5px;
}

/* Horizon flare */
.flare-horizon {
    top: 20%;
    left: 40%;
    width: 200px;
    height: 200px;
}

.flare-horizon .flare-ring {
    width: 100px;
    height: 100px;
    top: 50px;
    left: 50px;
}

.flare-horizon .flare-ring-2 {
    width: 160px;
    height: 160px;
    top: 20px;
    left: 20px;
}

/* Deco Arches */
.deco-arch {
    position: absolute;
    opacity: 0.6;
}

.deco-arch-1 {
    left: 10%;
    top: 5%;
    width: 200px;
    height: 300px;
}

.deco-arch-2 {
    right: 10%;
    top: 10%;
    width: 180px;
    height: 280px;
}

/* Corridor Silhouettes */
.corridor-silhouette {
    position: absolute;
    top: 0;
    height: 100%;
}

.corridor-left {
    left: 0;
    width: 30%;
}

.corridor-left svg {
    width: 100%;
    height: 100%;
}

.corridor-right {
    right: 0;
    width: 30%;
}

.corridor-right svg {
    width: 100%;
    height: 100%;
}

/* Neon Fog (Gathering) */
.neon-fog {
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--neon-fog);
}

/* Horizon Glow */
.horizon-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 50% 70%, rgba(196, 120, 62, 0.12) 0%, transparent 60%);
}

/* =====================
   PANEL 1: THRESHOLD
   ===================== */
.panel-threshold {
    background: linear-gradient(135deg, #1A0F0A 0%, #2C1810 50%, #3D2B1F 100%);
}

.threshold-content {
    gap: 20px;
}

.threshold-subtitle {
    margin-top: 10px;
    font-size: 0.9rem;
    opacity: 0.7;
}

/* =====================
   PANEL 2: CORRIDOR
   ===================== */
.panel-corridor {
    background: linear-gradient(135deg, #1A0F0A 0%, #3D2B1F 60%, #5A3D2B 100%);
}

.corridor-content {
    gap: 24px;
}

.corridor-text {
    font-size: clamp(1.4rem, 3vw, 2.5rem);
    color: var(--parchment);
    letter-spacing: 0.06em;
}

.corridor-subtext {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: var(--gold);
    opacity: 0.7;
}

.deco-divider {
    width: clamp(200px, 40vw, 400px);
    height: 20px;
}

.deco-divider svg {
    width: 100%;
    height: 100%;
}

.corridor-caption {
    opacity: 0.5;
}

/* =====================
   PANEL 3: GATHERING
   ===================== */
.panel-gathering {
    background: linear-gradient(135deg, #1A0F0A 0%, #2C1810 30%, #3D2B1F 70%, #1A0F0A 100%);
}

.gathering-content {
    gap: 0;
    position: relative;
}

/* Orbit Container */
.orbit-container {
    position: relative;
    width: clamp(320px, 50vw, 560px);
    height: clamp(320px, 50vw, 560px);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Sigil */
.sigil {
    position: absolute;
    width: 140px;
    height: 140px;
    z-index: 5;
}

.sigil svg {
    width: 100%;
    height: 100%;
}

.sigil-glow {
    position: absolute;
    top: -30px;
    left: -30px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232, 184, 109, 0.2) 0%, transparent 70%);
    animation: flare-pulse 4s ease-in-out infinite;
}

/* Orbit Cards */
.orbit-card {
    position: absolute;
    width: 90px;
    height: 110px;
    background: linear-gradient(135deg, rgba(44, 24, 16, 0.8) 0%, rgba(61, 43, 31, 0.6) 100%);
    border: 1px solid var(--copper);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    backdrop-filter: blur(4px);
    transition: border-color 0.6s ease, box-shadow 0.6s ease;
}

.orbit-card:hover {
    border-color: var(--gold);
    box-shadow: 0 0 20px rgba(212, 168, 84, 0.2);
}

.card-label {
    font-size: 0.85rem;
    color: var(--parchment);
    letter-spacing: 0.05em;
}

.card-detail {
    font-size: 0.65rem;
    color: var(--teal);
    opacity: 0.7;
}

/* Card positions (arranged in a circle) */
.orbit-card-1 { top: 0; left: 50%; transform: translateX(-50%); }
.orbit-card-2 { top: 18%; right: 0; }
.orbit-card-3 { bottom: 18%; right: 0; }
.orbit-card-4 { bottom: 0; left: 50%; transform: translateX(-50%); }
.orbit-card-5 { bottom: 18%; left: 0; }
.orbit-card-6 { top: 18%; left: 0; }

.gathering-text {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.5vw, 1.2rem);
    color: var(--gold);
    margin-top: 30px;
    letter-spacing: 0.08em;
    opacity: 0.8;
}

/* =====================
   PANEL 4: ARCHIVE
   ===================== */
.panel-archive {
    background: linear-gradient(135deg, #1A0F0A 0%, #3D2B1F 50%, #2C1810 100%);
}

.archive-content {
    gap: 0;
    padding: 5% 10%;
    align-items: stretch;
    justify-content: center;
}

.archive-band {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 18px 24px;
    position: relative;
    border-left: 2px solid var(--copper);
    margin-bottom: 16px;
    transition: border-color 0.4s ease;
}

.archive-band:hover {
    border-left-color: var(--gold);
}

.archive-label {
    font-size: 0.75rem;
    color: var(--teal);
    white-space: nowrap;
    min-width: 140px;
}

.archive-value {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: var(--parchment);
    letter-spacing: 0.04em;
}

.stepped-border {
    position: absolute;
    right: 0;
    top: 0;
    width: 20px;
    height: 100%;
    border-right: 1px solid var(--amber);
    opacity: 0.2;
}

.stepped-border::before {
    content: '';
    position: absolute;
    right: 4px;
    top: 25%;
    width: 8px;
    height: 50%;
    border-right: 1px solid var(--amber);
    opacity: 0.5;
}

/* Staggered reveal for archive bands */
.archive-band-1.reveal-element { transition-delay: 0s; }
.archive-band-2.reveal-element { transition-delay: 0.15s; }
.archive-band-3.reveal-element { transition-delay: 0.3s; }
.archive-band-4.reveal-element { transition-delay: 0.45s; }
.archive-band-5.reveal-element { transition-delay: 0.6s; }

/* =====================
   PANEL 5: HORIZON
   ===================== */
.panel-horizon {
    background: linear-gradient(135deg, #1A0F0A 0%, #3D2B1F 40%, #5A3D2B 80%, #3D2B1F 100%);
}

.horizon-content {
    gap: 0;
}

.horizon-vista {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    text-align: center;
    padding: 0 10%;
}

.horizon-title {
    font-family: 'Poiret One', sans-serif;
    font-size: clamp(2rem, 5vw, 4.5rem);
    letter-spacing: 0.12em;
    color: var(--parchment);
    line-height: 1.2;
}

.deco-fan-array {
    width: clamp(300px, 60vw, 600px);
    height: 80px;
    opacity: 0.6;
}

.deco-fan-array svg {
    width: 100%;
    height: 100%;
}

.horizon-text {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: var(--gold);
    letter-spacing: 0.06em;
    opacity: 0.8;
}

.horizon-subtext {
    opacity: 0.5;
    margin-top: 8px;
}
