/* ============================================================
   Cuevia — Journal / blog stylesheet
   Shared across the listing, article and topic templates.
   Mirrors the coming-soon design system (index.html).
   ============================================================ */

:root {
  /* Brand neutrals */
  --bg: #FAF7F2;
  --bgWarm: #F4EFE7;
  --surface: #FFFFFF;
  --hairline: #ECE7DD;
  --hairline2: #E3DDD0;
  --mute2: #9A9BA1;
  --muted: #6E6F76;
  --ink2: #3A3B40;
  --ink: #1F2024;

  /* Accents */
  --lavender: #B7A8D1;
  --lavenderSoft: #EFEAF4;
  --mint: #A9CDB7;
  --mintSoft: #E8F1EC;
  --sand: #D9C7A7;
  --sandSoft: #F4EDDF;

  --accent: var(--mint);
  --accentSoft: var(--mintSoft);

  --font-sans: "Inter Tight", system-ui, -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Reading measure for article body */
  --measure: 68ch;
  --radius: 14px;
  --radius-lg: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

/* Accessibility: skip link */
.skip-link {
  position: absolute; left: -999px; top: 8px;
  background: var(--ink); color: var(--bg); padding: 10px 16px;
  border-radius: 999px; z-index: 100; font-size: 14px;
}
.skip-link:focus { left: 16px; }

/* ---------- Layout shell ---------- */
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 40px; }
.wrap-narrow { max-width: 760px; }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in oklab, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.1) blur(12px);
  border-bottom: 1px solid var(--hairline);
}
.site-header .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}
.brand-mark { width: 34px; height: 34px; color: var(--ink); flex-shrink: 0; }
.brand-name { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.brand-name sup { font-size: 9px; color: var(--muted); margin-left: 2px; top: -0.7em; position: relative; }

.nav {
  display: inline-flex;
  align-items: center;
  gap: 28px;
}
.nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 15px;
  transition: color .15s ease;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav .btn-join {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink); color: var(--bg);
  padding: 9px 16px; border-radius: 999px;
  font-size: 14px; font-weight: 500;
  transition: background .18s ease;
}
.nav .btn-join:hover { background: var(--ink2); color: var(--bg); }
.nav-toggle { display: none; }

/* ============================================================
   Generic bits
   ============================================================ */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink2);
  text-decoration: none;
  padding: 8px 0;
  min-height: 44px;
}
.tag .tdot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.tag.t-plan .tdot    { background: var(--mint); }
.tag.t-cue .tdot     { background: var(--lavender); }
.tag.t-biz .tdot     { background: var(--sand); }
.tag.t-product .tdot { background: var(--ink2); }
.tag.t-reform .tdot  { background: var(--sand); }
.tag.t-prin .tdot    { background: var(--lavender); }
.tag.t-lib .tdot     { background: var(--mint); }
a.tag:hover { color: var(--ink); }

.dotsep { color: var(--mute2); padding: 0 8px; }

/* ============================================================
   Listing / index
   ============================================================ */
