/* Gobi Carbon Hub — public site styles */
:root {
  --bg: #f5f4ef;
  --surface: #ffffff;
  --surface-2: #faf9f5;
  --ink: #0f1c14;
  --ink-soft: #5a6660;
  --ink-mute: #8a9089;
  --line: #e6e3d8;
  --line-strong: #d4d0c2;
  --brand: #1f513a;
  --brand-strong: #143524;
  --accent: #b08956;
  --danger: #9c2a20;
  --warn: #8a6500;
  --ok: #2f7d4a;
  --radius: 6px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 28, 20, 0.04);
  --shadow-md: 0 4px 16px rgba(15, 28, 20, 0.06);
  --maxw: 1100px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { font-weight: 600; letter-spacing: -0.015em; color: var(--ink); }
h1 { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.15; margin: 0 0 12px; }
h2 { font-size: 20px; line-height: 1.3; margin: 0 0 10px; }
p  { margin: 0 0 12px; }

a { color: var(--brand); text-decoration: none; border-bottom: 1px solid rgba(31, 81, 58, 0.25); }
a:hover { color: var(--brand-strong); border-bottom-color: var(--brand-strong); }
nav a, .brand, .btn-primary, .btn-ghost, .badge { border-bottom: 0; }

code {
  background: #efece2;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink);
}

.container { max-width: var(--maxw); margin: 0 auto; padding: 32px 24px; }

