/* ========================================
   tanso.news - Pixel-Art Carbon News
   ======================================== */

/* === CUSTOM PROPERTIES === */
:root {
    --parchment-cream: #F6F0E4;
    --warm-linen: #EDE5D5;
    --carbon-ink: #2B2D2A;
    --moss-slate: #5A6356;
    --faded-sage: #A8B5A0;
    --pastel-coral: #E8A598;
    --dusty-mauve: #C4A6B5;
    --char-moss: #2B2D2A;
    --amber-haze: #D4B483;
    --grain-tone: #8B7D6B;

    --font-headline: 'Libre Baskerville', serif;
    --font-body: 'Crimson Text', serif;
    --font-pixel: 'Silkscreen', cursive;
    --font-data: 'IBM Plex Mono', monospace;

    --spring-ease: linear(0, 0.009, 0.035 2.1%, 0.141, 0.281 6.7%, 0.723 12.9%, 0.938 16.7%, 1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, 0.991, 0.977 51%, 0.975 57.1%, 0.997 69.8%, 1.003 76.9%, 1);

    --grid-gutter: 8px;
    --border-width: 2px;
    --game-margin: 24px;
}

/* === RESET === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--parchment-cream);
    color: var(--carbon-ink);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.15vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.005em;
    overflow-x: hidden;
    position: relative;
}

/* === GRAIN OVERLAY === */
#grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.06;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='64' height='64' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 64px 64px;
    mix-blend-mode: multiply;
    transition: opacity 0.5s linear;
}

/* === TICKER STRIP === */
#ticker-strip {
    position: fixed;
    top: -48px;
    left: 0;
    width: 100%;
    height: 48px;
    background-color: rgba(246, 240, 228, 0.92);
    z-index: 900;
    display: flex;
    align-items: center;
    overflow: hidden;
    opacity: 0;
    transition: top 0.6s var(--spring-ease), opacity 0.4s linear;
}

#ticker-strip.visible {
    top: 0;
    opacity: 1;
}

.ticker-border-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    border-bottom: 1px dashed var(--faded-sage);
}

.ticker-wave {
    position: absolute;
    bottom: 2px;
    left: 0;
    width: 100%;
    height: 8px;
    background: repeating-linear-gradient(
        90deg,
        transparent 0px,
        transparent 2px,
        var(--faded-sage) 2px,
        var(--faded-sage) 3px,
        transparent 3px,
        transparent 4px,
        var(--faded-sage) 4px,
        var(--faded-sage) 5px,
        transparent 5px,
        transparent 8px,
        var(--faded-sage) 8px,
        var(--faded-sage) 9px,
        transparent 9px,
        transparent 10px,
        var(--faded-sage) 10px,
        var(--faded-sage) 11px,
        transparent 11px,
        transparent 14px,
        var(--faded-sage) 14px,
        var(--faded-sage) 15px,
        transparent 15px,
        transparent 16px
    );
    background-size: 128px 8px;
    opacity: 0.3;
    animation: waveScroll 6s linear infinite;
}

#ticker-content {
    display: flex;
    align-items: center;
    white-space: nowrap;
    animation: tickerScroll 40s linear infinite;
    font-family: var(--font-pixel);
    font-size: 12px;
    letter-spacing: 0.06em;
    color: var(--carbon-ink);
    text-transform: uppercase;
    padding: 0 16px;
}

.ticker-item {
    margin: 0 12px;
}

.ticker-separator {
    color: var(--pastel-coral);
    font-size: 6px;
    margin: 0 4px;
}

@keyframes tickerScroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

@keyframes waveScroll {
    from { background-position-x: 0; }
    to { background-position-x: 128px; }
}

/* === NAVIGATION === */
#nav-toggle {
    position: fixed;
    top: 60px;
    right: var(--game-margin);
    z-index: 950;
    background: var(--parchment-cream);
    border: var(--border-width) solid var(--faded-sage);
    width: 40px;
    height: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    padding: 8px;
    transition: border-color 0.3s var(--spring-ease);
    image-rendering: pixelated;
}

#nav-toggle:hover {
    border-color: var(--pastel-coral);
}

.nav-square {
    display: block;
    width: 8px;
    height: 8px;
    background-color: var(--carbon-ink);
}

#nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(43, 45, 42, 0.94);
    z-index: 940;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s var(--spring-ease);
}

#nav-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.nav-map {
    position: relative;
    width: 400px;
    height: 400px;
}

