/* ── Variables ─────────────────────────────────────────────────────── */
:root {
    --bg:           #07111D;
    --bg2:          #0C1628;
    --surface:      #0E1E30;
    --surface2:     #132436;
    --border:       rgba(255,255,255,.07);
    --border-accent:rgba(255,255,255,.14);
    --text:         #E8EEF5;
    --text-2:       #8EA2BE;
    --text-3:       #546A84;
    --accent:       #5EC8F8;
    --accent-dim:   rgba(94,200,248,.12);
    --accent-glow:  rgba(94,200,248,.22);
    --info:         #5EC8F8;
    --warning:      #FFA726;
    --critical:     #EF5350;
    --radius:       16px;
    --radius-sm:    10px;
    --transition:   .22s ease;
}

body.el-nino {
    --accent:       #FF7043;
    --accent-dim:   rgba(255,112,67,.12);
    --accent-glow:  rgba(255,112,67,.22);
}

body.la-nina {
    --accent:       #42A5F5;
    --accent-dim:   rgba(66,165,245,.12);
    --accent-glow:  rgba(66,165,245,.22);
}

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

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    transition: background var(--transition);
}

/* ── Phase bar ──────────────────────────────────────────────────────── */
.phase-bar {
    height: 3px;
    background: var(--accent);
    transition: background .6s ease;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* ── Header ─────────────────────────────────────────────────────────── */
header {
    padding: 28px 40px 24px;
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon { font-size: 32px; }

h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.3px;
}

.brand-sub {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 2px;
    letter-spacing: .2px;
}

.brand-freshness {
    font-size: 10px;
    color: var(--text-3);
    margin-top: 1px;
    opacity: .7;
}

.phase-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-dim);
    border: 1px solid var(--accent-glow);
    border-radius: 100px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    transition: all .5s ease;
    white-space: nowrap;
}

.zhora-header-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(94,200,248,.10);
    border: 1px solid rgba(94,200,248,.30);
    border-radius: 100px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    font-family: inherit;
}
.zhora-header-btn:hover {
    background: rgba(94,200,248,.20);
    border-color: rgba(94,200,248,.55);
    transform: scale(1.03);
}
.zhora-header-label { letter-spacing: .02em; }

.tab-btn-zhora {
    color: var(--accent);
    font-weight: 600;
}
.tab-btn-zhora.active,
.tab-btn-zhora:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.zhora-intro {
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.65;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: var(--surface2);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent);
}

.phase-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    transition: background .5s ease;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: .5; transform: scale(.85); }
}

/* ── Main ───────────────────────────────────────────────────────────── */
main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 40px 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ── Error bar ──────────────────────────────────────────────────────── */
.error-bar {
    background: rgba(239,83,80,.12);
    border: 1px solid rgba(239,83,80,.3);
    border-radius: var(--radius-sm);
    color: #EF9A9A;
    padding: 12px 18px;
    font-size: 13px;
    font-weight: 500;
}
.error-bar.hidden { display: none; }

/* ── Cards ──────────────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255,255,255,.03) 0%, transparent 60%);
    pointer-events: none;
}

.card:hover {
    border-color: var(--border-accent);
    box-shadow: 0 8px 32px rgba(0,0,0,.25);
}

.card-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-3);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Hero grid ──────────────────────────────────────────────────────── */
.hero-grid {
    display: grid;
    grid-template-columns: 1.8fr 1.4fr 1fr 1fr 1fr 1fr;
    gap: 16px;
}

/* ── Modulation grid (PDO · NAO · AMO · QBO) ───────────────────────── */
.modulation-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

/* Hero card — the big ONI number */
.card-hero {
    border-top: 3px solid var(--accent);
    transition: border-color .5s ease, border-color var(--transition), box-shadow var(--transition);
}

.hero-value {
    font-family: 'Space Grotesk', monospace;
    font-size: 64px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 6px;
    transition: color .5s ease;
    letter-spacing: -2px;
}

.hero-unit {
    font-size: 11px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: .8px;
    margin-bottom: 20px;
}

/* ONI visual bar */
.oni-bar-wrap { margin-top: 4px; }

