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

/* ── Unified Navigation Bar ── */
.unified-nav {
  display: flex; align-items: center; justify-content: space-between;
  background: #13151f; border-bottom: 1px solid #2a2e45;
  padding: 0 1.5rem; height: 42px; position: sticky; top: 0; z-index: 1000;
  flex-shrink: 0;
}
.unified-nav__brand { font-size: .95rem; font-weight: 700; color: #e8eaf0; text-decoration: none; letter-spacing: -.02em; }
.unified-nav__brand span { color: #3ecf8e; }
.unified-nav__links { display: flex; gap: .25rem; }
.unified-nav__link {
  padding: .3rem .75rem; border-radius: 5px; font-size: .82rem;
  font-weight: 500; color: #8b92a8; text-decoration: none; transition: background .15s, color .15s;
}
.unified-nav__link:hover { background: #22263a; color: #e8eaf0; }
.unified-nav__link.active { background: #1e2438; color: #3ecf8e; }
.unified-nav__lang {
  margin-left: .5rem; padding: .25rem .55rem; border-radius: 4px;
  font-size: .72rem; font-weight: 600; letter-spacing: .06em;
  color: var(--text-secondary); background: transparent;
  border: 1px solid var(--border); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.unified-nav__lang:hover { background: var(--surface-hover); color: var(--text-primary); border-color: #3a3f5c; }

:root {
    --bg: #0f1117;
    --surface: #1a1d27;
    --surface-hover: #22263a;
    --border: #2a2e45;
    --accent: #3ecf8e;
    --accent-dim: #1e7a52;
    --text-primary: #e8eaf0;
    --text-secondary: #8b92a8;
    --text-muted: #8990a8;
    --badge-stac: #3b82f6;
    --badge-raster: #f59e0b;
    --badge-vector: #8b5cf6;
    --badge-pygeoapi: #10b981;
    --badge-browser: #ec4899;
}

body {
    background: var(--bg);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Header ── */
header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 2rem 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-wordmark {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.header-wordmark span {
    color: var(--accent);
}

.header-left p {
    margin-top: 0.4rem;
    color: var(--text-secondary);
    font-size: 0.92rem;
    max-width: 640px;
    line-height: 1.55;
}

.header-right {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    cursor: pointer;
}

.btn-primary {
    background: var(--accent);
    color: #0f1117;
    border-color: var(--accent);
}
.btn-primary:hover { background: #5adeaa; border-color: #5adeaa; }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface-hover); color: var(--text-primary); border-color: #3a3f5c; }

.btn-github {
    background: var(--surface-hover);
    color: var(--text-secondary);
    border-color: var(--border);
}
.btn-github:hover { background: #2c3150; color: var(--text-primary); border-color: #4a4f6c; }

/* ── Main ── */
main {
    flex: 1;
    padding: 2.5rem 2.5rem 3rem;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.section-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

/* ── Service Grid ── */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 1.25rem;
}

.service-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: border-color 0.2s, background 0.2s;
}
.service-card:hover { border-color: #3a3f5c; background: var(--surface-hover); }

.card-header {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.card-title-group { flex: 1; min-width: 0; }

.card-title {
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-badge {
    display: inline-block;
    margin-top: 0.3rem;
    padding: 0.18rem 0.55rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Service-scoped badge + icon colors — replace inline style="..." on cards */
.card-badge--stac     { background: #0f1e3d; color: #3b82f6; }
.card-badge--raster   { background: #2a1a00; color: #f59e0b; }
.card-badge--vector   { background: #1a0f35; color: #8b5cf6; }
.card-badge--pygeoapi { background: #062318; color: #10b981; }
.card-badge--chatbot  { background: #0b1e28; color: #38bdf8; }

.card-icon--stac     { background: #0f1e3d; }
.card-icon--raster   { background: #2a1a00; }
.card-icon--vector   { background: #1a0f35; }
.card-icon--pygeoapi { background: #062318; }
.card-icon--chatbot  { background: #0b1e28; }

.card-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    flex: 1;
}

.card-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

/* ── Status dot ── */
.endpoint-url {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: "SFMono-Regular", Consolas, monospace;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

/* ── Footer ── */
footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 1.25rem 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

footer p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ── Icon SVGs inline ── */
svg { display: block; }

@media (max-width: 640px) {
    header, main, footer { padding-left: 1.25rem; padding-right: 1.25rem; }
    .services-grid { grid-template-columns: 1fr; }
}
