/* CopyPasta — site stylesheet. Plain CSS, no JavaScript. Follows the OS light/dark setting. */
@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@400;600;800&display=swap');

:root {
  --bg: #f8f3ea;
  --surface: #efe7d9;
  --ink: #241c17;
  --muted: #5c5047;
  --rule: color-mix(in srgb, #241c17 38%, transparent);
  --red: #e0402a;
  --red-hover: #c7331e;
  --red-deep: #a92a17;
  --yellow: #f2bf45;
  --yellow-soft: #f7e2a6;
  --on-red: #fff9f0;
  --font: "Archivo", system-ui, sans-serif;
  --mono: ui-monospace, Consolas, monospace;
  --max: 1240px;
  --pad: 32px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1714;
    --surface: #27201b;
    --ink: #f4ece2;
    --muted: #b8aca0;
    --rule: color-mix(in srgb, #f4ece2 32%, transparent);
    --red: #ff6549;
    --red-hover: #ff7d65;
    --red-deep: #ff8d78;
    --yellow-soft: #4d3c15;
    --on-red: #1c1714;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh;
  background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.6;
}
h1, h2, h3 { font-weight: 800; margin: 0; }
p { margin: 0 0 14px; }
p:last-child { margin-bottom: 0; }
img { display: block; max-width: 100%; }
figure { margin: 0; }
a { color: var(--red-deep); text-underline-offset: 3px; }
a:hover { color: var(--red); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--red) 30%, transparent); }

kbd {
  font-family: inherit; font-weight: 600; font-size: 13px;
  padding: 1px 7px; background: var(--bg);
  border: 1.5px solid var(--ink); border-bottom-width: 3px;
  white-space: nowrap;
}
code { font-family: var(--mono); font-size: 14px; background: var(--surface); padding: 1px 5px; }

.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--pad); }
.muted { color: var(--muted); }
.kicker {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  font-weight: 600; color: var(--red-deep); margin-bottom: 12px;
}
.kicker .dot { width: 10px; height: 10px; background: var(--yellow); }
.lead { font-size: 19px; color: var(--muted); max-width: 560px; text-wrap: pretty; }
.lead strong { color: var(--ink); }
.highlight { background: linear-gradient(transparent 62%, var(--yellow) 62%); }
.rule-b { border-bottom: 2px solid var(--rule); }

/* — header — */
.site-header { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 2px solid var(--rule); }
.site-header .wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding-block: 12px; }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand img { width: 36px; height: 36px; }
.brand span { font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.nav { display: flex; gap: 22px; flex-wrap: wrap; }
.nav a {
  text-decoration: none; font-size: 15px; font-weight: 600; color: var(--muted);
  padding: 4px 0; border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--red); }

/* — buttons — */
.btn {
  display: inline-flex; align-items: center; justify-content: flex-start;
  font-weight: 800; font-size: 16px; text-decoration: none;
  padding: 14px 20px; border: 2px solid transparent;
}
.btn-sm { font-size: 14px; padding: 8px 16px; }
.btn-primary { background: var(--red); color: var(--on-red); }
.btn-primary:hover { background: var(--red-hover); color: var(--on-red); }
.btn-primary:active { background: var(--red-deep); }
.btn-secondary { border-color: var(--rule); color: var(--ink); padding: 12px 20px; }
.btn-secondary:hover { background: var(--surface); color: var(--ink); }
.btn-invert { background: var(--on-red); color: var(--red-deep); font-size: 17px; padding: 16px 22px; min-width: 260px; }
.btn-invert:hover { background: var(--bg); color: var(--red-deep); }
.btn-wide { min-width: 230px; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* — home — */
.hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 56px; align-items: center; padding-block: 72px 64px; }
.hero h1 { font-size: clamp(40px, 5.4vw, 68px); line-height: 1.02; letter-spacing: -0.035em; margin-bottom: 24px; text-wrap: balance; }
.hero .lead { margin-bottom: 32px; }
.hero .fine { font-size: 13px; color: var(--muted); margin-top: 16px; }
.hero-shot { border: 2px solid var(--rule); aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface); }
.hero-shot img { width: 100%; height: 100%; object-fit: cover; object-position: 57% 62%; }