.oni-bar {
    height: 6px;
    background: var(--surface2);
    border-radius: 100px;
    position: relative;
    overflow: visible;
    margin-bottom: 6px;
}

.oni-bar-fill {
    height: 100%;
    border-radius: 100px;
    background: var(--accent);
    position: absolute;
    left: 50%;
    top: 0;
    transition: width .8s cubic-bezier(.4,0,.2,1), background .5s ease, margin-left .8s cubic-bezier(.4,0,.2,1);
}

.oni-bar-zero {
    position: absolute;
    left: 50%;
    top: -3px;
    width: 2px;
    height: 12px;
    background: var(--text-3);
    border-radius: 2px;
    transform: translateX(-50%);
}

.oni-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-3);
}

/* Phase card */
.card-phase { display: flex; flex-direction: column; justify-content: center; }

.phase-display {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
    transition: color .5s ease;
    margin-bottom: 6px;
    line-height: 1.1;
}

.phase-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-2);
    margin-bottom: 10px;
}

.phase-desc {
    font-size: 12px;
    color: var(--text-3);
    line-height: 1.5;
}

/* Regular metric cards */
.metric-value {
    font-family: 'Space Grotesk', monospace;
    font-size: 36px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    margin-bottom: 6px;
    letter-spacing: -1px;
}

.metric-value.sm {
    font-size: 26px;
    letter-spacing: -.5px;
}

.metric-unit {
    font-size: 11px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: .8px;
}

.metric-unit.delta {
    font-size: 14px;
    text-transform: none;
    font-weight: 600;
    color: var(--text-2);
    letter-spacing: 0;
}

.trend-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

/* ── Panels (chart, insight, alerts) ───────────────────────────────── */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
}

.panel-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 20px;
    list-style: none;
}

.panel-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.panel-sub {
    font-size: 12px;
    color: var(--text-3);
}

.chart-wrap { position: relative; height: 280px; }

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ── Insight ────────────────────────────────────────────────────────── */
.insight-text {
    font-size: 15px;
    color: var(--text-2);
    line-height: 1.75;
}

/* ── Alert count badge ──────────────────────────────────────────────── */
.alert-count {
    background: var(--accent-dim);
    color: var(--accent);
    border-radius: 100px;
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 700;
    transition: all .5s;
}

/* ── Alert cards ────────────────────────────────────────────────────── */
#climate-alerts { display: flex; flex-direction: column; gap: 10px; }

.alert-card {
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    border-left: 4px solid var(--info);
    background: rgba(255,255,255,.03);
    transition: transform var(--transition), box-shadow var(--transition);
}

.alert-card:hover {
    transform: translateX(3px);
}

.alert-card.info  { border-left-color: var(--info);     background: rgba(94,200,248,.05); }
.alert-card.warning { border-left-color: var(--warning); background: rgba(255,167,38,.06); }
.alert-card.critical {
    border-left-color: var(--critical);
    background: rgba(239,83,80,.06);
    animation: critical-pulse 2.5s ease-in-out infinite;
}

@keyframes critical-pulse {
    0%, 100% { box-shadow: none; }
    50%       { box-shadow: 0 0 0 2px rgba(239,83,80,.18); }
}

.alert-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.alert-severity-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.info    .alert-severity-dot { background: var(--info); }
.warning .alert-severity-dot { background: var(--warning); }
.critical .alert-severity-dot { background: var(--critical); }

.alert-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.alert-message {
    font-size: 12px;
    color: var(--text-2);
    line-height: 1.55;
    margin-bottom: 6px;
}

.alert-source {
    font-size: 11px;
    color: var(--text-3);
}

.no-alerts {
    color: var(--text-3);
    font-size: 13px;
    text-align: center;
    padding: 20px 0;
}

/* ── Alert Ticker ───────────────────────────────────────────────────── */
.alert-ticker-wrap {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    height: 40px;
}

.ticker-label {
    flex-shrink: 0;
    padding: 0 14px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.4px;
    color: var(--accent);
    background: var(--accent-dim);
    border-right: 1px solid var(--border-accent);
    height: 100%;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.ticker-viewport {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 100%;
}

.ticker-track {
    display: flex;
    align-items: center;
    height: 100%;
    white-space: nowrap;
    animation: ticker-scroll 28s linear infinite;
}

.ticker-track:hover { animation-play-state: paused; }

@keyframes ticker-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 28px 0 0;
    font-size: 12px;
    color: var(--text-2);
    flex-shrink: 0;
}

