/* Kidney Compass website: shared tokens, type, bar, footer and the legal pages.
   Colours come from the app icon and src/ui/theme.ts. */

@font-face {
  font-family: 'Schibsted Grotesk';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('../fonts/schibsted-grotesk-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;

  --ground: #f2f5f9;
  --tone: #e3e9f1;
  --paper: #ffffff;
  --ink: #0d1a2b;
  --ink-soft: #3b4350;
  --blue: #0b4f8a;
  --navy: #0a2a52;
  --on-field: #ffffff;
  --on-field-soft: #cfdcec;
  --green: #2e7d32;
  --green-press: #256628;

  --font: 'Schibsted Grotesk', ui-sans-serif, system-ui, sans-serif;
  --app-font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;

  /* Five sizes do the work: display, heading, statement, body, small. */
  --t-display: clamp(3rem, 1.6rem + 5.6vw, 7rem);
  --t-heading: clamp(2.25rem, 1.5rem + 3vw, 4.25rem);
  --t-statement: clamp(1.375rem, 1.1rem + 1vw, 2rem);
  --t-body: 1.1875rem;
  --t-small: 0.9375rem;

  --m: clamp(1.25rem, 0.6rem + 3vw, 3.5rem);
  --gap: clamp(1rem, 0.6rem + 1.4vw, 2rem);
  --section: clamp(6rem, 3rem + 9vw, 12rem);
  --max: 90rem;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
  scrollbar-color: var(--blue) var(--tone);
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  caret-color: var(--green);
}

::selection { background: var(--green); color: #fff; }

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

h1, h2, h3 {
  margin: 0;
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 0.98;
  text-wrap: balance;
}
p { margin: 0; text-wrap: pretty; }

a { color: inherit; text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 0.14em; }

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

.skip {
  position: absolute; left: var(--m); top: -4rem; z-index: 50;
  background: var(--ink); color: #fff; padding: 0.75rem 1rem; border-radius: 999px; text-decoration: none;
}
.skip:focus { top: 0.75rem; }

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

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

/* Bar: wordmark, a few links, one action. */
.bar {
  position: sticky; top: 0; z-index: 20;
  background: var(--ground);
  transition: background-color 200ms ease;
}
.bar.is-stuck { background: var(--paper); }
.bar .wrap { display: flex; align-items: center; gap: var(--gap); min-height: 4.5rem; }
.wordmark {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-weight: 750; font-size: 1.25rem; letter-spacing: -0.03em; text-decoration: none; color: var(--ink); white-space: nowrap;
}
@media (max-width: 24rem) { .wordmark { font-size: 1.0625rem; gap: 0.45rem; } .wordmark svg { width: 1.9rem; height: 1.9rem; } }
.wordmark svg { width: 2.25rem; height: 2.25rem; flex: none; }
.bar nav { margin-left: auto; display: flex; gap: clamp(1rem, 2vw, 2rem); }
.bar nav a { text-decoration: none; font-size: var(--t-small); color: var(--ink); padding-block: 0.5rem; }
.bar nav a:hover { text-decoration: underline; }
@media (max-width: 62rem) { .bar nav { display: none; } .bar .btn { margin-left: auto; } }

/* One button style, fully round, chosen once. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 3.25rem; padding: 0 1.5rem;
  border: 0; border-radius: 999px;
  background: var(--green); color: #fff;
  font: inherit; font-weight: 650; font-size: 1.0625rem; letter-spacing: -0.01em;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform 160ms var(--ease-out), background-color 200ms ease;
}
.btn:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .btn:hover { background: var(--green-press); text-decoration: none; } }
@media (max-width: 36rem) { .wide-only { display: none; } }
.btn--small { min-height: 2.75rem; padding: 0 1.15rem; font-size: 1rem; }
.btn svg { width: 1.15em; height: 1.15em; }

/* Footer: the name returns, full width. */
.foot { background: var(--navy); color: var(--on-field); padding-top: var(--section); overflow: hidden; }
.foot a { color: var(--on-field); }
.foot-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }
.foot-grid > * { grid-column: span 12; }
.foot h2 { font-size: var(--t-statement); letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 1rem; }
.foot p, .foot li { color: var(--on-field-soft); font-size: var(--t-small); line-height: 1.6; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.foot .links a { font-size: var(--t-body); color: var(--on-field); }
.foot .disclaimer { color: var(--on-field); font-size: var(--t-body); max-width: 36ch; }
.foot .foot-name {
  margin-top: clamp(4rem, 8vw, 8rem);
  font-weight: 800; letter-spacing: -0.055em; line-height: 0.8;
  font-size: clamp(2.5rem, 11.6vw, 13.5rem);
  white-space: nowrap; color: var(--on-field);
  padding-bottom: clamp(1.5rem, 3vw, 3rem);
}
@media (min-width: 48rem) {
  .foot-grid .f-a { grid-column: span 5; }
  .foot-grid .f-b { grid-column: span 3; }
  .foot-grid .f-c { grid-column: span 4; }
}

/* Legal and support pages (generated by scripts/build-site.ts). */
.doc { padding-block: clamp(3rem, 6vw, 6rem) var(--section); }
.doc .wrap { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }
.doc-head { grid-column: 1 / -1; }
.doc-body { grid-column: 1 / -1; max-width: 68ch; }
@media (min-width: 64rem) {
  .doc-head { grid-column: 1 / span 4; position: sticky; top: 6.5rem; align-self: start; }
  .doc-body { grid-column: 6 / span 7; }
}
.doc h1 { font-size: var(--t-heading); margin-bottom: 1rem; }
.doc .updated { color: var(--ink-soft); font-size: var(--t-small); }
.doc-body h2 { font-size: 1.625rem; letter-spacing: -0.025em; line-height: 1.15; margin: 2.75rem 0 0.75rem; }
.doc-body h2:first-child { margin-top: 0; }
.doc-body p, .doc-body ul { margin: 0 0 1rem; }
.doc-body ul { padding-left: 1.25rem; }
.doc-body li { margin: 0.4rem 0; }
.doc-body a { color: var(--blue); }
.doc-body b { font-weight: 650; }
.doc-nav { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.doc-nav a { color: var(--blue); }
.doc-nav a[aria-current='page'] { color: var(--ink); text-decoration: none; font-weight: 650; }

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