/* ============================================
   tanso.markets — Chrome-Metallic Art Deco
   Ethereal Carbon Descent
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --deep-ground: #1B1B24;
    --mid-ground: #2E2E3A;
    --chrome-primary: #C0C0D2;
    --chrome-highlight: #E8E4F0;
    --accent-warm: #C9A84C;
    --accent-deep: #7B6A9B;
    --atmospheric: #3A3A5C;
    --surface-glow: #F4F0FA;
    --bg-shift: #22222F;

    --font-headline: 'Poiret One', cursive;
    --font-subheading: 'Josefin Sans', sans-serif;
    --font-body: 'Cormorant Garamond', serif;

    --anim-duration: 0.6s;
    --anim-ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

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

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

body {
    background-color: var(--deep-ground);
    color: var(--chrome-primary);
    font-family: var(--font-body);
    font-weight: 300;
    line-height: 1.85;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Ambient Chrome Spheres --- */
.chrome-spheres {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.sphere {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, var(--chrome-highlight), var(--chrome-primary) 40%, var(--accent-deep) 70%, transparent 100%);
    opacity: 0.15;
    animation: sphereDrift linear infinite;
}

.sphere-1 { width: 12px; height: 12px; left: 8%; animation-duration: 65s; animation-delay: -5s; }
.sphere-2 { width: 8px; height: 8px; left: 15%; animation-duration: 80s; animation-delay: -20s; }
.sphere-3 { width: 16px; height: 16px; left: 25%; animation-duration: 55s; animation-delay: -12s; }
.sphere-4 { width: 10px; height: 10px; left: 35%; animation-duration: 70s; animation-delay: -3s; }
.sphere-5 { width: 14px; height: 14px; left: 50%; animation-duration: 45s; animation-delay: -18s; }
.sphere-6 { width: 9px; height: 9px; left: 62%; animation-duration: 85s; animation-delay: -8s; }
.sphere-7 { width: 18px; height: 18px; left: 72%; animation-duration: 60s; animation-delay: -15s; }
.sphere-8 { width: 11px; height: 11px; left: 80%; animation-duration: 75s; animation-delay: -1s; }
.sphere-9 { width: 8px; height: 8px; left: 88%; animation-duration: 90s; animation-delay: -10s; }
.sphere-10 { width: 13px; height: 13px; left: 42%; animation-duration: 50s; animation-delay: -7s; }
.sphere-11 { width: 10px; height: 10px; left: 55%; animation-duration: 68s; animation-delay: -14s; }
.sphere-12 { width: 15px; height: 15px; left: 92%; animation-duration: 58s; animation-delay: -19s; }

@keyframes sphereDrift {
    0% {
        transform: translateY(110vh) translateX(0);
        opacity: 0;
    }
    5% {
        opacity: 0.15;
    }
    95% {
        opacity: 0.15;
    }
    100% {
        transform: translateY(-10vh) translateX(30px);
        opacity: 0;
    }
}

/* --- Navigation Compass Rose --- */
.compass-nav {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 100;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.compass-rose {
    width: 44px;
    height: 44px;
    cursor: pointer;
    transition: transform 0.4s var(--anim-ease);
}

.compass-rose:hover {
    transform: rotate(45deg);
}

.compass-svg {
    width: 100%;
    height: 100%;
}

.compass-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateX(10px);
    transition: opacity 0.4s var(--anim-ease), transform 0.4s var(--anim-ease);
    pointer-events: none;
    padding-top: 4px;
}

.compass-nav:hover .compass-menu {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
}

.compass-link {
    font-family: var(--font-subheading);
    font-weight: 300;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    color: var(--chrome-primary);
    text-decoration: none;
    writing-mode: horizontal-tb;
    transition: color 0.3s var(--anim-ease);
    white-space: nowrap;
}

.compass-link:hover {
    color: var(--accent-warm);
}

/* --- Scroll Progress Indicator --- */
.scroll-indicator {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 90;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.indicator-track {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    position: relative;
}

.indicator-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: 1px solid var(--chrome-primary);
    background: transparent;
    transition: background 0.4s var(--anim-ease), border-color 0.4s var(--anim-ease);
    position: relative;
    z-index: 2;
}

.indicator-dot.active {
    background: var(--accent-warm);
    border-color: var(--accent-warm);
}

.indicator-line {
    width: 1px;
    height: 30px;
    background: var(--atmospheric);
    position: relative;
    z-index: 1;
}

.indicator-fill {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 0%;
    background: linear-gradient(180deg, var(--accent-warm), var(--accent-deep));
    transition: height 0.3s linear;
    z-index: 1;
}

