/* BLOCKYARD — Ghost theme v0.2.1
 * Facelift: dark editorial publication. Confident Fraunces type ramp, Inter reading
 * body, JetBrains Mono editorial details. Violet (#7C5CFF) is the ONLY accent and is
 * rationed — CTAs, active nav, kicker labels, one hero mark, focus rings. Cards are
 * borderless; separation is whitespace + kicker + type contrast.
 */

:root {
  /* Accent — the single brand color, used sparingly */
  --accent: #7C5CFF;
  --accent-hover: #957BFF;
  --accent-muted: rgba(124, 92, 255, 0.16);

  /* Ink ramp — dark base. --surface is the near-black page; --ink-950 is the
     brightest foreground (headlines), stepping down to muted metadata. */
  --surface: #0A0A0F;
  --surface-raised: #14141C;
  --surface-sunken: #07070B;
  --ink-950: #F6F6FA;
  --ink-900: #E6E6EE;
  --ink-800: #C7C7D4;
  --ink-700: #9C9CAE;
  --ink-500: #6E6E80;
  --ink-300: #4B4B59;
  --ink-100: #22222E;
  --ink-50:  #1A1A24;

  /* Type families — the whole set. No fourth family. Body/display defer to Ghost's
     custom-font setting when an admin picks one (gscan custom-fonts support), and
     fall back to the BLOCKYARD defaults otherwise. */
  --font-body: var(--gh-font-body, 'Inter', system-ui, -apple-system, sans-serif);
  --font-display: var(--gh-font-heading, 'Fraunces', 'Times New Roman', serif);
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;

  /* Type ramp — magazine, not product page */
  --text-hero: clamp(3.25rem, 1.2rem + 8vw, 6rem);      /* 52 → 96px */
  --text-title: clamp(2.5rem, 1.6rem + 3.4vw, 3.5rem);  /* 40 → 56px post title */
  --text-body: 1.1875rem;                                /* 19px reading body */
  --text-dek: clamp(1.125rem, 1rem + 0.6vw, 1.375rem);   /* hero/post dek */
  --kicker-size: 0.75rem;                                /* 12px mono kicker */
  --kicker-tracking: 0.14em;

  /* Reading + rhythm */
  --measure-read: 680px;      /* post measure (640–720 band) */
  --container-max: 1180px;
  --rule-width: 2px;

  --radius-sm: 4px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --tx-fast: 140ms cubic-bezier(0.2, 0, 0.2, 1);
  --tx-base: 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink-900);
  background: var(--surface);
  font-size: 17px;
  line-height: 1.7;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink-900); text-decoration: none; transition: color var(--tx-fast); }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink-950);
  letter-spacing: -0.02em;
  font-weight: 500;
  line-height: 1.08;
  margin: 0 0 0.5em;
  font-optical-sizing: auto;
}
h2 { font-size: clamp(1.9rem, 1.3rem + 2vw, 2.6rem); }
h3 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.7rem); }
p { margin: 0 0 1.5em; }

/* Kicker — the editorial signal. Mono, tracked, accent-tinted. */
.kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--kicker-size);
  letter-spacing: var(--kicker-tracking);
  text-transform: uppercase;
  font-weight: 500;
  color: var(--accent);
}
.kicker--muted { color: var(--ink-500); }

/* Legacy alias kept so any stray {{overline}} usage still renders on-brand */
.overline { display: inline-block; font-family: var(--font-mono); font-size: var(--kicker-size);
  letter-spacing: var(--kicker-tracking); text-transform: uppercase; font-weight: 500; color: var(--accent); }

/* ---------- Layout ---------- */
.container { max-width: var(--container-max); margin: 0 auto; padding: 0 32px; }
.container-narrow { max-width: var(--measure-read); margin: 0 auto; padding: 0 32px; }

