/* ============================================================
   yongjoon.net — Retro-Futuristic Network Hub
   Colors: #0a2818 #2d6a4f #90b090 #b8e0b8 #d0e0d0 #d0e8d0 #d4a843 #5c3d2e
   Fonts: Space Grotesk, Atkinson Hyperlegible, Victor Mono
   ============================================================ */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: #0a2818;
    color: #b8e0b8;
    font-family: 'Atkinson Hyperlegible', sans-serif;
    font-weight: 400;
    line-height: 1.7;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ---- Typography ---- */
h1, h2, h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    line-height: 1.1;
}

.mono {
    font-family: 'Victor Mono', monospace;
    font-size: 0.85rem;
    font-weight: 400;
}

/* ---- Particles Background ---- */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    opacity: 0.15;
    animation: particle-drift linear infinite;
}

.particle-hex {
    width: 20px;
    height: 12px;
    background: rgba(144, 176, 144, 0.3);
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    backdrop-filter: blur(2px);
}

.particle-diamond {
    width: 14px;
    height: 14px;
    background: rgba(212, 168, 67, 0.2);
    transform: rotate(45deg);
    border-radius: 2px;
}

@keyframes particle-drift {
    0% {
        transform: translateY(110vh) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% { opacity: 0.15; }
    90% { opacity: 0.15; }
    100% {
        transform: translateY(-10vh) translateX(40px) rotate(360deg);
        opacity: 0;
    }
}

/* ============================================================
   HERO: Transmission Tower
   ============================================================ */
#hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center top, #1a4a2e 0%, #0a2818 60%);
    overflow: hidden;
    z-index: 1;
}

#hero-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
}

/* Transmission tower line */
#tower-line {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 120px;
    background: linear-gradient(to top, transparent, #2d6a4f, #90b090, transparent);
    overflow: hidden;
}

#tower-pulse {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: linear-gradient(to top, #d0e8d0, transparent);
    animation: tower-pulse 2s ease-in-out infinite;
}

@keyframes tower-pulse {
    0% { transform: translateY(0); opacity: 0; }
    30% { opacity: 1; }
    100% { transform: translateY(-120px); opacity: 0; }
}

/* Orbit ring */
#hero-orbit-ring {
    position: absolute;
    width: 480px;
    height: 480px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: orbit-ring 20s linear infinite;
    pointer-events: none;
}

@keyframes orbit-ring {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.orbit-card {
    position: absolute;
    width: 80px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(45, 106, 79, 0.3);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(144, 176, 144, 0.25);
    border-radius: 8px;
    font-family: 'Victor Mono', monospace;
    font-size: 0.7rem;
    color: #90b090;
    box-shadow: inset 0 1px 0 rgba(184, 224, 184, 0.2);
    /* counter-rotate so text stays upright */
    animation: orbit-counter 20s linear infinite;
}

/* Position 6 cards evenly on the circle */
.orbit-card:nth-child(1) { top: 0; left: 50%; transform: translateX(-50%) rotate(0deg); --angle: 0deg; }
.orbit-card:nth-child(2) { top: 25%; right: 0; transform: translateY(-50%); }
.orbit-card:nth-child(3) { bottom: 25%; right: 0; transform: translateY(50%); }
.orbit-card:nth-child(4) { bottom: 0; left: 50%; transform: translateX(-50%); }
.orbit-card:nth-child(5) { bottom: 25%; left: 0; transform: translateY(50%); }
.orbit-card:nth-child(6) { top: 25%; left: 0; transform: translateY(-50%); }

@keyframes orbit-counter {
    from { /* no extra rotation */ }
    to { /* CSS can't easily counter-rotate individual children; text handled in JS */ }
}

/* Hero title */
#hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 8vw, 5rem);
    letter-spacing: -0.02em;
    background: linear-gradient(180deg, #90b090 0%, #d0e0d0 50%, #90b090 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 2;
    margin-top: 20px;
}

#hero-subtitle {
    color: #90b090;
    margin-top: 12px;
    letter-spacing: 0.05em;
    opacity: 0.8;
    font-style: italic;
}

