/* ─── Fonts ──────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;1,400&family=Inter:wght@300;400;500&family=JetBrains+Mono:wght@300;400&display=swap');

/* ─── Tokens ─────────────────────────────────────────── */
:root {
  --bg:           #fdfdfc;
  --bg-subtle:    #f7f7f6;
  --bg-card:      #ffffff;
  --fg:           #111111;
  --fg-mid:       #444444;
  --fg-dim:       #888888;
  --border:       #e5e5e3;
  --border-dark:  #d0d0ce;

  /* Terminal accents — sparse, intentional */
  --t-green:      #2d7a4f;   /* // comments, labels   */
  --t-blue:       #1c5fa6;   /* keywords, links       */
  --t-teal:       #1a7f7a;   /* types, h3             */
  --t-cursor:     #2d7a4f;   /* blinking cursor       */

  --font-serif: 'Lora', 'Georgia', serif;
  --font-sans:  'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:  'JetBrains Mono', ui-monospace, 'Courier New', monospace;

  --space-1:  0.5rem;
  --space-2:  1rem;
  --space-3:  1.5rem;
  --space-4:  2rem;
  --space-6:  3rem;
  --space-8:  4rem;
  --space-12: 6rem;
  --space-16: 8rem;
}

/* ─── Reset ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── Base ───────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.65;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--t-blue);
  text-decoration: none;
  transition: opacity 0.15s;
}
a:hover { opacity: 0.7; }

::selection { background: rgba(45, 122, 79, 0.12); }

/* ─── Layout ──────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

/* ─── Header ──────────────────────────────────────────── */
header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  margin-bottom: 0;
}

.nav-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 52px;
  gap: 1rem;
  flex-wrap: wrap;
}

.logo {
  font-family: var(--font-mono);
  color: var(--fg);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.logo-main {
  font-weight: 400;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.logo-main::before {
  content: '>';
  color: var(--t-green);
  font-size: 0.72rem;
}
.logo .logo-sub {
  font-size: 0.58rem;
  color: var(--fg-dim);
  letter-spacing: 0.1em;
  padding-left: 0.85em;
  font-weight: 300;
}
.logo:hover { opacity: 0.7; }

nav {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 2.5vw, 2.25rem);
  flex-wrap: wrap;
}

nav a {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: lowercase;
  letter-spacing: 0.03em;
  color: var(--fg-dim);
  transition: color 0.12s;
}
nav a:hover,
nav a.active { color: var(--fg); opacity: 1; }

.republic-link { color: var(--t-green) !important; }
.agency-link   { color: var(--fg-mid)  !important; }

/* ─── Footer ──────────────────────────────────────────── */
footer {
  margin-top: var(--space-16);
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  padding: var(--space-6) 0 0;
  color: var(--fg-dim);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr;
  gap: var(--space-6);
  padding-bottom: var(--space-6);
}

.footer-brand-id {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--fg);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.footer-brand-id::before { content: '>'; color: var(--t-green); }
.footer-logo { margin-bottom: var(--space-2); text-decoration: none; }

.footer-brand-desc {
  font-family: var(--font-sans);
  font-size: 0.825rem;
  font-weight: 300;
  color: var(--fg-dim);
  max-width: 300px;
  line-height: 1.65;
  margin: 0;
}

.footer-col-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--t-green);
  letter-spacing: 0.08em;
  font-weight: 300;
  margin-bottom: var(--space-2);
}
.footer-col-label::before { content: '// '; }

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.footer-col li a {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--fg-dim);
  text-transform: lowercase;
  letter-spacing: 0.02em;
  transition: color 0.12s;
  opacity: 1;
}
.footer-col li a:hover { color: var(--fg); }

.footer-tree li a::before { content: '→ '; color: var(--t-green); font-size: 0.65rem; }

.footer-bar {
  border-top: 1px solid var(--border);
  padding: var(--space-2) 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--fg-dim);
  letter-spacing: 0.02em;
}

@media (max-width: 640px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
  }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }
}

/* ─── Typography ──────────────────────────────────────── */

/* Hero h1 — serif, large, editorial */
h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.25rem, 5.5vw, 4.5rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
  max-width: 880px;
  color: var(--fg);
}

/* Terminal comment prefix on hero h1 */
.hero h1::before {
  content: '// ';
  font-family: var(--font-mono);
  font-size: clamp(0.75rem, 1.5vw, 1rem);
  font-weight: 300;
  color: var(--t-green);
  letter-spacing: 0.04em;
  vertical-align: 0.35em;
}

/* Section h2 — Inter, clean */
h2 {
  font-family: var(--font-sans);
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 500;
  color: var(--fg);
  letter-spacing: -0.01em;
  margin-bottom: 0;
}