.nav-room {
    position: absolute;
    width: 100px;
    height: 80px;
    border: var(--border-width) solid var(--faded-sage);
    background-color: rgba(246, 240, 228, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.3s var(--spring-ease), background-color 0.3s var(--spring-ease);
}

.nav-room:hover {
    border-color: var(--pastel-coral);
    background-color: rgba(232, 165, 152, 0.15);
}

.nav-room-label {
    font-family: var(--font-pixel);
    font-size: 12px;
    color: var(--parchment-cream);
    letter-spacing: 0.06em;
    text-align: center;
}

.nav-room:nth-child(1) { top: 20px; left: 150px; }
.nav-room:nth-child(2) { top: 120px; left: 40px; }
.nav-room:nth-child(3) { top: 120px; left: 260px; }
.nav-room:nth-child(4) { top: 240px; left: 150px; }
.nav-room:nth-child(5) { top: 340px; left: 150px; }

.nav-connector {
    position: absolute;
    background-color: var(--faded-sage);
    opacity: 0.5;
}

.nav-conn-1 {
    width: 2px;
    height: 20px;
    top: 100px;
    left: 200px;
}

.nav-conn-2 {
    width: 60px;
    height: 2px;
    top: 160px;
    left: 140px;
}

.nav-conn-3 {
    width: 60px;
    height: 2px;
    top: 160px;
    left: 200px;
}

.nav-conn-4 {
    width: 2px;
    height: 20px;
    top: 320px;
    left: 200px;
}

/* === HERO ZONE === */
.hero-zone {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-landscape {
    position: relative;
    width: 100%;
    height: 100%;
}

.hero-sky {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(
        180deg,
        #F6F0E4 0%,
        #F2EAD8 40%,
        #EDE5D5 70%,
        #E8DFD0 100%
    );
}

.hero-earth {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(
        180deg,
        #A8B5A0 0%,
        #9DAA94 30%,
        #8B9E82 60%,
        #7A8F72 100%
    );
    image-rendering: pixelated;
}

/* Pixel grass texture on earth */
.hero-earth::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 16px;
    background: repeating-linear-gradient(
        90deg,
        var(--faded-sage) 0px,
        var(--faded-sage) 4px,
        transparent 4px,
        transparent 8px
    );
    background-size: 8px 4px;
    opacity: 0.4;
}

.hero-horizon {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--moss-slate);
    opacity: 0.3;
    transform: translateY(-1px);
}

/* === SMOKESTACK === */
.smokestack {
    position: absolute;
    bottom: 50%;
    left: 65%;
    z-index: 10;
}

.smokestack-body {
    width: 16px;
    height: 80px;
    background-color: var(--moss-slate);
    image-rendering: pixelated;
    position: relative;
}

.smokestack-body::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    width: 24px;
    height: 8px;
    background-color: var(--moss-slate);
}

.smokestack-body::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -8px;
    width: 32px;
    height: 16px;
    background-color: var(--moss-slate);
}

.smoke-plume {
    position: absolute;
    top: -60px;
    left: 0;
    width: 16px;
    height: 60px;
}

.smoke-pixel {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: var(--grain-tone);
    opacity: 0.4;
    image-rendering: pixelated;
    animation: smokeRise 3s steps(4) infinite;
}

.smoke-1 { bottom: 0; left: 4px; animation-delay: 0s; }
.smoke-2 { bottom: 8px; left: 0; animation-delay: 0.4s; }
.smoke-3 { bottom: 16px; left: 8px; animation-delay: 0.8s; }
.smoke-4 { bottom: 24px; left: 2px; animation-delay: 1.2s; }
.smoke-5 { bottom: 32px; left: 6px; animation-delay: 1.6s; }
.smoke-6 { bottom: 40px; left: -2px; animation-delay: 2.0s; }
.smoke-7 { bottom: 48px; left: 10px; animation-delay: 2.4s; }
.smoke-8 { bottom: 56px; left: 4px; animation-delay: 2.8s; }

@keyframes smokeRise {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0.5;
    }
    25% {
        transform: translateY(-8px) translateX(4px);
        opacity: 0.4;
    }
    50% {
        transform: translateY(-16px) translateX(-2px);
        opacity: 0.3;
    }
    75% {
        transform: translateY(-24px) translateX(6px);
        opacity: 0.15;
    }
    100% {
        transform: translateY(-32px) translateX(2px);
        opacity: 0;
    }
}

/* === PIXEL TREES === */
.pixel-tree {
    position: absolute;
    bottom: 50%;
    width: 24px;
    height: 32px;
    image-rendering: pixelated;
    z-index: 5;
}

