/* ============================================================
   tanso.markets — Carbon Trading Marketplace
   Hand-drawn futurism, terracotta warm palette
   ============================================================ */

/* CSS Custom Properties */
:root {
    --carbon-black: #2b2118;
    --terracotta-core: #c4603a;
    --burnt-sienna: #a0522d;
    --kiln-amber: #d4a04a;
    --parchment-warm: #f5ece0;
    --smoke-ash: #8a7e72;
    --carbon-deposit: #3d2b1f;
    --ember-glow: #e07040;
    --parchment-deep: #ede2d4;
    --ease-organic: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-card: cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
    font-family: 'Caveat', cursive;
    color: var(--carbon-black);
    background: linear-gradient(165deg, var(--parchment-warm) 0%, var(--parchment-deep) 100%);
    overflow-x: hidden;
    position: relative;
}

/* Paper grain overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.4;
}

/* Hexagonal background pattern */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='52' viewBox='0 0 60 52' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0 L60 15 L60 37 L30 52 L0 37 L0 15 Z' fill='none' stroke='%23a0522d' stroke-width='0.3' opacity='0.05'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 60px 52px;
    pointer-events: none;
    z-index: -1;
}

/* ============================================================
   NOTEBOOK MARGIN
   ============================================================ */
#notebook-margin {
    position: fixed;
    left: 0;
    top: 0;
    width: 80px;
    height: 100vh;
    z-index: 100;
    pointer-events: none;
}

.margin-line {
    position: absolute;
    left: 72px;
    top: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom,
        transparent 0%,
        var(--terracotta-core) 5%,
        var(--terracotta-core) 95%,
        transparent 100%
    );
    opacity: 0.25;
}

.margin-content {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.margin-entry {
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0.3;
    transition: opacity 0.6s var(--ease-organic);
    white-space: nowrap;
}

.margin-entry.active {
    opacity: 1;
}

.tick-mark {
    font-family: 'Architects Daughter', cursive;
    font-size: 12px;
    color: var(--terracotta-core);
    width: 12px;
    text-align: center;
}

.margin-text {
    font-family: 'Architects Daughter', cursive;
    font-size: 11px;
    color: var(--smoke-ash);
    writing-mode: horizontal-tb;
}

.margin-entry.active .margin-text {
    color: var(--terracotta-core);
}

/* ============================================================
   ZONE COMMON
   ============================================================ */
.zone {
    position: relative;
    padding-left: 90px;
    padding-right: 20px;
}

.zone-inner {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

/* ============================================================
   ZONE 1: SURFACE READING
   ============================================================ */
.zone-surface {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 60px;
    padding-bottom: 60px;
}

.zone-surface .zone-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
}

.hex-assembly {
    position: absolute;
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    width: 320px;
    height: 320px;
    opacity: 0;
    transition: opacity 1s var(--ease-organic);
}

.hex-assembly.visible {
    opacity: 1;
}

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

/* SVG draw-line animation */
.draw-line {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 3s var(--ease-organic);
}

.draw-line.animate {
    stroke-dashoffset: 0;
}

.draw-line.delay-1 {
    transition-delay: 0.8s;
}

.draw-line.delay-2 {
    transition-delay: 1.6s;
}

.draw-line.delay-3 {
    transition-delay: 2.4s;
}

.zone1-title {
    position: relative;
    z-index: 2;
    margin-bottom: 20px;
}

.site-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 5.5rem);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--carbon-black);
    line-height: 1;
}

.title-dot {
    color: var(--terracotta-core);
}

.kanji-label {
    font-family: 'Caveat', cursive;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 700;
    color: var(--terracotta-core);
    margin-left: 16px;
    vertical-align: super;
}

.zone1-tagline {
    font-family: 'Caveat', cursive;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    font-weight: 400;
    color: var(--smoke-ash);
    line-height: 1.7;
    max-width: 500px;
    position: relative;
    z-index: 2;
}

.zone1-scroll-hint {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    animation: bob 2.5s var(--ease-organic) infinite;
}

@keyframes bob {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

/* ============================================================
   ZONE 2: CARBON ANATOMY
   ============================================================ */
.zone-anatomy {
    min-height: 130vh;
    padding-top: 80px;
    padding-bottom: 120px;
}

.zone-asymmetric-left {
    display: grid;
    grid-template-columns: 55% 40%;
    gap: 5%;
    align-items: start;
}

.content-block {
    position: relative;
}

.section-heading {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 3.5vw, 3rem);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--carbon-black);
    margin-bottom: 32px;
    position: relative;
}