/* Item h3 — mono label */
h3 {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--fg);
  margin-bottom: var(--space-1);
  letter-spacing: 0.01em;
}

p {
  margin-bottom: var(--space-3);
  color: var(--fg-mid);
  max-width: 600px;
  line-height: 1.78;
  font-size: 0.9rem;
  font-weight: 300;
}

.lead {
  font-family: var(--font-sans);
  font-size: clamp(1rem, 2vw, 1.175rem);
  font-weight: 300;
  color: var(--fg-mid);
  max-width: 700px;
  line-height: 1.65;
}

/* Blinking cursor at end of hero lead */
.hero .lead::after {
  content: '▊';
  display: inline;
  color: var(--t-cursor);
  margin-left: 3px;
  animation: cursor-blink 1.1s step-end infinite;
  font-family: var(--font-mono);
  font-size: 0.85em;
}
@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.mono {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 300;
  color: var(--fg-mid);
  line-height: 1.75;
  max-width: none;
}

/* ─── Sections ───────────────────────────────────────── */
section { margin-bottom: var(--space-16); }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--t-green);
  font-weight: 300;
}
.section-label::before { content: '// '; }

/* ─── Hero ───────────────────────────────────────────── */
.hero {
  padding: clamp(3.5rem, 8vw, 7rem) 0 clamp(2.5rem, 5vw, 5rem);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-12);
}

/* ─── Grids ──────────────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-12);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-12);
}

/* ─── Cards ──────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.card:hover {
  border-color: var(--border-dark);
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
  text-decoration: none;
}

.card-header {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-3);
  gap: var(--space-2);
  min-height: 28px;
}

/* Status badges */
.card-status {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.5rem;
  font-weight: 400;
}
.card-status.active {
  color: var(--t-green);
  background: rgba(45, 122, 79, 0.07);
}
.card-status.development {
  color: #7c5c1a;
  background: rgba(180, 130, 30, 0.08);
}
.card-status.planned {
  color: var(--fg-dim);
  background: var(--bg-subtle);
}

.card-title {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(0.875rem, 1.4vw, 1rem);
  color: var(--fg);
  margin-bottom: var(--space-2);
  letter-spacing: -0.01em;
}

.card-desc {
  font-size: 0.825rem;
  color: var(--fg-mid);
  margin-bottom: var(--space-4);
  flex-grow: 1;
  line-height: 1.75;
  max-width: 100%;
  font-weight: 300;
}

.card-action {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--t-blue);
  text-transform: lowercase;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: auto;
  transition: opacity 0.15s;
}
.card-action::before { content: '$ '; color: var(--t-green); }
.card:hover .card-action { opacity: 0.7; }

/* ─── Plain grid items ───────────────────────────────── */
.grid-4 > div:not(.card),
.grid-2 > div:not(.card) {
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4);
  border-left: 1px solid var(--border);
  transition: border-color 0.15s;
}
.grid-4 > div:not(.card):hover,
.grid-2 > div:not(.card):hover {
  border-left-color: var(--t-teal);
}

/* ─── Tech list ──────────────────────────────────────── */
.tech-list {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--space-12);
}

.tech-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--space-8);
  align-items: baseline;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}
.tech-row:first-child { border-top: 1px solid var(--border); }

.tech-row h3 {
  margin-bottom: 0;
  padding-top: 0.1em;
}

.tech-row p {
  max-width: none;
}

@media (max-width: 640px) {
  .tech-row {
    grid-template-columns: 1fr;
    gap: var(--space-1);
  }
}

/* ─── Utility ────────────────────────────────────────── */
.mt-8  { margin-top: var(--space-8); }
.mb-0  { margin-bottom: 0 !important; }

/* ─── Hamburger ───────────────────────────────────────── */
.nav-hamburger {
  display: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 5px;
  color: var(--fg);
  margin-left: auto;
  flex-shrink: 0;
}
.nav-hamburger .bar {
  display: block;
  width: 20px;
  height: 1.5px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.15s ease;
}
header.nav-open .nav-hamburger .bar:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
header.nav-open .nav-hamburger .bar:nth-child(2) { opacity: 0; }
header.nav-open .nav-hamburger .bar:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-hamburger { display: flex; }

  header { position: relative; }

  nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem clamp(1.25rem, 4vw, 2.5rem) 1rem;
    gap: 0;
    z-index: 99;
  }

  header.nav-open nav { display: flex; }

  nav a {
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
    width: 100%;
    gap: 1rem;
  }
  nav a:last-child { border-bottom: none; }
}

@media (max-width: 640px) {
  h1 { letter-spacing: -0.015em; }
  .grid-2, .grid-4 { grid-template-columns: 1fr; }
}
