/* Base: reset, type, the page frame (top bar, bands, phone tab bar). Values come from
   tokens.css; phone first, widened at 960px. */

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

html {
  background: var(--bg);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--body);
  line-height: 1.5;
  font-feature-settings: "kern";
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --- type ------------------------------------------------------------------------------ */

.display,
.section-title,
.card-title,
.wordmark {
  font-family: var(--font-display);
  font-weight: 500;
  font-style: normal;
  letter-spacing: -0.01em;
  line-height: 1.05;
}

.display { font-size: var(--display-m); }
.section-title { font-size: var(--section); line-height: 1.1; }
.card-title { font-size: var(--card-title); line-height: 1.2; }

.lead {
  font-size: 1.125rem;
  line-height: 1.5;
  color: var(--muted);
  max-width: 34em;
}

.muted { color: var(--muted); }
.small { font-size: var(--small); }
.num { font-variant-numeric: tabular-nums lining-nums; }
.right { text-align: right; }

/* --- frame ------------------------------------------------------------------------------ */

.col {
  width: 100%;
  max-width: var(--col);
  margin: 0 auto;
  padding: 0 16px;
}

.band {
  --card: var(--sunk);
  background: var(--bg);
  padding: var(--gap-band) 0;
}

.band-alt {
  --card: var(--sunk-alt);
  background: var(--bg-alt);
}

.band-tight { padding-top: 24px; }

.hero { padding-top: 40px; padding-bottom: 40px; }

.hero .col > * + * { margin-top: 18px; }

/* top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--raised);
}

.topbar-row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--bar-h);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  font-size: 1.5rem;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
}

.wordmark-mark {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--bg);
  display: grid;
  place-items: center;
}

.nav-links {
  display: none;
  flex: 1;
  justify-content: center;
  gap: 4px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 12px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--ink);
}

.nav-link:hover { background: var(--sunk); }

.nav-link.is-active {
  color: var(--brand);
  font-weight: 600;
}

.nav-user {
  display: none;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.nav-menu { margin-left: auto; }

/* phone tab bar */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  background: var(--raised);
  border-top: 1px solid var(--hairline);
  padding-bottom: env(safe-area-inset-bottom);
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: var(--tab-h);
  font-size: var(--tiny);
  text-decoration: none;
  color: var(--muted);
}

.tab svg { width: 24px; height: 24px; }

.tab.is-active { color: var(--brand); font-weight: 600; }

.app-main { padding-bottom: calc(var(--tab-h) + 24px); }

.is-login .topbar,
.is-login .tabbar { display: none; }

.is-login .app-main { padding-bottom: 0; }

@media (min-width: 960px) {
  .col { padding: 0 12px; }
  .band { padding: var(--gap-band-d) 0; }
  .band-tight { padding-top: 40px; }
  .hero { padding-top: 72px; padding-bottom: 72px; }
  .hero .col > * + * { margin-top: 22px; }
  .display { font-size: var(--display); }
  .nav-links { display: flex; }
  .nav-user { display: flex; }
  .tabbar { display: none; }
  .app-main { padding-bottom: 0; }
}
