/*
 * Payong marketing site — styles.css
 *
 * Design tokens below are ported verbatim (light values) from
 * payong/apps/web/src/styles/tokens.css, and the dark-mode block is ported the same way,
 * per docs/superpowers/specs/2026-08-31-payong-design-system.md. See README.md for the
 * source and date read. Do not hand-edit a token value here without checking that file
 * first — if the product's tokens move, this file has drifted.
 */

:root {
  /* ---- Palette (light, spec-exact) ---- */
  --brand: #00bfff; /* decorative ground only — never text, never a button fill, never a meaningful border */
  --ink: #0b2430;
  --surface: #f4f8fa;
  --raised: #ffffff;
  --primary: #007399;
  --accent: #af5709;
  --muted: #54707c;
  --paid: #1f7a4d;
  --overdue: #b03a28;

  --on-primary: #ffffff;
  --on-accent: #ffffff;
  --on-brand: #ffffff;
  --rule: rgb(84 112 124 / 12%);
  --focus-ring: #007399;
  --overlay: rgb(11 36 48 / 45%);

  --brand-gradient: linear-gradient(100deg, #ebf6f1 0%, #9fe4fb 55%, #00bfff 100%);

  /* ---- Typography ---- */
  --font-display: 'Archivo', 'Arial Narrow', Arial, sans-serif;
  --font-body: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.125rem;
  --text-lg: 1.375rem;
  --text-xl: 1.75rem;
  --text-2xl: 2.5rem;
  --text-3xl: 3.5rem;
  --leading-body: 1.6;

  /* ---- Spacing scale ---- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;

  /* ---- Shape ---- */
  --radius: 6px;
  --radius-lg: 20px;
  --elevation: 0 12px 32px rgb(11 36 48 / 14%);

  /* ---- Layout ---- */
  --content-max: 1120px;
  --copy-max: 640px;
  --focus-ring-width: 2px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --brand: #00bfff;
    --ink: #e8f4f8;
    --surface: #08202b;
    --raised: #0e2e3b;
    --primary: #4fc9f5;
    --accent: #f0a951;
    --muted: #93afba;
    --paid: #4fbe85;
    --overdue: #e88a76;

    --on-primary: #04222d;
    --on-accent: #1a1206;
    --on-brand: #04222d;
    --rule: rgb(147 175 186 / 16%);
    --focus-ring: #6fd8ff;
    --overlay: rgb(2 10 14 / 60%);
    --elevation: 0 12px 32px rgb(0 0 0 / 40%);
    --brand-gradient: linear-gradient(100deg, #0e2e3b 0%, #0d5f7d 55%, #00bfff 100%);
  }
}

:root[data-theme='dark'] {
  --brand: #00bfff;
  --ink: #e8f4f8;
  --surface: #08202b;
  --raised: #0e2e3b;
  --primary: #4fc9f5;
  --accent: #f0a951;
  --muted: #93afba;
  --paid: #4fbe85;
  --overdue: #e88a76;

  --on-primary: #04222d;
  --on-accent: #1a1206;
  --on-brand: #04222d;
  --rule: rgb(147 175 186 / 16%);
  --focus-ring: #6fd8ff;
  --overlay: rgb(2 10 14 / 60%);
  --elevation: 0 12px 32px rgb(0 0 0 / 40%);
  --brand-gradient: linear-gradient(100deg, #0e2e3b 0%, #0d5f7d 55%, #00bfff 100%);
}

/* ====================== Reset / base ====================== */

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.1;
  margin: 0 0 var(--space-4);
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 var(--space-4);
}

a {
  color: var(--primary);
}

ul, ol {
  padding-left: 1.25em;
}

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

/* Skip link */
.skip-link {
  position: absolute;
  left: var(--space-3);
  top: -6rem;
  background: var(--raised);
  color: var(--ink);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  z-index: 100;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: var(--space-3);
  box-shadow: var(--elevation);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ====================== Layout helpers ====================== */

.wrap {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

.section {
  padding-block: var(--space-9);
  position: relative;
}

.section-head {
  max-width: var(--copy-max);
  margin-bottom: var(--space-7);
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  padding: var(--space-1) var(--space-3);
  border-radius: 999px;
  margin-bottom: var(--space-4);
}

.section h2 {
  font-size: var(--text-2xl);
}

.lede {
  font-size: var(--text-md);
  color: var(--muted);
}

.alt-surface {
  background: var(--raised);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

/* ====================== Header ====================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.site-header.is-condensed {
  border-color: var(--rule);
  box-shadow: 0 8px 24px -16px rgb(11 36 48 / 25%);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-3);
  max-width: var(--content-max);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-md);
}

.brand-lockup .mark-tile {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.brand-lockup .mark-tile img {
  width: 22px;
  height: auto;
}

.primary-nav {
  display: none;
}

.primary-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: var(--space-6);
}

.primary-nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 600;
  padding-block: var(--space-2);
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.primary-nav a:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.header-cta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.nav-toggle {
  position: relative;
}

.nav-toggle summary {
  list-style: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rule);
  background: var(--raised);
}

.nav-toggle summary::-webkit-details-marker {
  display: none;
}

.nav-toggle summary .bars,
.nav-toggle summary .bars::before,
.nav-toggle summary .bars::after {
  width: 18px;
  height: 2px;
  background: var(--ink);
  display: block;
  position: relative;
  border-radius: 2px;
}

.nav-toggle summary .bars::before,
.nav-toggle summary .bars::after {
  content: '';
  position: absolute;
  left: 0;
}

.nav-toggle summary .bars::before {
  top: -6px;
}

.nav-toggle summary .bars::after {
  top: 6px;
}

.nav-toggle[open] summary {
  background: var(--primary);
  border-color: var(--primary);
}

.nav-toggle[open] summary .bars,
.nav-toggle[open] summary .bars::before,
.nav-toggle[open] summary .bars::after {
  background: var(--on-primary);
}

.nav-toggle .menu {
  position: absolute;
  right: 0;
  top: calc(100% + var(--space-2));
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--elevation);
  padding: var(--space-3);
  min-width: 220px;
  list-style: none;
  margin: 0;
}

.nav-toggle .menu li + li {
  margin-top: var(--space-1);
}

.nav-toggle .menu a {
  display: block;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--text-sm);
}

.nav-toggle .menu a:hover {
  background: var(--surface);
  color: var(--primary);
}

@media (min-width: 860px) {
  .primary-nav {
    display: block;
  }

  .nav-toggle {
    display: none;
  }
}

/* ====================== Buttons ====================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--text-sm);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
  will-change: transform;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 1px 0 rgb(0 0 0 / 10%);
}

.btn-primary:hover {
  box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--primary) 60%, transparent);
}

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 40%, transparent);
}

.btn-secondary:hover {
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  border-color: var(--primary);
}

.btn-ghost {
  background: var(--raised);
  color: var(--ink);
  border-color: var(--rule);
}

.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
}

/* ====================== Hero ====================== */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: var(--space-9) var(--space-8);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--brand-gradient);
  opacity: 0.5;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--brand) 55%, transparent), transparent 60%);
  animation: driftBlob 22s ease-in-out infinite;
  will-change: transform;
}