.journal-head {
  padding: 64px 0 16px;
}
.journal-head h1 {
  font-size: clamp(40px, 5.2vw, 68px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.0;
  margin: 18px 0 0;
}
.journal-head .lede {
  margin: 22px 0 0;
  max-width: 580px;
  color: var(--muted);
  font-size: 18.5px;
  line-height: 1.55;
  text-wrap: pretty;
}

/* topic filter row */
.topics-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 32px 0 8px;
  border-bottom: 1px solid var(--hairline);
}
.topic-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--hairline2);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink2);
  font-size: 14px;
  text-decoration: none;
  transition: border-color .15s ease, color .15s ease;
}
.topic-chip:hover { border-color: var(--ink2); color: var(--ink); }
.topic-chip[aria-current="page"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.topic-chip .cdot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* Featured post */
.featured {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 44px;
  align-items: center;
  padding: 48px 0;
  border-bottom: 1px solid var(--hairline);
}
.featured .feat-media { width: 100%; }
.post-figure {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bgWarm);
  border: 1px solid var(--hairline);
  aspect-ratio: 16 / 11;
}
.post-figure .ph-wash {
  position: absolute; inset: 0;
  background:
    radial-gradient(420px 320px at 78% 12%, var(--accentSoft) 0%, transparent 60%),
    radial-gradient(360px 320px at 8% 96%, var(--bgWarm) 0%, transparent 64%);
}
.post-figure .ph-motif { position: absolute; inset: 0; width: 100%; height: 100%; }
.post-figure img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.featured .feat-body h2 {
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.08;
  margin: 16px 0 0;
}
.featured .feat-body h2 a { text-decoration: none; }
.featured .feat-body h2 a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.featured .feat-body .excerpt {
  margin: 16px 0 0; color: var(--muted); font-size: 17px; line-height: 1.55; max-width: 48ch;
  text-wrap: pretty;
}
.meta-row {
  display: inline-flex; align-items: center; flex-wrap: wrap;
  margin-top: 22px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* Grid of cards */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 36px;
  padding: 52px 0 8px;
}
.card { display: flex; flex-direction: column; }
.card .post-figure { aspect-ratio: 16 / 10; margin-bottom: 18px; }
.card h3 {
  font-size: 21px; font-weight: 600; letter-spacing: -0.018em; line-height: 1.18;
  margin: 12px 0 0;
}
.card h3 a { text-decoration: none; }
.card h3 a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.card .excerpt { margin: 10px 0 0; color: var(--muted); font-size: 15px; line-height: 1.5; text-wrap: pretty; }
.card .meta-row { margin-top: 14px; font-size: 11.5px; }

/* ============================================================
   CTA band (waitlist)
   ============================================================ */
.cta-band {
  margin: 72px 0 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--hairline);
  background: var(--surface);
  padding: 48px 48px;
  position: relative;
  overflow: hidden;
}
.cta-band::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(620px 360px at 100% 0%, var(--accentSoft) 0%, transparent 58%);
}
.cta-band .inner { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.cta-band h2 { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; margin: 10px 0 0; }
.cta-band p { color: var(--muted); margin: 10px 0 0; font-size: 16px; max-width: 42ch; }
.cta-form { display: flex; gap: 10px; flex-wrap: wrap; }
.cta-field {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border: 1px solid var(--hairline2); border-radius: 999px;
  padding: 0 18px; height: 52px; min-width: 240px;
}
.cta-field input { border: 0; outline: 0; background: transparent; font: inherit; font-size: 15.5px; color: var(--ink); width: 100%; }
.cta-field input::placeholder { color: var(--mute2); }
.btn-primary {
  display: inline-flex; align-items: center; gap: 9px;
  height: 52px; padding: 0 22px; border-radius: 999px; border: 0;
  background: var(--ink); color: var(--bg); font: inherit; font-size: 15px; font-weight: 500;
  cursor: pointer; white-space: nowrap; transition: background .18s ease, transform .12s ease;
  text-decoration: none;
}
.btn-primary:hover { background: var(--ink2); }
.btn-primary:active { transform: translateY(1px); }

/* ============================================================
   Article
   ============================================================ */
.breadcrumb {
  padding: 28px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.breadcrumb a { text-decoration: none; color: var(--muted); }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb .sep { color: var(--mute2); }

.article-head { padding: 28px 0 8px; }
.article-head h1 {
  font-size: clamp(34px, 4.6vw, 58px);
  font-weight: 600;
  letter-spacing: -0.032em;
  line-height: 1.04;
  margin: 18px 0 0;
  text-wrap: balance;
}
.article-head .dek {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.5;
  max-width: 60ch;
  text-wrap: pretty;
}
.byline {
  display: flex; align-items: center; gap: 14px;
  margin: 28px 0 0;
  padding: 20px 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.byline .avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--accentSoft); color: var(--ink2);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 16px; flex-shrink: 0;
}
.byline .who { font-size: 14.5px; }
.byline .who .name { font-weight: 600; color: var(--ink); }
.byline .who .meta { color: var(--muted); font-family: var(--font-mono); font-size: 12px; margin-top: 3px; letter-spacing: 0.02em; }
.byline .share { margin-left: auto; display: inline-flex; gap: 6px; }
.byline .share a {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--hairline2); color: var(--ink2); text-decoration: none;
  transition: border-color .15s ease, color .15s ease;
}
.byline .share a:hover { border-color: var(--ink2); color: var(--ink); }