/* Header */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: saturate(140%) blur(6px);
}
.site-header .brand {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--ink);
  display: inline-flex; align-items: center; gap: 10px;
}
.site-header .brand img {
  width: 28px; height: 28px; display: block;
  border-radius: 6px;
}
.site-header nav { display: flex; gap: 22px; }
.site-header nav a {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.site-header nav a:hover { color: var(--ink); }

.site-footer {
  text-align: center;
  padding: 36px 16px;
  color: var(--ink-mute);
  font-size: 13px;
  border-top: 1px solid var(--line);
  margin-top: 60px;
}
.site-footer a { color: var(--ink-soft); border-bottom: 0; }
.site-footer a:hover { color: var(--ink); }

/* Hero */
.hero {
  background: var(--brand-strong);
  color: #ecebe4;
  padding: 96px 24px 88px;
  border-bottom: 1px solid var(--brand-strong);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(1200px 400px at 80% -10%, rgba(176, 137, 86, 0.18), transparent 60%),
    radial-gradient(800px 400px at 0% 110%, rgba(255, 255, 255, 0.05), transparent 60%);
  pointer-events: none;
}
.hero-inner { max-width: var(--maxw); margin: 0 auto; position: relative; }
.hero .eyebrow {
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: rgba(236, 235, 228, 0.65);
  margin: 0 0 18px;
}
.hero h1 {
  font-size: clamp(34px, 5.2vw, 56px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 0 0 18px;
  color: #ffffff;
  max-width: 14ch;
}
.hero .lead {
  font-size: 17px;
  line-height: 1.65;
  color: rgba(236, 235, 228, 0.82);
  max-width: 62ch;
}
.hero .cta { margin-top: 28px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero .scan-hint {
  margin-top: 32px;
  font-size: 13px;
  color: rgba(236, 235, 228, 0.65);
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 60ch;
}
.hero .scan-hint strong { color: #ffffff; font-weight: 600; }
.hero .scan-hint code { background: rgba(255,255,255,0.08); color: #f4f1e8; }

/* Buttons */
.btn-primary, .btn-ghost {
  display: inline-flex; align-items: center;
  padding: 11px 20px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
  text-decoration: none;
  line-height: 1;
}
.btn-primary { background: #ffffff; color: var(--brand-strong); }
.btn-primary:hover { background: #f4f1e8; color: var(--brand-strong); }
.btn-ghost { background: transparent; color: #ecebe4; border-color: rgba(255,255,255,0.35); }
.btn-ghost:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.5); }

/* Grids */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin: 20px 0; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin: 20px 0; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 18px;
}
.card h1 { margin-top: 0; }
.card h2 { margin-top: 0; font-size: 17px; }

.grid-3 .card {
  padding: 26px;
  position: relative;
}
.grid-3 .card::before {
  content: "";
  display: block;
  width: 28px; height: 2px;
  background: var(--brand);
  margin-bottom: 18px;
}

.cta-card { background: var(--surface-2); }
.cta-card ol {
  padding-left: 0; list-style: none; counter-reset: step;
  margin: 12px 0 0;
}
.cta-card li {
  counter-increment: step;
  position: relative;
  padding: 8px 0 8px 38px;
  border-top: 1px solid var(--line);
  font-size: 15px;
}
.cta-card li:first-child { border-top: 0; }
.cta-card li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: 8px;
  font-variant-numeric: tabular-nums;
  color: var(--brand);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.05em;
}

.empty { color: var(--ink-mute); font-style: italic; font-size: 14px; }

/* Tree page */
.tree-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding-bottom: 16px; border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
.tree-head h1 { margin: 0; font-size: 28px; }
.meta {
  display: grid; grid-template-columns: 160px 1fr; gap: 10px 18px; margin: 18px 0 0;
  font-size: 15px;
}
.meta dt {
  color: var(--ink-mute); text-transform: uppercase;
  font-size: 12px; letter-spacing: 0.08em; padding-top: 2px;
}
.meta dd { margin: 0; }
.meta a { border-bottom: 0; color: var(--brand); }

/* Badges */
.badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  background: #ecebe2; color: var(--ink-soft);
  border: 1px solid var(--line);
}
.badge.alive   { background: #e3efd9; color: #335e1f; border-color: #cee0ba; }
.badge.dead    { background: #f3dad6; color: #7c1f17; border-color: #e6c3bd; }
.badge.stalled { background: #f1e5c2; color: #6e4f00; border-color: #e0d2a4; }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
  display: flex; gap: 18px; padding: 12px 0;
  border-bottom: 1px solid var(--line); font-size: 15px;
}
.timeline li:last-child { border-bottom: 0; }
.timeline time {
  color: var(--ink-mute); min-width: 110px;
  font-variant-numeric: tabular-nums; font-size: 13px;
}

/* Photos */
.photo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px;
}
.photo-grid figure { margin: 0; }
.photo-grid img {
  width: 100%; height: 160px; object-fit: cover;
  border-radius: var(--radius); display: block;
  border: 1px solid var(--line);
}
.photo-grid figcaption {
  font-size: 12px; color: var(--ink-mute); margin-top: 6px;
  text-align: center; font-variant-numeric: tabular-nums;
}

.error-card { border-color: #e6c3bd; background: #faf2f0; }
.error-card h1 { color: var(--danger); }

.contact { padding-left: 0; list-style: none; margin: 12px 0 0; }
.contact li {
  padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px;
}
.contact li:last-child { border-bottom: 0; }
.contact strong {
  display: inline-block; min-width: 110px; color: var(--ink-mute);
  font-weight: 500; font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em;
}

.page-offline .card { text-align: center; max-width: 520px; margin: 80px auto; }

/* Facts / numeric strip */
.fact-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 0 0 18px;
}
.fact {
  padding: 24px 22px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.fact:last-child { border-right: 0; }
.fact .num {
  display: block;
  font-size: 32px; font-weight: 600; letter-spacing: -0.02em;
  color: var(--ink); line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.fact .lbl {
  display: block; margin-top: 4px;
  font-size: 12px; color: var(--ink-mute);
  text-transform: uppercase; letter-spacing: 0.1em;
}
@media (max-width: 600px) {
  .fact { border-right: 0; }
}

/* Approach list (used on about) */
.approach { padding-left: 0; list-style: none; counter-reset: ap; margin: 0; }
.approach li {
  counter-increment: ap;
  position: relative;
  padding: 18px 0 18px 56px;
  border-top: 1px solid var(--line);
}
.approach li:first-child { border-top: 0; }
.approach li::before {
  content: counter(ap, decimal-leading-zero);
  position: absolute; left: 0; top: 20px;
  font-variant-numeric: tabular-nums;
  color: var(--brand); font-weight: 600;
  font-size: 13px; letter-spacing: 0.05em;
  border-right: 1px solid var(--line);
  padding-right: 14px;
  width: 42px;
}
.approach h3 {
  margin: 0 0 4px; font-size: 16px; font-weight: 600;
}
.approach p { margin: 0; color: var(--ink-soft); font-size: 15px; }

/* Subtle hero variant for inner pages */
.hero.hero-sm { padding: 72px 24px 64px; }
.hero.hero-sm h1 { font-size: clamp(28px, 4vw, 42px); max-width: 22ch; }

@media (max-width: 600px) {
  .site-header { padding: 14px 18px; }
  .site-header nav { gap: 14px; }
  .hero { padding: 64px 20px 56px; }
  .container { padding: 24px 18px; }
  .meta { grid-template-columns: 1fr; gap: 4px 0; }
  .meta dt { padding-top: 8px; }
  .tree-head h1 { font-size: 24px; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .photo-grid img { height: 130px; }
  .timeline li { flex-direction: column; gap: 2px; }
  .timeline time { min-width: 0; }
  .fact { padding: 18px; }
  .fact .num { font-size: 26px; }
  .approach li { padding-left: 48px; }
  .approach li::before { top: 18px; width: 36px; padding-right: 10px; }
  .contact strong { display: block; min-width: 0; margin-bottom: 2px; }
}
