/* =====================================================
   HELIO SECTION - Awwwards-Level Premium Design
   Theme: Obsidian Black + Warm Gold
   Foundation 08: HQ / Leadership
   ===================================================== */

/* =====================================================
   DESIGN TOKENS
   ===================================================== */
:root {
    /* === Colors === */
    --helio-obsidian: #0a0908;
    --helio-obsidian-light: #141210;
    --helio-obsidian-mid: #1a1815;
    --helio-gold: #d4a853;
    --helio-gold-bright: #f6c66a;
    --helio-gold-dim: #8b7355;
    --helio-gold-glow: rgba(212, 168, 83, 0.15);
    --helio-cream: #f5f0e8;
    --helio-cream-muted: rgba(245, 240, 232, 0.85);
    --helio-cream-subtle: rgba(245, 240, 232, 0.5);

    /* === Typography === */
    --helio-font-display: 'Cormorant Garamond', Georgia, serif;
    --helio-font-body: 'Inter', -apple-system, sans-serif;

    /* Font sizes - fluid typography */
    --helio-text-hero: clamp(4rem, 8vw + 1rem, 9rem);
    --helio-text-number: clamp(3rem, 5vw, 6rem);
    --helio-text-lead: clamp(1.25rem, 1.5vw + 0.5rem, 1.75rem);
    --helio-text-body: clamp(0.875rem, 1vw, 1rem);
    --helio-text-label: clamp(0.65rem, 0.8vw, 0.75rem);
    --helio-text-micro: 0.625rem;

    /* === Spacing === */
    --helio-space-xs: 0.5rem;
    --helio-space-sm: 1rem;
    --helio-space-md: 2rem;
    --helio-space-lg: 4rem;
    --helio-space-xl: 6rem;
    --helio-space-2xl: 10rem;

    /* === Effects === */
    --helio-blur-glass: 20px;
    --helio-blur-glow: 60px;
    --helio-shadow-panel: 0 40px 100px rgba(0, 0, 0, 0.6);
    --helio-shadow-text: 0 0 40px rgba(212, 168, 83, 0.3);
    --helio-vignette: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.7) 100%);

    /* === Transitions === */
    --helio-ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
    --helio-ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --helio-duration-fast: 400ms;
    --helio-duration-medium: 800ms;
    --helio-duration-slow: 1200ms;
    --helio-duration-reveal: 1800ms;
}

/* =====================================================
   SECTION CONTAINER
   ===================================================== */
.helio-section {
    position: relative;
    min-height: 100vh;
    width: 100%;
    background: #fdfbf7;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    isolation: isolate;
}

/* Vignette removed for paper aesthetic */

/* Film grain overlay */
.helio-grain {
    position: absolute;
    inset: 0;
    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)'/%3E%3C/svg%3E");
    opacity: 0.035;
    pointer-events: none;
    z-index: 50;
    mix-blend-mode: overlay;
}

/* =====================================================
   STARFIELD / EMBERS CANVAS
   ===================================================== */
.helio-starfield {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

/* =====================================================
   CURSOR SPOTLIGHT
   ===================================================== */
.helio-spotlight {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle,
            rgba(212, 168, 83, 0.06) 0%,
            rgba(212, 168, 83, 0.02) 30%,
            transparent 60%);
    pointer-events: none;
    z-index: 3;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.6s ease;
    will-change: transform;
}

.helio-section:hover .helio-spotlight {
    opacity: 1;
}

/* =====================================================
   FIGURE STAGE (LEFT SIDE)
   ===================================================== */
