/* ============================================================
   SUPPLYCHAIN.OBSERVER - COMPLETE STYLESHEET
   Art Deco | Translucent Frost | Border-Animate
   ============================================================ */

/* ============================================================
   ROOT & GLOBAL STYLES
   ============================================================ */

:root {
    /* Palette - Translucent Frost */
    --color-deep-observation: #0d1b2a;
    --color-harbor-blue: #1b2838;
    --color-ice-veil: rgba(200, 218, 230, 0.12);
    --color-crystal-edge: rgba(180, 210, 230, 0.25);
    --color-deco-gilt: #c9a84c;
    --color-transit-copper: #b87333;
    --color-frost-white: #e8edf2;
    --color-mist-gray: #8a9bb0;
    --color-flow-indicator: #4ecdc4;
    --color-disruption-rose: #d4726a;

    /* Typography */
    --font-display: "Poiret One", serif;
    --font-secondary: "Josefin Sans", sans-serif;
    --font-body: "Libre Baskerville", serif;

    /* Spacing & Sizing */
    --spacing-unit: 1rem;
    --transition-speed: 0.3s;
    --animation-duration: 20s;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: linear-gradient(135deg, var(--color-deep-observation) 0%, var(--color-harbor-blue) 100%);
    color: var(--color-frost-white);
    line-height: 1.8;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse 600px 400px at 20% 30%, rgba(78, 205, 196, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 500px 350px at 80% 70%, rgba(78, 205, 196, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse 700px 500px at 50% 50%, rgba(201, 168, 76, 0.04) 0%, transparent 60%);
    animation: ambient-drift 60s infinite ease-in-out;
    pointer-events: none;
    z-index: 0;
}

@keyframes ambient-drift {
    0%, 100% {
        background-position: 0% 0%, 100% 100%, 50% 50%;
    }
    50% {
        background-position: 100% 100%, 0% 0%, 50% 50%;
    }
}

/* ============================================================
   NAVIGATION BAR
   ============================================================ */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: rgba(13, 27, 42, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-crystal-edge);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 3rem;
    z-index: 1000;
    opacity: 0;
    animation: navbar-fade-in 2s ease-out 2s forwards;
}

@keyframes navbar-fade-in {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-brand {
    font-family: var(--font-secondary);
    font-size: clamp(0.85rem, 1.2vw, 1rem);
    font-weight: 300;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-frost-white);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-family: var(--font-secondary);
    font-size: clamp(0.8rem, 1vw, 0.95rem);
    font-weight: 300;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-frost-white);
    text-decoration: none;
    position: relative;
    padding-bottom: 4px;
    background: linear-gradient(to right, var(--color-deco-gilt) 0%, var(--color-deco-gilt) 0%, transparent 0%);
    background-position: left bottom;
    background-size: 0% 2px;
    background-repeat: no-repeat;
    transition: background-size 0.6s ease;
}

.nav-link:hover {
    background-size: 100% 2px;
}

/* ============================================================
   HERO SECTION - OBSERVATION DECK
   ============================================================ */

.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(180deg, var(--color-deep-observation) 0%, var(--color-harbor-blue) 100%);
    overflow: hidden;
    z-index: 10;
    margin-top: 0;
}

.hero-content {
    text-align: center;
    z-index: 20;
    position: relative;
}

.domain-title {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 6vw, 5.5rem);
    font-weight: 400;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--color-frost-white);
    margin-bottom: 2rem;
    line-height: 1.1;
    perspective: 1000px;
}

.domain-title .char {
    display: inline-block;
    opacity: 0;
    animation: char-fade-in 0.6s ease-out forwards;
}

.domain-title .dot {
    display: inline-block;
    opacity: 0;
    animation: char-fade-in 0.6s ease-out forwards;
}