/* ---------- Site header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--ink-100);
}
.site-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 76px; gap: 32px;
}
.site-brand {
  font-family: var(--font-body);
  font-weight: 800; letter-spacing: 0.26em; font-size: 15px;
  text-transform: uppercase; color: var(--ink-950);
}
.site-nav { display: flex; gap: 30px; align-items: center; }
.site-nav ul { list-style: none; padding: 0; margin: 0; display: flex; gap: 30px; align-items: center; }
.site-nav li { line-height: 1; }
.site-nav a {
  font-size: 14px; font-weight: 500; color: var(--ink-700);
  position: relative; padding: 4px 0;
}
.site-nav a:hover { color: var(--ink-950); }
/* Active nav state — one of the few sanctioned accent uses */
.site-nav .nav-current a,
.site-nav a.active { color: var(--ink-950); }
.site-nav .nav-current a::after,
.site-nav a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2px; background: var(--accent);
}
.subscribe-btn {
  padding: 10px 22px; border-radius: 999px;
  background: var(--accent); color: #fff !important;
  font-size: 14px; font-weight: 600; letter-spacing: 0.01em;
  transition: background var(--tx-fast), transform var(--tx-fast);
}
.subscribe-btn:hover { background: var(--accent-hover); transform: translateY(-1px); }

/* ---------- Mobile nav toggle + panel ---------- */
.site-nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  padding: 10px;
  margin: -10px -10px -10px 0;
  cursor: pointer;
  line-height: 0;
}
.site-nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink-950);
  margin: 5px 0;
  transition: transform 180ms ease, opacity 180ms ease;
}
.site-header-open .site-nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header-open .site-nav-toggle-bar:nth-child(2) { opacity: 0; }
.site-header-open .site-nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.site-mobile-nav {
  display: none;
  border-top: 1px solid color-mix(in srgb, var(--ink-950) 8%, transparent);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  max-height: 0;
  overflow: hidden;
  transition: max-height 220ms ease;
}
.site-mobile-nav .container { padding-top: 8px; padding-bottom: 20px; }
.site-mobile-nav ul { list-style: none; padding: 0; margin: 0; }
.site-mobile-nav li { border-bottom: 1px solid color-mix(in srgb, var(--ink-950) 6%, transparent); }
.site-mobile-nav li:last-child { border-bottom: 0; }
.site-mobile-nav a {
  display: block;
  padding: 16px 4px;
  font-family: var(--font-sans, 'Inter', sans-serif);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-800);
  text-decoration: none;
}
.site-mobile-nav a:hover { color: var(--ink-950); }
.site-mobile-nav .nav-current a,
.site-mobile-nav a.active { color: var(--accent); }
.subscribe-btn-mobile {
  display: block;
  margin-top: 14px;
  text-align: center;
  padding: 12px 20px !important;
}
.site-header-open .site-mobile-nav { display: block; max-height: 480px; }
body.site-nav-open { overflow: hidden; }

/* ---------- Hero (home) ---------- */
.hero {
  padding: clamp(96px, 12vw, 168px) 0 clamp(120px, 14vw, 180px);
}
.hero-inner { max-width: 940px; }
.hero .kicker { margin-bottom: 28px; }
.hero-title {
  font-size: var(--text-hero);
  letter-spacing: -0.03em; line-height: 0.98;
  margin: 0 0 28px; max-width: 15ch;
}
/* The single hero accent element */
.hero-title .accent { color: var(--accent); font-style: italic; }
.hero-dek {
  font-family: var(--font-body);
  font-size: var(--text-dek); line-height: 1.5; font-weight: 400;
  color: var(--ink-700); max-width: 46ch; margin: 0 0 36px;
}
.hero-cta {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 28px; border-radius: 999px;
  background: var(--accent); color: #fff;
  font-weight: 600; font-size: 15px;
  transition: background var(--tx-fast), transform var(--tx-fast);
}
.hero-cta:hover { background: var(--accent-hover); color: #fff; transform: translateY(-1px); }
.hero-cta .arrow { transition: transform var(--tx-fast); }
.hero-cta:hover .arrow { transform: translateX(3px); }

/* Section head (Latest / Read next) */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 24px; margin-bottom: 40px;
  padding-bottom: 20px; border-bottom: 1px solid var(--ink-100);
}
.section-head h2 { font-size: 1.4rem; margin: 0; letter-spacing: -0.01em; }
.section-head .kicker { color: var(--ink-500); }

