/* ============================================
   HECLM × DULCEDO — NATURAL SCROLL EDITION
   ============================================ */

/* ---------- Custom Fonts ---------- */
@font-face {
    font-family: 'PuHuiTi';
    src: url('./fonts/AlibabaPuHuiTi-3-45-Light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'PuHuiTi';
    src: url('./fonts/AlibabaPuHuiTi-3-105-Heavy.woff2') format('woff2');
    font-weight: 700 900;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Barlow';
    src: url('./fonts/Barlow-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Barlow';
    src: url('./fonts/Barlow-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Barlow';
    src: url('./fonts/Barlow-Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* ---------- CSS Variables ---------- */
:root {
    --bg-primary: #0a0a0a;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.5);
    --text-tertiary: rgba(255, 255, 255, 0.25);
    --accent-dim: rgba(255, 255, 255, 0.08);

    --font-display: 'PuHuiTi', sans-serif;
    --font-mono: 'PuHuiTi', monospace;
    --font-english: 'Barlow', sans-serif;

    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-cubic: cubic-bezier(0.33, 1, 0.68, 1);

    --nav-height: 60px;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-display);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    overflow-y: auto;
    cursor: none;
    height: auto;
}
body::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: calc(100vh * 3);
    z-index: 0;
    pointer-events: none;
}

::selection { background: rgba(255,255,255,0.2); color: #fff; }

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: none; background: none; border: none; color: inherit; }
a { color: inherit; text-decoration: none; cursor: none; }

/* ---------- Noise Overlay ---------- */
.noise-overlay {
    position: fixed; inset: 0;
    pointer-events: none; z-index: 9999;
    opacity: 0.03;
    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.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 200px 200px;
}

/* ========== CROSSHAIR CURSOR ========== */
.crosshair {
    position: fixed;
    width: 22px; height: 22px;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    transition: transform 0.15s var(--ease-out-cubic), opacity 0.2s ease;
    will-change: transform;
    color: rgba(255,255,255,0.75);
}
.crosshair svg { width: 100%; height: 100%; filter: drop-shadow(0 0 3px rgba(255,255,255,0.3)); }
.crosshair.hovering {
    transform: translate(-50%, -50%) scale(1.3);
    color: rgba(255,255,255,0.95);
}
.crosshair.rolling {
    animation: crosshairRoll 0.45s var(--ease-out-cubic);
}
@keyframes crosshairRoll {
    0%   { transform: translate(-50%, -50%) rotate(0deg) scale(1); }
    30%  { transform: translate(-50%, -50%) rotate(180deg) scale(0.7); }
    60%  { transform: translate(-50%, -50%) rotate(360deg) scale(1.1); }
    80%  { transform: translate(-50%, -50%) rotate(395deg) scale(0.95); }
    100% { transform: translate(-50%, -50%) rotate(360deg) scale(1); }
}
body.cursor-hidden .crosshair { opacity: 0; }

/* ========== INTRO OVERLAY ========== */
#intro-overlay {
    position: fixed; inset: 0; z-index: 9998;
    background: #000;
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}
#intro-overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.intro-loader {
    display: flex; flex-direction: column; align-items: center; gap: 24px;
}
.intro-line {
    width: 80px; height: 1px;
    background: rgba(255,255,255,0.2);
    position: relative; overflow: hidden;
}
.intro-line::after {
    content: ''; position: absolute; left: -100%; top: 0;
    width: 100%; height: 100%;
    background: #fff;
    animation: introLineSlide 1.2s ease-in-out infinite alternate;
}
@keyframes introLineSlide { to { left: 100%; } }

.intro-counter {
    font-family: var(--font-mono);
    font-size: clamp(14px, 2vw, 18px);
    letter-spacing: 0.3em; color: rgba(255,255,255,0.4);
}

/* ========== GLOBAL NAV ========== */
.global-nav {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--nav-height);
    padding: 0 40px;
    display: flex; align-items: center; justify-content: space-between;
    z-index: 100; pointer-events: none;
    mix-blend-mode: difference;
}
.nav-brand {
    font-family: var(--font-english);
    font-weight: 700;
    font-size: 10px; letter-spacing: 0.22em; color: white;
    pointer-events: auto;
}
.nav-status {
    font-family: var(--font-english);
    font-weight: 700;
    font-size: 10px; letter-spacing: 0.22em; color: white;
    pointer-events: auto;
}

/* ========== SCROLL SECTIONS ========== */
.scroll-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    z-index: 1;
}

/* ========== HERO SECTION ========== */
.hero-content {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 30px;
    padding: calc(var(--nav-height) + 40px) 40px 80px;
}