.helio-stage {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* Ambient glow behind figure */
.helio-stage::before {
    content: '';
    position: absolute;
    width: 70%;
    height: 60%;
    background: radial-gradient(ellipse,
            rgba(212, 168, 83, 0.08) 0%,
            rgba(212, 168, 83, 0.03) 40%,
            transparent 70%);
    filter: blur(var(--helio-blur-glow));
    pointer-events: none;
}

/* SVG Figure container */
.helio-figure {
    position: relative;
    width: 80%;
    max-width: 750px;
    aspect-ratio: 3 / 4;
}

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

/* Figure image (using figure-helio.png) */
.helio-figure-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(1.15) drop-shadow(0 0 60px rgba(251, 211, 141, 0.35));
    opacity: 0;
    transform: scale(0.95);
    transition:
        opacity var(--helio-duration-slow) var(--helio-ease-smooth),
        transform var(--helio-duration-slow) var(--helio-ease-smooth);
}

.helio-section.is-visible .helio-figure-img {
    opacity: 1;
    transform: scale(1);
}

/* Stroke animation for scribble effect */
.helio-figure .stroke-path {
    stroke: var(--helio-gold);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    filter: drop-shadow(0 0 8px rgba(212, 168, 83, 0.4));
    transition: stroke-dashoffset var(--helio-duration-reveal) var(--helio-ease-smooth);
}

.helio-figure .stroke-path.thick {
    stroke-width: 4;
}

.helio-figure .stroke-path.thin {
    stroke-width: 1.5;
    opacity: 0.6;
}

/* Animated state */
.helio-section.is-visible .helio-figure .stroke-path {
    stroke-dashoffset: 0 !important;
}

/* Staggered animation for different stroke groups */
.helio-figure .stroke-path:nth-child(1) {
    transition-delay: 0ms;
}

.helio-figure .stroke-path:nth-child(2) {
    transition-delay: 100ms;
}

.helio-figure .stroke-path:nth-child(3) {
    transition-delay: 200ms;
}

.helio-figure .stroke-path:nth-child(4) {
    transition-delay: 300ms;
}

.helio-figure .stroke-path:nth-child(5) {
    transition-delay: 400ms;
}

.helio-figure .stroke-path:nth-child(6) {
    transition-delay: 500ms;
}

.helio-figure .stroke-path:nth-child(7) {
    transition-delay: 600ms;
}

.helio-figure .stroke-path:nth-child(8) {
    transition-delay: 700ms;
}

.helio-figure .stroke-path:nth-child(9) {
    transition-delay: 800ms;
}

.helio-figure .stroke-path:nth-child(10) {
    transition-delay: 900ms;
}

/* Figure shadow */
.helio-figure-shadow {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 30px;
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.4) 0%, transparent 70%);
    filter: blur(15px);
}

/* =====================================================
   CONTENT PANEL (RIGHT SIDE)
   ===================================================== */
.helio-content {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--helio-space-xl);
    padding-left: var(--helio-space-lg);
    z-index: 10;
}

/* Glass panel background */
.helio-panel {
    position: relative;
    padding: var(--helio-space-lg);
    background: linear-gradient(135deg,
            rgba(20, 18, 16, 0.85) 0%,
            rgba(26, 24, 21, 0.75) 100%);
    backdrop-filter: blur(var(--helio-blur-glass));
    -webkit-backdrop-filter: blur(var(--helio-blur-glass));
    border-radius: 4px;
    border-left: 1px solid rgba(212, 168, 83, 0.2);
    box-shadow: var(--helio-shadow-panel);
    max-width: 520px;
}

/* Decorative hairline at top */
.helio-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: var(--helio-space-lg);
    right: var(--helio-space-lg);
    height: 1px;
    background: linear-gradient(90deg,
            transparent,
            rgba(212, 168, 83, 0.3) 20%,
            rgba(212, 168, 83, 0.3) 80%,
            transparent);
}

/* Foundation index */
.helio-index {
    position: absolute;
    right: calc(-1 * var(--helio-space-xl));
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
    transform-origin: center;
    display: flex;
    align-items: center;
    gap: var(--helio-space-sm);
    font-family: var(--helio-font-body);
    font-size: var(--helio-text-micro);
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--helio-cream-subtle);
    white-space: nowrap;
}