.pixel-tree::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10px;
    width: 4px;
    height: 12px;
    background-color: var(--grain-tone);
}

.pixel-tree::after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 2px;
    width: 20px;
    height: 20px;
    background-color: var(--moss-slate);
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.tree-1 { left: 15%; bottom: calc(50% - 4px); }
.tree-2 { left: 30%; bottom: calc(50% - 2px); transform: scale(0.8); }
.tree-3 { left: 80%; bottom: calc(50% - 6px); transform: scale(1.1); }

/* === HERO TITLE === */
.hero-title-upper {
    position: absolute;
    top: calc(50% - 120px);
    left: var(--game-margin);
    z-index: 20;
}

.hero-title-lower {
    position: absolute;
    top: calc(50% + 20px);
    left: calc(var(--game-margin) + 12.5%);
    z-index: 20;
}

.title-tanso,
.title-news {
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: -0.02em;
    line-height: 1.12;
    color: var(--carbon-ink);
}

.title-news {
    color: var(--moss-slate);
}

.hero-subtitle {
    position: absolute;
    top: calc(50% + 120px);
    left: calc(var(--game-margin) + 12.5%);
    font-family: var(--font-pixel);
    font-size: 12px;
    letter-spacing: 0.06em;
    color: var(--moss-slate);
    z-index: 20;
}

/* === SCROLL INDICATOR === */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    z-index: 20;
    animation: scrollPulse 2s steps(3) infinite;
}

.scroll-arrow {
    font-size: 10px;
    color: var(--moss-slate);
    opacity: 0.4;
    font-family: var(--font-pixel);
}

.scroll-arrow:nth-child(2) { opacity: 0.6; }
.scroll-arrow:nth-child(3) { opacity: 0.8; }

@keyframes scrollPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* === STORY GRID === */
.story-grid {
    position: relative;
    padding: var(--game-margin);
    padding-top: 80px;
    min-height: 300vh;
}

.story-grid-inner {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    gap: var(--grid-gutter);
    max-width: 1400px;
    margin: 0 auto;
}

/* === STORY TILES === */
.story-tile {
    background-color: var(--parchment-cream);
    border: var(--border-width) solid var(--faded-sage);
    position: relative;
    overflow: hidden;
    transition: border-color 0.4s var(--spring-ease), transform 0.4s var(--spring-ease);
    clip-path: polygon(
        4px 0%, calc(100% - 4px) 0%,
        100% 4px, 100% calc(100% - 4px),
        calc(100% - 4px) 100%, 4px 100%,
        0% calc(100% - 4px), 0% 4px
    );
}

.story-tile:hover {
    border-color: var(--pastel-coral);
    cursor: pointer;
}

/* Tile entrance animation states */
.tile-enter {
    opacity: 0;
    transition: opacity 0.7s var(--spring-ease), transform 0.7s var(--spring-ease);
}

.tile-enter[data-enter="left"] {
    transform: translateX(-60px) rotate(var(--rotate, 0deg));
}

.tile-enter[data-enter="right"] {
    transform: translateX(60px) rotate(var(--rotate, 0deg));
}

.tile-enter[data-enter="below"] {
    transform: translateY(60px) rotate(var(--rotate, 0deg));
}

.tile-enter.tile-visible {
    opacity: 1;
    transform: translateX(0) translateY(0) rotate(var(--rotate, 0deg));
}

.tile-content {
    padding: 16px 20px;
}

.tile-category {
    font-family: var(--font-pixel);
    font-size: 12px;
    letter-spacing: 0.06em;
    color: var(--dusty-mauve);
    display: block;
    margin-bottom: 8px;
}

.tile-headline {
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: clamp(1.1rem, 2.2vw, 1.6rem);
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--carbon-ink);
    margin-bottom: 10px;
}

.tile-excerpt {
    font-family: var(--font-body);
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.6;
    color: var(--moss-slate);
    margin-bottom: 12px;
}

.tile-meta {
    font-family: var(--font-data);
    font-weight: 300;
    font-size: 0.8rem;
    color: var(--grain-tone);
}

/* Tile sizes */
.tile-large { min-height: 420px; }
.tile-medium { min-height: 320px; }
.tile-small { min-height: 200px; background-color: var(--warm-linen); }

/* === PIXEL SCENE HEADERS === */
.tile-pixel-header {
    width: 100%;
    height: 140px;
    overflow: hidden;
    image-rendering: pixelated;
    position: relative;
}

