/* ==========================================================================
   Repvenge — public site (privacy / terms / support)
   Palette + type follow BRAND.md V2 (encouragement coach, gamified surfaces).
   Fonts are self-hosted: this page loads NOTHING from a third-party origin,
   which is what lets the privacy policy say so truthfully.
   ========================================================================== */

@font-face {
  font-family: "Fredoka";
  src: url("/fonts/fredoka.woff2") format("woff2");
  font-weight: 300 700;
  font-stretch: 75% 125%;
  font-display: swap;
}

@font-face {
  font-family: "Nunito";
  src: url("/fonts/nunito.woff2") format("woff2");
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --lime: #a3e635;
  --lime-pressed: #84cc16;
  --gold: #facc15;
  --coral: #f87171;

  --bg: #1c1c1e;
  --surface: #2c2c2e;
  --surface-pressed: #1f1f21;
  --track: #3a3a3c;

  --ink: #f5f5f7;
  --ink-2: #a1a1a6;
  --ink-3: #6e6e73;

  --display: "Fredoka", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --body: "Nunito", ui-sans-serif, system-ui, -apple-system, sans-serif;

  --measure: 68ch;
  --gutter: clamp(20px, 5vw, 40px);
  --radius: 20px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

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

/* ---------- skip link ---------- */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--lime);
  color: var(--bg);
  padding: 12px 18px;
  border-radius: 0 0 12px 0;
  font-family: var(--display);
  font-weight: 600;
}

.skip:focus {
  left: 0;
}

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

.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(28, 28, 30, 0.86);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--track);
}

.masthead-inner {
  max-width: 1020px;
  margin: 0 auto;
  padding: 14px var(--gutter);
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
}

.wordmark .pip {
  width: 11px;
  height: 11px;
  border-radius: 4px;
  background: var(--lime);
  box-shadow: 0 2px 0 var(--lime-pressed);
}

.masthead nav {
  margin-left: auto;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.masthead nav a {
  font-family: var(--display);
  font-weight: 500;
  font-size: 14.5px;
  color: var(--ink-2);
  text-decoration: none;
  padding: 7px 13px;
  border-radius: 999px;
  white-space: nowrap;
}

.masthead nav a:hover {
  color: var(--ink);
  background: var(--surface);
}

.masthead nav a[aria-current="page"] {
  color: var(--bg);
  background: var(--lime);
  box-shadow: 0 2px 0 var(--lime-pressed);
}

/* ---------- layout ---------- */

.wrap {
  max-width: 1020px;
  margin: 0 auto;
  padding: 0 var(--gutter) 72px;
}

.doc {
  max-width: var(--measure);
}

/* ---------- page head ---------- */

.pagehead {
  padding: clamp(38px, 7vw, 66px) 0 26px;
}

.eyebrow {
  font-family: var(--display);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lime);
  margin: 0 0 12px;
}

.pagehead h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(34px, 6vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}

.stamp {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--surface);
  border: 1px solid var(--track);
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.stamp .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
}

/* ---------- prose ---------- */

.prose > * + * {
  margin-top: 1.05em;
}

.prose h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(23px, 3.4vw, 29px);
  line-height: 1.24;
  letter-spacing: -0.012em;
  margin: 2.1em 0 0.55em;
  padding-top: 1.5rem;
  border-top: 1px solid var(--track);
  scroll-margin-top: 92px;
}

.prose h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.prose h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 19.5px;
  line-height: 1.35;
  margin: 1.9em 0 0.4em;
  color: var(--ink);
  scroll-margin-top: 92px;
}

.prose h4 {
  font-family: var(--body);
  font-weight: 800;
  font-size: 16.5px;
  margin: 1.6em 0 0.3em;
  color: var(--ink);
}

.prose p,
.prose li {
  color: #e4e4e8;
}

.prose strong {
  color: var(--ink);
  font-weight: 800;
}

.prose em {
  color: var(--ink);
}

.prose a {
  color: var(--lime);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.prose a:hover {
  color: var(--lime-pressed);
}

.prose ul,
.prose ol {
  padding-left: 1.35em;
  margin-block: 1em;
}

.prose li + li {
  margin-top: 0.42em;
}

.prose li::marker {
  color: var(--lime);
}

.prose ol li::marker {
  color: var(--ink-3);
  font-weight: 700;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--track);
  margin: 2.4em 0;
}

.prose blockquote {
  margin: 1.5em 0;
  padding: 16px 20px;
  background: var(--surface);
  border-left: 3px solid var(--lime);
  border-radius: 0 14px 14px 0;
  color: var(--ink);
}

.prose blockquote p {
  margin: 0;
  color: var(--ink);
}

.prose blockquote p + p {
  margin-top: 0.8em;
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 0.88em;
  background: var(--surface);
  border: 1px solid var(--track);
  border-radius: 7px;
  padding: 1.5px 6px;
  color: var(--gold);
  overflow-wrap: anywhere;
}

