/* ============================================================================
   hnd-viewer — project site stylesheet
   Hand-written, dependency-free CSS. Quiet, minimal, light theme:
   near-white background, near-black ink, hairline borders, serif headings
   over system sans text. System fonts only — works offline, no CDN, no
   gradients, no glows, no shadows.
   ========================================================================== */

/* ---------- tokens ---------- */
:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --ink: #16181d;
  --ink-soft: #43484f;
  --muted: #777c83;
  --line: #e5e5e5;
  --code-bg: #f0f0f1;

  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
          "Liberation Mono", monospace;

  --header-h: 64px;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { color: #000; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 2px;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.25;
  color: var(--ink);
  margin: 0;
}

p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }

::selection { background: var(--ink); color: var(--bg); }

code { font-family: var(--mono); }

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 100;
  padding: 0.5rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--ink);
  color: var(--ink);
  text-decoration: none;
}
.skip-link:focus { left: 8px; }

.container {
  width: min(44rem, 92vw);
  margin-inline: auto;
}

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

.nav {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1.4rem;
}

.brand {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--ink); text-decoration: none; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-left: auto;
  list-style: none;
}
.nav-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.95rem;
}
.nav-links a:hover { color: var(--ink); text-decoration: underline; }

.nav-gh {
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--ink);
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
}
.nav-gh:hover { border-color: var(--ink); text-decoration: none; }

/* ---------- buttons / links ---------- */
.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--ink);
  border-radius: 2px;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.4;
  text-decoration: none;
}
.btn:hover {
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
}

.text-link { text-decoration: underline; }

/* ---------- shared section scaffolding ---------- */
.section {
  padding: 4.2rem 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--header-h) + 10px);
}

h2 {
  font-size: clamp(1.8rem, 3vw + 0.9rem, 2.3rem);
  margin-bottom: 1rem;
}

.lede {
  color: var(--ink-soft);
  font-size: 1.08rem;
  max-width: 46em;
  margin-bottom: 1.6rem;
}

.note {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 1.6rem;
}

.subhead {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.8rem 0 0.6rem;
}

/* ---------- hero ---------- */
.hero {
  padding: clamp(4rem, 10vw, 7rem) 0 clamp(3rem, 8vw, 5rem);
  text-align: center;
  scroll-margin-top: var(--header-h);
}

.hero-title {
  font-size: clamp(2.6rem, 6vw + 0.8rem, 3.8rem);
  line-height: 1.1;
}

.hero-sub {
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 1.4vw + 0.7rem, 1.25rem);
  max-width: 30em;
  margin: 1.1rem auto 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1.3rem;
  margin: 2rem 0 0;
}

/* ---------- screenshots / demo ---------- */
.shot { margin: 2.4rem 0 0; }

.shot img,
.shot video {
  display: block;
  width: 100%;
  max-width: 40rem;
  margin-inline: auto;
  background: var(--surface);
  border: 1px solid var(--line);
}

.shot figcaption {
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

/* ---------- feature list ---------- */
.feature-list {
  list-style: none;
  margin: 1.2rem 0 0;
}
.feature-list li {
  display: grid;
  grid-template-columns: 13.5rem 1fr;
  gap: 1.4rem;
  align-items: baseline;
  padding: 1.25rem 0;
  border-top: 1px solid var(--line);
}
.feature-list li:first-child { border-top: 0; }
.feature-list h3 { font-size: 1.18rem; }
.feature-list p {
  color: var(--ink-soft);
  font-size: 0.98rem;
  margin: 0;
}

/* ---------- how it works ---------- */
.steps {
  list-style: none;
  margin: 1.2rem 0 0;
  counter-reset: steps;
}
.steps li {
  counter-increment: steps;
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  gap: 0.9rem;
  padding: 1.3rem 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
}
.steps li::before {
  content: counter(steps);
  font-family: var(--serif);
  color: var(--muted);
  font-size: 1.05rem;
  text-align: right;
}
.steps li:first-child { border-top: 0; }
.steps h3 { font-size: 1.16rem; margin-bottom: 0.35rem; }
.steps p { color: var(--ink-soft); font-size: 0.98rem; margin: 0; }

/* ---------- inline code ---------- */
p code,
li code {
  background: var(--code-bg);
  border-radius: 3px;
  padding: 0.12em 0.38em;
  font-size: 0.88em;
  color: var(--ink);
  white-space: nowrap;
}

/* ---------- downloads ---------- */
.dl-list {
  list-style: none;
  margin: 1.4rem 0 0;
}
.dl-list li {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
}
.dl-list li:first-child { border-top: 0; }
.dl-plat { font-weight: 600; }
.dl-art { color: var(--ink-soft); font-size: 0.98rem; }

/* ---------- getting started ---------- */
.plain-list {
  list-style: disc;
  padding-left: 1.35rem;
  margin: 0.4rem 0 1.8rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
}
.plain-list li { margin-bottom: 0.45rem; }

.codeblock {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1.15rem 1.35rem;
  overflow-x: auto;
  margin: 0 0 0.4rem;
}
.codeblock code {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--ink);
  white-space: pre;
  background: none;
  padding: 0;
}

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 3rem 0 0;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.4rem;
  padding-bottom: 2.4rem;
}

.footer-about p {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 0.9rem 0;
}
.footnote { color: var(--muted) !important; font-size: 0.85rem !important; }

.footer-nav h4 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 0.7rem;
}
.footer-nav ul { list-style: none; }
.footer-nav li { margin-bottom: 0.4rem; }
.footer-nav a {
  color: var(--ink-soft);
  font-size: 0.93rem;
  text-decoration: none;
}
.footer-nav a:hover { color: var(--ink); text-decoration: underline; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 1.2rem 0 1.6rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.footer-bottom p { margin: 0; }
.footer-bottom a { color: var(--muted); text-decoration: underline; }
.footer-bottom a:hover { color: var(--ink); }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .feature-list li { grid-template-columns: 1fr; gap: 0.2rem; }
  .dl-list li { grid-template-columns: 1fr; gap: 0.15rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.8rem; }
}

@media (max-width: 700px) {
  body { font-size: 16px; }
  .section { padding: 3.2rem 0; }

  .nav-links { display: none; }   /* single-page anchors; GitHub link stays */
  .nav-gh { margin-left: auto; }

  .nav { height: 56px; }
  :root { --header-h: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .nav-gh, a { transition: none; }
}
