/* ============================================================
   Synapt — Blog. Standalone static styles, matched to the main site.
   Self-hosted fonts, obsidian palette, CSS-only reading progress.
   ============================================================ */

/* ---- Fonts ---- */
@font-face {
  font-family: 'Clash Display';
  src: url('fonts/ClashDisplay-Variable.woff2') format('woff2');
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-latin-ext.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---- Tokens ---- */
:root {
  --ink: oklch(14% 0.02 265);
  --ink-2: oklch(10.5% 0.018 265);
  --surface: oklch(19% 0.03 265);
  --line: oklch(64% 0.03 265 / 0.16);
  --line-strong: oklch(70% 0.04 265 / 0.28);
  --text: oklch(96% 0 0);
  --text-dim: oklch(84% 0.012 265);
  --muted: oklch(72% 0.02 265);
  --accent: oklch(72% 0.19 250);
  --accent-2: oklch(78% 0.21 320);
  --hot: oklch(82% 0.18 72);
  --font-display: 'Clash Display', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --maxw: 1180px;
  --gutter: clamp(1.25rem, 0.4rem + 3vw, 3rem);
  --r-md: 14px;
  --r-lg: 22px;
  --r-pill: 999px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 320ms;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}
body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.01em;
  word-spacing: 0.07em;
  text-wrap: balance;
}
p {
  text-wrap: pretty;
}
a {
  color: inherit;
  text-decoration: none;
}
img,
svg {
  display: block;
  max-width: 100%;
}
ul,
ol {
  list-style: none;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
::selection {
  background: oklch(72% 0.19 250 / 0.32);
}
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.kicker::before {
  content: '';
  width: 2em;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
}
.accent-text {
  background: linear-gradient(100deg, var(--accent) 8%, var(--accent-2) 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---- Reading progress (CSS scroll-driven, no JS) ---- */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 100;
}
@supports (animation-timeline: scroll()) {
  .progress {
    animation: progress-grow linear;
    animation-timeline: scroll(root block);
  }
  @keyframes progress-grow {
    to {
      transform: scaleX(1);
    }
  }
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.9em 1.4em;
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: 0.9375rem;
  border: 1px solid transparent;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.btn:active {
  transform: translateY(1px);
}
.btn--hot {
  background: var(--hot);
  color: oklch(20% 0.04 60);
  box-shadow: 0 8px 38px -10px oklch(82% 0.18 72 / 0.55);
}
.btn--hot:hover {
  transform: translateY(-2px);
}
.btn--ghost {
  background: oklch(100% 0 0 / 0.04);
  border-color: var(--line-strong);
}
.btn--ghost:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* ---- Nav ---- */
.bnav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  background: oklch(11% 0.02 265 / 0.72);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.bnav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 70px;
}
.bnav__logo {
  height: 25px;
  width: auto;
}
.bnav__links {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.2vw, 1.9rem);
  margin-left: auto;
}
.bnav__links a {
  font-size: 0.9375rem;
  color: var(--muted);
  transition: color var(--dur) var(--ease);
}
.bnav__links a:hover,
.bnav__links a[aria-current] {
  color: var(--text);
}
.bnav__cta {
  padding: 0.65em 1.1em;
}
@media (max-width: 820px) {
  .bnav__links {
    display: none;
  }
}

/* ---- Blog hero ---- */
.bhero {
  position: relative;
  padding-top: clamp(8rem, 16vh, 11rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
  overflow: hidden;
  isolation: isolate;
}
.bhero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 80% at 80% 0%, oklch(72% 0.19 250 / 0.16), transparent 55%),
    url('blog-fog.webp') center/cover no-repeat;
  opacity: 0.5;
  mask-image: linear-gradient(180deg, #000 30%, transparent 100%);
}
.bhero__title {
  font-size: clamp(2.6rem, 1.2rem + 5.5vw, 5.5rem);
  margin: 0.8rem 0 0;
  letter-spacing: -0.02em;
}
.bhero__sub {
  margin-top: 1.1rem;
  max-width: 48ch;
  color: var(--muted);
  font-size: clamp(1.05rem, 1rem + 0.5vw, 1.35rem);
}

/* ---- Post grid ---- */
.posts {
  padding-bottom: clamp(4rem, 8vw, 7rem);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1.2rem, 2vw, 1.8rem);
}
.pcard {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--surface) 0%, var(--ink-2) 100%);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.pcard:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
}
.pcard--feature {
  grid-column: 1 / -1;
  flex-direction: row;
}
.pcard__media {
  position: relative;
  overflow: hidden;
  background: var(--ink-2);
}
.pcard--feature .pcard__media {
  flex: 1 1 46%;
  min-height: 320px;
}
.pcard__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}
.pcard:hover .pcard__media img {
  transform: scale(1.05);
}
.pcard__body {
  padding: clamp(1.4rem, 2.4vw, 2.1rem);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  flex: 1;
}
.pcard--feature .pcard__body {
  justify-content: center;
  flex: 1 1 54%;
}
.pcard__meta {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--muted);
}
.tag {
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  background: oklch(72% 0.19 250 / 0.12);
  padding: 0.35em 0.75em;
  border-radius: var(--r-pill);
}
.tag--soon {
  color: var(--hot);
  background: oklch(82% 0.18 72 / 0.12);
}
.pcard__title {
  font-size: clamp(1.3rem, 1rem + 1.2vw, 1.9rem);
}
.pcard--feature .pcard__title {
  font-size: clamp(1.6rem, 1rem + 2vw, 2.6rem);
}
.pcard__excerpt {
  color: var(--muted);
  font-size: 0.975rem;
  line-height: 1.6;
}
.pcard__more {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  transition: gap var(--dur) var(--ease);
}
.pcard:hover .pcard__more {
  gap: 0.8em;
}
.pcard--soon {
  opacity: 0.92;
}
.pcard__stretch {
  position: absolute;
  inset: 0;
}

