/* =======================================================================
   Frontier Security · Blog
   -----------------------------------------------------------------------
   Built on tokens.css. Deliberately does NOT reuse styles.css: that sheet
   pins .wrapper to 100vh with overflow:hidden to lock the marketing hero
   to the viewport, which would clip a scrolling article.
   ====================================================================== */

:root {
  color-scheme: light;

  /* Width of the centered reading column. Sized so that, after the section
     padding below, body text lands at roughly a 68-character measure. */
  --content-max: 780px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01" on, "cv11" on;
}

a { color: inherit; text-decoration: none; }

/* ── page frame ────────────────────────────────────────────────────── */
.wrapper {
  display: flex;
  flex-direction: column;
  max-width: 1400px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--background);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

main { flex: 1; }

/* ── header ────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
  padding: 0 clamp(20px, 4vw, 40px);
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: var(--font-display);
  font-size: 21.84px;
  font-weight: 700;
  letter-spacing: -0.014em;
  color: var(--foreground);
}

/* Same family, tracking and ink as .logo above; regular weight and 75% of
   its size, so the wordmark stays the dominant mark in the bar. */
.site-header-blog {
  padding-left: 16px;
  border-left: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 16.38px;
  font-weight: 400;
  letter-spacing: -0.014em;
  color: var(--foreground);
  transition: color var(--motion-fast);
}

.site-header-blog:hover { color: var(--primary); }

/* ── centered reading column ───────────────────────────────────────── */
/* The header stays a full-bleed bar; only the content centers. */
.index-head,
.post-list,
.post {
  max-width: var(--content-max);
  margin: 0 auto;
}

/* ── index ─────────────────────────────────────────────────────────── */
.index-head {
  padding: clamp(3rem, 6vw, 4.5rem) clamp(24px, 5vw, 64px) clamp(2rem, 4vw, 3rem);
}

.index-head h1 {
  margin: 0 0 16px;
  max-width: 18ch;
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 5vw, 3.4rem);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.032em;
  text-wrap: balance;
}

.index-head p {
  margin: 0;
  max-width: 56ch;
  color: var(--muted-foreground);
  font-size: 1.0625rem;
}

/* No `margin` here — it would reset the centering rule above. */
.post-list {
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
}

.post-row { border-bottom: 1px solid var(--border); }

.post-row > a {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  align-items: baseline;
  padding: 28px clamp(24px, 5vw, 64px);
  transition: background var(--motion-base);
}

.post-row > a:hover { background: var(--card); }

.post-row-date {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--muted-foreground);
}

.post-row-body { display: block; }

.post-row-title {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--foreground);
  text-wrap: balance;
  transition: color var(--motion-fast);
}

.post-row > a:hover .post-row-title { color: var(--primary); }

.post-row-desc {
  display: block;
  max-width: 68ch;
  color: var(--muted-foreground);
  font-size: 0.95rem;
}

/* ── post ──────────────────────────────────────────────────────────── */
.post {
  padding: clamp(3rem, 6vw, 4.5rem) clamp(24px, 5vw, 64px) clamp(4rem, 8vw, 6rem);
}

.post h1 {
  margin: 0 0 16px;
  max-width: 22ch;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4.4vw, 3.1rem);
  line-height: 1.06;
  font-weight: 600;
  letter-spacing: -0.032em;
  text-wrap: balance;
}

.post-byline {
  margin: 0 0 40px;
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.01em;
}

/* ── prose ─────────────────────────────────────────────────────────── */
/* Measure is set by --content-max on .post, not here. */
.prose { max-width: none; }

/* Flow spacing lives here and nowhere else. Element rules below must not
   set margin, or their higher specificity would silently cancel it. */
.prose > * { margin: 0; }
.prose > * + * { margin-top: 1.35em; }
.prose > * + h2 { margin-top: 2.2em; }
.prose > * + h3 { margin-top: 1.8em; }

.prose p {
  color: var(--muted-foreground);
  font-size: 1.0625rem;
  line-height: 1.7;
}

.prose strong { color: var(--foreground); font-weight: 600; }

.prose a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in oklch, var(--primary) 40%, transparent);
  transition: text-decoration-color var(--motion-fast);
}

.prose a:hover { text-decoration-color: var(--primary); }

.prose h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.022em;
  color: var(--foreground);
}

.prose h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.016em;
  color: var(--foreground);
}

.prose ul, .prose ol {
  padding-left: 1.3em;
  color: var(--muted-foreground);
  font-size: 1.0625rem;
  line-height: 1.7;
}

.prose li + li { margin-top: 0.5em; }

.prose blockquote {
  padding-left: 20px;
  border-left: 2px solid var(--primary);
  color: var(--foreground);
  font-size: 1.0625rem;
}

.prose code {
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  background: var(--muted);
  color: var(--foreground);
  font-family: var(--font-mono);
  font-size: 0.875em;
}

.prose pre {
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--muted);
  overflow-x: auto;
}

.prose pre code { padding: 0; background: none; font-size: 0.8125rem; }

/* ── link card ─────────────────────────────────────────────────────── */
/* The card is itself an <a> inside .prose, so it inherits the inline-link
   underline. It carries its own border and hover treatment instead. */
.prose a.link-card { text-decoration: none; }

.link-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--motion-base), box-shadow var(--motion-base);
}

.link-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.link-card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.014em;
  color: var(--foreground);
  text-wrap: balance;
}

.link-card-host {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted-foreground);
}

/* ── responsive ────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .wrapper { border-left: 0; border-right: 0; }

  .site-header, .index-head, .post,
  .post-row > a {
    padding-left: 20px;
    padding-right: 20px;
  }

  .post-row > a {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .prose { max-width: none; }
}