.ticker-item::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ticker-item.info::before    { background: var(--info); }
.ticker-item.warning::before { background: var(--warning); }
.ticker-item.critical::before { background: var(--critical); }

.ticker-item .ticker-severity {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: .6px;
    margin-right: 2px;
}

.ticker-item.info     .ticker-severity { color: var(--info); }
.ticker-item.warning  .ticker-severity { color: var(--warning); }
.ticker-item.critical .ticker-severity { color: var(--critical); }

.ticker-sep {
    display: inline-block;
    padding: 0 20px 0 0;
    color: var(--border-accent);
    flex-shrink: 0;
    font-size: 14px;
}

.ticker-skeleton {
    font-size: 12px;
    color: var(--text-3);
    padding: 0 20px;
}

/* ── Glossary ───────────────────────────────────────────────────────── */
.glossary { padding: 0; }

.glossary-summary {
    padding: 20px 28px;
    cursor: pointer;
    user-select: none;
    border-radius: var(--radius);
    margin-bottom: 0;
}

.glossary-summary::-webkit-details-marker { display: none; }

details[open] .glossary-summary {
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
}

.glossary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1px;
    background: var(--border);
}

.glossary-item {
    background: var(--surface);
    padding: 18px 22px;
}

.glossary-item:first-child { border-radius: 0; }
.glossary-item:last-child  { border-radius: 0 0 var(--radius) var(--radius); }

.glossary-item strong {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    display: block;
    margin-bottom: 4px;
}

.glossary-item p {
    font-size: 12px;
    color: var(--text-3);
    line-height: 1.5;
}

/* ── Prediction panel ───────────────────────────────────────────────── */
.panel-prediction {
    border-top: 3px solid rgba(171, 71, 188, .6);
}

.panel-plain {
    background: linear-gradient(135deg, rgba(38,166,154,.08) 0%, rgba(38,166,154,.03) 100%);
    border: 1px solid rgba(38,166,154,.22);
    border-top: 3px solid rgba(38,166,154,.7);
}

.plain-text {
    font-size: 16px;
    line-height: 1.75;
    color: var(--text);
    font-weight: 400;
}

/* ── Zhora Conversacional ────────────────────────────────────────────── */
.panel-zhora {
    border-top: 3px solid rgba(94, 200, 248, .6);
}

.zhora-suggestions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.zhora-hint {
    font-size: 11px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 600;
    flex-shrink: 0;
}

.zhora-chip {
    background: var(--surface2);
    border: 1px solid var(--border-accent);
    color: var(--text-2);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}
