/* Stardrift Talks — tokens mirror program/app/globals.css (pebble neutrals,
   tomato + ocean accents, radius 0). Keep the two in step. */
:root {
  --bg: #fff;
  --card: oklch(0.9886 0.0017 67.8);
  --muted: oklch(0.9649 0.0045 78.3);
  --muted-deep: oklch(0.9408 0.0046 78.3);
  --ink: oklch(0.2879 0.0046 325.7);
  --ink-2: oklch(0.5162 0.0088 332.26);
  --line: oklch(0.657 0.0093 349.39 / 0.2);
  --line-bold: oklch(0.657 0.0093 349.39 / 0.4);
  --tomato: oklch(0.5897 0.2167 30.52);
  --ocean: oklch(0.5192 0.1292 244.45);
  --success: oklch(0.5501 0.1419 151.91);
  --danger: oklch(0.533 0.1983 17.73);
  --sans: "Schibsted Grotesk", ui-sans-serif, system-ui, sans-serif;
  --serif: Literata, Georgia, serif;
  --mono: "Fragment Mono", ui-monospace, monospace;
  --gutter: 20px;
  --measure: 720px;
  --wide: 1060px;
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
}
a {
  color: inherit;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ---------- nav / footer (mirrors the marketing shell) ---------- */
.site-nav {
  border-bottom: 1px solid var(--line);
}
.site-nav-inner {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 1400px;
  margin: 0 auto;
  height: 56px;
  padding: 0 var(--gutter);
  font-size: 14px;
}
.site-nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 19px;
  text-decoration: none;
  margin-right: 14px;
}
.site-nav-mark {
  width: 32px;
  height: 32px;
}
.site-nav-link {
  text-decoration: none;
  padding: 6px 10px;
}
.site-nav-link.is-current {
  border-bottom: 2px solid var(--tomato);
}
.site-nav-spacer {
  flex: 1;
}
.site-nav-cta {
  background: var(--tomato);
  color: #fff;
  text-decoration: none;
  padding: 7px 14px;
  font-weight: 500;
}
@media (max-width: 720px) {
  .site-nav-link:not(.is-current) {
    display: none;
  }
}
@media (max-width: 380px) {
  .site-nav-inner {
    gap: 4px;
    padding: 0 16px;
  }
  .site-nav-logo {
    gap: 4px;
    margin-right: 4px;
  }
  .site-nav-mark {
    width: 28px;
    height: 28px;
  }
  .site-nav-link {
    padding: 6px;
  }
  .site-nav-cta {
    padding: 7px 10px;
    white-space: nowrap;
  }
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  max-width: var(--wide);
  margin: 48px auto 0;
  padding: 22px var(--gutter) 40px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-2);
}
.site-footer a {
  text-decoration: none;
}

/* ---------- shared type ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 0;
}

/* ---------- episode page (layout A) ----------
   The post body is plain editor blocks: an embed card, then per turn an H3
   ("Leila <code>06:36</code>") followed by paragraphs. .talk-body is
   display:contents so those blocks and the header share one two-column grid:
   H3s auto-place in the margin column, paragraphs in the text column, and
   the first embed jumps above the header via `order`. minmax(0, …) keeps a
   long line from widening a column past the viewport. */
.talk {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  column-gap: 14px;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.talk-body {
  display: contents;
}
.talk > *,
.talk-body > * {
  order: 3;
  grid-column: 2;
  margin: 0;
}

.talk-body > .kg-embed-card:first-child {
  order: 1;
  grid-column: 1 / -1;
  /* Break out of the 720px measure to the 1060px video width, still centred. */
  width: min(var(--wide) - 2 * var(--gutter), 100vw - 2 * var(--gutter));
  margin: 22px 0 0
    calc(
      50% - min(var(--wide) - 2 * var(--gutter), 100vw - 2 * var(--gutter)) / 2
    );
}
.talk-body > .kg-embed-card:first-child iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  max-width: 100%;
  border: 0;
  background: var(--ink);
}

.talk-head {
  order: 2;
  grid-column: 1 / -1;
  padding: 26px 0 16px;
}
.talk-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(28px, 4.2vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 8px 0 10px;
  text-wrap: balance;
}
.talk-meta {
  font-size: 14px;
  color: var(--ink-2);
  margin: 0;
}
.talk-dek {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.5;
  margin: 14px 0 0;
  max-width: 62ch;
}

/* Chapter headings span both columns; Ghost gives them ids, so each is an anchor. */
.talk-body > h2 {
  grid-column: 1 / -1;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 23px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  padding-top: 34px;
  scroll-margin-top: 16px;
}

/* Speaker label in the margin, aligned with its first paragraph. No rule
   between turns. */