@media (max-width: 760px) {
  .posts {
    grid-template-columns: 1fr;
  }
  .pcard--feature {
    flex-direction: column;
  }
  .pcard--feature .pcard__media {
    min-height: 210px;
  }
}

/* ---- Article ---- */
.article {
  padding-top: clamp(7rem, 13vh, 9rem);
  padding-bottom: clamp(4rem, 8vw, 7rem);
}
.article__head {
  max-width: 760px;
  margin: 0 auto clamp(2rem, 4vw, 3rem);
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1.6rem;
  transition: color var(--dur) var(--ease);
}
.back-link:hover {
  color: var(--accent);
}
.article__title {
  font-size: clamp(2.1rem, 1.2rem + 3.8vw, 3.7rem);
  margin: 0.9rem 0 1.1rem;
  letter-spacing: -0.016em;
}
.article__lead {
  font-size: clamp(1.1rem, 1rem + 0.6vw, 1.4rem);
  color: var(--text-dim);
  line-height: 1.55;
}
.article__meta {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-top: 1.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  color: var(--muted);
}
.article__author {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  color: var(--text-dim);
  font-weight: 500;
}
.avatar {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: oklch(18% 0.04 265);
  background: radial-gradient(circle at 35% 30%, #dbe8ff, var(--accent) 60%);
}
.dot-sep::before {
  content: '·';
  margin-right: 0.7rem;
  color: var(--line-strong);
}

/* TOC */
.toc {
  max-width: 760px;
  margin: 0 auto clamp(2rem, 4vw, 3rem);
  padding: clamp(1.3rem, 2.5vw, 1.8rem) clamp(1.4rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, oklch(72% 0.19 250 / 0.07), transparent);
}
.toc__label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9rem;
}
.toc ol {
  counter-reset: toc;
  display: grid;
  gap: 0.55rem;
}
.toc li {
  counter-increment: toc;
}
.toc a {
  display: flex;
  gap: 0.7rem;
  color: var(--text-dim);
  font-size: 0.95rem;
  transition: color var(--dur) var(--ease);
}
.toc a::before {
  content: counter(toc, decimal-leading-zero);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.85rem;
}
.toc a:hover {
  color: var(--text);
}