/* Smokestack scene */
.scene-smokestacks {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #F6F0E4 0%, #E8DFD0 40%, #D4B483 60%, #A8B5A0 100%);
    position: relative;
}

.scene-smokestacks::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    width: 12px;
    height: 60px;
    background-color: var(--moss-slate);
    box-shadow:
        24px 10px 0 0 var(--moss-slate),
        48px 20px 0 0 var(--moss-slate),
        60px 0px 0 0 var(--carbon-ink);
}

.scene-smokestacks::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 22%;
    width: 8px;
    height: 8px;
    background-color: var(--grain-tone);
    opacity: 0.4;
    box-shadow:
        4px -8px 0 0 var(--grain-tone),
        -2px -16px 0 0 var(--grain-tone),
        28px -4px 0 0 var(--grain-tone),
        32px -12px 0 0 var(--grain-tone);
    animation: smokeRise 4s steps(4) infinite;
}

/* Ocean scene */
.scene-ocean {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #EDE5D5 0%, #C4A6B5 40%, #A8B5A0 70%, #5A6356 100%);
    position: relative;
}

.scene-ocean::before {
    content: '';
    position: absolute;
    bottom: 30%;
    left: 0;
    width: 100%;
    height: 4px;
    background: repeating-linear-gradient(
        90deg,
        var(--dusty-mauve) 0px,
        var(--dusty-mauve) 8px,
        transparent 8px,
        transparent 16px
    );
    box-shadow: 0 8px 0 0 rgba(168, 181, 160, 0.3), 4px 16px 0 0 rgba(168, 181, 160, 0.2);
    animation: waveScroll 4s linear infinite;
}

/* Forest scene */
.scene-forest {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #F6F0E4 0%, #EDE5D5 30%, #A8B5A0 100%);
    position: relative;
}

.scene-forest::before {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 10%;
    width: 0;
    height: 0;
    border-left: 16px solid transparent;
    border-right: 16px solid transparent;
    border-bottom: 28px solid var(--moss-slate);
    box-shadow: 24px 4px 0 0 var(--moss-slate);
}

.scene-forest::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: calc(10% + 40px);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 22px solid #7A8F72;
}

/* Ice scene */
.scene-ice {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #F6F0E4 0%, #EDE5D5 50%, #C4A6B5 100%);
    position: relative;
}

.scene-ice::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    width: 80%;
    height: 40px;
    background-color: rgba(246, 240, 228, 0.8);
    clip-path: polygon(0% 100%, 10% 20%, 25% 60%, 40% 0%, 55% 40%, 70% 10%, 85% 50%, 100% 100%);
}

.scene-ice::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 5%;
    width: 90%;
    height: 20px;
    background: repeating-linear-gradient(
        90deg,
        rgba(196, 166, 181, 0.3) 0px,
        rgba(196, 166, 181, 0.3) 4px,
        transparent 4px,
        transparent 8px
    );
    animation: waveScroll 5s linear infinite;
}

/* City scene */
.scene-city {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #F6F0E4 0%, #EDE5D5 60%, #A8B5A0 100%);
    position: relative;
}

.scene-city::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 15%;
    width: 16px;
    height: 50px;
    background-color: var(--moss-slate);
    box-shadow:
        20px 10px 0 0 var(--carbon-ink),
        20px 10px 0 -2px var(--carbon-ink),
        40px 20px 0 0 var(--moss-slate),
        56px 5px 0 0 var(--carbon-ink),
        72px 15px 0 0 var(--moss-slate),
        88px 0px 0 0 var(--carbon-ink),
        104px 25px 0 0 var(--moss-slate);
}

.scene-city::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background-color: var(--faded-sage);
}

/* === DATA INTERLUDE === */
.data-interlude {
    position: relative;
    background-color: var(--char-moss);
    color: var(--parchment-cream);
    padding: 120px var(--game-margin);
    min-height: 100vh;
    overflow: hidden;
}

.data-wave-top,
.data-wave-bottom {
    position: absolute;
    left: 0;
    width: 100%;
    height: 16px;
    background: repeating-linear-gradient(
        90deg,
        transparent 0px,
        transparent 2px,
        var(--faded-sage) 2px,
        var(--faded-sage) 3px,
        transparent 3px,
        transparent 6px,
        var(--faded-sage) 6px,
        var(--faded-sage) 7px,
        transparent 7px,
        transparent 10px,
        var(--faded-sage) 10px,
        var(--faded-sage) 11px,
        transparent 11px,
        transparent 16px
    );
    background-size: 128px 16px;
    opacity: 0.3;
    animation: waveScroll 8s linear infinite;
}