/* --- Strata (Sections) --- */
.stratum {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.stratum-content {
    position: relative;
    z-index: 10;
    max-width: 720px;
    width: 100%;
    padding: 60px 30px;
    margin: 0 auto;
}

.stratum-content-shift-right {
    transform: translateX(15px);
}

.stratum-content-shift-left {
    transform: translateX(-15px);
}

/* --- Background Atmospheric Gradients --- */
.stratum-opening {
    background: linear-gradient(180deg, var(--deep-ground) 0%, var(--bg-shift) 50%, var(--deep-ground) 100%);
}

.stratum-market {
    background: linear-gradient(180deg, var(--deep-ground) 0%, var(--mid-ground) 30%, var(--bg-shift) 70%, var(--deep-ground) 100%);
}

.stratum-exchange {
    background: linear-gradient(180deg, var(--deep-ground) 0%, var(--bg-shift) 40%, var(--mid-ground) 60%, var(--deep-ground) 100%);
}

.stratum-deep {
    background: linear-gradient(180deg, var(--deep-ground) 0%, #181820 50%, var(--deep-ground) 100%);
}

.stratum-closing {
    background: linear-gradient(180deg, var(--deep-ground) 0%, var(--bg-shift) 40%, var(--deep-ground) 80%, var(--deep-ground) 100%);
}

/* --- Typography --- */
.hero-title {
    font-family: var(--font-headline);
    font-weight: 400;
    font-size: clamp(3rem, 10vw, 6rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--chrome-highlight);
    text-align: center;
    line-height: 1.1;
}

.title-char {
    display: inline-block;
    opacity: 0;
    transition: opacity 0.5s var(--anim-ease), transform 0.5s var(--anim-ease);
}

.title-char.visible {
    opacity: 1;
    transform: translateX(0) !important;
}

.hero-subtitle {
    font-family: var(--font-subheading);
    font-weight: 300;
    font-size: clamp(1.2rem, 4vw, 2.5rem);
    letter-spacing: 0.08em;
    color: var(--chrome-primary);
    text-align: center;
    opacity: 0;
    transition: opacity 0.8s var(--anim-ease);
    margin-top: 10px;
}

.hero-subtitle.visible {
    opacity: 1;
}

.section-heading {
    font-family: var(--font-headline);
    font-weight: 400;
    font-size: clamp(1.8rem, 5vw, 3rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--chrome-highlight);
    text-align: center;
    margin-bottom: 10px;
}

.section-subheading {
    font-family: var(--font-subheading);
    font-weight: 300;
    font-size: clamp(0.9rem, 2.5vw, 1.3rem);
    letter-spacing: 0.08em;
    color: var(--chrome-primary);
    text-align: center;
    margin-bottom: 30px;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.6s var(--anim-ease), transform 0.6s var(--anim-ease);
}

.section-subheading.in-view {
    opacity: 1;
    transform: translateY(0);
}

.body-text {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(1rem, 2vw, 1.15rem);
    line-height: 1.85;
    color: var(--chrome-primary);
    margin-bottom: 24px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s var(--anim-ease), transform 0.7s var(--anim-ease);
}

.body-text.in-view {
    opacity: 1;
    transform: translateY(0);
}

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

.body-italic {
    font-style: italic;
    font-weight: 300;
}

.body-large {
    font-size: clamp(1.05rem, 2.2vw, 1.2rem);
    line-height: 2;
}

/* --- Counter-Animate Text --- */
.counter-animate-text .char {
    display: inline-block;
    opacity: 0;
    transition: opacity 0.4s var(--anim-ease), transform 0.4s var(--anim-ease);
}

.counter-animate-text .char.even {
    transform: translateX(-20px);
}

.counter-animate-text .char.odd {
    transform: translateX(20px);
}

.counter-animate-text .char.visible {
    opacity: 1;
    transform: translateX(0);
}

/* --- Content Containers --- */
.content-container {
    position: relative;
    padding: 40px 35px;
    margin-bottom: 30px;
    border: 1px solid rgba(192, 192, 210, 0.1);
    border-radius: 4px;
    box-shadow: inset 0 0 30px rgba(192, 192, 210, 0.05);
    background: rgba(27, 27, 36, 0.4);
}

/* Corner Brackets */
.corner-bracket {
    position: absolute;
    width: 16px;
    height: 16px;
}

.corner-bracket::before,
.corner-bracket::after {
    content: '';
    position: absolute;
    background: var(--chrome-primary);
}

.corner-tl { top: -1px; left: -1px; }
.corner-tl::before { top: 0; left: 0; width: 16px; height: 1px; }
.corner-tl::after { top: 0; left: 0; width: 1px; height: 16px; }

.corner-tr { top: -1px; right: -1px; }
.corner-tr::before { top: 0; right: 0; width: 16px; height: 1px; }
.corner-tr::after { top: 0; right: 0; width: 1px; height: 16px; }

.corner-bl { bottom: -1px; left: -1px; }
.corner-bl::before { bottom: 0; left: 0; width: 16px; height: 1px; }
.corner-bl::after { bottom: 0; left: 0; width: 1px; height: 16px; }

.corner-br { bottom: -1px; right: -1px; }
.corner-br::before { bottom: 0; right: 0; width: 16px; height: 1px; }
.corner-br::after { bottom: 0; right: 0; width: 1px; height: 16px; }

.corner-bracket.gold::before,
.corner-bracket.gold::after {
    background: var(--accent-warm);
}

/* --- Chrome Membrane Separators --- */
.membrane {
    position: relative;
    height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.8s var(--anim-ease);
}

.membrane.in-view {
    opacity: 1;
}

.membrane-line {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--chrome-primary) 20%, var(--accent-deep) 50%, var(--chrome-primary) 80%, transparent 100%);
    opacity: 0.2;
}

