/* ----------------------------------------------------------------------------
   Steada blog stylesheet.

   Self-contained on purpose: the /blog/* pages are server-rendered by the Go
   control-plane API and fronted by CloudFront, so they cannot reference Astro's
   content-hashed _astro/*.css bundle. This file is served from S3 at the stable
   path /assets/blog.css and mirrors the main site's design tokens and chrome
   (Archivo/Geist, paper + ink + acid) so the blog reads as one brand.
---------------------------------------------------------------------------- */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/archivo.woff2") format("woff2");
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/geist.woff2") format("woff2");
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/geist-mono.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --ink: #11130f;
  --ink-soft: #1c1f19;
  --muted: #565d52;
  --muted-strong: #3d4338;
  --paper: #f6f5ee;
  --paper-deep: #efeee4;
  --panel: #ffffff;
  --line: #e0e0d4;
  --line-strong: #c3c6b7;
  --acid: #c8f54a;
  --acid-deep: #b6e637;
  --teal: #08736d;
  --teal-soft: #e3f3f0;
  --font-display: "Archivo", "Segoe UI", system-ui, sans-serif;
  --font-body: "Geist", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --shadow-sm: 0 1px 2px rgb(17 19 15 / 6%), 0 2px 6px rgb(17 19 15 / 5%);
  --shadow-md: 0 8px 22px rgb(17 19 15 / 7%), 0 2px 6px rgb(17 19 15 / 5%);
  --radius: 12px;
  --radius-sm: 9px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  font-family: var(--font-body);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

html {
  background: var(--paper);
  color: var(--ink);
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  min-width: 320px;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.005em;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(90deg, rgb(17 19 15 / 3.5%) 1px, transparent 1px),
    radial-gradient(60% 50% at 85% -10%, rgb(200 245 74 / 18%), transparent 60%);
  background-size: 32px 100%, 100% 100%;
}

a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--ink); }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---- Header / nav (mirrors the static site) ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.85rem clamp(1rem, 4vw, 3rem);
  background: rgb(246 245 238 / 86%);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--acid);
  font-weight: 800;
}
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
  margin-left: auto;
  font-size: 0.92rem;
}
.site-nav a {
  color: var(--muted-strong);
  text-decoration: none;
  padding: 0.2rem 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover,
.site-nav a[data-active="true"] { color: var(--ink); border-color: var(--acid-deep); }
.header-cta {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}
.header-cta:hover { color: var(--acid); }

/* ---- Layout ---- */
.blog-main {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 4vw, 2rem) 4rem;
}
.eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--teal);
  margin: 0 0 0.75rem;
}
.eyebrow a { color: var(--teal); text-decoration: none; }
.blog-hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: clamp(1.9rem, 5vw, 2.9rem);
  line-height: 1.08;
  margin: 0 0 0.75rem;
}
.blog-hero .lede { color: var(--muted-strong); font-size: 1.1rem; max-width: 60ch; }

/* ---- Tag rail / chips ---- */
.tag-rail { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.75rem 0 0; }
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--muted-strong);
  font-size: 0.82rem;
  font-family: var(--font-mono);
  text-decoration: none;
}
.tag-chip:hover { border-color: var(--acid-deep); color: var(--ink); }
.tag-chip span { color: var(--muted); font-size: 0.74rem; }

/* ---- Post list ---- */
.post-list { list-style: none; margin: 2.5rem 0 0; padding: 0; display: grid; gap: 1.25rem; }
.post-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 160ms var(--ease), transform 160ms var(--ease);
}
.post-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.post-card-link { display: flex; gap: 1.25rem; text-decoration: none; color: inherit; align-items: stretch; }
.post-card-img { width: 200px; object-fit: cover; flex: none; background: var(--paper-deep); }
.post-card-body { padding: 1.25rem 1.4rem; }
.post-card-body h2 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.3rem;
  margin: 0 0 0.4rem;
  color: var(--ink);
}
.post-card-body p { margin: 0 0 0.5rem; color: var(--muted-strong); }
.post-meta { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); }
.empty-state { margin-top: 3rem; color: var(--muted); font-family: var(--font-mono); }

/* ---- Single post ---- */
.breadcrumb { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); margin-bottom: 1.5rem; }
.breadcrumb a { color: var(--muted-strong); text-decoration: none; }
.breadcrumb span { margin: 0 0.4rem; }
.post-header h1 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: clamp(1.9rem, 5vw, 3rem);
  line-height: 1.08;
  margin: 0 0 0.75rem;
}
.post-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.9rem; }
.post-hero { width: 100%; border-radius: var(--radius); margin: 1.75rem 0; box-shadow: var(--shadow-sm); }

.post-body { font-size: 1.08rem; line-height: 1.75; color: var(--ink-soft); margin-top: 2rem; }
.post-body > * + * { margin-top: 1.15rem; }
.post-body h2 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.6rem;
  margin-top: 2.5rem;
  padding-top: 0.5rem;
}
.post-body h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; margin-top: 2rem; }
.post-body a { color: var(--teal); }
.post-body code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--paper-deep);
  padding: 0.12em 0.4em;
  border-radius: 6px;
  border: 1px solid var(--line);
}
.post-body pre {
  background: var(--ink);
  color: #eef0e6;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.6;
}
.post-body pre code { background: none; border: none; padding: 0; color: inherit; }
.post-body blockquote {
  margin: 0;
  padding: 0.5rem 1.25rem;
  border-left: 3px solid var(--acid-deep);
  color: var(--muted-strong);
  font-style: italic;
}
.post-body ul, .post-body ol { padding-left: 1.4rem; }
.post-body li + li { margin-top: 0.4rem; }
.post-body img { max-width: 100%; height: auto; border-radius: var(--radius); }
.post-body table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.post-body th, .post-body td { border: 1px solid var(--line); padding: 0.55rem 0.7rem; text-align: left; }
.post-body th { background: var(--paper-deep); font-family: var(--font-mono); font-size: 0.82rem; }

.post-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted-strong);
  font-size: 0.95rem;
}

/* ---- Footer (mirrors the static site) ---- */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: 1100px;
  margin: 4rem auto 0;
  padding: 2rem clamp(1rem, 4vw, 3rem);
  border-top: 1px solid var(--line);
  color: var(--muted-strong);
  font-size: 0.9rem;
}
.site-footer strong { font-family: var(--font-display); }
.site-footer p { max-width: 48ch; margin: 0.4rem 0 0; color: var(--muted); }
.site-footer div:last-child { display: flex; flex-direction: column; gap: 0.35rem; text-align: right; }
.site-footer span { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); }
.site-footer a { color: var(--muted-strong); text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

@media (max-width: 640px) {
  .post-card-link { flex-direction: column; }
  .post-card-img { width: 100%; height: 180px; }
  .site-nav { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; }
  .post-card { transition: none; }
}
