/* StepUp legal site.
   Tokens lifted from stepup/Core/DesignSystem/AppColors.swift so the pages
   look like the app rather than like a template. */

:root {
  --ink: #000000;
  --ink-muted: #858585;
  --ink-faint: #a8a8ad;
  --bg: #ffffff;
  --panel: #f4f4f4;
  --panel-2: #eeeef0;
  --rule: #e2e2e5;
  --accent: #3037f2;
  --accent-wash: #e8eaff;
  --accent-ink: #3037f2;
  --warn: #ff9d00;
  --warn-wash: #fff6e6;

  --display: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;

  --measure: 42rem;
  --gutter: 20px;
}

/* System preference, unless the reader has explicitly chosen light. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #f4f4f5;
    --ink-muted: #9a9aa0;
    --ink-faint: #6d6d73;
    --bg: #0d0d0d;
    --panel: #181818;
    --panel-2: #222224;
    --rule: #2e2e2e;
    --accent: #7e9cff;
    --accent-wash: #1a1f3d;
    --accent-ink: #9db2ff;
    --warn-wash: #2b2210;
    color-scheme: dark;
  }
}

/* An explicit choice from the toggle, which beats the system preference. */
:root[data-theme="dark"] {
    --ink: #f4f4f5;
    --ink-muted: #9a9aa0;
    --ink-faint: #6d6d73;
    --bg: #0d0d0d;
    --panel: #181818;
    --panel-2: #222224;
    --rule: #2e2e2e;
    --accent: #7e9cff;
    --accent-wash: #1a1f3d;
    --accent-ink: #9db2ff;
    --warn-wash: #2b2210;
  color-scheme: dark;
}

:root[data-theme="light"] {
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

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

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

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- header ---------- */

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  min-height: 68px;
  padding-top: 10px;
  padding-bottom: 10px;
}


.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: block;
  flex: none;
}

.hero-mark {
  width: 68px;
  height: 68px;
  display: block;
  margin: 0 0 26px;
}

.wordmark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.045em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
}


.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.site-nav {
  display: flex;
  gap: 4px;
  font-size: 15px;
}

.site-nav a {
  color: var(--ink-muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 999px;
  white-space: nowrap;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.site-nav a:hover { color: var(--ink); background: var(--panel-2); }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
/* The brand keeps the first row to itself once the nav no longer fits beside
   it, rather than the nav shrinking into something untappable. */
@media (max-width: 30rem) {
  .site-header .wrap { justify-content: center; }
  .header-actions { margin-left: 0; width: 100%; justify-content: space-between; }
  .site-nav { font-size: 14px; }
  .site-nav a { padding: 6px 7px; }
}

/* ---------- theme toggle ---------- */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  flex: none;
  -webkit-tap-highlight-color: transparent;
}

.theme-toggle:hover { background: var(--panel-2); color: var(--ink); }

.theme-toggle svg { width: 19px; height: 19px; display: none; }

/* The head script always sets data-theme-mode, so one icon is always shown.
   The :not() fallback covers a reader with JavaScript turned off. */
:root:not([data-theme-mode]) .theme-toggle .i-system,
:root[data-theme-mode="system"] .theme-toggle .i-system,
:root[data-theme-mode="light"] .theme-toggle .i-light,
:root[data-theme-mode="dark"] .theme-toggle .i-dark { display: block; }

/* ---------- hero (index) ---------- */

.hero { padding: 72px 0 56px; }

.hero h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.4rem, 9vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
  margin: 0 0 18px;
}

.hero h1 .muted { color: var(--ink-muted); display: block; }

.hero p.lede {
  font-size: 1.15rem;
  color: var(--ink-muted);
  margin: 0 0 40px;
  max-width: 34rem;
}

.card-list { display: grid; gap: 12px; margin: 0 0 44px; }

a.card {
  display: block;
  padding: 20px 22px;
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: var(--bg);
  text-decoration: none;
  color: inherit;
  transition: border-color .15s ease, transform .15s ease, background .15s ease;
}

a.card:hover {
  border-color: var(--accent);
  background: var(--panel);
  transform: translateY(-1px);
}

a.card .card-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

