@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/inter-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/inter-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/inter-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/source-serif-4-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/source-serif-4-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/source-serif-4-latin-600-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  --bg: #17130e;
  --surface: #221c15;
  --surface-soft: #2b241b;
  --text: #e8e2d9;
  --heading: #f6efe3;
  --muted: #cfc4b2;
  --faint: #b7aa96;
  --line: rgba(232, 226, 217, 0.16);
  --accent: #67e0ad;
  --accent-ink: #112f2b;
  --ember: #f0a968;
  --paper: #faf4e6;
  --paper-ink: #26221b;
  --paper-line: #d8cdb4;
  --paper-label: #8a4a38;
  --shadow: rgba(0, 0, 0, 0.28);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f1ea;
  --surface: #fffcf5;
  --surface-soft: #faf6ee;
  --text: #2a241d;
  --heading: #1d1812;
  --muted: #665d51;
  --faint: #6f6558;
  --line: rgba(42, 36, 29, 0.16);
  --accent: #135c46;
  --accent-ink: #f4f1ea;
  --ember: #8a4a38;
  --paper: #ffffff;
  --paper-ink: #26221b;
  --paper-line: #ded6c6;
  --paper-label: #8a4a38;
  --shadow: rgba(42, 36, 29, 0.08);
}

@media (prefers-color-scheme: light) {
  /* No-JS fallback: theme.js sets data-theme before paint when scripts are available. */
  :root:not([data-theme]) {
    color-scheme: light;
    --bg: #f4f1ea;
    --surface: #fffcf5;
    --surface-soft: #faf6ee;
    --text: #2a241d;
    --heading: #1d1812;
    --muted: #665d51;
    --faint: #6f6558;
    --line: rgba(42, 36, 29, 0.16);
    --accent: #135c46;
    --accent-ink: #f4f1ea;
    --ember: #8a4a38;
    --paper: #ffffff;
    --paper-ink: #26221b;
    --paper-line: #ded6c6;
    --paper-label: #8a4a38;
    --shadow: rgba(42, 36, 29, 0.08);
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top right, rgba(240, 169, 104, 0.1), transparent 32rem),
    var(--bg);
  color: var(--text);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  font-weight: 400;
  line-height: 1.65;
  text-align: left;
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 50%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover,
a:focus-visible {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.site-header,
.site-footer {
  border-color: var(--line);
}

.site-header {
  border-bottom: 1px solid var(--line);
}

.site-header__inner,
.site-footer__inner,
.guide-shell {
  width: min(100% - 2rem, 66ch);
  margin: 0 auto;
}

.site-header__inner {
  min-height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0;
  text-decoration: none;
}

.brand__mark {
  width: 1.5rem;
  height: 1.5rem;
}

.header-note,
.eyebrow,
.byline,
.muted,
.site-footer,
figcaption,
.template-hint,
.card-meta {
  color: var(--muted);
}

.header-note {
  font-size: 0.875rem;
}

.site-header__actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  min-width: 0;
}

.theme-toggle {
  min-width: 4.25rem;
  min-height: 2rem;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: 500 0.8125rem/1 "Inter", ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.01em;
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: var(--accent);
}

.theme-toggle:focus-visible {
  outline: 0;
  box-shadow:
    0 0 0 2px var(--bg),
    0 0 0 4px color-mix(in srgb, var(--accent) 72%, transparent);
}

.guide-shell {
  padding: 4rem 0;
}

.eyebrow,
.byline,
.template-kicker,
.template-hint,
figcaption,
.card-meta,
.short-answer__label,
.guide-card__number,
.callout__label {
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  font-size: 0.875rem;
  letter-spacing: 0.01em;
}

.eyebrow,
.short-answer__label,
.guide-card__number,
.callout__label {
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--ember);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
}

h1,
h2,
h3 {
  color: var(--heading);
  font-family: "Source Serif 4", Georgia, Cambria, "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: clamp(2.375rem, 1.55rem + 3.6vw, 3.5rem);
  line-height: 1.06;
  letter-spacing: -0.018em;
}

h2 {
  margin: 2.75em 0 0.6em;
  font-size: 1.75rem;
  line-height: 1.25;
}

h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.2rem;
  line-height: 1.35;
}

p,
ul,
ol,
figure {
  margin-block: 1.25em 0;
}

