/* adtechgent – Ghost theme of blog.carlos.ec. Magazine start page (hero, daily news, weekly
   explainers, archive), reading grid for articles. Palette: mint #00FFD4, blue #5465FF, periwinkle
   #D2DDFF, ink #050208. Fonts: Geist Sans + Geist Mono, self-hosted from assets/fonts (font-src
   'self' in blog.caddy). No script, style or image leaves this origin. */

@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #050208;
  --mint: #00ffd4;
  --blue: #5465ff;
  --peri: #d2ddff;

  --canvas: #f4f6ff;
  --surface: #ffffff;
  --surface-2: #e9edff;
  --text: #050208;
  --muted: #4a5478;
  --border: #b9c4f0;
  --line: #dde3fa;
  --accent: #3c4ce6;          /* blue, darkened for small text on light */
  --accent-soft: #e6eaff;
  --brand: #5465ff;
  --glow: #00ffd4;
  --on-glow: #050208;
  --focus: #5465ff;
  --code-bg: #0d0b1e;
  --code-text: #e8ecff;
  --hero-bg: #050208;
  --hero-text: #ffffff;
  --hero-muted: #c3cbea;

  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --reading-size: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --measure: 66ch;
  --wide: 1080px;
  --page: 1240px;
  --gutter: clamp(16px, 4.5vw, 64px);
  --reading-grid:
    [full-start] minmax(var(--gutter), 1fr)
    [wide-start] minmax(0, calc((var(--wide) - var(--measure)) / 2))
    [main-start] min(var(--measure), calc(100% - 2 * var(--gutter)))
    [main-end] minmax(0, calc((var(--wide) - var(--measure)) / 2))
    [wide-end] minmax(var(--gutter), 1fr)
    [full-end];
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #050208;
  --surface: #0f0d1f;
  --surface-2: #171532;
  --text: #eef1ff;
  --muted: #a3acd6;
  --border: #33375c;
  --line: #1d1c38;
  --accent: #8a95ff;
  --accent-soft: #171a3d;
  --brand: #8a95ff;
  --glow: #00ffd4;
  --on-glow: #050208;
  --focus: #00ffd4;
  --code-bg: #0f0d1f;
  --code-text: #e8ecff;
  --hero-bg: #0f0d1f;
  --hero-text: #ffffff;
  --hero-muted: #a3acd6;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --canvas: #050208;
    --surface: #0f0d1f;
    --surface-2: #171532;
    --text: #eef1ff;
    --muted: #a3acd6;
    --border: #33375c;
    --line: #1d1c38;
    --accent: #8a95ff;
    --accent-soft: #171a3d;
    --brand: #8a95ff;
    --glow: #00ffd4;
    --on-glow: #050208;
    --focus: #00ffd4;
    --code-bg: #0f0d1f;
    --code-text: #e8ecff;
    --hero-bg: #0f0d1f;
    --hero-text: #ffffff;
    --hero-muted: #a3acd6;
  }
}

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

html {
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.6;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss02" 1, "calt" 1;
}

.site-main {
  flex: 1 0 auto;
}

img,
svg,
video {
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: inherit;
}

a,
button {
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection {
  background: var(--mint);
  color: var(--ink);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--glow);
  color: var(--on-glow);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.page-width {
  width: min(100% - 2 * var(--gutter), var(--page));
  margin-inline: auto;
}

/* Mono labels: eyebrows, dates, reading time. */

.eyebrow,
.mono {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--accent);
}

.eyebrow::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--glow);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--glow) 25%, transparent);
  content: "";
}

.eyebrow__link {
  color: inherit;
  text-decoration: none;
}

.eyebrow__link:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--canvas) 86%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 20px;
  width: min(100% - 2 * var(--gutter), var(--page));
  min-height: 64px;
  margin-inline: auto;
  padding-block: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-right: auto;
  color: var(--text);
  font-size: 1.125rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand__mark {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.brand__name em {
  color: var(--brand);
  font-style: normal;
}

.site-nav {
  order: 3;
  width: calc(100% + 2 * var(--gutter));
  margin-inline: calc(-1 * var(--gutter));
  padding-inline: var(--gutter);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.site-nav::-webkit-scrollbar {
  display: none;
}

.nav {
  display: flex;
  gap: 2px;
  margin: 0 0 0 -12px;
  padding: 0;
  list-style: none;
}

.nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
}

.nav__link:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav__link[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--glow);
  border-radius: 0;
}