.prose pre {
  background: var(--surface);
  border: 1px solid var(--track);
  border-radius: 14px;
  padding: 16px 18px;
  overflow-x: auto;
}

.prose pre code {
  background: none;
  border: 0;
  padding: 0;
  color: var(--ink);
}

/* headings link to themselves */
.anchor {
  color: var(--ink-3);
  text-decoration: none;
  margin-left: 0.42em;
  font-size: 0.62em;
  opacity: 0;
  vertical-align: middle;
}

h2:hover .anchor,
h3:hover .anchor,
.anchor:focus {
  opacity: 1;
}

/* ---------- tables ---------- */

.table-scroll {
  overflow-x: auto;
  margin: 1.5em 0;
  border: 1px solid var(--track);
  border-radius: 14px;
  -webkit-overflow-scrolling: touch;
}

.prose table {
  border-collapse: collapse;
  width: 100%;
  min-width: 460px;
  font-size: 15.5px;
}

.prose th,
.prose td {
  text-align: left;
  padding: 11px 15px;
  border-bottom: 1px solid var(--track);
  vertical-align: top;
}

.prose th {
  font-family: var(--display);
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  white-space: nowrap;
}

.prose tbody tr:last-child td {
  border-bottom: 0;
}

.prose tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.018);
}

/* ---------- table of contents ---------- */

.toc {
  background: var(--surface);
  border: 1px solid var(--track);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 0 0 40px;
}

.toc h2 {
  font-family: var(--display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 0 0 12px;
  padding: 0;
  border: 0;
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
  columns: 2;
  column-gap: 28px;
}

.toc li {
  counter-increment: toc;
  break-inside: avoid;
  margin: 0 0 7px;
  padding-left: 26px;
  position: relative;
  font-size: 15px;
  line-height: 1.45;
}

.toc li::before {
  content: counter(toc);
  position: absolute;
  left: 0;
  top: 1px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 12px;
  color: var(--ink-3);
  background: var(--surface-pressed);
  border-radius: 6px;
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
}

.toc a {
  color: var(--ink-2);
  text-decoration: none;
}

.toc a:hover {
  color: var(--lime);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 640px) {
  .toc ol {
    columns: 1;
  }
}

/* ---------- home ---------- */

.hero {
  padding: clamp(52px, 10vw, 96px) 0 12px;
  max-width: 760px;
}

.hero h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(40px, 9vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.028em;
  margin: 0 0 20px;
}

.hero h1 .accent {
  color: var(--lime);
}

.hero p {
  font-size: clamp(18px, 2.4vw, 21px);
  color: var(--ink-2);
  margin: 0;
  max-width: 56ch;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 16px;
  padding: 0;
  margin: 44px 0 0;
  list-style: none;
}

.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--track);
  border-bottom-width: 4px;
  border-bottom-color: var(--surface-pressed);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--ink-3);
  border-bottom-color: var(--surface-pressed);
}

.card:active {
  transform: translateY(2px);
  border-bottom-width: 1px;
  margin-bottom: 3px;
}

.card h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 20px;
  margin: 0 0 7px;
  color: var(--ink);
}

.card p {
  margin: 0;
  font-size: 15.5px;
  color: var(--ink-2);
  line-height: 1.58;
}

.card .go {
  display: inline-block;
  margin-top: 14px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  color: var(--lime);
}

.factbox {
  margin: 46px 0 0;
  padding: 24px 26px;
  background: var(--surface);
  border: 1px solid var(--track);
  border-radius: var(--radius);
}

.factbox h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 18px;
  margin: 0 0 14px;
}

.factbox ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.factbox li {
  padding-left: 28px;
  position: relative;
  color: #e4e4e8;
  font-size: 15.5px;
  line-height: 1.55;
}

.factbox li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 16px;
  height: 9px;
  border-left: 2.5px solid var(--lime);
  border-bottom: 2.5px solid var(--lime);
  transform: rotate(-45deg);
  border-radius: 1px;
}

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

.footer {
  border-top: 1px solid var(--track);
  margin-top: 64px;
}

.footer-inner {
  max-width: 1020px;
  margin: 0 auto;
  padding: 32px var(--gutter) 56px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 26px;
  align-items: baseline;
  font-size: 14.5px;
  color: var(--ink-3);
}

.footer a {
  color: var(--ink-2);
  text-decoration: none;
}

.footer a:hover {
  color: var(--lime);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer .spacer {
  flex: 1 1 auto;
}

/* ---------- focus ---------- */

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- print ---------- */

@media print {
  :root {
    --bg: #fff;
    --ink: #000;
    --ink-2: #333;
    --ink-3: #555;
    --surface: #fff;
    --track: #bbb;
  }
  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }
  .masthead,
  .footer,
  .toc,
  .skip,
  .anchor {
    display: none !important;
  }
  .prose a {
    color: #000;
  }
  .prose a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #555;
  }
  .prose h2 {
    break-after: avoid;
  }
  .wrap {
    padding: 0;
  }
}