.section-heading::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--terracotta-core);
    margin-top: 12px;
    border-radius: 2px;
}

.section-heading-light {
    color: var(--parchment-warm);
}

.section-heading-light::after {
    background: var(--ember-glow);
}

.narrative-text {
    font-family: 'Caveat', cursive;
    font-size: 19px;
    font-weight: 400;
    line-height: 1.7;
    color: var(--carbon-black);
}

.narrative-text p {
    margin-bottom: 24px;
}

.viz-block {
    position: sticky;
    top: 80px;
}

.chart-svg {
    width: 100%;
    height: auto;
}

.chart-line {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 2.5s var(--ease-organic);
}

.chart-line.animate {
    stroke-dashoffset: 0;
}

/* ============================================================
   SPECIMEN CARDS (Shared)
   ============================================================ */
.specimen-cards {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-top: 60px;
    position: relative;
}

.specimen-card {
    width: 280px;
    height: 380px;
    perspective: 800px;
    cursor: pointer;
}

.specimen-card.size-small {
    width: 200px;
    height: 280px;
}

.specimen-card.size-medium {
    width: 280px;
    height: 380px;
}

.specimen-card.size-large {
    width: 340px;
    height: 460px;
}

.card-offset-1 {
    margin-top: 40px;
}

.card-offset-2 {
    margin-top: -20px;
}

.card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s var(--ease-card);
}

.specimen-card:hover .card-inner,
.specimen-card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border: 2px solid var(--burnt-sienna);
    border-radius: 6px;
    background: var(--parchment-warm);
    padding: 16px;
    box-shadow: 4px 6px 0px var(--carbon-black);
    transition: box-shadow 0.3s var(--ease-organic);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.specimen-card:hover .card-front,
.specimen-card:hover .card-back {
    box-shadow: 6px 8px 0px var(--carbon-black);
}

.card-back {
    transform: rotateY(180deg);
    justify-content: flex-start;
    padding: 24px 20px;
    overflow-y: auto;
}

.card-illustration {
    width: 80%;
    height: auto;
    max-height: 70%;
}

.card-label {
    font-family: 'Architects Daughter', cursive;
    font-size: 15px;
    color: var(--burnt-sienna);
    margin-top: 8px;
}

.card-back h3 {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 20px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--terracotta-core);
    margin-bottom: 16px;
    width: 100%;
}

.card-data {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 12px;
    width: 100%;
}

.data-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    color: var(--smoke-ash);
    text-transform: uppercase;
}

.data-value {
    font-family: 'Caveat', cursive;
    font-size: 15px;
    font-weight: 400;
    color: var(--carbon-black);
    line-height: 1.4;
}

/* ============================================================
   ZONE 3: THE LIVING LEDGER
   ============================================================ */
.zone-ledger {
    min-height: 150vh;
    background: linear-gradient(180deg,
        var(--parchment-warm) 0%,
        var(--carbon-deposit) 8%,
        var(--carbon-deposit) 92%,
        var(--parchment-warm) 100%
    );
    padding-top: 120px;
    padding-bottom: 120px;
}

.zone3-intro {
    font-family: 'Caveat', cursive;
    font-size: 20px;
    color: var(--parchment-deep);
    max-width: 600px;
    line-height: 1.7;
    margin-bottom: 60px;
}

.sankey-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

.sankey-svg {
    width: 100%;
    height: auto;
}

.sankey-flow {
    stroke-dasharray: 3000;
    stroke-dashoffset: 3000;
    transition: stroke-dashoffset 2s var(--ease-organic);
}

.sankey-flow.animate {
    stroke-dashoffset: 0;
}

.ledger-metrics {
    display: flex;
    gap: 48px;
    margin-top: 80px;
    flex-wrap: wrap;
    justify-content: center;
}

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

.metric-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 36px;
    font-weight: 600;
    color: var(--ember-glow);
}