.site-tools {
  display: flex;
  gap: 2px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.icon-button[hidden] {
  display: none;
}

.icon-button:hover {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

.icon {
  display: block;
  width: 20px;
  height: 20px;
}

.theme-toggle .icon--sun,
[data-theme="dark"] .theme-toggle .icon--moon {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon--sun {
  display: block;
}

@media (min-width: 768px) {
  .brand {
    margin-right: 12px;
  }

  .site-nav {
    order: 0;
    width: auto;
    margin: 0 auto 0 0;
    padding: 0;
    overflow: visible;
  }

  .nav {
    margin: 0;
  }
}

/* Masthead: the start page's h1, one quiet line that names the publication and what it covers. */

.masthead {
  margin-top: clamp(20px, 3.5vw, 40px);
}

.masthead__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.9375rem, 0.9rem + 0.2vw, 1.0625rem);
  font-weight: 450;
  letter-spacing: -0.005em;
  line-height: 1.45;
  text-wrap: pretty;
}

.masthead__name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 650;
  letter-spacing: -0.015em;
}

.masthead__name::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--glow);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--glow) 25%, transparent);
  content: "";
}

.masthead + .hero {
  margin-top: clamp(12px, 2vw, 20px);
}

/* Hero: newest post, dark tile with mint pulse, image to the right. */

.hero {
  margin-top: clamp(16px, 3vw, 32px);
}

.hero__card {
  position: relative;
  display: grid;
  gap: 24px;
  overflow: hidden;
  padding: clamp(20px, 4vw, 48px);
  border-radius: 24px;
  background: var(--hero-bg);
  color: var(--hero-text);
  text-decoration: none;
}

.hero__card::before {
  position: absolute;
  inset: auto -20% -60% auto;
  width: 60%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--blue) 55%, transparent), transparent 70%);
  content: "";
  pointer-events: none;
}

.hero__card::after {
  position: absolute;
  inset: -30% auto auto -10%;
  width: 40%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--mint) 22%, transparent), transparent 70%);
  content: "";
  pointer-events: none;
}

.hero__body,
.hero__media {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.hero__eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 0 0 18px;
  color: var(--hero-muted);
}

.hero__tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero__title {
  margin: 0;
  font-size: clamp(1.875rem, 1.2rem + 3vw, 3.5rem);
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1.04;
  text-wrap: balance;
}

.hero__excerpt {
  max-width: 52ch;
  margin: 18px 0 0;
  color: var(--hero-muted);
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.1875rem);
  line-height: 1.55;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  color: var(--mint);
  font-weight: 600;
}

.hero__cta .icon {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.hero__card:hover .hero__cta .icon {
  transform: translateX(4px);
}

.hero__media {
  order: -1;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 16px;
  background: var(--surface-2);
}

.hero__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.hero__card:hover .hero__media img {
  transform: scale(1.03);
}

.hero__media--empty {
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--blue) 70%, var(--ink)), color-mix(in srgb, var(--mint) 45%, var(--ink)));
}

.hero__media--empty svg {
  width: 40%;
  height: auto;
  opacity: 0.9;
}

@media (min-width: 860px) {
  .hero__card {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: center;
    gap: 48px;
  }

  .hero__media {
    order: 0;
  }
}

/* Sections on the start page. */

.section {
  padding-block: clamp(40px, 6vw, 72px) 0;
}

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--text);
}