@keyframes driftBlob {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(3%, -4%, 0) scale(1.08); }
}

.hero .wrap {
  display: grid;
  gap: var(--space-8);
  align-items: center;
}

@media (min-width: 900px) {
  .hero .wrap {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.hero-copy h1 {
  font-size: clamp(2.1rem, 5vw + 1rem, var(--text-3xl));
  margin-bottom: var(--space-5);
}

.hero-copy .lede {
  font-size: var(--text-md);
  color: var(--ink);
  opacity: 0.82;
  max-width: 52ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.hero-note {
  margin-top: var(--space-5);
  font-size: var(--text-xs);
  color: var(--ink); /* over the gradient ground: ink, not muted, to hold 4.5:1 in both themes */
  opacity: 0.85;
  max-width: 48ch;
}

/* ---- Hero schedule-rail illustration ---- */

.hero-visual {
  display: flex;
  justify-content: center;
}

.rail-card {
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--elevation);
  padding: var(--space-6);
  width: 100%;
  max-width: 360px;
}

.rail-card .mark-tile-lg {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-5);
}

.rail-card .mark-tile-lg img {
  width: 36px;
  height: auto;
}

.rail-svg {
  width: 100%;
  height: auto;
  display: block;
}

.rail-svg .rail-line {
  fill: none;
  stroke: var(--rule);
  stroke-width: 3;
  stroke-linecap: round;
}

.rail-svg .rail-line-progress {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 300;
  stroke-dashoffset: 0; /* fully drawn by default — content-first, no-JS safe */
}

.rail-svg .rail-node {
  stroke-width: 3;
  transform-origin: center;
  transform-box: fill-box;
  opacity: 1; /* fully visible by default — content-first, no-JS safe */
  transform: scale(1);
}

/* Only when JS has confirmed it can run the entrance animation do these
   start hidden, so the pop-in has something to animate from. */
.js-ready .rail-svg .rail-line-progress {
  stroke-dashoffset: 300;
}

.js-ready .rail-svg .rail-node {
  opacity: 0;
  transform: scale(0.4);
}

.rail-svg .rail-node.state-done {
  fill: var(--primary);
  stroke: var(--primary);
}

.rail-svg .rail-node.state-current {
  fill: var(--raised);
  stroke: var(--accent);
}

.rail-svg .rail-node.state-future {
  fill: var(--raised);
  stroke: var(--muted);
}

.rail-caption {
  margin-top: var(--space-5);
  font-size: var(--text-xs);
  color: var(--muted);
}

/* Entrance animation — plays once on load, JS-gated, reduced-motion safe */
.js-ready .rail-svg .rail-line-progress {
  animation: drawRail 1.4s 0.3s ease-out forwards;
}

.js-ready .rail-svg .rail-node {
  animation: popNode 0.5s ease-out forwards;
}

.js-ready .rail-svg .rail-node:nth-of-type(1) { animation-delay: 0.3s; }
.js-ready .rail-svg .rail-node:nth-of-type(2) { animation-delay: 0.75s; }
.js-ready .rail-svg .rail-node:nth-of-type(3) { animation-delay: 1.15s; }
.js-ready .rail-svg .rail-node:nth-of-type(4) { animation-delay: 1.5s; }

@keyframes drawRail {
  to { stroke-dashoffset: 0; }
}

@keyframes popNode {
  to { opacity: 1; transform: scale(1); }
}

/* ====================== Steps (how it works) ====================== */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 760px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

.step {
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.step .step-index {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--primary);
  margin-bottom: var(--space-4);
}

.step h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}

