/*
 * Reelery: public web pages.
 *
 * The palette is lifted from src/theme/tokens.ts so the site and the app read
 * as one thing. If the app's ramp moves, move these with it.
 */

:root {
  --ground: #faf8f5;
  --surface: #ffffff;
  --sunken: #f2eee8;
  --line: #e4ded5;
  --line-strong: #cfc7bb;
  --ink: #1a1714;
  --ink-muted: #5c544a;
  --ink-subtle: #a89e90;
  --accent: #d2542a;
  --accent-hover: #ae4220;
  --on-accent: #ffffff;

  --serif: Georgia, 'Times New Roman', Times, serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #221e1a;
    --surface: #2a2620;
    --sunken: #100e0c;
    --line: #413b34;
    --line-strong: #5c544a;
    --ink: #faf8f5;
    --ink-muted: #a89e90;
    --ink-subtle: #7d7367;
    --accent: #e57a55;
    --accent-hover: #f0a48a;
    --on-accent: #100e0c;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ── Chrome ─────────────────────────────────────────────────────────────── */

.masthead {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.masthead-inner,
main,
.site-footer-inner {
  margin: 0 auto;
  max-width: 44rem;
  padding: 0 1.5rem;
}

.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--accent);
  text-decoration: none;
}

.wordmark:hover {
  color: var(--accent-hover);
}

.masthead nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 0.95rem;
}

.masthead nav a {
  color: var(--ink-muted);
  text-decoration: none;
}

.masthead nav a:hover,
.masthead nav a[aria-current='page'] {
  color: var(--accent);
}

main {
  padding-top: 3rem;
  padding-bottom: 4rem;
}

/* ── Type ───────────────────────────────────────────────────────────────── */

h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 6vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

h2 {
  font-size: 1.3rem;
  line-height: 1.3;
  margin: 2.75rem 0 0.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}

h3 {
  font-size: 1.05rem;
  margin: 1.75rem 0 0.5rem;
}

p,
ul,
ol,
dl {
  margin: 0 0 1.1rem;
}

ul,
ol {
  padding-left: 1.35rem;
}

li {
  margin-bottom: 0.5rem;
}

li > ul,
li > ol {
  margin-top: 0.5rem;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

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

strong {
  font-weight: 650;
}

code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--sunken);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

.lede {
  font-size: 1.15rem;
  color: var(--ink-muted);
  margin-bottom: 2rem;
}

.updated {
  font-size: 0.9rem;
  color: var(--ink-subtle);
  margin-bottom: 2.5rem;
}

/* ── Blocks ─────────────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 0 0 1.5rem;
}

.card > :last-child {
  margin-bottom: 0;
}

.card h2,
.card h3 {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.callout {
  border-left: 3px solid var(--accent);
  background: var(--sunken);
  border-radius: 0 8px 8px 0;
  padding: 1rem 1.25rem;
  margin: 0 0 1.5rem;
}

.callout > :last-child {
  margin-bottom: 0;
}

.steps {
  counter-reset: step;
  list-style: none;
  padding-left: 0;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 2.75rem;
  margin-bottom: 1rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.05rem;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.9rem;
  font-weight: 650;
  display: flex;
  align-items: center;
  justify-content: center;
}

.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.5rem;
  border: 1px solid var(--line);
  border-radius: 12px;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

thead th {
  background: var(--sunken);
  font-weight: 650;
  white-space: nowrap;
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: none;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 2rem 0;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.site-footer nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.site-footer a {
  color: var(--ink-muted);
}

.site-footer a:hover {
  color: var(--accent);
}

.site-footer p {
  margin: 0;
}

/* ── Home ───────────────────────────────────────────────────────────────── */

.hero {
  text-align: center;
  padding: 2rem 0 3rem;
}

.hero h1 {
  margin-bottom: 1rem;
}

.hero .lede {
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
}

.how {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  margin-bottom: 2rem;
}

.how h3 {
  margin-top: 0;
}

.how p:last-child {
  margin-bottom: 0;
}
