:root {
  --bg: #FBFAF8;
  --surface: #FFFFFF;
  --surface-2: #F3F0EA;
  --text: #23211D;
  --muted: #5B574F;
  --border: #E5E1D8;
  --brand: #B8333A;
  --brand-hover: #0B5A53;
  --brand-soft: #E1F0EE;
  --on-brand: #FFFFFF;
  --radius: 12px;
  --max: 1040px;
  --prose: 720px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171614;
    --surface: #211F1C;
    --surface-2: #2A2824;
    --text: #EDEAE4;
    --muted: #B3ADA3;
    --border: #3A3732;
    --brand: #4FB8AD;
    --brand-hover: #6CCBC1;
    --brand-soft: #1D3532;
    --on-brand: #0E1F1D;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

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

a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-hover); }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2rem); letter-spacing: -.01em; margin-top: 0; }
h3 { font-size: 1.15rem; }
p, ul, ol { margin: 0 0 1em; }

code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: .9em;
  background: var(--surface-2);
  padding: .1em .35em;
  border-radius: 4px;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.prose > * { max-width: var(--prose); }
.prose > .table-wrap, .prose > figure { max-width: 100%; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }

/* Header */
.site-header { border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.logo img { width: 28px; height: 28px; }
.nav { display: flex; gap: 18px; flex-wrap: wrap; font-size: .95rem; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); text-decoration: underline; }

/* Buttons */
.btn {
  display: inline-block;
  background: var(--brand);
  color: var(--on-brand);
  text-decoration: none;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 10px;
  border: 1px solid transparent;
}
.btn:hover { background: var(--brand-hover); color: var(--on-brand); }
.btn.secondary { background: transparent; color: var(--brand); border-color: var(--border); }
.btn.secondary:hover { background: var(--brand-soft); color: var(--brand); }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 24px 0 8px; }

/* Sections */
section { padding: 56px 0; }
section + section { border-top: 1px solid var(--border); }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 640px; }
.small { font-size: .9rem; color: var(--muted); }

.hero { padding: 64px 0 48px; }
.hero .grid { display: grid; grid-template-columns: 1fr; gap: 32px; align-items: center; }
@media (min-width: 900px) { .hero .grid { grid-template-columns: 1fr 1.15fr; } }

.shot {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .08);
  display: block;
  background: var(--surface);
}
figure { margin: 0; }
figcaption { font-size: .92rem; color: var(--muted); margin-top: 10px; }

.shots { display: grid; grid-template-columns: 1fr; gap: 28px; }
@media (min-width: 760px) { .shots { grid-template-columns: 1fr 1fr; } .shots figure:first-child { grid-column: 1 / -1; } }

.steps { list-style: none; padding: 0; display: grid; gap: 16px; grid-template-columns: 1fr; counter-reset: step; }
@media (min-width: 760px) { .steps.cols { grid-template-columns: repeat(3, 1fr); } }
.steps > li {
  counter-increment: step;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.steps > li::before {
  content: counter(step);
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand);
  font-weight: 700; margin-bottom: 10px;
}
.steps > li > :last-child { margin-bottom: 0; }

.cards { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .cards { grid-template-columns: 1fr 1fr; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.card.featured { border-color: var(--brand); }
.card ul { padding-left: 1.2em; }
.card :last-child { margin-bottom: 0; }
.badge { display: inline-block; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: var(--brand-soft); color: var(--brand); padding: 3px 9px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }

.note { background: var(--brand-soft); border-left: 4px solid var(--brand); padding: 14px 18px; border-radius: 8px; margin: 0 0 1.2em; }
.note :last-child { margin-bottom: 0; }

/* FAQ (native details: works without JS) */
details { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 18px; margin-bottom: 10px; }
summary { cursor: pointer; font-weight: 600; }
details[open] summary { margin-bottom: 8px; }
details :last-child { margin-bottom: 0; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); margin: 0 0 1.2em; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--border); }
thead th { background: var(--surface-2); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }

/* Article pages */
.article { padding: 48px 0 56px; }
.article h2 { margin-top: 1.8em; }
.article h3 { margin-top: 1.4em; }
.article ol, .article ul { padding-left: 1.3em; }
.article li { margin-bottom: .4em; }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 16px; }

.cta { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin: 2em 0 0; }
.cta :last-child { margin-bottom: 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 32px 0 40px; font-size: .9rem; color: var(--muted); }
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.site-footer a { color: var(--muted); }
.site-footer p { margin: 0 0 .5em; }