/* Prose */
.prose {
  max-width: 720px;
  margin: 0 auto;
}
.prose > * + * {
  margin-top: 1.3rem;
}
.prose h2 {
  font-size: clamp(1.6rem, 1.1rem + 1.8vw, 2.2rem);
  margin-top: 3rem;
  scroll-margin-top: 90px;
}
.prose h3 {
  font-size: clamp(1.2rem, 1rem + 1vw, 1.5rem);
  margin-top: 2rem;
  color: var(--text);
}
.prose p,
.prose li {
  color: var(--text-dim);
  font-size: 1.075rem;
  line-height: 1.75;
}
.prose strong {
  color: var(--text);
  font-weight: 600;
}
.prose ul {
  display: grid;
  gap: 0.8rem;
}
.prose ul li {
  position: relative;
  padding-left: 1.6rem;
}
.prose ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}
.prose ul li strong {
  color: var(--text);
}

/* Callout */
.callout {
  margin-top: 1.6rem;
  padding: 1.3rem 1.5rem;
  border-left: 2px solid var(--hot);
  background: oklch(82% 0.18 72 / 0.07);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}
.callout strong {
  color: var(--text);
}

/* In-article CTA */
.article-cta {
  max-width: 760px;
  margin: clamp(3rem, 6vw, 4.5rem) auto 0;
  padding: clamp(1.8rem, 4vw, 3rem);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  background:
    radial-gradient(100% 120% at 100% 0%, oklch(78% 0.21 320 / 0.14), transparent 60%),
    linear-gradient(160deg, oklch(72% 0.19 250 / 0.12), transparent);
}
.article-cta h3 {
  font-size: clamp(1.4rem, 1rem + 1.6vw, 2rem);
  margin-bottom: 0.7rem;
}
.article-cta p {
  color: var(--text-dim);
  margin-bottom: 1.5rem;
  max-width: 46ch;
}

/* Related */
.related {
  max-width: 760px;
  margin: clamp(3rem, 6vw, 4.5rem) auto 0;
}
.related__label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.2rem;
}
.related__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.related__item {
  padding: 1.3rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--ink-2);
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.related__item:hover {
  border-color: var(--line-strong);
  transform: translateY(-3px);
}
.related__item span {
  font-size: 0.75rem;
  color: var(--hot);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.related__item h4 {
  margin-top: 0.5rem;
  font-size: 1.05rem;
}
@media (max-width: 560px) {
  .related__grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Newsletter ---- */
.newsletter {
  padding-block: clamp(3rem, 6vw, 5rem);
  text-align: center;
  border-top: 1px solid var(--line);
}
.newsletter h2 {
  font-size: clamp(1.7rem, 1rem + 2.4vw, 2.8rem);
}
.newsletter p {
  margin: 0.9rem auto 1.8rem;
  color: var(--muted);
  max-width: 40ch;
}

/* ---- Footer ---- */
.bfooter {
  border-top: 1px solid var(--line);
  padding-block: clamp(3rem, 6vw, 4.5rem) 2rem;
}
.bfooter__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2.5rem;
}
.bfooter__logo {
  height: 28px;
  width: auto;
}
.bfooter__blurb {
  margin-top: 1rem;
  color: var(--muted);
  max-width: 38ch;
  font-size: 0.9375rem;
}
.bfooter__col {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.bfooter__col a,
.bfooter__company {
  color: var(--muted);
  font-size: 0.9375rem;
  width: max-content;
}
.bfooter__col a:hover {
  color: var(--text);
}
.bfooter__company {
  line-height: 1.5;
}
.bfooter__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--muted);
}
@media (max-width: 680px) {
  .bfooter__grid {
    grid-template-columns: 1fr;
    gap: 1.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition-duration: 0.001ms !important;
  }
}
