/* ============================================================
   bodell.ai — Design v2
   "Engineering-lab minimalism"
   Serif display + sans body + mono meta. One electric-blue accent.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ---------- Tokens ---------- */
:root {
  /* color */
  --bg:            #0A0A0B;
  --bg-elevated:   #101012;
  --surface:       #141417;
  --surface-hover: #1B1B1F;
  --border:        #232327;
  --border-strong: #2E2E34;
  --text:          #F4F4F5;
  --text-secondary:#A1A1AA;
  --text-muted:    #6B6B73;
  --accent:        #4F8CFF;
  --accent-hover:  #7AA9FF;
  --accent-quiet:  rgba(79,140,255,0.12);
  --success:       #34D399;

  /* type */
  --font-serif: "Instrument Serif", Georgia, serif;
  --font-sans:  "Inter", system-ui, -apple-system, sans-serif;
  --font-mono:  "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;

  --step--1: 0.833rem;
  --step-0:  1.0rem;
  --step-1:  1.25rem;
  --step-2:  1.75rem;
  --step-3:  2.5rem;
  --step-4:  clamp(2.75rem, 6vw, 4rem);

  /* space (8px base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  /* layout */
  --maxw-prose: 680px;
  --maxw-page:  1080px;
  --radius: 14px;
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.7;
  letter-spacing: -0.011em;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, .logo { font-family: var(--font-serif); line-height: 1.15; font-weight: 400; }
.meta, .chip, code, time, .mono { font-family: var(--font-mono); }

a { color: var(--accent); text-decoration: none; transition: color 150ms ease; }

::selection { background: var(--accent-quiet); color: var(--text); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Layout helpers ---------- */
.wrap {
  max-width: var(--maxw-page);
  margin-inline: auto;
  padding-inline: var(--space-5);
}
.prose {
  max-width: var(--maxw-prose);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

section { padding-block: var(--space-9); }
@media (max-width: 768px) {
  section { padding-block: var(--space-7); }
}

.section-label {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin-bottom: var(--space-5);
  display: block;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(10,10,11,0.6);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease;
}
.nav-inner {
  max-width: var(--maxw-page);
  margin-inline: auto;
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav .logo {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.35rem;
  color: var(--text);
  letter-spacing: 0;
}
.nav-links {
  display: flex;
  gap: var(--space-5);
  font-family: var(--font-mono);
  font-size: var(--step--1);
}
.nav-links a {
  color: var(--text-secondary);
}
.nav-links a:hover { color: var(--accent); }

/* ---------- Hero ---------- */
.hero {
  padding-top: var(--space-9);
  padding-bottom: var(--space-8);
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: var(--space-5);
}
.hero h1 {
  font-size: var(--step-4);
  max-width: 16ch;
  margin-bottom: var(--space-5);
}
.hero .subhead {
  font-size: var(--step-1);
  color: var(--text-secondary);
  max-width: 54ch;
  margin-bottom: var(--space-6);
}
.status-line {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

/* ---------- Status dot ---------- */
.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--success);
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(52,211,153,0.5);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(52,211,153,0.45); }
  70%  { box-shadow: 0 0 0 6px rgba(52,211,153,0); }
  100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: var(--step-0);
  color: var(--accent);
  padding: var(--space-3) var(--space-5);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}
.btn:hover {
  border-color: var(--accent);
  background: var(--accent-quiet);
  color: var(--accent-hover);
}

/* ---------- Bento grid ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
}
@media (max-width: 900px) {
  .bento { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}
@media (max-width: 560px) {
  .bento { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}
.card:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  transform: translateY(-2px);
}
.card .card-icon { font-size: 1.5rem; line-height: 1; }
.card h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--step-1);
  line-height: 1.25;
  color: var(--text);
}
.card p {
  color: var(--text-secondary);
  font-size: var(--step-0);
  line-height: 1.6;
  flex: 1;
}
.card .card-status {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.card .card-status .live {
  color: var(--success);
  font-size: 0.7rem;
}

/* bento spans (desktop) */
.span-4 { grid-column: span 4; }
.span-3 { grid-column: span 3; }
.span-2 { grid-column: span 2; }
@media (max-width: 900px) {
  .span-4, .span-3, .span-2 { grid-column: span 1; }
}
@media (max-width: 560px) {
  .span-4, .span-3, .span-2 { grid-column: span 1; }
}

/* ---------- Post list ---------- */
.post-list { display: flex; flex-direction: column; }
.post-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-5);
  padding: var(--space-5) var(--space-2);
  border-top: 1px solid var(--border);
  transition: background 150ms ease;
}
.post-row:last-child { border-bottom: 1px solid var(--border); }
.post-row:hover { background: var(--surface-hover); }
.post-row time {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 108px;
}
.post-row .post-title {
  font-weight: 600;
  color: var(--text);
  flex: 1;
  transition: color 150ms ease;
}
.post-row .arrow {
  color: var(--text-muted);
  transition: color 150ms ease, transform 150ms ease;
}
.post-row:hover .post-title { color: var(--accent); }
.post-row:hover .arrow { color: var(--accent); transform: translateX(3px); }

.all-posts {
  margin-top: var(--space-5);
  display: inline-flex;
  font-family: var(--font-mono);
  font-size: var(--step--1);
}

/* ---------- About strip ---------- */
.about p {
  color: var(--text-secondary);
  max-width: 60ch;
  font-size: var(--step-1);
  line-height: 1.6;
}
.about a { color: var(--accent); }
.about a:hover { color: var(--accent-hover); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding-block: var(--space-6);
}
.footer-inner {
  max-width: var(--maxw-page);
  margin-inline: auto;
  padding-inline: var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--text-muted);
  flex-wrap: wrap;
}
.footer-inner a { color: var(--text-secondary); }
.footer-inner a:hover { color: var(--accent); }

/* ---------- Blog listing page ---------- */
.page-head {
  padding-top: var(--space-8);
  padding-bottom: var(--space-4);
}
.page-head h1 { font-size: var(--step-3); margin-bottom: var(--space-3); }
.page-head p { color: var(--text-secondary); }

/* ---------- Article (post) ---------- */
.article { padding-block: var(--space-7) var(--space-9); }
.article .post-meta {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--text-muted);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.article h1 {
  font-size: var(--step-3);
  line-height: 1.15;
  margin-bottom: var(--space-6);
  max-width: 22ch;
}
.article h2 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--step-2);
  margin-top: var(--space-7);
  margin-bottom: var(--space-3);
  letter-spacing: -0.02em;
}
.article p {
  color: var(--text);
  margin-bottom: var(--space-5);
  font-size: var(--step-0);
}
.article p.lead {
  font-size: var(--step-1);
  color: var(--text-secondary);
}
.article ul { margin: 0 0 var(--space-5) var(--space-5); color: var(--text); }
.article li { margin-bottom: var(--space-2); }
.article strong { color: var(--text); font-weight: 600; }
.article a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.article a:hover { color: var(--accent-hover); }
.article .pull {
  border-left: 2px solid var(--accent);
  padding-left: var(--space-5);
  margin: var(--space-6) 0;
  color: var(--text-secondary);
  font-size: var(--step-1);
  font-style: normal;
}
.back-link {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--text-secondary);
  display: inline-flex;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}
.back-link:hover { color: var(--accent); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