#hero-cta {
    display: inline-block;
    margin-top: 40px;
    padding: 12px 36px;
    background: rgba(45, 106, 79, 0.4);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(144, 176, 144, 0.4);
    border-radius: 40px;
    color: #b8e0b8;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    letter-spacing: 0.05em;
    transition: background 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
    position: relative;
    z-index: 2;
}

#hero-cta:hover {
    background: rgba(45, 106, 79, 0.7);
    border-color: rgba(212, 168, 67, 0.5);
    transform: translateY(-2px);
}

/* Scroll indicator */
#scroll-indicator {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #90b090;
    opacity: 0.5;
}

#scroll-arrow {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, #90b090, transparent);
    animation: scroll-pulse 1.8s ease-in-out infinite;
}

@keyframes scroll-pulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.8); }
    50% { opacity: 1; transform: scaleY(1); }
}

/* ============================================================
   FLOW PATH: S-Curve Content Spine
   ============================================================ */
#flow-path {
    position: relative;
    width: 100%;
    min-height: 300vh;
    padding: 80px 0 120px;
    overflow: visible;
}

/* SVG Spine */
#spine-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.spine-path-main {
    stroke: #2d6a4f;
    stroke-width: 2;
    stroke-dasharray: 10 20;
    animation: flow-dash 3s linear infinite;
}

.spine-path-glow {
    stroke: #90b090;
    stroke-width: 4;
    stroke-dasharray: 6 100;
    animation: glow-travel 4s linear infinite;
    opacity: 0.4;
    filter: url(#glow-filter);
}

@keyframes flow-dash {
    to { stroke-dashoffset: -30; }
}

@keyframes glow-travel {
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -800; }
}

/* ============================================================
   Node Cards
   ============================================================ */
.node-card {
    position: relative;
    width: clamp(280px, 38%, 420px);
    margin: 80px 0;
    z-index: 2;
    transition: transform 0.15s ease;
}

.node-card.node-left {
    margin-left: 6%;
}

.node-card.node-right {
    margin-left: auto;
    margin-right: 6%;
}