.step p {
  color: var(--muted);
  margin-bottom: 0;
}

/* ====================== Two-column detail sections ====================== */

.detail-grid {
  display: grid;
  gap: var(--space-7);
}

@media (min-width: 860px) {
  .detail-grid {
    grid-template-columns: 0.9fr 1.1fr;
    align-items: start;
  }
}

.fact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-5);
}

.fact-list > li {
  padding-left: var(--space-6);
  position: relative;
}

.fact-list > li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.4em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
}

.fact-list h3 {
  font-size: var(--text-md);
  margin-bottom: var(--space-1);
}

.fact-list p {
  color: var(--muted);
  margin-bottom: 0;
}

.card {
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.card + .card {
  margin-top: var(--space-5);
}

/* Mini schedule timeline used in the patients section */
.mini-rail {
  display: flex;
  align-items: center;
  gap: 0;
  margin-block: var(--space-5);
}

.mini-rail .node {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--raised);
  border: 3px solid var(--muted);
  flex: none;
  transform: scale(1);
  opacity: 1;
}

.mini-rail .node.state-done {
  background: var(--primary);
  border-color: var(--primary);
}

.mini-rail .node.state-current {
  border-color: var(--accent);
}

.mini-rail .seg {
  height: 3px;
  background: var(--rule);
  flex: 1 1 auto;
  transform: scaleX(1);
  transform-origin: left;
}

.mini-rail .seg.filled {
  background: var(--primary);
}

/* Only hide for the pop-in once JS confirms the reveal system is active. */
.js-ready .reveal .mini-rail .node {
  transform: scale(0.5);
  opacity: 0;
}

.js-ready .reveal .mini-rail .seg {
  transform: scaleX(0);
}

.reveal.is-visible .mini-rail .node {
  animation: popNode 0.45s ease-out forwards;
}

.reveal.is-visible .mini-rail .node:nth-of-type(1) { animation-delay: 0.05s; }
.reveal.is-visible .mini-rail .seg:nth-of-type(2) { animation: growSeg 0.4s ease-out 0.35s forwards; }
.reveal.is-visible .mini-rail .node:nth-of-type(3) { animation-delay: 0.65s; }
.reveal.is-visible .mini-rail .seg:nth-of-type(4) { animation: growSeg 0.4s ease-out 0.95s forwards; }
.reveal.is-visible .mini-rail .node:nth-of-type(5) { animation-delay: 1.25s; }
.reveal.is-visible .mini-rail .seg:nth-of-type(6) { animation: growSeg 0.4s ease-out 1.55s forwards; }
.reveal.is-visible .mini-rail .node:nth-of-type(7) { animation-delay: 1.85s; }

@keyframes growSeg {
  to { transform: scaleX(1); }
}

/* ====================== Trust / about ====================== */

.about-card {
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.notice {
  background: color-mix(in srgb, var(--accent) 10%, var(--raised));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: var(--radius);
  padding: var(--space-5);
  margin-bottom: var(--space-6);
}

.notice p {
  margin-bottom: 0;
  color: var(--ink);
}

dl.company-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--space-3) var(--space-5);
  margin: 0;
}

dl.company-facts dt {
  font-weight: 700;
  color: var(--muted);
  font-size: var(--text-sm);
}

dl.company-facts dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