.article-hero { margin: 36px 0 8px; }
.article-hero .post-figure { aspect-ratio: 16 / 8.4; border-radius: var(--radius-lg); }
.article-hero figcaption { margin-top: 12px; font-size: 13px; color: var(--muted); font-family: var(--font-mono); letter-spacing: 0.02em; }

/* Layout: body + sticky TOC */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 232px;
  gap: 56px;
  align-items: start;
  padding: 40px 0 0;
}
.toc {
  position: sticky;
  top: 92px;
  font-size: 14px;
}
.toc .toc-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute2);
  margin-bottom: 14px;
}
.toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.toc a {
  display: block;
  text-decoration: none;
  color: var(--muted);
  padding: 7px 0 7px 14px;
  border-left: 2px solid var(--hairline2);
  line-height: 1.35;
  transition: color .15s ease, border-color .15s ease;
}
.toc a:hover { color: var(--ink2); }
.toc a.active { color: var(--ink); border-color: var(--accent); font-weight: 500; }

/* Prose */
.prose { font-size: 18px; line-height: 1.72; color: var(--ink2); max-width: var(--measure); }
.prose > * + * { margin-top: 1.5em; }
.prose h2 {
  font-size: 28px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15;
  color: var(--ink); margin-top: 2em; scroll-margin-top: 92px;
}
.prose h3 {
  font-size: 21px; font-weight: 600; letter-spacing: -0.015em;
  color: var(--ink); margin-top: 1.6em; scroll-margin-top: 92px;
}
.prose p { text-wrap: pretty; }
.prose a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--hairline2); text-underline-offset: 3px; text-decoration-thickness: 2px; transition: text-decoration-color .15s ease; }
.prose a:hover { text-decoration-color: var(--accent); }
.prose a.btn-primary { color: var(--bg); text-decoration: none; }
.prose a.btn-primary:hover { color: var(--bg); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-top: 0.5em; padding-left: 0.3em; }
.prose li::marker { color: var(--mute2); }
.prose blockquote {
  margin: 1.8em 0;
  padding: 4px 0 4px 26px;
  border-left: 3px solid var(--accent);
  font-size: 22px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-weight: 500;
}
.prose figure { margin: 2em 0; }
.prose figure .post-figure { aspect-ratio: 16 / 9; }
.prose figcaption { margin-top: 12px; font-size: 13.5px; color: var(--muted); font-family: var(--font-mono); letter-spacing: 0.02em; }
.prose hr { border: 0; border-top: 1px solid var(--hairline); margin: 2.4em 0; }
.prose code {
  font-family: var(--font-mono); font-size: 0.86em;
  background: var(--bgWarm); padding: 2px 6px; border-radius: 6px; color: var(--ink);
}
.prose .lead { font-size: 21px; line-height: 1.6; color: var(--ink2); }

/* Key-takeaway callout */
.callout {
  margin: 2em 0;
  border: 1px solid var(--hairline);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px 26px;
}
.callout .callout-label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); display: inline-flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.callout .callout-label .cdot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.callout ul { margin: 0; padding-left: 1.2em; }
.callout li { margin-top: 8px; }

/* Inline mid-article CTA */
.inline-cta {
  margin: 2.4em 0;
  border-radius: var(--radius);
  background: var(--bgWarm);
  border: 1px solid var(--hairline);
  padding: 26px 28px;
  display: flex; align-items: center; gap: 24px; justify-content: space-between; flex-wrap: wrap;
}
.inline-cta .ic-text { font-size: 16px; color: var(--ink2); max-width: 46ch; }
.inline-cta .ic-text strong { color: var(--ink); }
.inline-cta a.btn-primary { height: 46px; }