/* ---------- Post grid + borderless cards ---------- */
.post-grid {
  display: grid; gap: 56px 40px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.feed { padding: 0 0 clamp(96px, 12vw, 160px); }
.feed-gap { height: clamp(120px, 14vw, 180px); }  /* hero → cards breathing room */

.post-card { display: flex; flex-direction: column; gap: 18px; }
.post-card-image {
  display: block; overflow: hidden; border-radius: var(--radius-md);
  aspect-ratio: 16 / 10; background: var(--surface-raised);
}
.post-card-image img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}
.post-card:hover .post-card-image img { transform: scale(1.035); }
.post-card-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 0.6875rem; /* 11px */
  letter-spacing: 0.06em; color: var(--ink-500);
}
.post-card-meta .sep { color: var(--ink-300); }
/* Kicker (tag) — mono, accent, tracked ≥0.08em, 11–13px */
.post-card-kicker {
  font-family: var(--font-mono); font-size: 0.75rem;
  letter-spacing: 0.1em; text-transform: uppercase; font-weight: 500;
  color: var(--accent);
}
.post-card-title {
  font-family: var(--font-display);
  font-size: 1.5rem; line-height: 1.14; font-weight: 500;
  letter-spacing: -0.015em; margin: 0; color: var(--ink-950);
}
.post-card-title a { color: inherit; }
.post-card-title a:hover { color: var(--ink-800); }
.post-card-excerpt {
  color: var(--ink-700); font-size: 0.9375rem; line-height: 1.6; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* Feature card — first in the HOME feed only, editorial split */
.post-grid--home > .post-card:first-child {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: 1.25fr 1fr; gap: 52px; align-items: center;
}
.post-grid--home > .post-card:first-child .post-card-title {
  font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); line-height: 1.06;
}
.post-grid--home > .post-card:first-child .post-card-excerpt {
  font-size: 1.0625rem; -webkit-line-clamp: 3;
}
@media (max-width: 860px) {
  .post-grid--home > .post-card:first-child { grid-template-columns: 1fr; gap: 20px; }
  .post-grid--home > .post-card:first-child .post-card-title { font-size: clamp(1.75rem, 6vw, 2.25rem); }
}

/* ---------- Archive masthead (author / tag) ---------- */
.masthead { padding: clamp(88px, 11vw, 140px) 0 clamp(48px, 6vw, 72px); }
.masthead .kicker { margin-bottom: 22px; }
.masthead h1 { font-size: clamp(2.75rem, 1.6rem + 4vw, 4.25rem); letter-spacing: -0.03em; margin: 0 0 20px; }
.masthead-dek { font-size: var(--text-dek); color: var(--ink-700); max-width: 52ch; margin: 0; }
.masthead-avatar {
  width: 84px; height: 84px; border-radius: 50%; object-fit: cover;
  margin-bottom: 28px; border: 1px solid var(--ink-100);
}

/* ---------- Post (reading) ---------- */
.post-full { padding: clamp(72px, 9vw, 120px) 0 0; }
.post-full-header { max-width: 860px; margin: 0 auto clamp(40px, 5vw, 60px); text-align: center; }
.post-full-meta {
  display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.06em;
  color: var(--ink-500); margin-bottom: 26px;
}
.post-full-meta .sep { color: var(--ink-300); }
.post-full-title { font-size: var(--text-title); letter-spacing: -0.03em; line-height: 1.04; margin: 0 0 24px; }
.post-full-dek {
  font-family: var(--font-body); font-size: var(--text-dek); line-height: 1.5;
  color: var(--ink-700); max-width: 44ch; margin: 0 auto;
}
.post-full-image {
  max-width: 1080px; margin: 0 auto clamp(48px, 6vw, 72px);
  border-radius: var(--radius-lg); overflow: hidden;
}
.post-full-image figcaption {
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.04em;
  color: var(--ink-500); text-align: center; margin-top: 14px;
}

