/* One stylesheet for both sites. A theme sets the colours and the display face; the layout is shared. */
:root {
  --bg: #ffffff;
  --panel: #f4f4f4;
  --ink: #0b0b0c;
  --ink-2: rgb(11 11 12 / 0.66);
  --line: #e0e0e0;
  --accent: #6b3fe0;
  --accent-fill: #8657e7;
  --accent-soft: #f1ebff;
  --code-bg: #111014;
  --code-ink: #ece9f5;
  --display: "Instrument Sans", system-ui, sans-serif;
  --display-weight: 500;
  --display-tracking: -0.03em;
  --sans: "Instrument Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 14px;
  --measure: 720px;
  --wide: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
}
[data-theme="paper"] {
  --bg: #f4f1ea;
  --panel: #ebe7dd;
  --ink: #14130f;
  --ink-2: rgb(20 19 15 / 0.68);
  --line: #d9d3c5;
  --accent: #1f35c9;
  --accent-fill: #1f35c9;
  --accent-soft: #e2e4f6;
  --code-bg: #14130f;
  --code-ink: #f1ede2;
  --display: "Instrument Serif", Georgia, serif;
  --display-weight: 400;
  --display-tracking: -0.015em;
  --radius: 4px;
}
[data-theme="night"] {
  --bg: #0a0b0d;
  --panel: #16181c;
  --ink: #f2f3ee;
  --ink-2: rgb(242 243 238 / 0.66);
  --line: #26292f;
  --accent: #c8f04a;
  --accent-fill: #c8f04a;
  --accent-soft: #15190c;
  --on-accent: #0a0b0d;
  --code-bg: #16181c;
  --code-ink: #e9ecdf;
  --display-weight: 400;
  --display-tracking: -0.04em;
  --radius: 2px;
}
[data-theme="clay"] {
  --bg: #f7f3ec;
  --panel: #ede6da;
  --ink: #1d1a16;
  --ink-2: rgb(29 26 22 / 0.68);
  --line: #dfd6c6;
  --accent: #a8431f;
  --accent-fill: #c2552d;
  --accent-soft: #f3e3d8;
  --code-bg: #1d1a16;
  --code-ink: #f3ecdf;
  --display: "Instrument Serif", Georgia, serif;
  --display-weight: 400;
  --display-tracking: -0.02em;
  --radius: 10px;
}
[data-theme="mono"] {
  --bg: #f3f4f2;
  --panel: #e6e8e4;
  --ink: #0c0e0d;
  --ink-2: rgb(12 14 13 / 0.66);
  --line: #d3d7d1;
  --accent: #0b6d4b;
  --accent-fill: #0f8a5f;
  --accent-soft: #dfeee7;
  --code-bg: #0c0e0d;
  --code-ink: #dff5ea;
  --display: "JetBrains Mono", ui-monospace, monospace;
  --display-weight: 500;
  --display-tracking: -0.05em;
  --radius: 0px;
}
[data-theme="sky"] {
  --bg: #ffffff;
  --panel: #eef3fa;
  --ink: #07101f;
  --ink-2: rgb(7 16 31 / 0.66);
  --line: #dbe3ee;
  --accent: #0a55c4;
  --accent-fill: #0a66e8;
  --accent-soft: #e8f1fe;
  --code-bg: #07101f;
  --code-ink: #e6eefb;
  --display-weight: 600;
  --display-tracking: -0.04em;
  --radius: 20px;
}
[data-theme="plum"] {
  --bg: #17121c;
  --panel: #231b2b;
  --ink: #f6eff5;
  --ink-2: rgb(246 239 245 / 0.68);
  --line: #35293f;
  --accent: #ff8fb1;
  --accent-fill: #ff8fb1;
  --accent-soft: #261a2a;
  --on-accent: #17121c;
  --code-bg: #0f0b13;
  --code-ink: #f1e6ee;
  --display: "Instrument Serif", Georgia, serif;
  --display-weight: 400;
  --display-tracking: -0.015em;
  --radius: 18px;
}
[data-theme="signal"] {
  --bg: #eef0f3;
  --panel: #e1e4e9;
  --ink: #0d0f12;
  --ink-2: rgb(13 15 18 / 0.66);
  --line: #cdd2d9;
  --accent: #c2241c;
  --accent-fill: #e5342b;
  --accent-soft: #fbe4e2;
  --code-bg: #0d0f12;
  --code-ink: #eef0f3;
  --display-weight: 600;
  --display-tracking: -0.045em;
  --radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: var(--bg); padding: 8px 12px; z-index: 10; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 28px;
  padding: 14px var(--gutter);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.01em; text-decoration: none; margin: 0; }
