/*
 * Steel Note public pages, drawn like the app (Ledger cards): warm paper, an eyebrow label over
 * a serif page title, sections as bordered cards with an emoji and a serif heading over a
 * hairline, and a floating nav with the pinned-card red and ink double border.
 * Colours are the app's tokens (src/shared/presentation/tokens.ts); dark follows the system.
 */

:root {
  --paper: #fbf7ee;
  --ink: #1d2433;
  --pen: #1f3f8f;
  --muted: #625f57;
  --rule: #e1ddd2;
  --alert: #a3332f;
  --card: #fffcf5;
  --card-border: #d3ccbd;
  --serif: "Noto Serif", Georgia, "DejaVu Serif", serif;
  --sans: system-ui, "Roboto", "Noto Sans", sans-serif;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #17191e;
    --ink: #ebe8df;
    --pen: #a9c5ff;
    --muted: #a19e94;
    --rule: #2c3039;
    --alert: #ff8f87;
    --card: #1c1f25;
    --card-border: #383d48;
  }
}

* {
  box-sizing: border-box;
}

body {
  max-width: 40rem;
  margin: 0 auto;
  /* Bottom padding keeps the last card clear of the floating nav. */
  padding: 24px 16px 120px;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
}

a {
  color: var(--pen);
  text-underline-offset: 3px;
}

code {
  font-size: 0.9em;
}

/* ---------- Page head ---------- */

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

h1 {
  margin: 4px 0 8px;
  font: 700 28px/1.15 var(--serif);
}

.sub {
  margin: 0;
  color: var(--muted);
}

/* ---------- Section cards ---------- */

.card {
  margin-top: 24px;
  padding: 12px 16px 16px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: var(--card);
}

.page-head + .card {
  margin-top: 32px;
}

.card h2 {
  display: flex;
  gap: 8px;
  margin: 0 0 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
  font: 700 18px/1.25 var(--serif);
}

.card p {
  margin: 8px 0 0;
}

/* Lists read as the app's ruled rows: one hairline under each, none under the last. */
.card ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.card li {
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}

.card li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.card li b {
  display: block;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

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

nav {
  position: fixed;
  left: 50%;
  bottom: 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(40rem - 16px, calc(100% - 16px));
  padding: 4px 0;
  border: 1.5px solid var(--alert);
  border-radius: 22px;
  background: var(--card);
  /* Inner ink line 2 px inside the red border, then the floating shadow. */
  box-shadow:
    inset 0 0 0 2px var(--card),
    inset 0 0 0 3px var(--ink),
    0 6px 16px rgb(0 0 0 / 28%);
  transform: translateX(-50%);
}

nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 52px;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

nav a span {
  font-size: 18px;
  line-height: 1.2;
}

/* The current page: ink with a short rule above it, like the app's tab bar. */
nav a[aria-current="page"] {
  color: var(--ink);
}

nav a[aria-current="page"]::before {
  content: "";
  width: 18px;
  height: 2px;
  margin-bottom: 3px;
  background: var(--ink);
}