.data-wave-top { top: 0; }
.data-wave-bottom { bottom: 0; animation-direction: reverse; }

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

.data-title {
    font-family: var(--font-pixel);
    font-size: 16px;
    letter-spacing: 0.06em;
    color: var(--pastel-coral);
    text-align: center;
    margin-bottom: 60px;
}

/* === CARBON CYCLE DIAGRAM === */
.carbon-cycle-diagram {
    position: relative;
    width: 100%;
    max-width: 600px;
    height: 400px;
    margin: 0 auto 60px;
}

.cycle-node {
    position: absolute;
    width: 120px;
    height: 100px;
    border: var(--border-width) solid var(--faded-sage);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background-color: rgba(168, 181, 160, 0.08);
    clip-path: polygon(
        4px 0%, calc(100% - 4px) 0%,
        100% 4px, 100% calc(100% - 4px),
        calc(100% - 4px) 100%, 4px 100%,
        0% calc(100% - 4px), 0% 4px
    );
}

.node-atmosphere { top: 0; left: 50%; transform: translateX(-50%); }
.node-ocean { bottom: 0; left: 10%; }
.node-land { bottom: 0; right: 10%; }
.node-fossil { top: 50%; left: 50%; transform: translate(-50%, -50%); border-color: var(--amber-haze); }

.node-label {
    font-family: var(--font-pixel);
    font-size: 12px;
    letter-spacing: 0.06em;
    color: var(--parchment-cream);
}

.node-value {
    font-family: var(--font-data);
    font-weight: 300;
    font-size: 0.8rem;
    color: var(--faded-sage);
}

.node-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Pixel icons for nodes */
.pixel-cloud {
    width: 16px;
    height: 8px;
    background-color: var(--faded-sage);
    border-radius: 0;
    position: relative;
    image-rendering: pixelated;
}

.pixel-cloud::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 4px;
    width: 8px;
    height: 4px;
    background-color: var(--faded-sage);
}

.pixel-wave-icon {
    width: 16px;
    height: 8px;
    background: repeating-linear-gradient(
        90deg,
        var(--dusty-mauve) 0px,
        var(--dusty-mauve) 4px,
        transparent 4px,
        transparent 8px
    );
}

.pixel-tree-icon {
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 14px solid var(--faded-sage);
}

.pixel-fuel-icon {
    width: 12px;
    height: 12px;
    background-color: var(--amber-haze);
    position: relative;
}

.pixel-fuel-icon::after {
    content: '';
    position: absolute;
    top: -4px;
    left: 4px;
    width: 4px;
    height: 4px;
    background-color: var(--pastel-coral);
}

/* Flow arrows */
.flow-arrow {
    position: absolute;
    display: flex;
    gap: 4px;
}

.arrow-pixel {
    width: 4px;
    height: 4px;
    background-color: var(--faded-sage);
    animation: arrowPulse 2s steps(2) infinite;
}

.arrow-pixel:nth-child(2) { animation-delay: 0.2s; }
.arrow-pixel:nth-child(3) { animation-delay: 0.4s; }
.arrow-pixel:nth-child(4) { animation-delay: 0.6s; }

.arrow-atmo-ocean {
    top: 110px;
    left: 25%;
    flex-direction: column;
    transform: rotate(30deg);
}

.arrow-atmo-land {
    top: 110px;
    right: 25%;
    flex-direction: column;
    transform: rotate(-30deg);
}

.arrow-fossil-atmo {
    top: 120px;
    left: calc(50% + 30px);
    flex-direction: column;
}

.arrow-fossil-atmo .arrow-pixel {
    background-color: var(--amber-haze);
}

.arrow-ocean-atmo {
    top: 110px;
    left: calc(25% - 16px);
    flex-direction: column;
    transform: rotate(-30deg);
}

.arrow-ocean-atmo .arrow-pixel {
    background-color: var(--dusty-mauve);
}