@keyframes char-fade-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger animation for each character */
.domain-title .char:nth-child(1) { animation-delay: 0.2s; }
.domain-title .char:nth-child(2) { animation-delay: 0.4s; }
.domain-title .char:nth-child(3) { animation-delay: 0.6s; }
.domain-title .char:nth-child(4) { animation-delay: 0.8s; }
.domain-title .char:nth-child(5) { animation-delay: 1s; }
.domain-title .char:nth-child(6) { animation-delay: 1.2s; }
.domain-title .char:nth-child(7) { animation-delay: 1.4s; }
.domain-title .char:nth-child(8) { animation-delay: 1.6s; }
.domain-title .char:nth-child(9) { animation-delay: 1.8s; }
.domain-title .char:nth-child(10) { animation-delay: 2s; }
.domain-title .char:nth-child(11) { animation-delay: 2.2s; }
.domain-title .dot { animation-delay: 2.4s; }
.domain-title .char:nth-child(13) { animation-delay: 2.6s; }
.domain-title .char:nth-child(14) { animation-delay: 2.8s; }
.domain-title .char:nth-child(15) { animation-delay: 3s; }
.domain-title .char:nth-child(16) { animation-delay: 3.2s; }
.domain-title .char:nth-child(17) { animation-delay: 3.4s; }
.domain-title .char:nth-child(18) { animation-delay: 3.6s; }
.domain-title .char:nth-child(19) { animation-delay: 3.8s; }
.domain-title .char:nth-child(20) { animation-delay: 4s; }

.hero-divider {
    width: 200px;
    height: 1px;
    background: var(--color-deco-gilt);
    margin: 1.5rem auto;
    transform: scaleX(0);
    transform-origin: center;
    animation: divider-draw 1.2s ease-out 4.2s forwards;
}

@keyframes divider-draw {
    to {
        transform: scaleX(1);
    }
}

.hero-tagline {
    font-family: var(--font-secondary);
    font-size: clamp(0.9rem, 1.8vw, 1.3rem);
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-mist-gray);
    opacity: 0;
    animation: tagline-fade-in 0.8s ease-out 5s forwards;
}

@keyframes tagline-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Skyline in Hero */
.skyline-hero {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30vh;
    z-index: 15;
}

/* ============================================================
   FLOW CORRIDORS (Content Sections)
   ============================================================ */

.flow-corridor {
    position: relative;
    width: 100%;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(3rem, 10vw, 6rem) clamp(2rem, 5vw, 4rem);
    overflow: hidden;
    z-index: 20;
    margin-top: 4rem;
}

.flow-corridor.corridor-left {
    justify-content: flex-start;
    margin-left: 0;
    animation: slide-in-left 0.7s ease-out forwards;
    opacity: 0;
}

.flow-corridor.corridor-right {
    justify-content: flex-end;
    margin-right: 0;
    animation: slide-in-right 0.7s ease-out forwards;
    opacity: 0;
}