.metric-unit {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    font-weight: 400;
    color: var(--kiln-amber);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.metric-label {
    font-family: 'Architects Daughter', cursive;
    font-size: 14px;
    color: var(--smoke-ash);
}

/* ============================================================
   ZONE 4: SPECIMEN GALLERY
   ============================================================ */
.zone-gallery {
    min-height: 120vh;
    padding-top: 100px;
    padding-bottom: 100px;
}

.gallery-intro {
    font-family: 'Caveat', cursive;
    font-size: 19px;
    color: var(--smoke-ash);
    max-width: 500px;
    line-height: 1.7;
    margin-bottom: 60px;
}

.gallery-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    align-items: flex-start;
    justify-content: flex-start;
}

.gallery-card:nth-child(2) {
    margin-top: 60px;
}

.gallery-card:nth-child(3) {
    margin-top: 20px;
}

.gallery-card:nth-child(4) {
    margin-top: 80px;
}

.gallery-card:nth-child(5) {
    margin-top: 10px;
}

.gallery-card:nth-child(6) {
    margin-top: 50px;
}

/* ============================================================
   ZONE 5: DEEP CARBON
   ============================================================ */
.zone-deep {
    min-height: 100vh;
    background: var(--carbon-black);
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 60px;
    padding-bottom: 60px;
}

.zone-deep .zone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.deep-carbon-atom {
    width: 280px;
    height: 280px;
    margin-bottom: 40px;
}

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

.pulse-ring {
    animation: pulseRing 4s ease-in-out infinite;
    transform-origin: 200px 200px;
}

.pulse-ring-inner {
    animation: pulseRingInner 4s ease-in-out infinite;
    animation-delay: 0.5s;
    transform-origin: 200px 200px;
}

@keyframes pulseRing {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

@keyframes pulseRingInner {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.08); }
}

.deep-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 5vw, 4rem);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--terracotta-core);
    line-height: 1;
}

.title-dot-light {
    color: var(--ember-glow);
}

.deep-underline {
    width: 200px;
    height: 12px;
    margin: 12px auto 32px;
    overflow: visible;
}

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

.underline-path {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 1.5s var(--ease-organic);
}

.underline-path.animate {
    stroke-dashoffset: 0;
}

.deep-statement {
    font-family: 'Caveat', cursive;
    font-size: clamp(1rem, 2vw, 1.3rem);
    font-weight: 400;
    color: var(--smoke-ash);
    line-height: 1.7;
    max-width: 480px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    #notebook-margin {
        width: 12px;
    }

    .margin-line {
        left: 10px;
    }

    .margin-content {
        display: none;
    }

    .zone {
        padding-left: 24px;
        padding-right: 16px;
    }

    .zone-asymmetric-left {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .viz-block {
        position: relative;
        top: auto;
    }

    .hex-assembly {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        width: 240px;
        height: 240px;
        margin: 0 auto 20px;
    }

    .zone-surface .zone-inner {
        align-items: center;
        text-align: center;
    }

    .zone1-tagline {
        text-align: center;
    }

    .specimen-cards,
    .gallery-cards {
        justify-content: center;
    }

    .specimen-card,
    .specimen-card.size-large {
        width: 260px;
        height: 360px;
    }

    .specimen-card.size-small {
        width: 200px;
        height: 280px;
    }

    .card-offset-1,
    .card-offset-2,
    .gallery-card:nth-child(n) {
        margin-top: 0;
    }

    .ledger-metrics {
        gap: 32px;
    }

    .deep-carbon-atom {
        width: 200px;
        height: 200px;
    }
}

@media (max-width: 600px) {
    .site-title {
        font-size: 2.5rem;
    }

    .section-heading {
        font-size: 1.8rem;
    }

    .narrative-text {
        font-size: 17px;
    }

    .metric-value {
        font-size: 28px;
    }

    .ledger-metrics {
        flex-direction: column;
        align-items: center;
        gap: 24px;
    }

    .specimen-card,
    .specimen-card.size-large,
    .specimen-card.size-medium,
    .specimen-card.size-small {
        width: 100%;
        max-width: 300px;
        height: 380px;
    }
}

/* ============================================================
   SCROLL REVEAL ANIMATIONS
   ============================================================ */
.zone-anatomy,
.zone-gallery {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--ease-organic), transform 0.8s var(--ease-organic);
}

.zone-anatomy.visible,
.zone-gallery.visible {
    opacity: 1;
    transform: translateY(0);
}

.zone-ledger {
    opacity: 0;
    transition: opacity 1s var(--ease-organic);
}

.zone-ledger.visible {
    opacity: 1;
}