@media (max-width: 520px) {
  dl.company-facts {
    grid-template-columns: 1fr;
  }

  dl.company-facts dt {
    margin-top: var(--space-3);
  }
}

/* ====================== Contact ====================== */

.contact-grid {
  display: grid;
  gap: var(--space-5);
}

@media (min-width: 700px) {
  .contact-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.contact-card {
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.contact-card h3 {
  font-size: var(--text-md);
}

.contact-card a.email {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  text-decoration: none;
  display: inline-block;
  margin-top: var(--space-2);
}

.contact-card a.email:hover {
  text-decoration: underline;
}

/* ====================== Footer ====================== */

.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: var(--space-7);
  background: var(--raised);
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  justify-content: space-between;
  align-items: flex-start;
}

.footer-legal ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
}

.footer-legal a {
  color: var(--muted);
  text-decoration: none;
  font-size: var(--text-sm);
}

.footer-legal a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.footer-meta {
  font-size: var(--text-xs);
  color: var(--muted);
  max-width: 50ch;
}

.footer-meta p {
  margin-bottom: var(--space-2);
}

/* ====================== Scroll reveal system ======================
 * Default: everything visible (no-JS / reduced-motion safe).
 * .js-ready (set by inline script) + supported browser -> reveal elements
 * start hidden and are promoted to .is-visible by IntersectionObserver,
 * or driven purely by CSS scroll-timelines where supported.
 */

.reveal {
  opacity: 1;
  transform: none;
}

.js-ready .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js-ready .reveal.is-visible {
  opacity: 1;
  transform: none;
}

.js-ready .reveal-stagger.is-visible > * {
  transition-delay: calc(var(--stagger-index, 0) * 90ms);
}

/* Scroll-driven animation for browsers that support it, as an enhancement
   layered on top of the IntersectionObserver baseline above. */
@supports (animation-timeline: view()) {
  .js-ready .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: none;
    animation: revealIn linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 25%;
  }

  .js-ready .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}

@keyframes revealIn {
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .js-ready .reveal,
  .js-ready .reveal.is-visible {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }

  .rail-svg .rail-line-progress,
  .rail-svg .rail-node,
  .mini-rail .node,
  .mini-rail .seg {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    stroke-dashoffset: 0 !important;
  }

  .hero-bg::after {
    animation: none !important;
  }

  .btn:hover {
    transform: none;
  }

  * {
    scroll-behavior: auto !important;
  }
}

/* ====================== Misc ====================== */

/* ====================== Legal document pages ====================== */

.legal-page {
  padding-block-start: var(--space-7);
}

.legal-back {
  margin-bottom: var(--space-5);
}

.legal-back a {
  text-decoration: none;
  font-weight: 600;
  font-size: var(--text-sm);
}

.legal-back a:hover {
  text-decoration: underline;
}

.legal-header h1 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-2);
}

.legal-version {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--muted);
  margin-bottom: var(--space-6);
}

.legal-version-code {
  color: var(--primary);
}

.legal-notice {
  margin-bottom: var(--space-7);
}

.legal-notice p {
  font-size: var(--text-sm);
}

.legal-notice code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.legal-toc {
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-8);
  max-width: var(--copy-max);
}

.legal-toc-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: var(--space-3);
}

.legal-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
  columns: 1;
}

@media (min-width: 700px) {
  .legal-toc-list {
    columns: 2;
    column-gap: var(--space-6);
  }
}

.legal-toc-list a {
  text-decoration: none;
  font-size: var(--text-sm);
  display: inline-block;
}

.legal-toc-list a:hover {
  text-decoration: underline;
}

.legal-body {
  max-width: var(--copy-max);
}

.legal-body .legal-h2 {
  font-size: var(--text-lg);
  margin-top: var(--space-8);
  padding-top: var(--space-5);
  border-top: 1px solid var(--rule);
  scroll-margin-top: var(--space-7);
}

.legal-body .legal-h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.legal-body p {
  font-size: var(--text-sm);
  color: var(--ink);
  scroll-margin-top: var(--space-7);
}

.legal-body .legal-clause1 {
  margin-left: 0;
}

.legal-body .legal-clause2 {
  margin-left: var(--space-5);
  color: var(--muted);
}

.legal-body .legal-clause3 {
  margin-left: var(--space-7);
  color: var(--muted);
}

.legal-body .clause-number {
  font-family: var(--font-mono);
  color: var(--primary);
  font-weight: 600;
}

.legal-body a {
  text-decoration: underline;
}

.divider {
  border: none;
  border-top: 1px solid var(--rule);
  margin: var(--space-7) 0;
}

::selection {
  background: color-mix(in srgb, var(--brand) 55%, transparent);
  color: var(--ink);
}
