:root {
  --bg: #f7f8fa;
  --panel: #ffffff;
  --line: #e3e6ea;
  --ink: #1a1d23;
  --muted: #5c6470;
  --primary: #1f4e79;
  --primary-dark: #163a5a;
  --copper: #b5732e;
  --radius: 12px;
  --font-sans: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --maxw: 960px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.site-nav {
  display: flex;
  gap: 1.4rem;
  align-items: center;
}
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.15s;
}
.site-nav a:hover { color: var(--primary); }
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1.1rem;
  padding: 0.2rem 0.6rem;
  cursor: pointer;
  color: var(--ink);
}

/* ---------- hero ---------- */
.hero {
  padding: 5rem 0 3.5rem;
  background: linear-gradient(180deg, #eef2f7 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  line-height: 1.15;
  margin: 0 0 1.1rem;
  color: var(--primary-dark);
  max-width: 18ch;
}
.hero-lead {
  font-size: 1.12rem;
  color: var(--muted);
  max-width: 60ch;
  margin: 0 0 1.8rem;
}
.btn {
  display: inline-block;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.7rem 1.3rem;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--primary);
  margin-top: 1.2rem;
}
.btn-ghost:hover { border-color: var(--primary); }

/* ---------- sections ---------- */
.section { padding: 3.2rem 0; border-bottom: 1px solid var(--line); }
.section-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 1.2rem;
}
.section-label {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--copper);
}
.section h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0;
  color: var(--ink);
}
.prose { max-width: 68ch; margin: 0 0 1rem; color: var(--ink); }
.prose.muted, .muted { color: var(--muted); }

/* ---------- cards ---------- */
.card-grid { display: grid; gap: 1rem; margin-top: 1.4rem; }
.card-grid.three { grid-template-columns: repeat(3, 1fr); }
.card-grid.two { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.4rem 1.5rem;
}
.card-icon { font-size: 1.6rem; margin-bottom: 0.6rem; }
.card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  margin: 0 0 0.4rem;
  color: var(--primary-dark);
}
.card p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.spec { margin: 0; padding-left: 1.1rem; color: var(--muted); font-size: 0.92rem; }
.spec li { margin-bottom: 0.2rem; }

/* ---------- alert ---------- */
.alert {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  background: #f0f4f8;
  border: 1px solid var(--line);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.alert-icon { font-size: 1.2rem; line-height: 1.4; }

/* ---------- feed (articles + journal) ---------- */
.feed-grid { display: grid; gap: 1rem; margin-top: 1.2rem; }
.feed-meta { color: var(--muted); font-size: 0.85rem; margin: 0.4rem 0 0; }

.note-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--copper);
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.note-card .note-tag {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--copper);
}
.note-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.3;
  margin: 0;
  color: var(--ink);
}
.note-card .note-date { font-size: 0.78rem; color: var(--muted); }
.note-card .excerpt {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--muted);
  margin: 0;
}
.note-card .excerpt strong { color: var(--ink); font-weight: 600; }
.note-card .excerpt em { color: var(--copper); font-style: italic; }
.note-card .excerpt code {
  background: rgba(181,115,46,0.12);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--copper);
}
.full-text {
  margin-top: 0.8rem;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--ink);
  border-top: 1px solid var(--line);
  padding-top: 0.8rem;
}
.read {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9rem;
  align-self: flex-start;
}
.read:hover { text-decoration: underline; }
.share-row { display: flex; gap: 0.6rem; margin-top: 0.6rem; }
.share-btn {
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--primary);
  text-decoration: none;
}
.share-btn:hover { border-color: var(--primary); }

/* ---------- performance / fleet telemetry ---------- */
.subsection-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  margin: 1.8rem 0 0.8rem;
  color: var(--primary-dark);
}
.perf-fleet {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem;
  margin-top: 0.8rem;
}
.perf-metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.perf-metric-k {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.perf-metric-v {
  font-size: 1.25rem;
  font-weight: 600;
  font-family: var(--font-sans);
  color: var(--ink);
}
.perf-metric.is-pos .perf-metric-v { color: #15803d; }
.perf-metric.is-neg .perf-metric-v { color: #b91c1c; }
.perf-brokers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.6rem;
}
.perf-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.8rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.perf-card.is-offline { opacity: 0.55; }
.perf-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.perf-card-head h3 {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  color: var(--ink);
}
.perf-badge {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
}
.perf-badge.is-on { background: #e7f6ec; color: #15803d; }
.perf-badge.is-off { background: #fdeaea; color: #b91c1c; }
.perf-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem 0.7rem;
}
.perf-card-grid .perf-metric {
  border: none;
  background: #f4f6f9;
  padding: 0.55rem 0.6rem;
  border-radius: 8px;
}
.perf-card-grid .perf-metric-v { font-size: 0.95rem; }
.perf-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-top: 1px solid var(--line);
  padding-top: 0.6rem;
}
.perf-spark { width: 120px; height: 36px; }
.perf-spark polyline { stroke: var(--primary); }
.perf-spark.is-down polyline { stroke: #b91c1c; }
.perf-updated {
  font-size: 0.7rem;
  color: var(--muted);
}
.perf-note {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 1rem;
  font-style: italic;
}

/* ---------- builder spec modules ---------- */
.spec-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1.4rem;
}
.spec-module {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.4rem 1.5rem;
  overflow: hidden;
}
.spec-led {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--copper);
  box-shadow: 0 0 0 3px rgba(181, 115, 46, 0.15);
}
.spec-icon { font-size: 1.6rem; margin-bottom: 0.5rem; }
.spec-module h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  margin: 0 0 0.6rem;
  color: var(--primary-dark);
}
.spec-module .spec { padding-left: 0; list-style: none; }
.spec-module .spec li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.88rem;
  padding: 0.3rem 0;
  border-bottom: 1px dashed var(--line);
}
.spec-module .spec li:last-child { border-bottom: none; }
.spec-module .spec li span {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- footer ---------- */
.site-footer {
  padding: 2.5rem 0 3rem;
  background: #fff;
  border-top: 1px solid var(--line);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.footer-brand { display: flex; align-items: baseline; gap: 0.8rem; flex-wrap: wrap; }
.footer-tag { color: var(--muted); font-size: 0.9rem; }
.footer-nav { display: flex; gap: 1.3rem; flex-wrap: wrap; }
.footer-nav a { color: var(--muted); text-decoration: none; font-size: 0.9rem; font-weight: 500; }
.footer-nav a:hover { color: var(--primary); }
.footer-note {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0;
  max-width: 60ch;
}
.footer-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-end;
  text-align: right;
}
.footer-views {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--copper);
  background: rgba(181, 115, 46, 0.08);
  border: 1px solid rgba(181, 115, 46, 0.18);
  border-radius: 20px;
  padding: 0.25rem 0.8rem;
  letter-spacing: 0.02em;
}
.footer-views #view-count-n { font-variant-numeric: tabular-nums; font-weight: 600; }
@media (max-width: 720px) {
  .footer-meta { align-items: flex-start; text-align: left; }
}



/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .spec-grid { grid-template-columns: repeat(2, 1fr); }
  .site-nav {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 1.25rem;
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 0.6rem 0; width: 100%; }
  .nav-toggle { display: block; }
  .card-grid.three, .card-grid.two { grid-template-columns: 1fr; }
  .spec-grid { grid-template-columns: 1fr; }
  .hero { padding: 3rem 0 2.5rem; }
}