@keyframes arrowPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* === DATA READOUTS === */
.data-readouts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.readout {
    border: 1px solid rgba(168, 181, 160, 0.3);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.readout-label {
    font-family: var(--font-pixel);
    font-size: 12px;
    letter-spacing: 0.06em;
    color: var(--faded-sage);
}

.readout-value {
    font-family: var(--font-data);
    font-weight: 300;
    font-size: 1.4rem;
    color: var(--parchment-cream);
}

.readout-alert {
    color: var(--amber-haze);
}

/* === DEEP STORIES === */
.deep-stories {
    position: relative;
    padding: 80px var(--game-margin);
    min-height: 200vh;
    background-color: var(--parchment-cream);
}

.deep-stories-inner {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    gap: 6px;
    max-width: 1400px;
    margin: 0 auto;
}

.tile-dense {
    min-height: 140px;
    background-color: var(--warm-linen);
    padding: 0;
}

.tile-dense .tile-content {
    padding: 12px 16px;
}

.tile-dense .tile-headline {
    font-size: clamp(0.95rem, 1.6vw, 1.2rem);
    margin-bottom: 4px;
}

.tile-dense .tile-category {
    font-size: 10px;
    margin-bottom: 4px;
}

.tile-dense .tile-meta {
    font-size: 0.7rem;
}

/* === FOOTER TERMINAL === */
.footer-terminal {
    position: relative;
    background-color: var(--char-moss);
    color: var(--parchment-cream);
    padding: 80px var(--game-margin) 60px;
    min-height: 50vh;
}

.terminal-wave {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background: repeating-linear-gradient(
        90deg,
        var(--faded-sage) 0px,
        var(--faded-sage) 2px,
        transparent 2px,
        transparent 4px,
        var(--faded-sage) 4px,
        var(--faded-sage) 5px,
        transparent 5px,
        transparent 8px
    );
    background-size: 128px 8px;
    opacity: 0.4;
    animation: waveScroll 6s linear infinite;
}

.terminal-inner {
    max-width: 800px;
    margin: 0 auto;
}

.terminal-prompt {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(168, 181, 160, 0.2);
}

.terminal-cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    background-color: var(--pastel-coral);
    animation: cursorBlink 1s steps(2) infinite;
}

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

.terminal-text {
    font-family: var(--font-pixel);
    font-size: 16px;
    letter-spacing: 0.06em;
    color: var(--pastel-coral);
}

.terminal-output {
    margin-bottom: 40px;
}

.terminal-line {
    font-family: var(--font-pixel);
    font-size: 12px;
    letter-spacing: 0.04em;
    color: var(--faded-sage);
    line-height: 2.4;
}

.terminal-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 40px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(168, 181, 160, 0.2);
}

.terminal-link {
    font-family: var(--font-pixel);
    font-size: 12px;
    letter-spacing: 0.06em;
    color: var(--faded-sage);
    cursor: pointer;
    transition: color 0.3s var(--spring-ease);
}

.terminal-link:hover {
    color: var(--pastel-coral);
}

.terminal-copyright .terminal-line {
    color: var(--grain-tone);
    opacity: 0.6;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .story-grid-inner,
    .deep-stories-inner {
        grid-template-columns: repeat(8, 1fr);
    }

    .story-tile {
        grid-column: span 4 !important;
        grid-row: auto !important;
    }

    .tile-large {
        grid-column: span 8 !important;
    }

    .tile-dense {
        grid-column: span 4 !important;
        grid-row: auto !important;
    }

    .carbon-cycle-diagram {
        height: 350px;
    }
}

@media (max-width: 640px) {
    :root {
        --game-margin: 16px;
    }

    .story-grid-inner,
    .deep-stories-inner {
        grid-template-columns: 1fr;
    }

    .story-tile,
    .tile-large,
    .tile-dense {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
        transform: none !important;
    }

    .hero-title-upper {
        top: calc(50% - 80px);
    }

    .hero-title-lower {
        top: calc(50% + 10px);
        left: calc(var(--game-margin) + 8%);
    }

    .title-tanso, .title-news {
        font-size: clamp(2.5rem, 12vw, 4rem);
    }

    .nav-map {
        width: 280px;
        height: 360px;
    }

    .nav-room {
        width: 80px;
        height: 60px;
    }

    .nav-room:nth-child(1) { top: 10px; left: 100px; }
    .nav-room:nth-child(2) { top: 90px; left: 20px; }
    .nav-room:nth-child(3) { top: 90px; left: 180px; }
    .nav-room:nth-child(4) { top: 190px; left: 100px; }
    .nav-room:nth-child(5) { top: 280px; left: 100px; }

    .carbon-cycle-diagram {
        height: 300px;
    }

    .cycle-node {
        width: 90px;
        height: 80px;
    }

    .data-readouts {
        grid-template-columns: 1fr 1fr;
    }

    .terminal-footer-links {
        gap: 16px;
    }
}