.mark { width: 18px; height: 18px; border-radius: 5px; background: var(--accent-fill); display: inline-block; }
[data-theme="paper"] .mark { border-radius: 50%; }
.top nav { display: flex; gap: 22px; margin-left: auto; font-size: 15px; }
.top nav a { text-decoration: none; color: var(--ink-2); }
.top nav a:hover { color: var(--ink); }
.btn {
  display: inline-flex; align-items: center; white-space: nowrap;
  padding: 9px 16px; border-radius: 999px;
  background: var(--ink); color: var(--bg); text-decoration: none; font-size: 15px; font-weight: 500;
  transition: background 0.2s;
}
.btn:hover { background: var(--accent-fill); color: var(--on-accent, #fff); }

/* Page */
main { max-width: calc(var(--measure) + var(--gutter) * 2); margin: 0 auto; padding: 56px var(--gutter) 40px; }
main.wide { max-width: calc(var(--wide) + var(--gutter) * 2); }
main.wide > .lede, main.wide > .brief, main.wide > h1, main.wide > section > p, main.wide > .faq { max-width: var(--measure); }
.crumbs { font-size: 14px; color: var(--ink-2); margin-bottom: 28px; }
.crumbs a { text-decoration: none; }
.eyebrow { font: 500 12px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin: 0 0 18px; }
h1, h2 { font-family: var(--display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); text-wrap: balance; margin: 0; }
h1 { font-size: clamp(38px, 6.2vw, 68px); line-height: 1.02; margin-bottom: 28px; }
main.wide h1 { font-size: clamp(44px, 7.4vw, 92px); max-width: 15ch; }
h2 { font-size: clamp(27px, 3.4vw, 38px); line-height: 1.1; margin: 64px 0 18px; }
h3 { font-size: 18px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 6px; }
p { margin: 0 0 16px; }
.lede { font-size: clamp(19px, 2vw, 22px); line-height: 1.45; color: var(--ink-2); margin-bottom: 32px; }
.note { font-size: 14.5px; color: var(--ink-2); }
section.break, main:not(.wide) .cta { width: min(var(--wide), 100vw - var(--gutter) * 2); margin-left: 50%; transform: translateX(-50%); }
main.wide section.break { width: auto; margin-left: 0; transform: none; }
section.break > h2, section.break > p { max-width: var(--measure); }

.byline { font-size: 14.5px; color: var(--ink-2); margin: -12px 0 28px; }
.result figure { margin: 24px 0 0; }
.result img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); }
.result figcaption { padding-top: 12px; }
.run { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 24px; margin: 20px 0 0; font-size: 15px; }
.run > div { border-top: 1px solid var(--line); padding: 12px 0; }
.run dt { font: 500 12px/1.4 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 4px; }
.run dd { margin: 0; }

/* Answer in brief */
.brief { border-left: 3px solid var(--accent-fill); background: var(--accent-soft); padding: 20px 24px; border-radius: 0 var(--radius) var(--radius) 0; margin: 0 0 8px; }
.brief p { margin: 0 0 10px; font-size: 18px; line-height: 1.5; }
.brief p:last-child { margin: 0; }
.brief .label, .prompt figcaption span, caption { font: 500 12px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.brief .label { color: var(--accent); margin-bottom: 12px; }

/* Lists */
.list { padding-left: 22px; margin: 0 0 16px; }
.list li { margin-bottom: 8px; }
.check { list-style: none; padding: 0; }
.check li { padding: 12px 0 12px 30px; border-top: 1px solid var(--line); margin: 0; position: relative; }
.check li::before { content: ""; position: absolute; left: 4px; top: 21px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent-fill); }

/* Prompt block */
.prompt { margin: 0 0 12px; background: var(--code-bg); color: var(--code-ink); border-radius: var(--radius); overflow: hidden; }
.prompt figcaption { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-bottom: 1px solid rgb(255 255 255 / 0.12); color: rgb(255 255 255 / 0.62); }
.copy { font: 500 13px/1 var(--sans); color: var(--code-bg); background: var(--code-ink); border: 0; border-radius: 999px; padding: 8px 14px; cursor: pointer; }
.copy:hover { background: #fff; }
.prompt pre { margin: 0; padding: 20px 18px 22px; white-space: pre-wrap; overflow-wrap: anywhere; font: 400 14.5px/1.65 var(--mono); }

/* Template cards */
.tpl-grid, .topic-grid, .guide-list, .chips { list-style: none; padding: 0; margin: 0; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px 20px; margin-top: 28px; }
.tpl-media { display: block; border-radius: var(--radius); overflow: hidden; background: var(--panel); aspect-ratio: 16 / 10; }
.tpl-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.tpl:hover .tpl-media img { transform: scale(1.03); }
.tpl-body { padding-top: 14px; }
.tpl-body p { font-size: 15px; line-height: 1.5; color: var(--ink-2); margin-bottom: 8px; }
.tpl h3 a { text-decoration: none; }
.tags { display: flex; gap: 6px; margin-bottom: 8px !important; }
.tag { font: 500 11px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; padding: 5px 7px; border-radius: 4px; background: var(--panel); color: var(--ink-2); }
.tag-free { background: var(--accent-fill); color: var(--on-accent, #fff); }
.tag-pro { background: var(--ink); color: var(--bg); }
.more { font-size: 15px; font-weight: 500; }

/* Topic tiles */
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; margin-top: 24px; }
.topic-grid a { display: block; text-decoration: none; }
.topic-grid img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius); background: var(--panel); margin-bottom: 12px; }
.topic-name { display: block; font-weight: 600; letter-spacing: -0.01em; }
.topic-line { display: block; font-size: 15px; color: var(--ink-2); line-height: 1.45; }

