:root {
  --accent: #b8451f;
  --accent-dark: #973a1a;
  --accent-tint: #f3e2d9;
  --bg: #faf8f5;
  --surface: #ffffff;
  --surface-sunk: #f3f0ec;
  --text: #211d18;
  --muted: #6b6258;
  --border: #e6e0d8;
  --ok: #3f6b3f;
  --warn: #8a6214;
  --stop: #a3341f;
  --radius: 10px;
  --serif: "Lora", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #e4703f;
    --accent-dark: #ef8457;
    --accent-tint: #3a2a20;
    --bg: #1c1a17;
    --surface: #242019;
    --surface-sunk: #292420;
    --text: #f3efe9;
    --muted: #aba194;
    --border: #39332b;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

img, svg { max-width: 100%; }

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------------------------------------------------------------- nav */

header.nav {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  max-width: 1040px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}

.brand svg { width: 22px; height: 22px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a.ghost {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  white-space: nowrap;
}

.nav-links a.ghost:hover { color: var(--text); }

@media (max-width: 680px) {
  .nav-links a.ghost { display: none; }
  .nav-inner { padding: 13px 16px; }
  .brand { font-size: 1.1rem; }
  .btn { padding: 9px 16px; font-size: 0.88rem; }
}

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 7px;
  font-weight: 600;
  font-size: 0.93rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--sans);
}

.btn.primary {
  background: var(--accent);
  color: #fff8f4;
}

.btn.primary:hover { background: var(--accent-dark); }

.btn.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn.secondary:hover { border-color: var(--accent); color: var(--accent); }

/* ---------------------------------------------------------------- disclaimer banner */

.disclaimer {
  background: var(--surface-sunk);
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  padding: 9px 16px;
}

.disclaimer b { color: var(--text); font-weight: 600; }

/* ---------------------------------------------------------------- hero */

.hero {
  padding: 88px 0 60px;
  text-align: center;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 560;
  font-size: clamp(2.1rem, 5.2vw, 3.6rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 20px;
}

.hero h1 .accent { color: var(--accent); font-style: italic; }

.hero p.sub {
  max-width: 640px;
  margin: 0 auto 34px;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.6;
}

.hero .cta-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------- sections */

section { padding: 60px 0; }

section.alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

h2.section-title {
  font-family: var(--serif);
  font-weight: 560;
  letter-spacing: -0.01em;
  font-size: 1.9rem;
  text-align: center;
  margin: 0 0 10px;
}

p.section-sub {
  text-align: center;
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto 44px;
  font-size: 1rem;
}

/* ---------------------------------------------------------------- how it works */

.flow {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
  align-items: stretch;
  counter-reset: step;
}

.flow-step {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 20px 18px;
  width: 200px;
  text-align: left;
  position: relative;
}

.flow-step:not(:first-child) { border-left: none; }

.flow-step .num {
  font-family: var(--serif);
  font-style: italic;
  color: var(--accent);
  font-size: 1.3rem;
  display: block;
  margin-bottom: 10px;
}

.flow-step h3 { font-size: 0.95rem; margin: 0 0 6px; font-weight: 600; }
.flow-step p { font-size: 0.83rem; color: var(--muted); margin: 0; line-height: 1.5; }

@media (max-width: 760px) {
  .flow { flex-direction: column; align-items: stretch; max-width: 360px; margin: 0 auto; }
  .flow-step { width: auto; border-left: 1px solid var(--border) !important; border-top: none; }
  .flow-step:not(:first-child) { border-top: none; margin-top: -1px; }
}

/* ---------------------------------------------------------------- feature grid */

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

@media (max-width: 860px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
}

.feature {
  background: var(--surface);
  padding: 26px 22px;
}

.feature .icon {
  font-family: var(--serif);
  font-style: italic;
  color: var(--accent);
  font-size: 1.4rem;
  display: block;
  margin-bottom: 12px;
}

.feature h3 { font-size: 1rem; margin: 0 0 6px; font-weight: 600; }
.feature p { font-size: 0.89rem; color: var(--muted); margin: 0; line-height: 1.5; }

/* ---------------------------------------------------------------- example */

.example {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 30px;
  max-width: 700px;
  margin: 0 auto;
  font-size: 0.93rem;
}

.example .q { color: var(--muted); margin-bottom: 16px; font-size: 0.95rem; }
.example .q b { color: var(--text); font-family: var(--serif); font-style: italic; font-weight: 500; }

.example ul { padding-left: 0; margin: 0 0 18px; list-style: none; }
.example li { margin: 12px 0; padding-left: 16px; border-left: 2px solid var(--accent-tint); line-height: 1.6; }

.example .sources {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  font-size: 0.83rem;
  color: var(--muted);
}

.cite-tag {
  font-size: 0.72em;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--accent-tint);
  color: var(--accent-dark);
  margin-left: 2px;
}

.checks {
  margin-top: 18px;
  display: grid;
  gap: 7px;
  font-size: 0.81rem;
}

.checks .row { display: flex; gap: 8px; color: var(--muted); }
.checks .ok-mark { color: var(--ok); font-weight: 700; }

/* ---------------------------------------------------------------- stack */

.stack-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  max-width: 700px;
  margin: 0 auto;
}

@media (max-width: 560px) {
  .stack-list { grid-template-columns: 1fr; }
}

.stack-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface);
  padding: 13px 18px;
  font-size: 0.88rem;
}

.stack-item .license {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

/* ---------------------------------------------------------------- final cta */

.final-cta {
  text-align: center;
}

.final-cta h2 { margin-bottom: 10px; }
.final-cta p { color: var(--muted); margin-bottom: 28px; }

/* ---------------------------------------------------------------- footer */

footer {
  border-top: 1px solid var(--border);
  padding: 34px 0 44px;
  font-size: 0.84rem;
  color: var(--muted);
}

footer .foot-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
}

footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--accent); }

footer .links { display: flex; gap: 18px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- live touches */

.cursor {
  display: inline-block;
  width: 3px;
  height: 0.85em;
  background: var(--accent);
  margin-left: 4px;
  vertical-align: -0.1em;
  animation: blink 1s steps(1) infinite;
}

@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; opacity: 0; }
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* Scroll-reveal: the .reveal class is only ever added by JS, so content stays
   fully visible with no-JS or if the script fails -- never hidden by default. */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}
