/* ============================================================
   MOMENTLY — Base: reset, layout shell, hero, section heads
   ============================================================ */

/* ---------- Reset / base ----------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 32px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .3s ease, color .3s ease;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.2; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
code, .mono { font-family: var(--font-mono); }

/* ---------- Layout shell ----------------------------------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; align-self: start;
  height: 100vh; overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 28px 20px;
  display: flex; flex-direction: column; gap: 4px;
}
.brand-row { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.monogram {
  width: 40px; height: 40px; border-radius: var(--radius-lg);
  background: var(--ink-950); color: var(--white);
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 600; font-size: 26px;
  line-height: 1;
}
[data-theme="dark"] .monogram { background: var(--white); color: var(--ink-950); }
.brand-row .wordmark { font-family: var(--font-display); font-weight: 600; font-size: 22px; letter-spacing: -0.02em; }
.nav-label {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-3); margin: 18px 0 6px; font-weight: 600;
}
.nav-link {
  display: block; text-decoration: none; color: var(--text-2);
  font-size: 14px; padding: 7px 10px; border-radius: var(--radius-md);
  transition: background .15s ease, color .15s ease;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--surface-2); color: var(--text); font-weight: 500; }

.theme-toggle {
  margin-top: auto; display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); border-radius: var(--radius-full);
  background: transparent; color: var(--text-2); cursor: pointer;
  padding: 9px 14px; font-family: var(--font-ui); font-size: 13px; font-weight: 500;
  transition: border-color .15s ease, color .15s ease;
}
.theme-toggle:hover { border-color: var(--border-strong); color: var(--text); }

/* ---------- Content ---------------------------------------- */
.content { padding: 0; }
.wrap { max-width: 940px; margin: 0 auto; padding: 0 48px; }
.hero {
  padding: 96px 48px 72px;
  border-bottom: 1px solid var(--border);
}
.hero-inner { max-width: 940px; margin: 0 auto; display: flex; flex-direction: column; }
.eyebrow {
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-3); font-weight: 600; margin-bottom: 20px;
}
.hero h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(40px, 6vw, 61px); letter-spacing: -0.02em; line-height: 1.12;
  margin-bottom: 28px;
}
.hero .lede { font-size: 19px; line-height: 1.6; color: var(--text-2); max-width: 620px; margin: 0; }

section.block { padding: 72px 0; border-bottom: 1px solid var(--border); }
section.block:last-child { border-bottom: none; }
.section-head { margin-bottom: 40px; }
.section-num {
  font-family: var(--font-mono); font-size: 13px; color: var(--text-3);
  margin-bottom: 10px;
}
.section-head h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 39px; letter-spacing: -0.01em;
}
.section-head p { color: var(--text-2); font-size: 17px; margin-top: 14px; max-width: 640px; }

.subhead {
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-3); font-weight: 600; margin: 44px 0 18px;
}

/* ---------- Misc / notes / tables -------------------------- */
.note {
  border-left: 2px solid var(--border-strong); padding: 4px 0 4px 18px;
  color: var(--text-2); font-size: 14px; margin-top: 24px; max-width: 640px;
}
.note strong { color: var(--text); }
.rule-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 14px; }
.rule-table th, .rule-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.rule-table th { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); font-weight: 600; }
.rule-table td { color: var(--text-2); }
.rule-table td:first-child, .rule-table th:first-child { padding-left: 0; }

/* ---------- Toast ------------------------------------------ */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink-950); color: var(--white);
  padding: 11px 20px; border-radius: var(--radius-full); font-size: 14px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100;
  box-shadow: var(--shadow-lg);
}
[data-theme="dark"] .toast { background: var(--white); color: var(--ink-950); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Responsive ------------------------------------- */
@media (max-width: 880px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .content { min-width: 0; }
  .sidebar { display: none; }
  .layers, .font-cards, .showcase-stage { grid-template-columns: 1fr; }
  .wrap, .hero { padding-left: 24px; padding-right: 24px; }
  .qr-card { justify-content: center; }
}