@keyframes slide-in-left {
    from {
        opacity: 0;
        transform: translateX(-60px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slide-in-right {
    from {
        opacity: 0;
        transform: translateX(60px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Trigger animations with IntersectionObserver */
.flow-corridor.in-view.corridor-left {
    animation: slide-in-left 0.7s ease-out forwards;
}

.flow-corridor.in-view.corridor-right {
    animation: slide-in-right 0.7s ease-out forwards;
}

/* Frost Container */
.frost-container {
    max-width: 45%;
    background: var(--color-ice-veil);
    backdrop-filter: blur(12px) saturate(120%);
    border: 1px solid var(--color-crystal-edge);
    padding: clamp(2rem, 4vw, 3.5rem);
    clip-path: polygon(16px 0, calc(100% - 16px) 0, 100% 16px, 100% calc(100% - 16px), calc(100% - 16px) 100%, 16px 100%, 0 calc(100% - 16px), 0 16px);
    animation: border-breathe 3s ease-in-out infinite;
}

@keyframes border-breathe {
    0%, 100% {
        border-color: rgba(180, 210, 230, 0.25);
    }
    50% {
        border-color: rgba(180, 210, 230, 0.4);
    }
}

.section-heading {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3.5vw, 3rem);
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-deco-gilt);
    margin-bottom: 1.5rem;
}

.section-text {
    font-family: var(--font-body);
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.8;
    color: var(--color-frost-white);
    margin-bottom: 1.5rem;
    text-align: justify;
}

.section-text:last-child {
    margin-bottom: 0;
}

/* Connector Lines (SVG) */
.connector-line {
    position: absolute;
    top: 0;
    right: 5%;
    width: 3%;
    height: 100%;
    opacity: 0.3;
    pointer-events: none;
}

.flow-corridor.corridor-right .connector-line {
    right: auto;
    left: 5%;
    transform: scaleX(-1);
}

/* ============================================================
   NETWORK MAP SECTION
   ============================================================ */

.network-map-section {
    position: relative;
    width: 100%;
    min-height: 80vh;
    padding: clamp(4rem, 8vw, 6rem) clamp(2rem, 5vw, 4rem);
    background: linear-gradient(135deg, rgba(27, 40, 56, 0.3) 0%, rgba(13, 27, 42, 0.4) 100%);
    z-index: 25;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.network-map-section .section-heading {
    width: 100%;
    text-align: center;
    margin-bottom: 3rem;
}

.network-map-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    aspect-ratio: 2 / 1;
    background: var(--color-ice-veil);
    backdrop-filter: blur(16px) saturate(120%);
    border: 1px solid var(--color-crystal-edge);
    padding: 2rem;
    clip-path: polygon(16px 0, calc(100% - 16px) 0, 100% 16px, 100% calc(100% - 16px), calc(100% - 16px) 100%, 16px 100%, 0 calc(100% - 16px), 0 16px);
    display: flex;
    justify-content: center;
    align-items: center;
    animation: border-breathe 3s ease-in-out infinite;
}

.network-map {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 8px rgba(78, 205, 196, 0.15));
}

.network-node {
    cursor: pointer;
    transition: all 0.3s ease;
}

.node-origin,
.node-destination {
    filter: drop-shadow(0 0 15px rgba(201, 168, 76, 0.4));
}

.node {
    cursor: pointer;
}

.node:hover circle:first-child {
    filter: drop-shadow(0 0 15px rgba(78, 205, 196, 0.6));
}

/* Network line animations */
.network-line {
    stroke-dashoffset: 12;
    animation: line-flow 6s linear infinite;
}

@keyframes line-flow {
    to {
        stroke-dashoffset: -12;
    }
}

/* Staggered node illumination */
.node {
    opacity: 0.4;
    animation: node-illuminate 6s ease-out forwards;
}

.node[data-node="origin"] { animation-delay: 0s; }
.node[data-node="hub1"] { animation-delay: 0.3s; }
.node[data-node="hub2"] { animation-delay: 0.6s; }
.node[data-node="hub3"] { animation-delay: 0.9s; }
.node[data-node="hub4"] { animation-delay: 1.2s; }
.node[data-node="destination"] { animation-delay: 1.5s; }
.node[data-node="dist1"] { animation-delay: 1.8s; }
.node[data-node="dist2"] { animation-delay: 2.1s; }
.node[data-node="dist3"] { animation-delay: 2.4s; }
.node[data-node="dist4"] { animation-delay: 2.7s; }
.node[data-node="dist5"] { animation-delay: 3s; }

@keyframes node-illuminate {
    from {
        opacity: 0.3;
        filter: drop-shadow(0 0 0px rgba(78, 205, 196, 0));
    }
    to {
        opacity: 0.8;
        filter: drop-shadow(0 0 8px rgba(78, 205, 196, 0.3));
    }
}

/* Node Tooltip */
.node-tooltip {
    position: absolute;
    background: rgba(13, 27, 42, 0.95);
    border: 1px solid var(--color-deco-gilt);
    padding: 1rem;
    border-radius: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 50;
}

.node-tooltip.active {
    opacity: 1;
}

#tooltip-title {
    font-family: var(--font-secondary);
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    color: var(--color-deco-gilt);
    margin-bottom: 0.5rem;
}

#tooltip-data {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--color-mist-gray);
    line-height: 1.6;
}

/* ============================================================
   DIVIDER SECTION
   ============================================================ */

.divider-section {
    position: relative;
    width: 100%;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(180deg, rgba(13, 27, 42, 0.5) 0%, rgba(27, 40, 56, 0.5) 100%);
    z-index: 22;
    padding: 2rem;
}

.deco-divider {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    opacity: 0.6;
}

.chevron-stack {
    width: 60px;
    height: 20px;
    border-left: 2px solid var(--color-deco-gilt);
    border-bottom: 2px solid var(--color-deco-gilt);
    transform: rotate(-45deg);
    margin: 0 auto;
}

.chevron-stack:nth-child(2) {
    margin-top: -10px;
}

.chevron-stack:nth-child(3) {
    margin-top: -10px;
}

/* ============================================================
   FOOTER SECTION
   ============================================================ */

.footer-section {
    position: relative;
    width: 100%;
    min-height: 40vh;
    background: linear-gradient(180deg, var(--color-harbor-blue) 0%, var(--color-deep-observation) 100%);
    padding: 4rem 2rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    z-index: 30;
    padding-top: 8rem;
}

.footer-content {
    text-align: center;
    z-index: 35;
    position: relative;
}

.footer-meditation {
    font-family: var(--font-body);
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    line-height: 1.8;
    color: var(--color-mist-gray);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-link {
    font-family: var(--font-secondary);
    font-size: clamp(0.8rem, 1vw, 0.95rem);
    font-weight: 300;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-frost-white);
    text-decoration: none;
    position: relative;
    padding-bottom: 4px;
    background: linear-gradient(to right, var(--color-deco-gilt) 0%, var(--color-deco-gilt) 0%, transparent 0%);
    background-position: left bottom;
    background-size: 0% 2px;
    background-repeat: no-repeat;
    transition: background-size 0.6s ease;
}

.footer-link:hover {
    background-size: 100% 2px;
}

.deco-bullet {
    color: var(--color-deco-gilt);
    opacity: 0.6;
    font-size: 1rem;
}

.skyline-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 25vh;
    z-index: 32;
    opacity: 0.6;
}

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */

@media (max-width: 1024px) {
    .frost-container {
        max-width: 70%;
    }

    .nav-links {
        gap: 1rem;
    }

    .nav-link {
        font-size: 0.75rem;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0 1.5rem;
    }

    .nav-brand {
        font-size: 0.75rem;
    }

    .nav-links {
        gap: 0.75rem;
    }

    .nav-link {
        font-size: 0.65rem;
    }

    .flow-corridor {
        justify-content: center !important;
        padding: 2rem 1.5rem;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .frost-container {
        max-width: 100%;
        padding: 1.5rem;
    }

    .connector-line {
        display: none;
    }

    .network-map-container {
        max-width: 100%;
        aspect-ratio: auto;
        min-height: 400px;
    }

    .divider-section {
        height: 150px;
    }

    .chevron-stack {
        width: 40px;
        height: 15px;
    }

    .footer-section {
        min-height: 30vh;
        padding-top: 4rem;
    }

    .skyline-footer {
        height: 20vh;
    }

    .skyline-hero {
        height: 25vh;
    }
}

@media (max-width: 480px) {
    .domain-title {
        font-size: clamp(1.5rem, 5vw, 2.5rem);
        letter-spacing: 0.15em;
    }

    .hero-tagline {
        font-size: clamp(0.75rem, 1.5vw, 0.9rem);
    }

    .hero-divider {
        width: 120px;
    }

    .section-heading {
        font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    }

    .section-text {
        font-size: clamp(0.85rem, 1vw, 0.95rem);
        text-align: left;
    }

    .frost-container {
        padding: 1rem;
    }

    .footer-links {
        gap: 0.5rem;
    }

    .footer-link,
    .nav-link {
        font-size: 0.6rem;
    }

    .chevron-stack {
        width: 30px;
        height: 12px;
    }
}

/* ============================================================
   ACCESSIBILITY & PRINT
   ============================================================ */

@media print {
    .navbar,
    .skyline,
    .connector-line {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    .section-text,
    .footer-meditation {
        color: black;
    }
}

/* High contrast mode support */
@media (prefers-contrast: more) {
    .frost-container {
        border-width: 2px;
        background: rgba(200, 218, 230, 0.2);
    }

    .section-text {
        font-weight: 500;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}