.zhora-chip:hover {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

.zhora-input-wrap {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.zhora-input {
    flex: 1;
    background: var(--surface2);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    padding: 10px 14px;
    resize: none;
    transition: border-color var(--transition);
    outline: none;
}
.zhora-input:focus {
    border-color: var(--accent);
}
.zhora-input::placeholder { color: var(--text-3); }

.zhora-btn {
    background: var(--accent);
    color: #07111D;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity var(--transition);
    font-family: inherit;
    flex-shrink: 0;
}
.zhora-btn:hover { opacity: .85; }
.zhora-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.zhora-response-wrap {
    margin-top: 20px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}
.zhora-response-wrap.hidden { display: none; }

.zhora-response-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.zhora-avatar {
    font-size: 18px;
}

.zhora-response-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.zhora-response {
    font-size: 15px;
    line-height: 1.75;
    color: var(--text);
}

/* Markdown rendered inside Zhora response */
.zhora-response p          { margin-bottom: 10px; line-height: 1.7; }
.zhora-response p:last-child { margin-bottom: 0; }
.zhora-response ul,
.zhora-response ol         { padding-left: 20px; margin-bottom: 10px; }
.zhora-response li         { margin-bottom: 4px; line-height: 1.6; }
.zhora-response strong     { color: var(--text); font-weight: 600; }
.zhora-response em         { color: var(--text-2); font-style: italic; }
.zhora-response hr         { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.zhora-response table      { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; }
.zhora-response th         { background: var(--surface2); color: var(--text); padding: 8px 12px; text-align: left; border: 1px solid var(--border-accent); font-weight: 600; }
.zhora-response td         { padding: 7px 12px; border: 1px solid var(--border); color: var(--text-2); vertical-align: top; }
.zhora-response tr:nth-child(even) td { background: rgba(255,255,255,.02); }
.zhora-response code       { background: var(--surface2); padding: 1px 5px; border-radius: 4px; font-size: 12px; color: var(--accent); }

.zhora-thinking {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-3);
    font-size: 13px;
}

.zhora-thinking-dots span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: thinking-pulse 1.2s ease-in-out infinite;
}
.zhora-thinking-dots span:nth-child(2) { animation-delay: .2s; }
.zhora-thinking-dots span:nth-child(3) { animation-delay: .4s; }

@keyframes thinking-pulse {
    0%, 80%, 100% { opacity: .2; transform: scale(.8); }
    40%           { opacity: 1;  transform: scale(1); }
}

/* ── Climate Map ─────────────────────────────────────────────────────── */
.home-hero-map-row {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 20px;
    align-items: start;
}

.home-hero-map-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.climate-map-footer {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
}

.climate-map-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.map-badge-sep {
    color: var(--text-3);
    font-size: 11px;
}

.climate-map-legend {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.map-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-3);
}

.map-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.climate-map-wrap {
    position: relative;
    width: 100%;
    background: #0a1628;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.climate-map-wrap svg {
    width: 100%;
    height: auto;
    display: block;
}

/* ── ONI Thermometer ─────────────────────────────────────────── */
.climate-map-with-therm {
    display: flex;
    align-items: stretch;
    gap: 6px;
}

.climate-map-with-therm .climate-map-wrap {
    flex: 1;
    min-width: 0;
}

.oni-therm-wrap {
    width: 64px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: #0a1628;
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: var(--radius-sm);
    padding: 8px 0 6px;
    overflow: hidden;
}

.oni-therm-wrap svg {
    flex: 1;
    width: 56px;
    min-height: 0;
    display: block;
}

.oni-therm-title {
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .04em;
    color: rgba(255,255,255,0.45);
    text-transform: uppercase;
    line-height: 1;
}

.oni-therm-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.1;
}

#thermoWeeklyVal {
    font-size: 10px;
    font-weight: 700;
    color: #FF8A65;
}

.oni-therm-sub {
    font-size: 7px;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.map-month-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.map-oni-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-2);
}

.climate-map-timeline {
    height: 3px;
    background: var(--surface2);
    border-radius: 2px;
    overflow: hidden;
}

.map-timeline-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

.seismic-legend { gap: 8px; margin-top: 2px; }
.seismic-legend-title { font-size: 10px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.seismic-dot { font-size: 10px; line-height: 1; }

.seismic-tooltip {
    position: fixed;
    background: rgba(12,22,40,.95);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text);
    pointer-events: none;
    z-index: 10;
    max-width: 240px;
    line-height: 1.5;
    box-shadow: 0 4px 16px rgba(0,0,0,.4);
}
.seismic-tooltip.hidden { display: none; }
.seismic-tooltip strong { color: #FF7043; }

.map-mjo-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-2);
}

.map-mjo-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-3);
    flex-shrink: 0;
}

.map-mjo-dot.active {
    background: #FF9800;
    box-shadow: 0 0 6px 2px rgba(255,152,0,.4);
    animation: mjo-pulse 1.8s ease-in-out infinite;
}

@keyframes mjo-pulse {
    0%, 100% { box-shadow: 0 0 4px 1px rgba(255,215,0,.4); }
    50%       { box-shadow: 0 0 10px 4px rgba(255,215,0,.6); }
}

/* SVG map elements */
.map-nino34 { opacity: 0.82; transition: fill 1s ease; }

@media (max-width: 768px) {
    .climate-map-legend { display: none; }
    .climate-map-header { flex-direction: column; }
}

