/*
 * Migajapp on the web.
 *
 * The palette and type are the app's, copied from src/theme/tokens.ts so the
 * two surfaces read as one product: Baloo 2 for display, Nunito for body,
 * purple for anything you act on, gold for value, orange for urgency.
 *
 * Line heights are generous on purpose. Baloo 2 also carries Devanagari and
 * declares a line box a third taller than its Latin letters use; browsers do
 * not clip the way iOS does, but the same numbers keep both surfaces matched.
 */

:root {
  --bg: #f8f1f6;
  --card: #ffffff;
  --wave-1: #f7dcc6;
  --wave-2: #f2c9ac;

  --purple: #6c56e0;
  --purple-deep: #4a34b8;
  --purple-text: #5b45d6;

  --ink: #3d1f63;
  --ink-strong: #4a1e7a;
  --text: #4e3b6b;
  --text-soft: #5b4b78;
  --eyebrow: #6f5490;
  --faint: #8b7c9c;

  --lavender: #f3efff;
  --border: #f0e3f2;
  --divider: #f2eaf4;

  --gold: #f2b33d;
  --gold-title: #c2790b;
  --gold-soft: #fdf6e9;
  --gold-border: #f0dcb4;

  --orange: #e2703a;
  --orange-ink: #9c4413;
  --orange-soft: #fbeae0;

  --display: 'Baloo 2', system-ui, sans-serif;
  --body: 'Nunito', system-ui, sans-serif;

  --radius: 26px;
  --gutter: 16px;
  --max: 720px;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
}

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

/* ------------------------------------------------------------------ nav */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(248, 241, 246, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 68px;
  flex-wrap: wrap;
}

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

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: block;
}

.brand span {
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  line-height: 1.6;
  color: var(--ink-strong);
  letter-spacing: -0.4px;
}

.nav a.link {
  font-weight: 700;
  font-size: 14.5px;
  color: var(--purple-text);
  text-decoration: none;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}

.nav a.link:hover,
.nav a.link:focus-visible { border-bottom-color: var(--purple); }

.nav a.link[aria-current='page'] {
  color: var(--ink-strong);
  border-bottom-color: var(--purple);
}

/* ---------------------------------------------------------------- hero */

.hero { padding: 54px 0 34px; }

.eyebrow {
  font-family: var(--body);
  font-weight: 800;
  font-size: 11.5px;
  letter-spacing: 1.7px;
  text-transform: uppercase;
  color: var(--eyebrow);
  margin: 0 0 10px;
}

h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(34px, 7vw, 52px);
  line-height: 1.22;
  letter-spacing: -1.4px;
  color: var(--ink-strong);
  margin: 0 0 14px;
}

.lead {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-soft);
  margin: 0 0 8px;
  max-width: 54ch;
}

.updated {
  font-size: 13.5px;
  color: var(--faint);
  margin: 18px 0 0;
}

/* --------------------------------------------------------------- cards */

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 26px 24px;
  margin: 0 0 14px;
  box-shadow: 0 12px 30px rgba(61, 31, 99, 0.06);
}

.card.gold {
  background: var(--gold-soft);
  border: 2px solid var(--gold-border);
  box-shadow: none;
}

.card.orange {
  background: var(--orange-soft);
  border: 2px solid var(--orange);
  box-shadow: none;
}

.card.orange h2,
.card.orange h3 { color: var(--orange-ink); }

.card.gold h2 { color: var(--gold-title); }

/* ---------------------------------------------------------- typography */

h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: 26px;
  line-height: 1.35;
  letter-spacing: -0.6px;
  color: var(--ink);
  margin: 0 0 12px;
  scroll-margin-top: 84px;
}

h3 {
  font-family: var(--body);
  font-weight: 800;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  margin: 22px 0 6px;
}

h3:first-of-type { margin-top: 0; }

p { margin: 0 0 14px; }
p:last-child { margin-bottom: 0; }

ul, ol {
  margin: 0 0 14px;
  padding-left: 22px;
}

li { margin-bottom: 8px; }
li:last-child { margin-bottom: 0; }

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

a { color: var(--purple-text); }
a:hover { color: var(--purple-deep); }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--lavender);
  padding: 1px 6px;
  border-radius: 6px;
  color: var(--purple-deep);
}

/* Anything still to be confirmed by a lawyer, visible at a glance. */
.todo {
  background: #fff3cd;
  border-bottom: 2px solid var(--gold);
  padding: 0 5px;
  border-radius: 4px;
  font-weight: 700;
  color: #6b4a06;
}

/* --------------------------------------------------------------- index */

.toc { margin: 0 0 22px; }

.toc ol {
  columns: 2;
  column-gap: 26px;
  padding-left: 20px;
  margin: 0;
}

.toc li { break-inside: avoid; margin-bottom: 6px; }

.toc a {
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
}

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

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

/* ------------------------------------------------------------- landing */

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, #fcefc8, #f6dca0);
  border: 3px solid #c9922b;
  border-radius: 999px;
  padding: 7px 16px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 16px;
  line-height: 1.6;
  color: #5b3a1e;
}

.features {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  margin: 0 0 14px;
}

.features .card { margin: 0; }

.features h3 { margin-top: 0; }

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

.footer {
  position: relative;
  margin-top: 46px;
  padding: 64px 0 34px;
}

/* The two peach bands from the bottom of every screen in the app. */
.footer::before,
.footer::after {
  content: '';
  position: absolute;
  left: -5vw;
  right: -5vw;
  height: 140px;
  top: 0;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  z-index: -1;
}

.footer::before { background: var(--wave-1); top: 0; }
.footer::after { background: var(--wave-2); top: 26px; }

.footer .wrap {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
}

.footer a {
  font-weight: 700;
  font-size: 14.5px;
  color: var(--ink-strong);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.footer a:hover { border-bottom-color: var(--ink-strong); }

.footer .copy {
  width: 100%;
  font-size: 13px;
  color: var(--text-soft);
  margin: 6px 0 0;
}

@media (max-width: 480px) {
  .nav .wrap { min-height: 60px; gap: 12px; }
  .brand span { font-size: 19px; }
  .nav a.link { font-size: 13.5px; }
  .card { padding: 22px 18px; }
  h2 { font-size: 23px; }
}