.post-full-content {
  max-width: var(--measure-read); margin: 0 auto;
  font-size: var(--text-body); line-height: 1.72; color: var(--ink-900);
}
.post-full-content > p:first-of-type::first-letter {
  float: left; font-family: var(--font-display); font-weight: 500;
  font-size: 3.6em; line-height: 0.82; padding: 0.02em 0.12em 0 0; color: var(--ink-950);
}
.post-full-content h2 { margin: 1.8em 0 0.5em; font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2rem); }
.post-full-content h3 { margin: 1.5em 0 0.5em; }
/* Body links — subtle underline, NOT accent color */
.post-full-content a {
  color: var(--ink-950);
  text-decoration: underline; text-decoration-color: var(--ink-300);
  text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.post-full-content a:hover { text-decoration-color: var(--ink-700); }
.post-full-content strong { color: var(--ink-950); font-weight: 600; }
.post-full-content hr { border: none; border-top: 1px solid var(--ink-100); margin: 3em 0; }
.post-full-content ul, .post-full-content ol { padding-left: 1.4em; margin: 0 0 1.5em; }
.post-full-content li { margin-bottom: 0.5em; }

/* Pull quotes — left-rule + Fraunces italic */
.post-full-content blockquote {
  margin: 2.2em 0; padding: 0.2em 0 0.2em 28px;
  border-left: var(--rule-width) solid var(--accent);
  font-family: var(--font-display); font-style: italic; font-weight: 400;
  font-size: 1.5rem; line-height: 1.4; color: var(--ink-950);
}
.post-full-content blockquote p:last-child { margin-bottom: 0; }

/* Code — JetBrains Mono, subtle contrast (not neon) */
.post-full-content pre {
  background: var(--surface-raised); color: var(--ink-800);
  border: 1px solid var(--ink-100); border-radius: var(--radius-md);
  padding: 22px 24px; overflow-x: auto;
  font-family: var(--font-mono); font-size: 0.875rem; line-height: 1.65;
  margin: 2em 0;
}
.post-full-content :not(pre) > code {
  font-family: var(--font-mono); font-size: 0.86em;
  background: var(--surface-raised); color: var(--ink-900);
  border: 1px solid var(--ink-100); padding: 1px 6px; border-radius: var(--radius-sm);
}
.post-full-content pre code { background: none; border: none; padding: 0; color: inherit; }

/* Tag chips */
.post-tags { display: flex; flex-wrap: wrap; gap: 10px; max-width: var(--measure-read);
  margin: clamp(40px, 5vw, 56px) auto 0; }
.post-tag-chip {
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-700);
  border: 1px solid var(--ink-100); border-radius: 999px; padding: 6px 14px;
}
.post-tag-chip:hover { color: var(--ink-950); border-color: var(--ink-300); }

/* Byline */
.post-author {
  display: flex; align-items: center; gap: 16px;
  max-width: var(--measure-read); margin: clamp(40px, 5vw, 56px) auto 0;
  padding-top: 36px; border-top: 1px solid var(--ink-100);
}
.post-author-avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.post-author-name { font-weight: 600; color: var(--ink-950); font-size: 0.95rem; }
.post-author-bio { font-size: 0.875rem; color: var(--ink-500); margin: 3px 0 0; line-height: 1.5; }

/* Read next */
.read-next { padding: clamp(88px, 11vw, 140px) 0 0; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--surface-sunken); color: var(--ink-500);
  padding: clamp(64px, 8vw, 96px) 0 40px; margin-top: clamp(96px, 12vw, 160px);
  border-top: 1px solid var(--ink-100);
}
.site-footer a { color: var(--ink-800); }
.site-footer a:hover { color: var(--ink-950); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 56px; margin-bottom: 48px; }
.footer-brand {
  font-family: var(--font-body); font-weight: 800; letter-spacing: 0.26em;
  font-size: 18px; color: var(--ink-950); margin-bottom: 16px; display: inline-block;
}
.footer-tagline { color: var(--ink-500); font-size: 15px; max-width: 34ch; line-height: 1.6; }
.footer-col h4 {
  font-family: var(--font-mono); font-size: 0.6875rem; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--ink-500); margin: 0 0 18px; font-weight: 500;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 11px; }