/* ── Home / Início ───────────────────────────────────────────────────── */
.home-hero {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface2) 100%);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius);
    padding: 28px;
}

.home-hero-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.home-hero-text {
    flex: 1;
    min-width: 0;
}

.home-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text);
    margin-bottom: 12px;
}

.home-subtitle {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-2);
    max-width: 520px;
}

.home-status-card {
    background: var(--bg2);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-sm);
    padding: 20px;
}

.home-status-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-3);
    margin-bottom: 8px;
}

.home-status-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 12px;
}

.home-status-plain {
    font-size: 13px;
    line-height: 1.65;
    color: var(--text-2);
}

.local-weather-card {
    background: var(--bg2);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    flex-shrink: 0;
    width: 260px;
}

.local-weather-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-3);
    margin-bottom: 8px;
}

.local-weather-body {
    display: flex;
    align-items: center;
    gap: 10px;
}

.local-weather-icon {
    font-size: 28px;
    line-height: 1;
}

.local-weather-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.local-weather-temp {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.local-weather-desc {
    font-size: 12px;
    color: var(--text-2);
}

.local-weather-place {
    font-size: 11px;
    color: var(--text-3);
}

.local-weather-forecast {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.local-forecast-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex: 1;
}

.local-forecast-weekday {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-3);
}

.local-forecast-icon {
    font-size: 18px;
    line-height: 1;
}

.local-forecast-temps {
    font-size: 11px;
    display: flex;
    gap: 4px;
}

.local-forecast-max {
    color: var(--text);
    font-weight: 600;
}

.local-forecast-min {
    color: var(--text-3);
}

.home-nav-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.home-nav-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    cursor: pointer;
    transition: all var(--transition);
}
.home-nav-card:hover {
    border-color: var(--accent);
    background: var(--surface2);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0,0,0,.2);
}

.home-nav-icon { font-size: 24px; flex-shrink: 0; margin-top: 2px; }

.home-nav-content { flex: 1; }

.home-nav-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.home-nav-desc {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-3);
    margin-bottom: 10px;
}

.home-nav-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
}

.home-nav-arrow {
    font-size: 18px;
    color: var(--text-3);
    flex-shrink: 0;
    transition: color var(--transition);
}
.home-nav-card:hover .home-nav-arrow { color: var(--accent); }

@media (max-width: 900px) {
    .home-hero-map-row { grid-template-columns: 1fr; }
    .home-nav-grid { grid-template-columns: 1fr; }
    .home-title { font-size: 22px; }
    .home-hero-top { flex-direction: column; }
    .local-weather-card { width: 100%; }
}

/* ── Regional Consulting CTA ────────────────────────────────────────── */
.regional-cta {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, rgba(38,166,154,.12) 0%, rgba(94,200,248,.08) 100%);
    border: 1px solid rgba(38,166,154,.30);
    border-left: 4px solid rgba(38,166,154,.8);
    border-radius: var(--radius);
    padding: 20px 24px;
    cursor: pointer;
    transition: all var(--transition);
}
.regional-cta:hover {
    background: linear-gradient(135deg, rgba(38,166,154,.18) 0%, rgba(94,200,248,.12) 100%);
    border-color: rgba(38,166,154,.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(38,166,154,.12);
}

.regional-cta-icon { font-size: 32px; line-height: 1; }

.regional-cta-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
    letter-spacing: .01em;
}
.regional-cta-desc {
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.55;
    margin-bottom: 10px;
}
.regional-cta-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.regional-cta-examples span {
    font-size: 11px;
    color: rgba(38,166,154,.9);
    background: rgba(38,166,154,.10);
    border: 1px solid rgba(38,166,154,.25);
    border-radius: 20px;
    padding: 2px 10px;
}

.regional-cta-btn {
    font-size: 13px;
    font-weight: 600;
    color: rgba(38,166,154,1);
    white-space: nowrap;
    padding: 8px 16px;
    border: 1px solid rgba(38,166,154,.4);
    border-radius: 20px;
    transition: all var(--transition);
}
.regional-cta:hover .regional-cta-btn {
    background: rgba(38,166,154,.15);
}

