@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
    --bg0: #020617;
    --bg1: #0f172a;
    --border: rgba(51, 65, 85, 0.65);
    --text: #e2e8f0;
    --muted: #94a3b8;
    --emerald: #34d399;
    --emerald-dim: #10b981;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: Inter, system-ui, sans-serif;
    color: var(--text);
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(16, 185, 129, 0.12), transparent),
        linear-gradient(165deg, #0f172a 0%, #020617 55%, #0b1220 100%);
    min-height: 100vh;
}
.font-display { font-family: 'Space Grotesk', Inter, sans-serif; }

a { color: var(--emerald); text-decoration: none; }
a:hover { color: #6ee7b7; }

.wrap { max-width: 64rem; margin: 0 auto; padding: 0 1.25rem; }

/* Nav */
.nav {
    position: sticky; top: 0; z-index: 50;
    border-bottom: 1px solid rgba(30, 41, 59, 0.9);
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(12px);
}
.nav-inner {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 0.75rem; padding: 0.85rem 0;
}
.brand { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.brand img.loule { height: 40px; width: auto; max-width: 7rem; object-fit: contain; }
.brand img.cavebox { height: 40px; width: 40px; border-radius: 10px; object-fit: contain; background: #1e2937; }
.brand-title { font-family: 'Space Grotesk', Inter, sans-serif; font-size: 1.25rem; font-weight: 600; color: var(--emerald); line-height: 1; }
.brand-sub { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: #64748b; margin-top: 2px; }

.nav-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.nav-link {
    padding: 0.35rem 0.75rem; font-size: 12px; font-weight: 500; border-radius: 0.75rem;
    color: #cbd5e1; border: 1px solid transparent;
}
.nav-link:hover { background: #1e2937; border-color: #334155; color: #e2e8f0; }
.nav-link.active {
    background: rgba(16, 185, 129, 0.15); color: #6ee7b7; border-color: rgba(16, 185, 129, 0.4); font-weight: 600;
}
.nav-link.monitor {
    color: #94a3b8; border-color: rgba(51, 65, 85, 0.8);
}

.lang-btn {
    width: 2rem; height: 1.35rem; border-radius: 0.35rem; overflow: hidden;
    border: 2px solid transparent; opacity: 0.55; padding: 0; cursor: pointer; background: none;
}
.lang-btn.active { opacity: 1; border-color: #14b8a6; }
.lang-btn:hover { opacity: 1; }
.lang-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Layout */
main { padding: 2.5rem 0 3rem; }
.hero { text-align: center; max-width: 36rem; margin: 0 auto 2.5rem; }
.kicker {
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.2em;
    color: rgba(52, 211, 153, 0.85); font-weight: 600; margin-bottom: 0.5rem;
}
.hero h1 {
    font-family: 'Space Grotesk', Inter, sans-serif;
    font-size: clamp(2rem, 5vw, 2.75rem); font-weight: 600; color: #fff;
    letter-spacing: -0.02em; margin: 0 0 0.85rem; line-height: 1.15;
}
.hero p, .lead { color: #94a3b8; font-size: 1rem; line-height: 1.7; margin: 0; }

.glass {
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    backdrop-filter: blur(12px);
}

/* Metrics */
.section { margin-bottom: 2.5rem; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem; margin-bottom: 1.25rem; }
.section-head h2 {
    font-family: 'Space Grotesk', Inter, sans-serif;
    font-size: 1.25rem; font-weight: 600; color: #fff; margin: 0;
    display: flex; align-items: center; gap: 0.5rem;
}
.section-head .meta { font-size: 10px; color: #64748b; font-family: ui-monospace, monospace; text-align: right; }

.metrics {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem;
}
@media (min-width: 900px) {
    .metrics { grid-template-columns: repeat(5, 1fr); }
}
.metric {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(51, 65, 85, 0.55);
    border-radius: 1rem; padding: 0.9rem;
    transition: border-color 0.15s, transform 0.15s;
}
.metric:hover { border-color: rgba(20, 184, 166, 0.4); transform: translateY(-2px); }
.metric .label {
    font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: #64748b;
    margin-bottom: 0.4rem; display: flex; align-items: center; gap: 0.35rem;
}
.metric .value {
    font-size: 1.5rem; font-weight: 600; color: #fff;
    font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.metric .unit { font-size: 0.85rem; font-weight: 400; color: #94a3b8; margin-left: 0.2rem; }
.metric .loc { font-size: 10px; color: #64748b; margin-top: 0.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.note { font-size: 11px; color: #475569; text-align: center; margin: 1rem 0 0; }

/* Gas cards */
.gas-grid {
    display: grid; grid-template-columns: 1fr; gap: 1rem;
}
@media (min-width: 768px) {
    .gas-grid { grid-template-columns: repeat(3, 1fr); }
}
.gas-card { padding: 1.25rem; }
.gas-icon {
    width: 2.5rem; height: 2.5rem; border-radius: 0.75rem;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 0.75rem; font-size: 1rem;
}
.gas-icon.o2 { background: rgba(14, 165, 233, 0.15); border: 1px solid rgba(14, 165, 233, 0.3); color: #7dd3fc; }
.gas-icon.co2 { background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.3); color: #fcd34d; }
.gas-icon.rn { background: rgba(139, 92, 246, 0.15); border: 1px solid rgba(139, 92, 246, 0.3); color: #c4b5fd; }
.gas-card h3 {
    margin: 0 0 0.85rem; font-size: 1.15rem; color: #fff;
    font-family: 'Space Grotesk', Inter, sans-serif; font-weight: 600; letter-spacing: -0.01em;
}
.gas-card .prose, .prose { max-width: 42rem; }
.gas-card p, .prose p, .prose-p {
    margin: 0 0 0.85rem;
    line-height: 1.75;
    color: #d1d5db;
    font-size: 0.95rem;
    text-align: left;
}
.gas-card p:last-child, .prose p:last-child, .prose-p:last-child { margin-bottom: 0; }
.muted { color: #64748b !important; }

/* Project page structure */
.prize-banner {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 1.25rem;
    padding: 1.15rem 1.35rem;
    margin-bottom: 1.75rem;
    border-radius: 1rem;
    background: linear-gradient(120deg, rgba(15, 23, 42, 0.9), rgba(6, 78, 59, 0.2));
    border: 1px solid rgba(51, 65, 85, 0.7);
}
.prize-label {
    font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em;
    color: #6ee7b7; font-weight: 600; margin-bottom: 0.35rem;
}
.prize-name {
    font-size: 1rem; color: #f1f5f9; font-weight: 500; line-height: 1.4; max-width: 28rem;
}
.prize-logos {
    display: flex; align-items: center; gap: 1rem; flex-shrink: 0;
}
.prize-logos img {
    max-height: 2.75rem; max-width: 7.5rem; width: auto; object-fit: contain; opacity: 0.95;
}
.prize-logos img.fct { max-height: 2.4rem; max-width: 8.5rem; }

.project-main-title {
    font-family: 'Space Grotesk', Inter, sans-serif;
    font-size: clamp(1.65rem, 4vw, 2.35rem);
    font-weight: 600; color: #fff; letter-spacing: -0.02em;
    line-height: 1.25; margin: 0 0 1.5rem;
}

.project-meta-grid {
    display: grid; grid-template-columns: 1fr; gap: 0.75rem; margin-bottom: 2rem;
}
@media (min-width: 640px) {
    .project-meta-grid { grid-template-columns: 1fr 1.4fr; }
}
.meta-card {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(51, 65, 85, 0.65);
    border-radius: 0.85rem; padding: 0.85rem 1rem;
}
.meta-card-label {
    font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em;
    color: #64748b; font-weight: 600; margin-bottom: 0.3rem;
}
.meta-card-value { font-size: 0.95rem; color: #e2e8f0; line-height: 1.45; }

.project-section { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid rgba(51, 65, 85, 0.55); }
.project-section-title {
    font-family: 'Space Grotesk', Inter, sans-serif;
    font-size: 1.2rem; font-weight: 600; color: #6ee7b7;
    letter-spacing: -0.01em; margin: 0 0 1rem;
}
.project-resume { max-width: 46rem; }
.project-resume .prose-p {
    font-size: 1.02rem; line-height: 1.8; color: #d1d5db; margin-bottom: 1rem;
}

.inst-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.65rem; }
.inst-list li {
    display: flex; flex-direction: column; gap: 0.15rem;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 0.75rem;
}
.inst-role {
    font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em;
    color: #64748b; font-weight: 600;
}
.inst-name { font-size: 0.95rem; color: #e2e8f0; line-height: 1.45; }

.team-list {
    list-style: none; margin: 0; padding: 0;
    display: grid; grid-template-columns: 1fr; gap: 0.45rem;
}
@media (min-width: 720px) {
    .team-list { grid-template-columns: 1fr 1fr; }
}
.team-item {
    padding: 0.65rem 0.85rem;
    border-radius: 0.65rem;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(51, 65, 85, 0.4);
    display: flex; flex-direction: column; gap: 0.15rem;
}
.team-name { font-size: 0.92rem; font-weight: 600; color: #f1f5f9; }
.team-aff { font-size: 0.8rem; color: #94a3b8; line-height: 1.35; }

/* API error box */
.api-help {
    text-align: left; max-width: 36rem; margin: 0 auto;
    padding: 1rem 1.15rem; border-radius: 0.85rem;
    background: rgba(69, 26, 3, 0.35); border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fde68a; font-size: 0.85rem; line-height: 1.55;
}
.api-help code {
    display: block; margin: 0.5rem 0; padding: 0.5rem 0.65rem;
    background: rgba(0,0,0,0.35); border-radius: 0.4rem; color: #fef3c7;
    font-size: 0.78rem; word-break: break-all; font-family: ui-monospace, monospace;
}
.api-help .hint { color: #fcd34d; margin-top: 0.5rem; font-size: 0.8rem; }

/* Teaser */
.teaser {
    padding: 1.5rem 1.75rem;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
    background: linear-gradient(135deg, rgba(6, 78, 59, 0.25), rgba(15, 23, 42, 0.6));
    border-color: rgba(6, 78, 59, 0.35);
}
.teaser h2 { margin: 0 0 0.4rem; font-size: 1.1rem; color: #fff; font-family: 'Space Grotesk', Inter, sans-serif; }
.teaser p { margin: 0; font-size: 0.9rem; color: #94a3b8; max-width: 32rem; line-height: 1.55; }
.btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.6rem 1.15rem; border-radius: 1rem; font-size: 0.875rem; font-weight: 500;
    background: #059669; color: #fff; border: none; cursor: pointer;
}
.btn:hover { background: #10b981; color: #fff; }
.btn.ghost {
    background: transparent; border: 1px solid #334155; color: #cbd5e1;
}
.btn.ghost:hover { background: #1e2937; color: #fff; }

/* Project page shell */
.project-article { padding: 1.75rem 1.5rem 2.25rem; max-width: 52rem; }
@media (min-width: 640px) {
    .project-article { padding: 2rem 2.25rem 2.5rem; }
}
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

/* Footer */
.footer {
    border-top: 1px solid #1e2937; background: rgba(15, 23, 42, 0.9);
    padding: 2rem 0; margin-top: 1rem;
}
.footer p { font-size: 12px; color: #94a3b8; text-align: center; max-width: 36rem; margin: 0 auto 1.25rem; line-height: 1.55; }
.funding-logos {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.85rem; margin-bottom: 1.25rem;
}
.funding-logos img {
    max-height: 2.75rem; max-width: 8rem; width: auto; object-fit: contain; opacity: 0.92;
}
.funding-logos img.fct { max-height: 2.5rem; max-width: 9rem; }
.funding-logos img.geoparque { max-height: 2.75rem; max-width: 8.5rem; }
.copy {
    text-align: center; font-size: 11px; color: #64748b;
    padding-top: 1rem; border-top: 1px solid rgba(30, 41, 59, 0.8);
}

.spinner { text-align: center; padding: 2.5rem; color: #64748b; font-size: 0.875rem; }
.err { text-align: center; padding: 1.5rem; color: #fbbf24; font-size: 0.875rem; }
.hidden { display: none !important; }