.cells { display: grid; gap: 2px; background: var(--rule); }
.cells-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.cells-feat { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); border-top: 2px solid var(--rule); }
.cell { background: var(--bg); padding: 28px 32px; }
a.cell { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--ink); padding: 32px; }
a.cell:hover { background: var(--surface); color: var(--ink); }
.cell .num { font-size: 12px; font-weight: 600; color: var(--red-deep); }
.cell .title { font-weight: 800; font-size: 21px; letter-spacing: -0.01em; }
.cell .body { color: var(--muted); font-size: 15px; }
.keys { display: flex; gap: 6px; margin-bottom: 12px; }
.keys kbd { font-size: 14px; padding: 2px 9px; }
.keys kbd.hot { font-weight: 800; border-color: var(--red); background: var(--yellow-soft); }
.cell .label { font-weight: 800; font-size: 18px; }
.cell .sub { color: var(--muted); font-size: 15px; }

.section-head { padding-block: 72px 32px; }
h2.section-title { font-size: clamp(30px, 3.6vw, 44px); line-height: 1.08; letter-spacing: -0.03em; max-width: 720px; text-wrap: balance; margin-bottom: 8px; }

.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 48px; padding-block: 72px; }
.steps { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--rule); }
.steps li { display: grid; grid-template-columns: 56px 1fr; gap: 16px; padding: 20px 0; border-bottom: 2px solid var(--rule); align-items: baseline; font-size: 18px; }
.steps li > span:first-child { font-weight: 800; font-size: 28px; color: var(--red); }
.steps kbd { font-size: 14px; }

.poster { background: var(--red); color: var(--on-red); }
.poster .wrap { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-end; justify-content: space-between; padding-block: 80px; }
.poster h2 { font-size: clamp(40px, 6vw, 80px); line-height: 0.98; letter-spacing: -0.04em; max-width: 820px; }

/* — download — */
.page-hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 48px; align-items: end; padding-block: 64px; }
.page-hero h1 { font-size: clamp(38px, 5vw, 60px); line-height: 1.02; letter-spacing: -0.035em; margin-bottom: 20px; }
.page-hero .lead { font-size: 18px; }
.dl-box { border: 2px solid var(--rule); background: var(--surface); padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.dl-box .meta { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.dl-box .meta strong { font-size: 18px; font-weight: 800; }
.dl-box .meta span { font-size: 13px; color: var(--muted); }
.dl-box .btn { font-size: 17px; padding: 16px 20px; }
.dl-box > a:last-child { font-size: 14px; }
.cells .step { padding: 36px 32px; }
.step .n { font-weight: 800; font-size: 28px; color: var(--red); margin-bottom: 8px; }
.step h3 { font-size: 21px; margin-bottom: 8px; }
.step p { color: var(--muted); }
.step strong { color: var(--ink); }
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 32px; padding-block: 48px 72px; }
.shot .frame { aspect-ratio: 16 / 10; border: 2px solid var(--rule); overflow: hidden; background: var(--surface); }
.shot .frame img { width: 100%; height: 100%; object-fit: cover; }
figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }
.next { border-top: 2px solid var(--rule); }
.next .wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 40px; padding-block: 56px 80px; }
.next h2 { font-size: 32px; letter-spacing: -0.02em; }
.next p { color: var(--muted); font-size: 17px; margin-bottom: 20px; }