a.card .card-title::after {
  content: "→";
  color: var(--accent);
  font-family: var(--body);
  font-weight: 400;
}

a.card p { margin: 6px 0 0; color: var(--ink-muted); font-size: .95rem; line-height: 1.55; }

/* ---------- promise panel ---------- */

.promise {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  background: var(--accent-wash);
  border-radius: 14px;
  padding: 22px 24px;
  margin: 0 0 44px;
}

.promise h2 {
  font-family: var(--display);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.promise p { margin: 0; color: var(--ink); font-size: .97rem; }

/* ---------- document pages ---------- */

.doc-head { padding: 56px 0 28px; border-bottom: 1px solid var(--rule); }

.doc-head h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2rem, 7.5vw, 2.9rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
  margin: 0 0 14px;
}

.stamp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  color: var(--ink-muted);
  background: var(--panel-2);
  border-radius: 999px;
  padding: 5px 13px;
  font-variant-numeric: tabular-nums;
}

.toc {
  margin: 28px 0 0;
  padding: 20px 22px;
  background: var(--panel);
  border-radius: 14px;
}

.toc h2 {
  font-family: var(--body);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 12px;
}

.toc ul { margin: 0; padding: 0; list-style: none; columns: 2; column-gap: 28px; }
.toc li { margin: 0 0 6px; font-size: .92rem; break-inside: avoid; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }

@media (max-width: 34rem) { .toc ul { columns: 1; } }

.doc { padding: 8px 0 72px; }

.doc h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.55rem;
  letter-spacing: -0.035em;
  line-height: 1.2;
  margin: 52px 0 14px;
  scroll-margin-top: 24px;
}

.doc h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.14rem;
  letter-spacing: -0.02em;
  margin: 34px 0 10px;
  scroll-margin-top: 24px;
}

.doc p { margin: 0 0 18px; }
.doc ul, .doc ol { margin: 0 0 18px; padding-left: 1.35em; }
.doc li { margin: 0 0 9px; }
.doc li > ul { margin-top: 9px; }

.doc a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }
.doc a:hover { text-decoration-thickness: 2px; }

.doc strong { font-weight: 650; }

.doc hr { border: 0; border-top: 1px solid var(--rule); margin: 44px 0; }

.doc code {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--panel-2);
  padding: 1px 5px;
  border-radius: 5px;
}

.doc blockquote {
  margin: 0 0 18px;
  padding: 14px 18px;
  border-left: 3px solid var(--accent);
  background: var(--accent-wash);
  border-radius: 0 10px 10px 0;
}

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

/* tables scroll rather than squash on a phone */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 18px;
  border: 1px solid var(--rule);
  border-radius: 12px;
}

.doc table { border-collapse: collapse; width: 100%; font-size: .92rem; }
.doc th, .doc td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.doc th { background: var(--panel); font-weight: 650; white-space: nowrap; }
.doc tr:last-child td { border-bottom: 0; }

/* an unfilled [PLACEHOLDER] must be impossible to miss */
.placeholder {
  background: var(--warn-wash);
  border-bottom: 2px solid var(--warn);
  padding: 0 4px;
  font-family: var(--mono);
  font-size: .86em;
  border-radius: 3px;
}

/* ---------- support page ---------- */

.doc a.contact,
.contact {
  display: block;
  margin: 0 0 18px;
  padding: 24px;
  border-radius: 16px;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  transition: transform .15s ease, opacity .15s ease;
}

.doc a.contact:hover {
  text-decoration: none;
  opacity: .9;
  transform: translateY(-1px);
}

.doc a.contact .label,
.doc a.contact .value { color: var(--bg); }

.contact .label {
  font-size: .74rem;
  letter-spacing: .11em;
  text-transform: uppercase;
  opacity: .6;
}

.contact .value {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.1rem, 5vw, 1.5rem);
  letter-spacing: -0.03em;
  margin-top: 6px;
  word-break: break-all;
}

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

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 34px 0 56px;
  font-size: .89rem;
  color: var(--ink-muted);
}

.site-footer nav { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 16px; }
.site-footer a { color: var(--ink-muted); text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }
.site-footer p { margin: 0 0 6px; }

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

.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: var(--gutter);
  top: 10px;
  z-index: 10;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 8px;
}