@media (max-width: 768px) {
    .regional-cta { grid-template-columns: auto 1fr; }
    .regional-cta-btn { display: none; }
}

/* ── Sobre o projeto ────────────────────────────────────────────────── */
.sobre {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 48px 40px;
    margin-top: 0;
}

.sobre-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 2fr 1fr;
    gap: 40px;
    align-items: start;
}

.sobre-titulo {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-3);
    margin-bottom: 12px;
}

.sobre-texto {
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.7;
}

.sobre-lista {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.6;
}

.sobre-lista li::before {
    content: "→ ";
    color: var(--text-3);
}

@media (max-width: 900px) {
    .sobre-inner { grid-template-columns: 1fr; gap: 28px; }
    .sobre { padding: 36px 20px; }
}

/* ── Footer ─────────────────────────────────────────────────────────── */
footer {
    text-align: center;
    padding: 24px 40px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-3);
}

.footer-sep { margin: 0 8px; opacity: .4; }

/* ── Tooltip ────────────────────────────────────────────────────────── */
.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--surface2);
    border: 1px solid var(--border-accent);
    font-size: 9px;
    color: var(--text-3);
    cursor: help;
    font-style: normal;
    flex-shrink: 0;
}

/* ── Skeleton loading ───────────────────────────────────────────────── */
.skeleton {
    display: inline-block;
    background: linear-gradient(90deg, var(--surface2) 25%, var(--surface) 50%, var(--surface2) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    color: transparent !important;
    pointer-events: none;
    user-select: none;
}

.skeleton-line {
    display: block;
    height: 14px;
    width: 90%;
    margin-bottom: 8px;
    border-radius: 4px;
}
.skeleton-line.short { width: 55%; }

.skeleton-alert {
    display: block;
    height: 70px;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
}

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Tab navigation ─────────────────────────────────────────────────── */
.tabs-nav {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
}
.tabs-nav::-webkit-scrollbar { display: none; }

.tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-3);
    padding: 10px 22px;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
    margin-bottom: -1px;
    transition: color var(--transition), border-color var(--transition);
}
.tab-btn:hover { color: var(--text-2); }
.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-panel { display: none; }
.tab-panel.active {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ── Modulation charts 2×2 ──────────────────────────────────────────── */
.modulation-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.panel-iod-chart {
    grid-column: 1 / -1;
}
.panel-iod-chart .chart-wrap {
    height: 220px;
}

/* ── Wheeler-Hendon MJO diagram ─────────────────────────────────────── */
.wh-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 24px;
    align-items: start;
}

.wh-canvas-wrap {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.wh-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 4px;
}

.wh-legend-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-3);
    margin-top: 4px;
}

.wh-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-2);
    line-height: 1.4;
}

.wh-legend-note {
    font-size: 11px;
    color: var(--text-3);
    line-height: 1.5;
}

.wh-legend-sep {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.wh-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.wh-dot-current {
    background: #FFFFFF;
    box-shadow: 0 0 6px 2px rgba(255,255,255,.55);
}

.wh-phase-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 11px;
    color: var(--text-3);
}

/* ── CO₂ + Ice side-by-side ─────────────────────────────────────────── */
.chart-pair-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
    .modulation-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1100px) {
    .hero-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
    .card-hero { grid-column: 1 / -1; }
    .modulation-grid { grid-template-columns: 1fr 1fr 1fr; }
}

@media (max-width: 900px) {
    .wh-layout { grid-template-columns: 1fr; }
    .wh-canvas-wrap { max-width: 380px; }
    .chart-pair-grid { grid-template-columns: 1fr; }
    .modulation-charts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    header { padding: 20px; }
    main   { padding: 20px; gap: 16px; }
    .hero-grid { grid-template-columns: 1fr 1fr; }
    .card-hero { grid-column: 1 / -1; }
    .hero-value { font-size: 48px; }
    .two-col { grid-template-columns: 1fr; }
    .header-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
    .modulation-grid { grid-template-columns: 1fr 1fr; }
    .wh-canvas-wrap { max-width: 320px; }
}

@media (max-width: 480px) {
    .hero-grid { grid-template-columns: 1fr; }
    .hero-value { font-size: 56px; }
}