.helio-index::before {
    content: '';
    width: 40px;
    height: 1px;
    background: rgba(212, 168, 83, 0.3);
}

.helio-index-current {
    color: var(--helio-gold);
    font-weight: 500;
}

/* =====================================================
   TYPOGRAPHY
   ===================================================== */

/* Unify Helio Section with Global Foundation Aesthetic */
.helio-section {
    position: relative;
    /* Remove overflow: hidden to allow ornate corners to breathe */
    overflow: visible;
}

/* Helio inherits layout from index.css */

/* Restore the Helio-specific Figure Positioning if it was different */
.helio-stage {
    position: absolute;
    left: 10%;
    top: 50%;
    transform: translateY(-50%);
    width: 40%;
    height: 70%;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Unify Figure Image handling */
.figure--foundation[data-figure="helio"] {
    display: block;
    opacity: 0;
    transition: opacity 1s ease;
}

.scene.is-visible .figure--foundation[data-figure="helio"] {
    opacity: 1;
}

/* Ensure Helio uses global foundation-card styles with correct spacing */
.helio-section .foundation-header {
    width: 100%;
    max-width: 750px;
    margin-bottom: 2rem;
    padding: 0 1rem;
    /* Standard foundation-header padding */
}

/* Standard foundation-card styles are inherited from index.css */

/* Force visibility of Premium Ornate Corners */
.helio-section .foundation-card::before,
.helio-section .foundation-card::after {
    display: block !important;
    content: '' !important;
}

/* Ensure Left Alignment for Header when Card is on the Left */
.helio-section[data-position="right"] .foundation-header {
    align-items: flex-start !important;
    text-align: left !important;
}

.helio-section[data-position="right"] .foundation-header__main {
    flex-direction: row !important;
    /* Keep Number then Name */
}

/* Hide all legacy Helio-specific panel/list/node styles */
.helio-panel,
.helio-lead,
.helio-bullets,
.helio-index,
.helio-label,
.helio-cta {
    display: none !important;
}

.helio-section.is-visible .helio-bullet:nth-child(1) {
    transition-delay: 400ms;
}

.helio-section.is-visible .helio-bullet:nth-child(2) {
    transition-delay: 500ms;
}

.helio-section.is-visible .helio-bullet:nth-child(3) {
    transition-delay: 600ms;
}

/* Constellation node */
.helio-node {
    position: relative;
    width: 8px;
    height: 8px;
    flex-shrink: 0;
    margin-top: 0.5em;
}

.helio-node::before {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    background: var(--helio-gold-dim);
    transition:
        background var(--helio-duration-fast) ease,
        box-shadow var(--helio-duration-fast) ease,
        transform var(--helio-duration-fast) var(--helio-ease-bounce);
}

.helio-node::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid var(--helio-gold-dim);
    opacity: 0;
    transform: scale(0.5);
    transition:
        opacity var(--helio-duration-fast) ease,
        transform var(--helio-duration-fast) var(--helio-ease-bounce);
}

/* Hover state */
.helio-bullet:hover {
    color: var(--helio-cream);
}

.helio-bullet:hover .helio-node::before {
    background: var(--helio-gold-bright);
    box-shadow: 0 0 12px rgba(212, 168, 83, 0.6);
    transform: scale(1.2);
}

.helio-bullet:hover .helio-node::after {
    opacity: 1;
    transform: scale(1.8);
    border-color: rgba(212, 168, 83, 0.4);
}

/* Constellation line (connects to figure) */
.helio-constellation-line {
    position: absolute;
    left: 4px;
    top: 0.9em;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, var(--helio-gold), transparent);
    transform-origin: left center;
    transition: width var(--helio-duration-medium) var(--helio-ease-smooth);
    pointer-events: none;
}

.helio-bullet:hover .helio-constellation-line {
    width: 120px;
}

/* =====================================================
   CTA BUTTON
   ===================================================== */