/* — docs — */
.docs { max-width: var(--max); margin: 0 auto; display: flex; flex-wrap: wrap; }
.sidebar { flex: 1 1 220px; padding: 40px 24px 40px var(--pad); border-right: 2px solid var(--rule); }
.sidebar-inner { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 28px; }
.sidebar h2 { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding-bottom: 8px; border-bottom: 2px solid var(--rule); margin-bottom: 6px; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar a { display: block; text-decoration: none; font-size: 15px; padding: 7px 10px; color: var(--muted); border-left: 3px solid transparent; }
.sidebar a:hover { color: var(--ink); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.sidebar a[aria-current="page"] { color: var(--ink); font-weight: 800; background: var(--surface); border-left-color: var(--red); }
.article { flex: 999 1 520px; min-width: 0; max-width: 860px; padding: 48px var(--pad) 80px 48px; }
.article h1 { font-size: clamp(34px, 4vw, 48px); line-height: 1.05; letter-spacing: -0.03em; margin-bottom: 16px; }
.article .lead { max-width: none; margin-bottom: 32px; }
.article h2 { font-size: 24px; letter-spacing: -0.02em; margin: 36px 0 12px; padding-top: 24px; border-top: 2px solid var(--rule); }
.article h2.plain { border-top: 0; padding-top: 0; font-size: 22px; margin: 0 0 4px; }
.article h3 { font-size: 20px; margin: 28px 0 10px; }
.article ul, .article ol { margin: 0 0 16px; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.article figure { margin: 0 0 40px; }
.article figure .frame { border: 2px solid var(--rule); overflow: hidden; background: var(--surface); }
.article figure img { width: 100%; height: auto; }
.note { border-top: 2px solid var(--rule); border-bottom: 2px solid var(--rule); padding: 18px 0 18px 20px; margin: 20px 0; background: linear-gradient(90deg, var(--yellow) 0 6px, transparent 6px); }
.note .note-title { font-weight: 800; margin-bottom: 6px; }

.table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 0 0 32px; }
.table th { text-align: left; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 8px 0; border-bottom: 2px solid var(--rule); }
.table td { padding: 12px 10px 12px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.table td:first-child { white-space: nowrap; }
.table .w40 { width: 40%; }
.table .mono { font-family: var(--mono); font-size: 14px; }
.table .aside { font-size: 12px; color: var(--muted); }
.table tbody tr:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.pill { font-size: 12px; font-weight: 600; padding: 2px 9px; background: var(--yellow-soft); }

.cells-topics { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); border: 2px solid var(--rule); }
.cells-topics a.cell { padding: 24px; gap: 6px; }
.cells-topics .title { font-size: 19px; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--rule); border: 2px solid var(--rule); margin-top: 64px; }
.pager a, .pager span { background: var(--bg); padding: 18px 20px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; }
.pager a:hover { background: var(--surface); color: var(--ink); }
.pager small { font-size: 12px; color: var(--muted); }
.pager strong { font-weight: 800; }
.pager .next-link { text-align: right; }

/* — credits — */
.credits { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 56px; padding-block: 64px 80px; }
.credits h1 { font-size: clamp(38px, 5vw, 60px); line-height: 1.02; letter-spacing: -0.035em; margin-bottom: 20px; }
.credits .lead { font-size: 18px; }
.credit-list { border-top: 2px solid var(--rule); }
.credit-list > div { padding: 22px 0; border-bottom: 2px solid var(--rule); }
.credit-list h3 { font-size: 20px; margin-bottom: 6px; }

/* — footer — */
.site-footer { border-top: 2px solid var(--rule); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: center; padding-block: 28px; font-size: 14px; color: var(--muted); }
.site-footer .foot-brand { display: flex; align-items: center; gap: 10px; margin-right: auto; flex-wrap: wrap; }
.site-footer .foot-brand img { width: 24px; height: 24px; }
.site-footer .foot-brand strong { color: var(--ink); }
.site-footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
.site-footer nav a { color: var(--muted); }
.site-footer nav a:hover { color: var(--red); }

@media (max-width: 720px) {
  :root { --pad: 20px; }
  .sidebar { border-right: 0; border-bottom: 2px solid var(--rule); padding: 24px var(--pad); }
  .sidebar-inner { position: static; }
  .article { padding: 32px var(--pad) 64px; }
  .table td:first-child { white-space: normal; }
}