/* Guide list */
.guide-list { border-top: 1px solid var(--line); margin-top: 20px; }
.guide-list a { display: block; padding: 16px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.guide-list a > span:first-child { display: block; font-weight: 600; letter-spacing: -0.01em; }
.guide-line { display: block; font-size: 15px; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.chips a { display: block; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-size: 15px; }
.chips a:hover { border-color: var(--accent); }

/* Questions, glossary, facts */
.qa { border-top: 1px solid var(--line); padding: 18px 0 4px; }
.qa p { color: var(--ink-2); }
.glossary > div { border-top: 1px solid var(--line); padding: 18px 0 6px; scroll-margin-top: 80px; }
.glossary dt { font-weight: 600; margin-bottom: 4px; }
.glossary dd { margin: 0 0 12px; color: var(--ink-2); }
.facts { width: 100%; border-collapse: collapse; margin: 40px 0 0; font-size: 16px; }
.facts caption { text-align: left; color: var(--accent); padding-bottom: 12px; }
.facts th, .facts td { text-align: left; vertical-align: top; padding: 12px 0; border-top: 1px solid var(--line); }
.facts th { width: 34%; font-weight: 500; color: var(--ink-2); padding-right: 16px; }

/* Call to action and the note about who writes the site */
.cta { margin-top: 72px; margin-bottom: 0; padding: clamp(28px, 5vw, 56px); background: var(--ink); color: var(--bg); border-radius: var(--radius); }
.cta > p:first-child { font-family: var(--display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); font-size: clamp(28px, 4vw, 46px); line-height: 1.08; max-width: 20ch; margin-bottom: 28px; text-wrap: balance; }
.cta-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin: 0; }
.cta .btn { background: var(--bg); color: var(--ink); }
.cta .btn:hover { background: var(--accent-fill); color: var(--on-accent, #fff); }
.cta a:not(.btn):hover { color: var(--bg); }
:is([data-theme="night"], [data-theme="plum"]) .cta { background: var(--accent-fill); color: var(--on-accent); }
:is([data-theme="night"], [data-theme="plum"]) .cta .btn { background: var(--on-accent); color: var(--ink); }
:is([data-theme="night"], [data-theme="plum"]) .cta .btn:hover { background: var(--bg); color: var(--ink); }
:is([data-theme="night"], [data-theme="plum"]) .prompt { border: 1px solid var(--line); }
[data-theme="mono"] h1, [data-theme="mono"] main.wide h1 { font-size: clamp(32px, 5.2vw, 64px); line-height: 1.08; }
[data-theme="mono"] .btn, [data-theme="mono"] .copy, [data-theme="mono"] .chips a { border-radius: 0; }
.made { margin-top: 72px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 15px; color: var(--ink-2); max-width: var(--measure); }
.made h2 { font: 500 12px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 12px; }
.cite { font-size: 13.5px; overflow-wrap: anywhere; }

/* Footer */
.foot { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; padding: 48px var(--gutter) 56px; margin-top: 48px; border-top: 1px solid var(--line); font-size: 15px; color: var(--ink-2); }
.foot .brand { color: var(--ink); margin-bottom: 10px; }
.foot p { max-width: 40ch; }
.foot nav { display: flex; flex-direction: column; gap: 8px; }
.foot nav a { text-decoration: none; }

@media (max-width: 760px) {
  body { font-size: 16px; }
  .top { gap: 14px; }
  .top nav { display: none; }
  .top .btn { margin-left: auto; padding: 8px 13px; font-size: 14px; }
  .top .long { display: none; }
  .top .brand { font-size: 15px; white-space: nowrap; }
  main { padding-top: 36px; }
  h2 { margin-top: 48px; }
  .foot { grid-template-columns: 1fr; }
  .tpl-grid { grid-template-columns: 1fr; }
  .facts th { width: 40%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tpl-media img { transition: none; }
}
