/* gptads.chat — warm light editorial theme */

:root {
  color-scheme: light;

  --bg: #fdfaf3;
  --surface: #ffffff;
  --ink: #1c1a17;
  --ink-soft: #45403a;
  --muted: #6f685e;
  --rule: #e9e2d6;
  --rule-soft: #f2ece1;
  --accent: #b8420d;
  --accent-hover: #8f3208;
  --accent-wash: #fbf1e7;
  --code-bg: #f5f0e6;

  --measure: 43rem;
  --measure-wide: 66rem;
  --pad: clamp(1.25rem, 5vw, 2.25rem);
  --radius: 8px;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 2rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap { width: 100%; max-width: var(--measure); margin-inline: auto; padding-inline: var(--pad); }
.wrap--wide { max-width: var(--measure-wide); }

a { color: var(--accent); text-decoration: none; text-underline-offset: 0.18em; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* ---------- masthead ---------- */

.masthead { border-bottom: 1px solid var(--rule); background: var(--surface); }
.masthead .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 4.25rem; flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--serif); font-size: 1.15rem; font-weight: 600;
  letter-spacing: -0.01em; color: var(--ink);
}
.brand:hover { color: var(--ink); text-decoration: none; }
.brand svg { display: block; flex: none; }
.nav { display: flex; gap: 1.4rem; font-size: 0.9375rem; }
.nav a { color: var(--ink-soft); }
.nav a:hover { color: var(--accent); }

/* ---------- hero (two columns) ---------- */

.hero { border-bottom: 1px solid var(--rule); padding-block: clamp(2.5rem, 7vw, 4.5rem); }
.hero-grid {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
}
@media (min-width: 62rem) {
  .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin: 0 0 1.15rem;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--accent);
}
.eyebrow::before {
  content: ""; width: 1.5rem; height: 1px; background: currentColor; opacity: 0.5;
}
.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.1rem, 5.6vw, 3.15rem);
  line-height: 1.08; letter-spacing: -0.023em; font-weight: 600;
  text-wrap: balance;
}
.hero .lead {
  margin: 1.15rem 0 0;
  font-size: clamp(1.0625rem, 2.2vw, 1.1875rem);
  line-height: 1.62; color: var(--ink-soft); max-width: 46ch;
}
.hero-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem;
  margin-top: 1.9rem;
}
.btn {
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: var(--accent); color: #fff;
  padding: 0.7rem 1.15rem; border-radius: 999px;
  font-size: 0.9375rem; font-weight: 550; line-height: 1.2;
}
.btn:hover { background: var(--accent-hover); color: #fff; text-decoration: none; }
.hero-actions .note { font-size: 0.875rem; color: var(--muted); }

.hero-figure { margin: 0; }
.hero-figure img {
  display: block; width: 100%; height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  background: var(--rule-soft);
}

/* ---------- feed ---------- */

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding-top: clamp(2.5rem, 6vw, 3.5rem); padding-bottom: 0.75rem;
}
.section-head h2 {
  margin: 0; font-family: var(--serif); font-size: 1.3rem;
  font-weight: 600; letter-spacing: -0.012em;
}
.section-head .count { font-size: 0.875rem; color: var(--muted); }

.postlist { list-style: none; margin: 0; padding: 0 0 1.5rem; }
.postlist > li { border-top: 1px solid var(--rule); }
.postlist > li:first-child { border-top: none; }

.entry {
  display: grid; gap: 1.1rem 1.6rem; align-items: start;
  padding-block: 1.9rem; color: inherit;
}
@media (min-width: 44rem) {
  .entry { grid-template-columns: 13.5rem minmax(0, 1fr); }
}
.entry:hover { text-decoration: none; }

.entry .thumb {
  margin: 0; overflow: hidden;
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--rule-soft); aspect-ratio: 16 / 10;
}
.entry .thumb img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.35s ease;
}
.entry:hover .thumb img { transform: scale(1.03); }

.entry .kicker {
  display: flex; align-items: center; gap: 0.55rem;
  margin-bottom: 0.5rem;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.entry .kicker .num { color: var(--accent); }
.entry h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.3rem, 3vw, 1.5rem);
  line-height: 1.24; letter-spacing: -0.016em; font-weight: 600;
  color: var(--ink); text-wrap: balance;
}
.entry:hover h3 { color: var(--accent); }
.entry p { margin: 0.55rem 0 0; color: var(--ink-soft); font-size: 1rem; }
.entry .meta { margin-top: 0.85rem; }