.section__title {
  margin: 0;
  font-size: clamp(1.5rem, 1.2rem + 1.3vw, 2.25rem);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.section__title small {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.section__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

.section__more .icon {
  width: 16px;
  height: 16px;
}

.section__more:hover {
  color: var(--text);
}

.section__empty {
  margin: 0;
  padding-block: 24px;
  color: var(--muted);
}

/* Daily news: dense rows. */

.news {
  margin: 0;
  padding: 0;
  list-style: none;
}

.news__item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px 24px;
  padding-block: 18px;
  border-bottom: 1px solid var(--line);
}

.news__date {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.news__title {
  margin: 0;
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
  text-wrap: pretty;
}

.news__link {
  text-decoration: none;
}

.news__link::after {
  position: absolute;
  inset: 0;
  content: "";
}

.news__link:focus-visible {
  outline: none;
}

.news__link:focus-visible::after {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
  border-radius: 8px;
}

.news__item:hover .news__title {
  color: var(--accent);
}

.news__meta {
  color: var(--muted);
  font-size: 0.8125rem;
}

@media (min-width: 640px) {
  .news__item {
    grid-template-columns: 9ch minmax(0, 1fr) auto;
    align-items: baseline;
  }
}

/* Weekly explainers: card grid. */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 20px;
  margin: 0;
  padding: 24px 0 0;
  list-style: none;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}

.card:hover {
  border-color: var(--border);
}

.card__image {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  background: var(--surface-2);
  object-fit: cover;
}

.card__body {
  display: grid;
  gap: 8px;
  padding: 4px 6px 8px;
}

.card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.card__title {
  margin: 0;
  font-size: 1.1875rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-wrap: balance;
}

.card__link {
  text-decoration: none;
}

.card__link::after {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  content: "";
}

.card__link:focus-visible {
  outline: none;
}

.card__link:focus-visible::after {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.card:hover .card__title {
  color: var(--accent);
}

.card__excerpt {
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.55;
}

/* Archive header (tag, author, page 2+) */

.archive-header {
  padding-block: clamp(36px, 6vw, 72px) clamp(24px, 3vw, 40px);
  border-bottom: 1px solid var(--line);
}

.archive-header__title {
  margin: 0;
  font-size: clamp(2rem, 1.5rem + 2.5vw, 3.25rem);
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1.08;
  text-wrap: balance;
}

.archive-header__lede {
  max-width: 60ch;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.125rem;
  line-height: 1.55;
}

.archive-header__count {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 16px 0 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.archive-header__count a {
  color: var(--accent);
}

/* Post list (archive, tag, author). */

.post-list {
  padding-block: 8px 16px;
}

.post-list__empty {
  margin: 0;
  padding-block: 48px;
  color: var(--muted);
  font-size: 1.125rem;
}

.post-card {
  position: relative;
  display: grid;
  gap: 16px;
  padding-block: 28px;
  border-bottom: 1px solid var(--line);
}

.post-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin: 0 0 10px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.post-card__tag {
  color: var(--accent);
  font-weight: 600;
}

.post-card__title {
  margin: 0;
  font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.18;
  text-wrap: balance;
}

.post-card__link {
  text-decoration: none;
}

.post-card__link::after {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  content: "";
}

.post-card__link:focus-visible {
  outline: none;
}

.post-card__link:focus-visible::after {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

.post-card:hover .post-card__title {
  color: var(--accent);
}

.post-card__excerpt {
  max-width: 66ch;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.post-card__image {
  order: -1;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  background: var(--surface-2);
  object-fit: cover;
}

@media (min-width: 768px) {
  .post-card--image {
    grid-template-columns: minmax(0, 1fr) 260px;
    align-items: start;
    gap: 32px;
  }

  .post-card__image {
    order: 0;
  }
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 24px 56px;
  font-size: 0.9375rem;
}

.pagination__status {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.pagination__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 550;
  text-decoration: none;
}

.pagination__link:hover {
  border-color: var(--text);
}

.pagination__link .icon,
.post-nav__label .icon {
  width: 16px;
  height: 16px;
}

/* Article: named grid; text in "main" (66ch), wide cards and feature image in "wide", full edge to edge. */

.article,
.gh-content {
  overflow-wrap: anywhere;
  display: grid;
  grid-template-columns: var(--reading-grid);
}

.article {
  padding-top: clamp(32px, 6vw, 80px);
  font-size: var(--reading-size);
}

.article > * {
  grid-column: main;
  min-width: 0;
}

.article > .gh-content {
  grid-column: full;
}

.article__title {
  margin: 0;
  font-size: clamp(2rem, 1.4rem + 2.8vw, 3.5rem);
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1.06;
  text-wrap: balance;
}

.article__dek {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(1.125rem, 1.05rem + 0.4vw, 1.3125rem);
  line-height: 1.45;
}

.article__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin: 24px 0 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}

.article__meta > * + *::before {
  margin-right: 12px;
  color: var(--border);
  content: "/";
}

.article__author {
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 600;
  text-decoration: none;
}

.article__author:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.article__image {
  grid-column: wide;
  margin: 40px 0 0;
}

.article__image img {
  display: block;
  width: 100%;
  border-radius: 20px;
}

.article__image figcaption,
.gh-content figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.5;
  text-align: center;
}

.article__content {
  margin-top: 40px;
}

.article--page > .article__content:first-child,
.article--page > h1.visually-hidden + .article__content {
  margin-top: 0;
}

/* Body text. */

.gh-content {
  line-height: 1.7;
}

.gh-content > * {
  grid-column: main;
  min-width: 0;
  margin-block: 0;
}

.gh-content > * + * {
  margin-top: 1.25em;
}

.gh-content > .kg-width-wide {
  grid-column: wide;
}

.gh-content > .kg-width-full {
  grid-column: full;
}

.gh-content > .kg-card,
.gh-content > figure,
.gh-content > pre,
.gh-content > hr {
  margin-top: 2em;
}

.gh-content > .kg-card + *,
.gh-content > figure + *,
.gh-content > pre + * {
  margin-top: 2em;
}

.gh-content > :is(h2, h3, h4, h5, h6) {
  margin-top: 2em;
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.22;
  text-wrap: balance;
}

.gh-content > :is(h2, h3, h4, h5, h6) + * {
  margin-top: 0.6em;
}

.gh-content > h2 {
  font-size: 1.5em;
}

.gh-content > h3 {
  font-size: 1.25em;
}

.gh-content > :is(h4, h5, h6) {
  font-size: 1.05em;
}

.gh-content a:not([class]) {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.gh-content a:not([class]):hover {
  text-decoration-thickness: 2px;
}

.gh-content :is(ul, ol) {
  padding-left: 1.4em;
}

.gh-content li + li {
  margin-top: 0.4em;
}

.gh-content li::marker {
  color: var(--accent);
}

.gh-content strong {
  font-weight: 650;
}

.gh-content blockquote:not([class]),
.gh-content blockquote.kg-blockquote {
  margin-inline: 0;
  padding: 0.1em 0 0.1em 1.1em;
  border-left: 3px solid var(--glow);
  font-size: 1.1em;
}

.gh-content blockquote.kg-blockquote-alt {
  margin-inline: 0;
  padding: 0 1em;
  border: 0;
  color: var(--muted);
  font-size: 1.35em;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.4;
  text-align: center;
}

.gh-content hr {
  width: 100%;
  margin-block: 2.5em;
  border: 0;
  border-top: 1px solid var(--line);
}

.gh-content hr + * {
  margin-top: 0;
}

.gh-content :not(pre) > code {
  padding: 0.12em 0.4em;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.875em;
}

.gh-content pre {
  overflow-x: auto;
  padding: 18px 20px;
  border-radius: 14px;
  background: var(--code-bg);
  color: var(--code-text);
  font-family: var(--font-mono);
  font-size: 0.8125em;
  line-height: 1.6;
  tab-size: 2;
}

.gh-content pre code {
  font-family: inherit;
  font-size: inherit;
}

.gh-content figure {
  margin-inline: 0;
}

.gh-content .kg-image {
  display: block;
  margin-inline: auto;
  border-radius: 14px;
}

.gh-content .kg-width-wide .kg-image {
  width: 100%;
}

.gh-content .kg-width-full .kg-image {
  width: 100%;
  border-radius: 0;
}

.gh-content .kg-width-full figcaption {
  padding-inline: var(--gutter);
}

.gh-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.9em;
}

.gh-content :is(th, td) {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.gh-content th {
  font-family: var(--font-mono);
  font-size: 0.8em;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Ghost's card assets paint white with #222 text; follow the theme surfaces instead. */

.gh-content .kg-audio-card,
.gh-content .kg-bookmark-card a.kg-bookmark-container,
.gh-content .kg-bookmark-card a.kg-bookmark-container:hover,
.gh-content .kg-file-card a.kg-file-card-container,
.gh-content .kg-product-card-container {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

.gh-content .kg-audio-card,
.gh-content .kg-product-card-container {
  box-shadow: inset 0 0 0 1px var(--line);
}

.gh-content .kg-bookmark-card a.kg-bookmark-container:hover,
.gh-content .kg-file-card a.kg-file-card-container:hover {
  border-color: var(--border);
}

.gh-content .kg-audio-time {
  color: var(--muted);
}

.gh-content .kg-file-card-icon svg {
  color: var(--accent);
}

.gh-content .kg-callout-card {
  border-radius: 14px;
}

.gh-content .kg-button-card .kg-btn-accent,
.gh-content .kg-product-card-button {
  border-radius: 12px;
  font-weight: 600;
}

/* Tags, newer and older post. */

.article__footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

/* Author box: who stands behind the article (name, bio and website from Ghost's profile). */

.author-box {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-top: 32px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.author-box__image,
.author-box__mark {
  display: block;
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
}

.author-box__mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.author-box__body {
  min-width: 0;
}

.author-box__label {
  margin: 0 0 4px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.author-box__name {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.author-box__name a {
  color: inherit;
  text-decoration: none;
}

.author-box__name a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.author-box__bio {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.author-box__links {
  margin: 8px 0 0;
  font-size: 0.9375rem;
}

.author-box__links a {
  color: var(--accent);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tag-list__link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
}

.tag-list__link:hover {
  border-color: var(--text);
}

.post-nav {
  display: grid;
  gap: 12px;
  padding-block: 56px 64px;
}

.post-nav:not(:has(a)) {
  display: none;
}

.post-nav__link {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  text-decoration: none;
}

.post-nav__link:hover {
  border-color: var(--border);
}

.post-nav__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.post-nav__title {
  font-size: 1.125rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

@media (min-width: 768px) {
  .post-nav {
    grid-template-columns: 1fr 1fr;
  }

  .post-nav__link--older {
    grid-column: 2;
    align-items: flex-end;
    text-align: right;
  }
}

/* Error pages and the one button. */

.error {
  padding-block: clamp(64px, 12vw, 128px);
}

.error__title {
  margin: 0;
  font-size: clamp(2.25rem, 1.6rem + 3vw, 3.5rem);
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1.06;
}

.error__text {
  max-width: 50ch;
  margin: 16px 0 32px;
  color: var(--muted);
  font-size: 1.125rem;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 12px;
  background: var(--glow);
  color: var(--on-glow);
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  filter: brightness(0.92);
}

/* Footer. */

.site-footer {
  margin-top: 48px;
  border-top: 1px solid var(--line);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  width: min(100% - 2 * var(--gutter), var(--page));
  margin-inline: auto;
  padding-block: 24px calc(28px + env(safe-area-inset-bottom, 0px));
  color: var(--muted);
  font-size: 0.875rem;
}

.site-footer__copy {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.site-footer__copy svg {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-inline: -12px;
}

.site-footer .nav {
  flex-wrap: wrap;
  margin: 0;
}

.site-footer .nav__link {
  font-size: 0.875rem;
}

.article__jump {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 20px;
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}

.article__jump:hover {
  background: var(--surface);
  border-color: var(--glow);
}

/* Story deck: assets/js/deck.js turns the stories of a daily news post into a stack of cards on a
   sticky, viewport-high stage. Scroll down/swipe left advances; scroll up/swipe right returns
   (the section is taller than the stage by one step per story). A card opens
   into a reading view. Without JavaScript the linear article stays; print shows every card open. */

.gh-content > .deck {
  --deck-header: 0px;
  --deck-steps: 0;
  --deck-stage: calc(100svh - var(--deck-header));
  --deck-step: 55svh;
  grid-column: full;
  height: calc(var(--deck-stage) + var(--deck-steps) * var(--deck-step));
  margin-top: 2em;
  font-size: 1rem;
}

.gh-content > .deck + * {
  margin-top: 2.5em;
}

.deck__stage {
  position: sticky;
  top: var(--deck-header);
  display: flex;
  flex-direction: column;
  height: var(--deck-stage);
  padding: 12px var(--gutter) 16px;
  overflow: hidden;
  background: var(--canvas);
  isolation: isolate;
}

.deck__stage:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

.deck__backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.deck__backdrop img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.2) translateZ(0);
  filter: blur(36px) saturate(1.3);
  opacity: 0.55;
  will-change: transform;
}

.deck__backdrop::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--canvas) 55%, transparent), color-mix(in srgb, var(--canvas) 85%, transparent));
  content: "";
}

.deck__bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px 16px;
  margin: 0 0 12px;
}

.deck__count {
  margin: 0;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.deck__progress {
  display: flex;
  gap: 4px;
}

.deck__segment {
  flex: 1;
  height: 3px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 18%, transparent);
  transition: background-color 300ms;
}

.deck__segment.is-done {
  background: var(--glow);
}

.deck__nav {
  display: flex;
  gap: 4px;
}

.deck__arrow {
  border-color: color-mix(in srgb, var(--text) 18%, transparent);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--text);
}

.deck__arrow:disabled {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  cursor: default;
  opacity: 0.45;
}

/* All cards share one grid cell, so the pile is as high as its tallest card and sits in the
   middle of the stage; the stack itself is drawn with transforms. */

.gh-content .deck__cards {
  display: grid;
  flex: 0 1 auto;
  min-height: 0;
  margin: auto 0;
  padding: 0;
  grid-template-rows: minmax(0, 1fr);
  list-style: none;
  transition: height 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.deck__card:not(.is-active):not(.is-open) {
  min-height: 0;
  align-self: stretch;
  overflow: hidden;
}

.deck__stage--open .deck__cards {
  flex: 1;
  margin: 0;
}

.gh-content .deck__card {
  position: relative;
  grid-area: 1 / 1;
  box-sizing: border-box;
  width: min(100%, 34rem);
  max-height: 100%;
  overflow: hidden;
  justify-self: center;
  align-self: start;
  margin: 0;
  border: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 24px 60px -24px rgba(5, 2, 8, 0.45);
  touch-action: pan-y pinch-zoom;
  transform-origin: 50% 100%;
  transition: transform 480ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 320ms ease;
  will-change: transform;
}

.deck__card.is-active {
  z-index: 3;
  cursor: grab;
}

.deck__card:not(.is-open) {
  user-select: none;
  -webkit-user-select: none;
}

.deck__card.is-resetting,
.deck__card.is-dragging {
  transition: none;
  cursor: grabbing;
}

.deck__card.is-next-1 {
  z-index: 2;
  transform: translateY(18px) scale(0.95);
  opacity: 0.85;
}

.deck__card.is-next-2 {
  z-index: 1;
  transform: translateY(36px) scale(0.9);
  opacity: 0.55;
}

.deck__card.is-hidden {
  transform: translateY(54px) scale(0.85);
  opacity: 0;
  visibility: hidden;
  transition: transform 480ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 320ms ease, visibility 0s 480ms;
}

.deck__card.is-gone-left,
.deck__card.is-gone-right {
  z-index: 4;
  opacity: 0;
  pointer-events: none;
}

.deck__card.is-leaving-left,
.deck__card.is-leaving-right {
  z-index: 4;
  opacity: 0;
  pointer-events: none;
}

.deck__card.is-leaving-left,
.deck__card.is-gone-left {
  transform: translate(-130%, -6%) rotate(-16deg);
}

.deck__card.is-leaving-right,
.deck__card.is-gone-right {
  transform: translate(130%, -6%) rotate(16deg);
}

/* This scroll container is the touch-action boundary; the card ancestor alone is not enough. */
.deck__face {
  touch-action: pan-y pinch-zoom;
  display: flex;
  flex-direction: column;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: auto;
  gap: 12px;
  padding: 22px 20px;
}

.deck__face > * {
  flex-shrink: 0;
}

.deck__eyebrow {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 0;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.deck__date {
  color: var(--muted);
  letter-spacing: 0.02em;
  text-transform: none;
}

.deck__title {
  margin: 0;
  font-size: clamp(1.375rem, 1.1rem + 1.4vw, 1.875rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.15;
  text-wrap: balance;
}

.deck__summary {
  margin: 0;
  color: var(--text);
  font-size: 1.0625rem;
  line-height: 1.55;
}

.deck__summary--clamp {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.deck__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

.deck__meta {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.deck__open {
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--glow);
  color: var(--on-glow);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition: transform 150ms, box-shadow 150ms;
}

.deck__open:hover {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--glow) 35%, transparent);
}

.article__jump:focus-visible,
.deck__open:focus-visible,
.deck__arrow:focus-visible,
.deck__close:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.deck__hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  text-align: center;
  transition: opacity 300ms;
}

.deck__hint.is-quiet {
  opacity: 0;
}

/* Reading view: the open card fills the stage and its text scrolls inside. */

.deck__card.is-open {
  display: flex;
  flex-direction: column;
  width: min(100%, 46rem);
  height: 100%;
  align-self: stretch;
  cursor: auto;
}

.deck__card.is-open .deck__face {
  flex: none;
  padding-bottom: 12px;
  max-height: 45%;
  overscroll-behavior: contain;
}

.deck__card.is-open .deck__foot,
.deck__card.is-open .deck__summary {
  display: none;
}

.deck__body {
  position: relative;
  flex: 1;
  min-height: 0;
  padding: 0 20px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  line-height: 1.65;
}

.deck__close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: none;
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

.deck__card.is-open .deck__close {
  display: inline-grid;
}

.deck__card.is-open .deck__face {
  padding-right: 64px;
}

/* Behind the top card only blank sheets show; while a card is open the rest of the stack and the
   hint step aside. */

.deck__card:not(.is-active):not(.is-open):not(.is-leaving-left):not(.is-leaving-right) .deck__face {
  visibility: hidden;
}

.deck__stage--open .deck__card:not(.is-open) {
  visibility: hidden;
}

.deck__stage--open .deck__hint {
  display: none;
}

.deck__text > * {
  margin: 0;
}

.deck__text > * + * {
  margin-top: 1em;
}

.deck__sources-label {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.deck__text > .deck__sources-label + .deck__sources {
  margin-top: 8px;
}

@media (min-width: 640px) {
  .deck__face {
    gap: 14px;
    padding: 28px;
  }

  .deck__body {
    padding: 0 28px 28px;
  }

  .deck__close {
    top: 14px;
    right: 14px;
  }
}

@media (min-width: 860px) {
  .deck__stage {
    padding-top: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }

  .deck__card.is-gone-left,
  .deck__card.is-gone-right {
    transform: none;
    visibility: hidden;
  }
}

@media print {
  :root {
    --canvas: #ffffff;
    --surface: #ffffff;
    --text: #000000;
    --muted: #444444;
  }

  .article__jump,
  .site-header,
  .site-footer,
  .post-nav,
  .skip-link,
  .deck__backdrop,
  .deck__bar,
  .deck__hint,
  .deck__foot,
  .deck__close,
  .deck__summary {
    display: none;
  }

  .gh-content > .deck {
    height: auto;
  }

  .deck__stage {
    position: static;
    display: block;
    height: auto;
    overflow: visible;
  }

  .gh-content .deck__cards {
    display: block;
    height: auto !important;
  }

  .deck__face,
  .deck__body {
    max-height: none !important;
    overflow: visible;
  }

  .gh-content .deck__card {
    position: static;
    height: auto;
    max-height: none;
    overflow: visible;
    box-shadow: none;
    transform: none;
    opacity: 1;
    visibility: visible;
  }

  .deck__stage--open .deck__card:not(.is-open) {
    visibility: visible;
  }

  .gh-content .deck__card + .deck__card {
    margin-top: 16px;
  }

  .deck__card:not(.is-active):not(.is-open):not(.is-leaving-left):not(.is-leaving-right) .deck__face {
    visibility: visible;
  }

  .deck__body[hidden] {
    display: block;
  }
}