/* Article footer: tags + author card */
.article-foot { padding: 40px 0 0; }
.article-foot .tag-list { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 32px; border-bottom: 1px solid var(--hairline); }
.pill-tag {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border: 1px solid var(--hairline2); border-radius: 999px;
  font-size: 13px; color: var(--ink2); text-decoration: none;
}
.pill-tag:hover { border-color: var(--ink2); color: var(--ink); }

.author-card {
  display: flex; gap: 18px; align-items: flex-start;
  padding: 32px 0;
  border-bottom: 1px solid var(--hairline);
}
.author-card .avatar { width: 56px; height: 56px; font-size: 20px; }
.author-card .a-name { font-weight: 600; font-size: 17px; }
.author-card .a-role { color: var(--muted); font-family: var(--font-mono); font-size: 12px; margin-top: 4px; letter-spacing: 0.02em; }
.author-card .a-bio { margin-top: 12px; color: var(--muted); font-size: 15px; line-height: 1.55; max-width: 60ch; }

/* Related posts */
.related { padding: 56px 0 0; }
.related h2 { font-size: 14px; font-family: var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0 0 28px; }
.related-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 36px; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  margin-top: 96px;
  border-top: 1px solid var(--hairline);
  background: var(--bgWarm);
}
.site-footer .f-top {
  display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap;
  padding: 56px 0 40px;
}
.site-footer .f-brand { max-width: 320px; }
.site-footer .f-brand p { color: #5C5D64; font-size: 14.5px; line-height: 1.55; margin: 16px 0 0; }
.f-cols { display: flex; gap: 64px; flex-wrap: wrap; }
.f-col h4, .f-col .f-heading { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: #5C5D64; margin: 0 0 16px; font-weight: 500; }
.f-col a { display: block; text-decoration: none; color: var(--ink2); font-size: 14.5px; margin-top: 10px; transition: color .15s ease; }
.f-col a:hover { color: var(--ink); }
.site-footer .f-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 24px 0 40px;
  border-top: 1px solid var(--hairline);
  font-family: var(--font-mono); font-size: 12px; color: #5C5D64; letter-spacing: 0.03em;
}
.site-footer .socials { display: inline-flex; gap: 6px; }
.site-footer .socials a {
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--hairline2); border-radius: 50%; color: var(--ink2); text-decoration: none;
  transition: border-color .15s ease, color .15s ease;
}
.site-footer .socials a:hover { border-color: var(--ink2); color: var(--ink); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 960px) {
  .article-layout { grid-template-columns: 1fr; gap: 0; }
  .toc { display: none; }
  .featured { grid-template-columns: 1fr; gap: 24px; }
  .featured .feat-media { order: -1; }
  .post-grid { grid-template-columns: repeat(2, 1fr); gap: 36px 28px; }
  .related-grid { gap: 28px; }
}
@media (max-width: 720px) {
  .wrap { padding: 0 22px; }
  .nav { gap: 18px; }
  .nav a.nav-link { display: none; }
  .journal-head { padding: 44px 0 8px; }
  .post-grid { grid-template-columns: 1fr; gap: 36px; }
  .related-grid { grid-template-columns: 1fr; }
  .cta-band { padding: 32px 26px; }
  .cta-band .inner { flex-direction: column; align-items: flex-start; gap: 22px; }
  .prose { font-size: 17px; }
  .prose blockquote { font-size: 20px; }
  .inline-cta { flex-direction: column; align-items: flex-start; }
  .byline .share { display: none; }
}
@media (max-width: 480px) {
  .cta-field { min-width: 0; width: 100%; }
  .cta-form { width: 100%; }
  .cta-form .btn-primary { width: 100%; justify-content: center; }
}

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