.meta {
  font-size: 0.875rem; color: var(--muted);
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
}
.meta .dot { color: var(--rule); }
.tag {
  display: inline-block; padding: 0.15rem 0.55rem;
  border: 1px solid var(--rule); border-radius: 999px;
  background: var(--surface);
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--accent);
}

/* ---------- article ---------- */

.breadcrumb { padding-top: 1.75rem; font-size: 0.8125rem; color: var(--muted); }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0; padding: 0; }
.breadcrumb li::after { content: "/"; margin-left: 0.45rem; color: var(--rule); }
.breadcrumb li:last-child::after { content: none; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }

.article-head { padding-block: 1.5rem 0; }
.article-head .tag { margin-bottom: 1rem; }
.article-head h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.95rem, 5vw, 2.7rem);
  line-height: 1.12; letter-spacing: -0.023em; font-weight: 600;
  text-wrap: balance;
}
.article-head .standfirst {
  margin: 1rem 0 0; font-size: 1.15rem; line-height: 1.6; color: var(--ink-soft);
}
.article-head .meta {
  margin-top: 1.35rem; padding-top: 1.25rem; border-top: 1px solid var(--rule);
}

.cover { margin: 2rem 0 0; }
.cover img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--rule-soft);
}

/* table of contents */
.toc {
  margin: 2.25rem 0 0; padding: 1.25rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--rule); border-radius: var(--radius);
}
.toc h2 {
  margin: 0 0 0.7rem;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--muted);
}
.toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; }
.toc li { counter-increment: toc; margin-bottom: 0.4rem; line-height: 1.45; }
.toc li:last-child { margin-bottom: 0; }
.toc a { color: var(--ink-soft); font-size: 0.9375rem; }
.toc a::before {
  content: counter(toc, decimal-leading-zero);
  display: inline-block; width: 1.9rem;
  color: var(--accent); font-variant-numeric: tabular-nums;
  font-size: 0.8125rem; font-weight: 600;
}
.toc a:hover { color: var(--accent); }

.prose { padding-block: 0.5rem 0.75rem; font-size: 1.125rem; }
.prose > *:first-child { margin-top: 2.25rem; }
.prose p { margin: 0 0 1.35rem; }
.prose p.lead-para { font-size: 1.25rem; line-height: 1.6; color: var(--ink); }

.prose h2 {
  margin: 2.9rem 0 1rem;
  font-family: var(--serif); font-size: 1.55rem; line-height: 1.26;
  letter-spacing: -0.016em; font-weight: 600; text-wrap: balance;
}
.prose h3 {
  margin: 2rem 0 0.75rem;
  font-size: 1.0625rem; font-weight: 650; letter-spacing: -0.005em;
}
.prose h2 a.anchor, .prose h3 a.anchor {
  opacity: 0; margin-left: 0.4rem; font-weight: 400;
  color: var(--muted); text-decoration: none;
}
.prose h2:hover a.anchor, .prose h3:hover a.anchor { opacity: 1; }

.prose ul, .prose ol { margin: 0 0 1.35rem; padding-left: 1.4rem; }
.prose li { margin-bottom: 0.55rem; }
.prose li::marker { color: var(--accent); }

.prose strong { font-weight: 650; color: var(--ink); }

/* a paragraph that opens with a bold lead-in reads as a key point */
.prose p.key {
  padding-left: 1.15rem;
  margin-bottom: 1.5rem;
  border-left: 2px solid var(--accent);
}
/* a run of key points reads as one block, not three boxes */
.prose p.key + p.key {
  margin-top: -0.6rem;
}

.prose hr { height: 1px; border: 0; background: var(--rule); margin: 2.9rem 0; }

.prose figure { margin: 2.25rem 0; }
.prose figure img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--rule-soft);
}