/* Branch line connecting card to spine */
.branch-line {
    position: absolute;
    top: 50%;
    height: 2px;
    background: linear-gradient(to right, transparent, #2d6a4f);
    transform: translateY(-50%);
    z-index: -1;
    animation: branch-pulse 3s ease-in-out infinite;
}

.node-left .branch-line {
    right: -80px;
    width: 80px;
    background: linear-gradient(to right, #2d6a4f, transparent);
}

.node-right .branch-line {
    left: -80px;
    width: 80px;
    background: linear-gradient(to left, #2d6a4f, transparent);
}

@keyframes branch-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Glassmorphic card base */
.card-content {
    background: rgba(45, 106, 79, 0.3);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(144, 176, 144, 0.2);
    border-radius: 16px;
    padding: 32px;
    box-shadow:
        inset 0 1px 0 rgba(184, 224, 184, 0.2),
        0 8px 32px rgba(10, 40, 24, 0.4);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.node-card:hover .card-content {
    border-color: rgba(144, 176, 144, 0.4);
    box-shadow:
        inset 0 1px 0 rgba(184, 224, 184, 0.3),
        0 16px 48px rgba(10, 40, 24, 0.5);
}

.node-label {
    color: #d4a843;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.card-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 700;
    color: #d0e8d0;
    margin-bottom: 16px;
}

.card-body {
    color: #b8e0b8;
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 20px;
}

.tag-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-list li {
    padding: 4px 12px;
    background: rgba(144, 176, 144, 0.1);
    border: 1px solid rgba(144, 176, 144, 0.2);
    border-radius: 20px;
    color: #90b090;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    transition: background 0.2s ease, color 0.2s ease;
}

.tag-list li:hover {
    background: rgba(212, 168, 67, 0.15);
    color: #d4a843;
    border-color: rgba(212, 168, 67, 0.3);
}

/* ============================================================
   Skeleton Loading
   ============================================================ */
.skeleton-overlay {
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background: rgba(45, 106, 79, 0.3);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(144, 176, 144, 0.2);
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 1;
    transition: opacity 0.4s ease;
    z-index: 5;
    pointer-events: none;
}

.node-card.loaded .skeleton-overlay {
    opacity: 0;
    pointer-events: none;
}

.node-card.loaded .card-content {
    opacity: 1;
}

.card-content {
    opacity: 0;
    transition: opacity 0.4s ease 0.1s;
}

.node-card.loaded .card-content {
    opacity: 1;
}

.skel-line, .skel-circle {
    background: linear-gradient(
        90deg,
        rgba(144, 176, 144, 0.08) 0%,
        rgba(144, 176, 144, 0.15) 50%,
        rgba(144, 176, 144, 0.08) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.skel-line {
    height: 12px;
}

.skel-short { width: 40%; }
.skel-medium { width: 65%; }
.skel-long { width: 90%; }

.skel-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================================
   HUB FOOTER: Network Diagram
   ============================================================ */
#hub-footer {
    position: relative;
    background: linear-gradient(to bottom, #0a2818, #061510);
    padding: 80px 40px 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    z-index: 1;
}

#hub-diagram-container {
    width: 100%;
    max-width: 600px;
}

#hub-svg {
    width: 100%;
    height: auto;
}

.hub-line {
    stroke: #2d6a4f;
    stroke-width: 1.5;
    stroke-dasharray: 4 8;
    animation: hub-pulse 2s ease-in-out infinite;
    transition: stroke 0.3s ease;
}

.hub-line:hover {
    stroke: #d4a843;
}

@keyframes hub-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.9; }
}

.hub-node {
    fill: rgba(45, 106, 79, 0.4);
    stroke: rgba(144, 176, 144, 0.3);
    stroke-width: 1.5;
    backdrop-filter: blur(8px);
    transition: fill 0.3s ease, stroke 0.3s ease;
}

.hub-center {
    fill: rgba(45, 106, 79, 0.6);
    stroke: rgba(144, 176, 144, 0.5);
    stroke-width: 2;
}

.hub-satellite:hover {
    fill: rgba(212, 168, 67, 0.25);
    stroke: rgba(212, 168, 67, 0.5);
}

.hub-label {
    fill: #90b090;
    font-family: 'Victor Mono', monospace;
    font-size: 11px;
    dominant-baseline: middle;
    pointer-events: none;
}

.hub-center-label {
    fill: #d0e8d0;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    font-weight: 700;
}

.hub-label-sub {
    fill: #90b090;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 10px;
    font-weight: 400;
}

.footer-sig {
    color: #2d6a4f;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    opacity: 0.6;
}

/* Bark Brown (#5c3d2e) — warm accent dot on node labels */
.node-card .node-label::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #5c3d2e;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

/* ============================================================
   Responsive: Mobile
   ============================================================ */
@media (max-width: 768px) {
    #hero-orbit-ring {
        width: 320px;
        height: 320px;
        display: none;
    }

    .node-card {
        width: 88%;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .branch-line {
        display: none;
    }

    #spine-svg {
        display: none;
    }

    /* Simple vertical connector on mobile */
    .node-card::before {
        content: '';
        position: absolute;
        top: -40px;
        left: 50%;
        width: 1px;
        height: 40px;
        background: linear-gradient(to bottom, transparent, #2d6a4f);
        transform: translateX(-50%);
    }

    #flow-path {
        min-height: auto;
        padding: 40px 0 80px;
    }

    #hero-title {
        text-align: center;
        padding: 0 20px;
    }

    #hub-diagram-container {
        max-width: 100%;
    }
}

/* ============================================================
   Hover Node ID indicator dot
   ============================================================ */
.node-card::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 10px;
    height: 10px;
    background: #d4a843;
    border-radius: 50%;
    transform: translateY(-50%);
    box-shadow: 0 0 12px rgba(212, 168, 67, 0.8);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 3;
}

.node-left::after {
    right: -5px;
}

.node-right::after {
    left: -5px;
}

.node-card:hover::after {
    opacity: 1;
}

/* ============================================================
   Smooth appear for cards on low-end devices (no JS fallback)
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .node-card, .skeleton-overlay, .card-content {
        transition: none;
    }
    .spine-path-main, .spine-path-glow {
        animation: none;
    }
    #tower-pulse, #scroll-arrow, .orbit-card {
        animation: none;
    }
}