.hero-title-group { text-align: center; margin-bottom: 10px; }

.hero-label {
    font-family: var(--font-display);
    font-size: clamp(18px, 2.5vw, 28px);
    font-weight: 700;
    letter-spacing: 0.15em; text-transform: uppercase;
    color: var(--text-secondary); margin-bottom: 8px;
}

.hero-main {
    font-size: clamp(4rem, 12vw, 12rem);
    font-weight: 800; line-height: 1;
    letter-spacing: -0.04em; white-space: nowrap;
}
.en-sub {
    display: block;
    font-family: var(--font-english);
    font-size: clamp(12px, 1.6vw, 22px);
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-top: 10px;
    opacity: 0; transform: translateY(16px);
    transition: opacity 0.6s var(--ease-out-expo), transform 0.6s var(--ease-out-expo);
}
.reveal .en-sub {
    opacity: 1; transform: translateY(0);
}

.split-char {
    display: inline-block;
    opacity: 0; transform: translateY(110%);
    transition: opacity 0.55s var(--ease-out-expo), transform 0.65s var(--ease-out-expo);
    will-change: transform, opacity;
}

.in-view .split-char {
    opacity: 1; transform: translateY(0);
}

.hero-underline {
    margin-top: 18px; width: 120px; height: 6px;
    opacity: 0; transform: scaleX(0);
    transform-origin: left;
    transition: opacity 0.6s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}
.in-view .hero-underline { opacity: 1; transform: scaleX(1); }
.hero-underline svg { width: 100%; height: 100%; overflow: visible; }
.hero-underline svg line {
    stroke-dasharray: 120; stroke-dashoffset: 120;
    transition: stroke-dashoffset 1s var(--ease-out-expo) 0.2s;
}
.in-view .hero-underline svg line { stroke-dashoffset: 0; }

/* Logo Zone */
.logo-zone {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    opacity: 1; transform: scale(1);
}

.logo-image {
    width: clamp(180px, 28vw, 300px); height: auto;
    object-fit: contain;
    opacity: 0.92;
    transition: filter 0.4s ease;
}
.logo-zone:hover .logo-image {
    filter: drop-shadow(0 0 20px rgba(255,255,255,0.15));
}

/* Hero Footer */
.hero-footer {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 24px 40px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.footer-left, .footer-right {
    display: flex; align-items: center; gap: 12px;
}
.footer-right { justify-content: flex-end; }

.footer-year, .footer-copy {
    font-family: var(--font-mono);
    font-size: 10px; letter-spacing: 0.1em; color: var(--text-secondary);
}
.footer-divider { color: var(--text-secondary); }

.btn-text {
    cursor: pointer;
    font-family: var(--font-display);
    font-size: clamp(11px, 1.1vw, 13px);
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    padding: 6px 10px;
    transition: all 0.3s var(--ease-out-cubic);
}
.btn-text:hover { color: var(--text-primary); }

.external-link {
    font-family: var(--font-display);
    font-size: clamp(11px, 1.1vw, 13px);
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-secondary); padding: 6px 10px;
    transition: color 0.3s ease; position: relative;
}
.external-link:hover { color: var(--text-primary); }
.external-link::after {
    content: ''; position: absolute;
    bottom: 4px; left: 10px; right: 10px; height: 1px;
    background: currentColor;
    transform: scaleX(0); transform-origin: right;
    transition: transform 0.3s var(--ease-out-cubic);
}
.external-link:hover::after { transform: scaleX(1); transform-origin: left; }

/* ========== REVEAL ANIMATIONS ========== */
.reveal {
    opacity: 0; transform: translateY(28px);
    transition: opacity 0.75s var(--ease-out-expo), transform 0.75s var(--ease-out-expo);
}
.in-view .reveal { opacity: 1; transform: translateY(0); }

.reveal-scale {
    opacity: 0; transform: scale(0.9);
    transition: opacity 0.6s var(--ease-out-expo), transform 0.6s var(--ease-out-expo);
}
.in-view .reveal-scale { opacity: 1; transform: scale(1); }

/* Stagger delays via CSS custom properties */
[data-index="0"] .hero-label.reveal { transition-delay: 0.05s; }
[data-index="0"] .footer-left.reveal { transition-delay: 0.9s; }
[data-index="0"] .footer-right.reveal { transition-delay: 1.2s; }

[data-index="1"] .about-main-title.reveal { transition-delay: 0.05s; }

/* ========== ABOUT SECTION ========== */
.about-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 40px;
}

.about-header {
    position: absolute; top: 60px; left: 40px;
    z-index: 20;
}