.footer-col a { font-size: 15px; }
.footer-bottom {
  border-top: 1px solid var(--ink-100); padding-top: 24px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.04em; color: var(--ink-500);
}

/* ---------- Subscribe form ---------- */
.subscribe-form { display: flex; gap: 10px; max-width: 460px; margin: 36px 0 0; }
.subscribe-form input {
  flex: 1; padding: 14px 18px;
  border: 1px solid var(--ink-100); border-radius: 999px;
  font-size: 15px; font-family: inherit;
  background: var(--surface-raised); color: var(--ink-950);
}
.subscribe-form input::placeholder { color: var(--ink-500); }
.subscribe-form input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-muted);  /* sanctioned accent: focus ring */
}
.subscribe-form button {
  padding: 14px 26px; background: var(--accent); color: #fff;
  border: none; border-radius: 999px; font-size: 15px; font-weight: 600; cursor: pointer;
  transition: background var(--tx-fast);
}
.subscribe-form button:hover { background: var(--accent-hover); }

/* ---------- Error ---------- */
.error-page { min-height: 66vh; display: flex; align-items: center; text-align: center; }
.error-code { font-family: var(--font-mono); font-size: 0.8125rem; letter-spacing: 0.2em;
  color: var(--accent); margin-bottom: 24px; }
.error-title { font-size: clamp(2.5rem, 1.5rem + 4vw, 4rem); margin: 0 0 20px; }
.error-dek { font-size: var(--text-dek); color: var(--ink-700); max-width: 44ch; margin: 0 auto 36px; }

/* ---------- Koenig editor cards (gscan-required) ---------- */
.post-full-content figure { margin: 2.4em 0; }
.post-full-content figure img { border-radius: var(--radius-md); }
.post-full-content figcaption {
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.04em;
  text-align: center; color: var(--ink-500); margin-top: 12px;
}
.kg-width-wide { position: relative; width: 92vw; max-width: 1080px; left: 50%; transform: translateX(-50%); }
.kg-width-full { position: relative; width: 100vw; max-width: 100vw; left: 50%; transform: translateX(-50%); }
.kg-width-wide img { width: 100%; border-radius: var(--radius-md); }
.kg-width-full img { width: 100%; border-radius: 0; }
.kg-bookmark-card { margin: 2.4em 0; }
.kg-bookmark-container {
  display: flex; min-height: 148px;
  border: 1px solid var(--ink-100); border-radius: var(--radius-md);
  overflow: hidden; text-decoration: none; color: var(--ink-900); background: var(--surface-raised);
  transition: border-color var(--tx-fast);
}
.kg-bookmark-container:hover { border-color: var(--ink-300); }
.kg-bookmark-content { flex: 1 1 auto; display: flex; flex-direction: column; padding: 20px 24px; }
.kg-bookmark-title { font-family: var(--font-body); font-weight: 600; font-size: 16px; color: var(--ink-950); line-height: 1.4; }
.kg-bookmark-description { margin-top: 8px; font-size: 14px; color: var(--ink-500); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kg-bookmark-metadata { display: flex; align-items: center; margin-top: 14px; font-size: 13px; color: var(--ink-700); }
.kg-bookmark-icon { width: 18px; height: 18px; margin-right: 8px; border-radius: 4px; }
.kg-bookmark-author::after { content: "•"; margin: 0 6px; color: var(--ink-300); }
.kg-bookmark-publisher { color: var(--ink-500); overflow: hidden; max-width: 240px; white-space: nowrap; text-overflow: ellipsis; }
.kg-bookmark-thumbnail { position: relative; min-width: 33%; max-height: 100%; }
.kg-bookmark-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 640px) { .kg-bookmark-thumbnail { display: none; } }

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  .container, .container-narrow { padding: 0 22px; }
  .site-nav { display: none; }
  .site-nav-toggle { display: block; }
  .post-grid { gap: 44px; }
  .footer-grid { grid-template-columns: 1fr; gap: 36px; }
  .post-full-content > p:first-of-type::first-letter { font-size: 3em; }
}