ul,
ol {
  padding-left: 1.5rem;
}

li + li {
  margin-top: 0.5rem;
}

.byline {
  margin-block: 1rem 0;
}

.lede {
  color: var(--text);
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.35em;
  font-weight: 400;
  line-height: 1.45;
}

.short-answer {
  margin-block: 1.5rem 0;
  padding: 1.5rem;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line));
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.editorial-cta {
  margin-block: 1.5rem 0;
  padding: 0 0 0 1.25rem;
  border: 0;
  border-left: 2px solid var(--accent);
  border-radius: 0;
  background: none;
}

.short-answer__label,
.callout__label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.short-answer p,
.editorial-cta p,
.callout p {
  margin: 0;
}

.callout {
  margin-block: 1.5rem 0;
  padding: 0 0 0 1.25rem;
  border: 0;
  border-left: 2px solid var(--accent);
  border-radius: 0;
  background: none;
}

.callout--danger {
  border-left-color: var(--ember);
}

.callout--danger .callout__label {
  color: var(--ember);
}

.pull-quote {
  margin-block: 3rem;
  margin-inline: 0;
  color: var(--text);
  font-family: "Source Serif 4", Georgia, Cambria, "Times New Roman", serif;
  font-size: 1.9em;
  font-style: italic;
  font-weight: 600;
  line-height: 1.2;
}

.pull-quote::before {
  display: block;
  width: 3rem;
  height: 2px;
  margin-bottom: 1.25rem;
  background: var(--ember);
  content: "";
}

.template-card {
  margin-block: 1.5rem 0;
  overflow: hidden;
  border: 1px solid var(--paper-line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--paper-ink);
  box-shadow: 0 1.5rem 4rem var(--shadow);
}

.template-kicker {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--paper-line);
  color: var(--paper-label);
  font-weight: 500;
}

.template-subject,
.template-body {
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.875em;
  line-height: 1.6;
  white-space: pre-wrap;
}

.template-subject {
  padding: 1rem 1.5rem 0;
  font-weight: 500;
}

.template-body {
  margin: 0;
  padding: 1rem 1.5rem 1.5rem;
  color: var(--paper-ink);
  user-select: all;
}

.template-hint {
  margin-block: 0.5rem 0;
}

.guide-figure {
  color: var(--text);
}

.guide-figure svg {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
}

.guide-figure text {
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

figcaption {
  margin-block: 0.5rem 0;
  line-height: 1.5;
}

.read-next {
  margin-block: 4rem 0;
}

.read-next__grid,
.guide-list {
  display: grid;
  gap: 1rem;
  margin-block: 1rem 0;
  padding: 0;
  list-style: none;
}

.read-next-card,
.guide-list li {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.read-next-card {
  display: block;
  padding: 1rem;
  text-decoration: none;
}

.read-next-card strong,
.guide-list a {
  color: var(--text);
  font-family: "Source Serif 4", Georgia, Cambria, "Times New Roman", serif;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.35;
}

.read-next-card p,
.guide-list p {
  margin-block: 0.5rem 0;
  color: var(--muted);
  font-size: 0.95em;
}

.guide-list li {
  padding: 1rem;
}

.guide-list a {
  text-decoration-color: color-mix(in srgb, var(--accent) 42%, transparent);
}

.guide-card__number {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.card-meta {
  display: block;
  margin-top: 1rem;
}

.cta {
  display: block;
  margin-block: 2.5rem 0;
  padding: 0 0 0 1.25rem;
  border-left: 2px solid var(--accent);
  color: var(--text);
  text-decoration: none;
}

.cta strong {
  color: var(--accent);
}

pre {
  overflow-x: hidden;
  margin: 1rem 0 1.5rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  font-size: 0.875em;
  line-height: 1.6;
  white-space: pre-wrap;
}

.template-card pre.template-body {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: var(--paper);
  color: var(--paper-ink);
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem 0 4rem;
  font-size: 0.88rem;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 1rem;
}

@media (max-width: 640px) {
  .site-header__inner {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 1rem 0;
  }

  .header-note {
    max-width: 32ch;
  }

  .site-header__actions {
    width: 100%;
    justify-content: space-between;
  }

  .short-answer,
  .template-kicker,
  .template-subject,
  .template-body {
    padding-inline: 1rem;
  }
}