.prose code {
  font-family: var(--mono); font-size: 0.86em;
  background: var(--code-bg); padding: 0.12em 0.36em;
  border-radius: 3px; word-break: break-word;
}
.prose pre {
  margin: 0 0 1.6rem; padding: 1.05rem 1.15rem;
  background: var(--code-bg); border: 1px solid var(--rule);
  border-radius: var(--radius); overflow-x: auto;
  font-size: 0.9375rem; line-height: 1.6;
}
.prose pre code { background: none; padding: 0; font-size: 1em; }

.table-scroll {
  overflow-x: auto; margin: 0 0 1.7rem;
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--surface);
}
.prose table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; line-height: 1.55; }
.prose th, .prose td {
  text-align: left; vertical-align: top;
  padding: 0.7rem 1rem; border-bottom: 1px solid var(--rule);
}
.prose tbody tr:last-child td { border-bottom: 0; }
.prose th {
  font-weight: 600; font-size: 0.75rem; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--muted);
  background: var(--rule-soft); white-space: nowrap;
}
.prose tbody tr:nth-child(even) { background: #fdfbf7; }

.prose blockquote {
  margin: 0 0 1.35rem; padding-left: 1.2rem;
  border-left: 2px solid var(--accent); color: var(--ink-soft);
}

/* ---------- article footer ---------- */

.author-card {
  display: grid; gap: 1rem; align-items: start;
  margin-top: 2.5rem; padding: 1.6rem;
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius);
}
@media (min-width: 34rem) { .author-card { grid-template-columns: 3.5rem minmax(0, 1fr); } }
.author-card .avatar {
  width: 3.5rem; height: 3.5rem; border-radius: 50%;
  background: var(--accent-wash); border: 1px solid var(--rule);
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 1.25rem; font-weight: 600; color: var(--accent);
}
.author-card h2 { margin: 0 0 0.35rem; font-family: var(--serif); font-size: 1.0625rem; font-weight: 600; }
.author-card p { margin: 0; font-size: 0.9375rem; color: var(--ink-soft); line-height: 1.6; }
.author-card .links { margin-top: 0.65rem; font-size: 0.9375rem; }

.readnext { padding-block: 2.75rem 1rem; border-top: 1px solid var(--rule); margin-top: 2.75rem; }
.readnext > h2 {
  margin: 0 0 1.1rem;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--muted);
}
.readnext .cards { display: grid; gap: 1.25rem; list-style: none; margin: 0; padding: 0; }
@media (min-width: 40rem) { .readnext .cards { grid-template-columns: 1fr 1fr; } }
.readnext .card {
  display: block; height: 100%;
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--surface); overflow: hidden; color: inherit;
}
.readnext .card:hover { text-decoration: none; border-color: var(--accent); }
.readnext .card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--rule-soft); }
.readnext .card .body { padding: 0.95rem 1.1rem 1.2rem; }
.readnext .card .rel {
  display: block; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.11em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 0.3rem;
}
.readnext .card h3 {
  margin: 0; font-family: var(--serif); font-size: 1.0625rem;
  line-height: 1.3; font-weight: 600; color: var(--ink);
}
.readnext .card:hover h3 { color: var(--accent); }

/* ---------- 404 ---------- */

.notfound { padding-block: clamp(3.5rem, 10vw, 5.5rem) 1rem; }
.notfound .code {
  margin: 0 0 0.9rem;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--accent);
}
.notfound h1 {
  margin: 0 0 1rem; font-family: var(--serif);
  font-size: clamp(1.9rem, 5.4vw, 2.6rem); line-height: 1.14;
  letter-spacing: -0.02em; font-weight: 600;
}
.notfound p { margin: 0 0 2rem; color: var(--ink-soft); max-width: 46ch; }

/* ---------- footer ---------- */

.sitefoot {
  border-top: 1px solid var(--rule); background: var(--surface);
  padding-block: 2.5rem 3rem; font-size: 0.875rem; color: var(--muted);
  margin-top: 2rem;
}
.sitefoot p { margin: 0 0 0.5rem; }
.sitefoot .foot-nav { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-bottom: 1.1rem; }
.sitefoot .foot-nav a { color: var(--ink-soft); }

/* ---------- misc ---------- */

.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: var(--pad); top: 0.5rem; z-index: 10;
  background: var(--surface); padding: 0.5rem 0.9rem;
  border: 1px solid var(--rule); border-radius: 4px;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

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