.talk-body > h3 {
  grid-column: 1;
  align-self: start;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink-2);
  padding-top: 13px;
}
.talk-body > h3.is-leila {
  color: var(--tomato);
}
.talk-body > h3.is-guest {
  color: var(--ocean);
}
.talk-body > h3 code {
  display: block;
  font-family: var(--mono);
  font-weight: 400;
  font-size: 11px;
  color: var(--ink-2);
  margin-bottom: 2px;
  cursor: pointer;
}
.talk-body > h3 code:hover {
  color: var(--tomato);
}
.talk-body > p {
  padding-top: 10px;
}
.talk-body > h3 + p {
  padding-top: 10px;
}
.talk-body > p:has(> em:only-child) {
  color: var(--ink-2);
}

@media (max-width: 600px) {
  .talk {
    grid-template-columns: minmax(0, 1fr);
  }
  .talk > *,
  .talk-body > * {
    grid-column: 1 / -1;
  }
  .talk-body > h3 {
    grid-column: 1;
    padding-top: 18px;
  }
  .talk-body > h3 code {
    display: inline;
    margin-right: 8px;
  }
  .talk-body > h3 + p {
    padding-top: 4px;
  }
}

/* ---------- call to action (after the transcript and on the index) ---------- */
.cta {
  order: 4;
  grid-column: 1 / -1;
  margin: 40px 0 0;
  padding: 30px 28px 32px;
  background: var(--card);
  border: 1px solid var(--line);
  text-align: center;
}
.cta-heading {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 24px;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0 0 8px;
  text-wrap: balance;
}
.cta-quote {
  margin: 14px auto 16px;
  padding: 0 0 16px;
  max-width: 52ch;
  border-bottom: 2px solid var(--tomato);
  width: fit-content;
}
.cta-quote p {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
}
.cta-quote cite {
  display: block;
  margin-top: 6px;
  font-family: var(--mono);
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}
.cta-text {
  margin: 0 auto;
  font-size: 15px;
  color: var(--ink-2);
  max-width: 58ch;
}
/* One primary action; the secondary is a text link so it never competes. */
.cta-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 18px;
  margin-top: 20px;
}
.cta-primary {
  display: inline-block;
  padding: 11px 22px;
  font-size: 15px;
  font-weight: 500;
  background: var(--tomato);
  color: #fff;
  text-decoration: none;
}
.cta-primary:hover {
  background: oklch(0.5199 0.1879 30.37);
}
.cta-secondary {
  font-size: 14px;
  color: var(--ink-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cta-secondary:hover {
  color: var(--ink);
}
.blog-index .cta {
  margin-top: 28px;
}

/* Other Koenig cards read at the measure; wide/full break out like the video. */
.kg-width-wide {
  grid-column: 1 / -1;
}
.kg-width-full {
  grid-column: 1 / -1;
}

/* ---------- index pages (the Next blog's layout) ---------- */
.blog-index {
  max-width: 900px;
  margin: 0 auto;
  padding: 96px 24px 0;
}
.blog-index-head {
  padding-bottom: 40px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--line);
}
.blog-index-title {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
}
.post-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.post-card {
  display: flex;
  background: var(--card);
  border: 1px solid var(--line);
  text-decoration: none;
  transition: opacity 0.15s;
}
.post-card:hover {
  opacity: 0.8;
}
.post-card-image {
  width: 30%;
  max-height: 220px;
  object-fit: contain;
  background: var(--muted);
  border-right: 1px solid var(--line);
}
.post-card-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
}
.post-card-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
}
.post-card-date {
  font-family: var(--mono);
  font-size: 14px;
  margin: 0;
}
.post-card-action {
  flex: 1;
  display: flex;
  align-items: flex-end;
}
.button {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: var(--ink);
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
@media (max-width: 767px) {
  .blog-index {
    padding: 80px 16px 0;
  }
  .post-card {
    flex-direction: column;
  }
  .post-card-image {
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .post-card-body {
    padding: 16px;
  }
  .post-card-title {
    font-size: 20px;
  }
}
.pagination {
  display: flex;
  justify-content: space-between;
  padding: 18px 0;
  font-size: 14px;
}
.pagination a {
  text-decoration: none;
  color: var(--ink-2);
}

/* ---------- section nav ---------- */
.blog-index-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.section-nav {
  display: flex;
  gap: 4px;
  font-size: 14px;
}
.section-nav-link {
  text-decoration: none;
  padding: 6px 10px;
  color: var(--ink-2);
}
.section-nav-link.is-current {
  color: var(--ink);
  border-bottom: 2px solid var(--tomato);
}

/* ---------- article (the Next blog's post layout) ---------- */
.article {
  display: flex;
  flex-direction: column;
  gap: 40px;
  max-width: 645px;
  margin: 0 auto;
  padding: 96px 24px;
}
.article-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
}
.article-back:hover {
  text-decoration: underline;
}
.article-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.article-title {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
}
.article-dek {
  font-size: 20px;
  font-style: italic;
  color: var(--ink-2);
  margin: 0;
}
.article-byline {
  display: flex;
  gap: 8px;
}
.article-byline-mark {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-top: 6px;
  background: var(--ocean);
}
.article-author {
  font-size: 16px;
  line-height: 20px;
  margin: 0 0 4px;
}
.article-date {
  font-family: var(--mono);
  font-size: 14px;
  line-height: 20px;
  color: var(--ink-2);
  margin: 0;
}
.article-rule {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
}
.gh-content {
  display: flex;
  flex-direction: column;
  gap: 40px;
  font-size: 16px;
  line-height: 24px;
}
.gh-content > * {
  margin: 0;
}
.gh-content h2,
.gh-content h3,
.gh-content h4 {
  font-weight: 600;
}
.gh-content h2 {
  font-size: 24px;
  line-height: 30px;
  margin-top: 24px;
}
.gh-content h3 {
  font-size: 20px;
  line-height: 27.5px;
  margin-top: 16px;
}
.gh-content h4 {
  font-size: 18px;
  line-height: 24px;
  margin-top: 12px;
}
.gh-content a {
  color: var(--ocean);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.gh-content code {
  font-family: var(--mono);
  background: var(--muted);
  border-radius: 6px;
  padding: 2px 6px;
}
.gh-content pre {
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.gh-content pre code {
  font-family: inherit;
  background: none;
  border-radius: 0;
  padding: 0;
}
.gh-content ul {
  list-style: disc;
  margin-left: 16px;
  padding: 0;
}
.gh-content ol {
  list-style: decimal;
  margin-left: 24px;
  padding: 0;
}
.gh-content li + li {
  margin-top: 4px;
}
.gh-content hr {
  border: 0;
  border-top: 1px solid var(--line);
}
.gh-content figure {
  margin-left: 0;
  margin-right: 0;
}
.gh-content img {
  width: 100%;
  object-fit: cover;
}
.gh-content figcaption {
  text-align: center;
  margin-top: 8px;
}
.gh-content video {
  width: 100%;
}
.gh-content .kg-embed-card iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
}
.gh-content .kg-toggle-card {
  font-size: 14px;
  line-height: 1.625;
  border: 1px solid oklch(0.657 0.0093 349.39 / 0.08);
  border-radius: 12px;
  box-shadow:
    0 1px 3px 0 rgb(0 0 0 / 0.1),
    0 1px 2px -1px rgb(0 0 0 / 0.1);
  padding: 0;
}
.gh-content .kg-toggle-heading {
  padding: 8px 16px;
}
.gh-content .kg-toggle-card h4.kg-toggle-heading-text {
  font-size: 14px;
  font-style: italic;
  font-weight: 400;
  color: var(--ink-2);
  margin: 0;
}
.gh-content .kg-toggle-content {
  padding: 4px 16px 16px;
  background: oklch(0.9649 0.0045 78.3 / 0.3);
  border-radius: 0 0 12px 12px;
}
.article .cta {
  margin-top: 8px;
}

/* ---------- subscribe (the Next blog's "Stay in the loop" box) ---------- */
.subscribe {
  max-width: 448px;
  margin-top: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: oklch(0.9649 0.0045 78.3 / 0.3);
}
.blog-index .subscribe {
  margin-top: 48px;
}
.subscribe-heading {
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 4px;
}
.subscribe-text {
  font-size: 12px;
  color: var(--ink-2);
  margin: 0 0 12px;
}
.subscribe-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.subscribe-input {
  flex: 1;
  min-width: 0;
  max-width: 320px;
  height: 40px;
  padding: 8px 12px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.subscribe-button:disabled {
  opacity: 0.6;
}
.subscribe-status {
  font-size: 12px;
  margin: 8px 0 0;
}
.subscribe-status:empty {
  display: none;
}
.subscribe-status[data-state="success"] {
  color: var(--success);
}
.subscribe-status[data-state="error"] {
  color: var(--danger);
}
@media (max-width: 767px) {
  .article {
    gap: 32px;
    padding: 80px 16px;
  }
  .article-title {
    font-size: 24px;
  }
  .article-dek {
    font-size: 18px;
  }
  .subscribe-row {
    flex-direction: column;
    align-items: stretch;
  }
  .subscribe-input {
    max-width: none;
  }
}