.about-main-title {
    font-size: clamp(2rem, 5vw, 4.5rem);
    font-weight: 700; letter-spacing: -0.02em; line-height: 1.1;
}

.constellation-wrapper {
    position: relative;
    width: 75vmin; height: 75vmin;
    max-width: 650px; max-height: 650px;
}

#constellation-canvas {
    position: absolute; inset: 0;
    width: 100%; height: 100%; z-index: 5; pointer-events: none;
}
#constellation-nodes { position: absolute; inset: 0; z-index: 10; }

.constellation-node {
    position: absolute; width: 50px; height: 50px;
    border-radius: 50%; cursor: none;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.4s var(--ease-out-expo), z-index 0s;
    will-change: transform, left, top; z-index: 1;
}
.constellation-node:hover {
    transform: scale(1.25); z-index: 10;
}
.node-avatar {
    width: 50px; height: 50px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 22px rgba(255,255,255,0.08);
    transition: box-shadow 0.3s ease;
}
.constellation-node:hover .node-avatar {
    box-shadow: 0 0 31px rgba(255,255,255,0.18);
}
.node-avatar-inner {
    font-size: 18px; font-weight: 700; color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.node-info-panel {
    position: absolute; bottom: 32px; left: 50%;
    transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 4px 0;
    opacity: 0; transform: translateX(-50%) translateY(12px);
    transition: all 0.35s var(--ease-out-cubic);
    pointer-events: none; z-index: 30;
}
.node-info-panel.visible {
    opacity: 1; transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}
.node-name {
    font-size: 15px; font-weight: 700; letter-spacing: 0.03em;
    color: var(--text-primary);
}
.node-role {
    font-family: var(--font-mono);
    font-size: 10px; letter-spacing: 0.1em;
    color: var(--text-secondary);
}

/* ========== FUTURE SECTION ========== */
.future-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 40px;
}
.future-section--centered {
    justify-content: center; align-items: center;
}
.future-main-title {
    font-size: clamp(3rem, 8vw, 8rem);
    font-weight: 800; letter-spacing: -0.03em; line-height: 1;
}

.future-launch-text {
    font-family: var(--font-mono);
    font-size: clamp(14px, 2vw, 22px);
    letter-spacing: 0.15em;
    color: var(--text-secondary);
    margin-bottom: 32px;
    opacity: 0; transform: translateY(16px);
    transition: opacity 0.6s var(--ease-out-expo), transform 0.6s var(--ease-out-expo);
}
.reveal .future-launch-text {
    opacity: 1; transform: translateY(0);
}
.future-countdown {
    display: flex; align-items: center;
    gap: 2px;
    font-family: var(--font-mono);
    font-size: clamp(36px, 7vw, 64px);
    font-weight: 300;
    letter-spacing: 0.04em;
    color: var(--text-primary);
    line-height: 1;
    opacity: 0; transform: translateY(20px);
    transition: opacity 0.8s var(--ease-out-expo) 0.15s, transform 0.8s var(--ease-out-expo) 0.15s;
}
.reveal .future-countdown {
    opacity: 1; transform: translateY(0);
}
.future-countdown .count-num {
    min-width: 1ch;
    text-align: center;
}
.future-countdown .count-unit {
    font-size: 0.5em;
    color: var(--text-secondary);
    margin-left: 4px;
    vertical-align: middle;
}

/* ========== PARALLAX LAYERS ========== */
.parallax-layer {
    will-change: transform;
}

/* ========== TOAST ========== */
.toast {
    position: fixed; bottom: 36px; left: 50%;
    transform: translateX(-50%) translateY(16px);
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(12px);
    color: var(--text-primary);
    padding: 10px 24px;
    border-radius: 100px;
    font-size: 12px; letter-spacing: 0.06em;
    font-family: var(--font-mono);
    z-index: 10001;
    opacity: 0; visibility: hidden;
    transition: all 0.35s var(--ease-out-cubic);
}
.toast.show {
    opacity: 1; visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .global-nav { padding: 0 24px; }
    .hero-content { padding: calc(var(--nav-height) + 24px) 24px 70px; }
    .hero-footer {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto; gap: 12px; padding: 20px 24px;
    }
    .footer-left, .footer-right { justify-content: center; order: 3; gap: 16px; }
    .about-header { left: 24px; top: 48px; }
    .about-section { padding: 24px; }
    .constellation-wrapper { width: 85vmin; height: 85vmin; }
}

@media (max-width: 480px) {
    .hero-footer { padding: 16px 20px; gap: 8px; }
    .btn-text, .external-link { font-size: 10px; padding: 5px 8px; }
}