.helio-cta {
    display: inline-flex;
    align-items: center;
    gap: 1em;
    margin-top: var(--helio-space-lg);
    font-family: var(--helio-font-body);
    font-size: var(--helio-text-label);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--helio-gold);
    text-decoration: none;
    position: relative;
    padding: 0.5em 0;
    opacity: 0;
    transform: translateY(20px);
    transition:
        opacity var(--helio-duration-medium) var(--helio-ease-smooth) 700ms,
        transform var(--helio-duration-medium) var(--helio-ease-smooth) 700ms,
        color var(--helio-duration-fast) ease;
}

.helio-section.is-visible .helio-cta {
    opacity: 1;
    transform: translateY(0);
}

.helio-cta::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--helio-gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--helio-duration-fast) var(--helio-ease-smooth);
}

.helio-cta:hover {
    color: var(--helio-gold-bright);
}

.helio-cta:hover::after {
    transform: scaleX(1);
}

.helio-cta-arrow {
    display: inline-block;
    transition: transform var(--helio-duration-fast) var(--helio-ease-smooth);
}

.helio-cta:hover .helio-cta-arrow {
    transform: translateX(4px);
}

/* Focus styles for accessibility */
.helio-cta:focus-visible {
    outline: 2px solid var(--helio-gold);
    outline-offset: 4px;
}

/* =====================================================
   RESPONSIVE DESIGN
   ===================================================== */
@media (max-width: 1200px) {
    .helio-panel {
        max-width: 450px;
        padding: var(--helio-space-md);
    }

    .helio-content {
        padding: var(--helio-space-lg);
        padding-left: var(--helio-space-md);
    }

    .helio-index {
        display: none;
    }
}

@media (max-width: 1024px) and (orientation: portrait),
(max-width: 900px) {
    .helio-section {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        height: 100dvh;
        padding: 4rem 1.5rem 2rem !important;
        background-image: none !important;
        overflow: hidden;
    }

    .helio-content {
        height: 100%;
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: center;
        padding: 0;
        z-index: 10;
        position: relative;
    }

    .helio-stage {
        position: absolute;
        top: 45%;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 80% !important;
        max-width: 300px;
        height: auto;
        z-index: 1;
        pointer-events: none;
        opacity: 0.8;
    }

    .helio-figure {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .helio-section .foundation-header {
        align-self: flex-start;
        text-align: left;
        margin-bottom: 0;
        padding: 0;
        margin-top: 1rem;
        width: 100%;
    }

    .helio-section .foundation-card {
        width: 100%;
        max-width: 100%;
        padding: 1.75rem 1.5rem;
        margin-bottom: 2dvh;
        margin-top: auto;
    }

    .helio-constellation-line {
        display: none;
    }
}

@media (max-width: 600px) {
    .helio-stage {
        height: 45vh;
        min-height: 320px;
    }

    .helio-figure {
        width: 70%;
    }

    .helio-panel {
        padding: var(--helio-space-sm) var(--helio-space-sm);
    }

    .helio-lead {
        font-size: 1.1rem;
    }
}

/* =====================================================
   REDUCED MOTION
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
    .helio-figure .stroke-path {
        stroke-dashoffset: 0;
        transition: none;
    }

    .helio-number,
    .helio-title,
    .helio-label,
    .helio-lead,
    .helio-bullet,
    .helio-cta {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .helio-title::after {
        display: none;
    }

    .helio-spotlight {
        display: none;
    }

    .helio-starfield {
        opacity: 0.5;
    }

    @keyframes shimmer {
        to {
            left: -100%;
        }
    }
}

/* =====================================================
   PRINT STYLES
   ===================================================== */
@media print {
    .helio-section {
        background: white;
        color: black;
        min-height: auto;
        page-break-inside: avoid;
    }

    .helio-grain,
    .helio-spotlight,
    .helio-starfield {
        display: none;
    }

    .helio-title,
    .helio-number {
        color: black;
    }
}