.membrane-line:nth-child(2) {
    opacity: 0.35;
    width: 80%;
}

.membrane-line:nth-child(3) {
    opacity: 0.15;
    width: 60%;
}

/* --- Background Lattice --- */
.background-lattice {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
}

.lattice-svg {
    width: 80%;
    max-width: 600px;
    height: auto;
}

.lattice-rotate {
    animation: latticeRotate 120s linear infinite;
}

@keyframes latticeRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- Diamond Sunburst --- */
.diamond-sunburst {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 3;
}

.sunburst-svg {
    width: 90%;
    max-width: 800px;
    height: auto;
    animation: sunburstPulse 8s ease-in-out infinite;
}

@keyframes sunburstPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* --- Background Facets --- */
.background-facets {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
}

.facets-svg {
    width: 80%;
    max-width: 600px;
    height: auto;
}

/* --- Morphing Polygon (Deep Carbon) --- */
.morphing-polygon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
}

.morph-svg {
    width: 70%;
    max-width: 600px;
    height: auto;
}

.morph-shape {
    transition: all 4s var(--anim-ease);
}

/* --- Deco Dividers --- */
.deco-divider {
    display: flex;
    justify-content: center;
    margin: 20px 0 30px;
}

.deco-divider-svg {
    width: 200px;
    height: 30px;
}

/* --- Exchange Figures --- */
.exchange-figures {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 40px 0;
    padding: 30px 10px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s var(--anim-ease), transform 0.7s var(--anim-ease);
}

.exchange-figures.in-view {
    opacity: 1;
    transform: translateY(0);
}

.figure-block {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.figure-number {
    font-family: var(--font-headline);
    font-weight: 400;
    font-size: clamp(2rem, 5vw, 3rem);
    color: var(--chrome-highlight);
    letter-spacing: 0.05em;
}

.figure-unit {
    font-family: var(--font-subheading);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    color: var(--accent-warm);
    text-transform: uppercase;
}

.figure-label {
    font-family: var(--font-subheading);
    font-weight: 300;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: var(--accent-deep);
    text-transform: uppercase;
}

/* --- Deep Container --- */
.deep-container {
    border-color: rgba(192, 192, 210, 0.06);
    box-shadow: inset 0 0 50px rgba(123, 106, 155, 0.03);
}

/* --- Closing Section --- */
.closing-container {
    border-color: rgba(201, 168, 76, 0.15);
    box-shadow: inset 0 0 40px rgba(201, 168, 76, 0.03);
}

.deco-final-ornament {
    display: flex;
    justify-content: center;
    margin-top: 60px;
    animation: compassPulse 4s ease-in-out infinite;
}

.deco-ornament-svg {
    width: 300px;
    height: 60px;
}

@keyframes compassPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* --- Scroll Animations --- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
}

.animate-on-scroll.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .stratum-content {
        padding: 40px 20px;
    }

    .stratum-content-shift-right,
    .stratum-content-shift-left {
        transform: translateX(0);
    }

    .content-container {
        padding: 25px 20px;
    }

    .exchange-figures {
        flex-direction: column;
        gap: 30px;
    }

    .compass-nav {
        top: 15px;
        right: 15px;
    }

    .scroll-indicator {
        right: 8px;
    }

    .indicator-line {
        height: 20px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        letter-spacing: 0.08em;
    }

    .section-heading {
        letter-spacing: 0.08em;
    }

    .compass-nav {
        top: 10px;
        right: 10px;
    }

    .compass-rose {
        width: 36px;
        height: 36px;
    }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    .sphere {
        animation: none;
        opacity: 0.08;
    }

    .lattice-rotate {
        animation: none;
    }

    .sunburst-svg {
        animation: none;
    }

    .deco-final-ornament {
        animation: none;
    }

    .title-char,
    .hero-subtitle,
    .body-text,
    .section-subheading,
    .exchange-figures,
    .membrane,
    .counter-animate-text .char {
        transition: none;
        opacity: 1;
        transform: none;
    }
}
