/* Clinical Dusk, on the web.
 *
 * Every value here is lifted from lib/tokens.dart. Dark is primary, the
 * document is a different material, mono appears only on measured values, and
 * severity is one hue at eleven luminances. If a colour here has no twin in
 * tokens.dart it is a bug. */

/* The three voices, served from this origin.
 *
 * They used to come from fonts.googleapis.com, which meant every visitor to
 * the privacy policy of an app that never makes a network request handed their
 * IP address to Google in order to read it. A German court has called that a
 * GDPR violation on its own, and even where it is not, it is the exact thing
 * this page is claiming the app does not do.
 *
 * The files are the same ones the app bundles — copied from assets/fonts/, all
 * three SIL OFL 1.1, with fonts/OFL.txt served alongside them because the
 * licence asks for it. `swap` so the text is readable before they land. */
@font-face {
  font-family: "Instrument Sans"; font-style: normal; font-weight: 400;
  font-display: swap; src: url("fonts/InstrumentSans-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "Instrument Sans"; font-style: normal; font-weight: 500;
  font-display: swap; src: url("fonts/InstrumentSans-Medium.ttf") format("truetype");
}
@font-face {
  font-family: "Instrument Sans"; font-style: normal; font-weight: 600;
  font-display: swap; src: url("fonts/InstrumentSans-SemiBold.ttf") format("truetype");
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400;
  font-display: swap; src: url("fonts/IBMPlexMono-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500;
  font-display: swap; src: url("fonts/IBMPlexMono-Medium.ttf") format("truetype");
}
@font-face {
  font-family: "Source Serif 4"; font-style: normal; font-weight: 400;
  font-display: swap; src: url("fonts/SourceSerif4-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "Source Serif 4"; font-style: normal; font-weight: 600;
  font-display: swap; src: url("fonts/SourceSerif4-SemiBold.ttf") format("truetype");
}
@font-face {
  font-family: "Source Serif 4"; font-style: italic; font-weight: 400;
  font-display: swap; src: url("fonts/SourceSerif4-Italic.ttf") format("truetype");
}

:root {
  --ink-deep: #0b0a12;
  --ink-base: #14121f;
  --ink-raised: #1c1a2a;
  --ink-overlay: #201d30;
  --ink-elevated: #2a2740;

  --txt: #eceaf3;
  --txt-2: #a9a3bf;
  --txt-3: #948ea7;

  --hair-soft: #a9a3bf29;
  --hair-strong: #a9a3bf47;

  --signal: #3b798a;
  --signal-hover: #47899c;
  --signal-border: #4e93a6;
  --signal-text: #8fc0ce;
  --signal-on: #f2f7f8;

  --bone: #f0ebdf;
  --bone-light: #f5f1e7;
  --bone-under: #e7e1d3;
  --doc-ink: #26222e;
  --doc-muted: #6e6455;
  --doc-rule: #3c342c40;

  --ui: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --doc: "Source Serif 4", Georgia, serif;

  /* 4px base, same ladder as Space in tokens.dart. */
  --sp-sm: 8px;
  --sp-md: 12px;
  --sp-lg: 16px;
  --sp-xl: 24px;
  --sp-section: 44px;

  --r-chip: 12px;
  --r-button: 14px;
  --r-card: 16px;
  --r-hero: 18px;
}

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

html {
  scroll-behavior: smooth;
  /* Anchored headings (privacy#erasure) must not land under the header. */
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  background: var(--ink-base);
  color: var(--txt);
  font-family: var(--ui);
  font-size: 17px;
  line-height: 1.65;
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------ furniture */

.skip {
  position: absolute;
  left: -9999px;
  top: var(--sp-sm);
  z-index: 10;
  padding: var(--sp-md) var(--sp-lg);
  background: var(--ink-elevated);
  border-radius: var(--r-button);
}
.skip:focus {
  left: var(--sp-lg);
}

a {
  color: var(--signal-text);
  text-decoration-color: #8fc0ce66;
  text-underline-offset: 3px;
}
a:hover {
  color: var(--signal-on);
  text-decoration-color: currentColor;
}
:focus-visible {
  outline: 2px solid var(--signal-border);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: min(100% - 2 * var(--sp-xl), 68rem);
  margin-inline: auto;
}
.narrow {
  width: min(100% - 2 * var(--sp-xl), 40rem);
  margin-inline: auto;
}

header.site {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #14121fd9;
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hair-soft);
}
header.site .wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-lg);
  min-height: 64px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--txt);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand img {
  width: 30px;
  height: 30px;
  border-radius: 6.7px; /* 22.37% of 30, the tile's own corner */
}
nav.site {
  margin-left: auto;
  display: flex;
  gap: var(--sp-xs, 4px);
  flex-wrap: wrap;
}
nav.site a {
  display: inline-flex;
  align-items: center;
  min-height: 48px; /* Touch.min, and a pointer is not always a mouse */
  padding-inline: var(--sp-md);
  border-radius: var(--r-chip);
  color: var(--txt-2);
  font-size: 15px;
  text-decoration: none;
}
nav.site a:hover {
  color: var(--txt);
  background: var(--ink-raised);
}
nav.site a[aria-current="page"] {
  color: var(--txt);
  background: var(--ink-elevated);
}

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

h1,
h2,
h3 {
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0;
}
h1 {
  font-size: clamp(34px, 6vw, 56px);
  font-weight: 600;
}
h2 {
  font-size: clamp(24px, 3.4vw, 31px);
  font-weight: 600;
}
h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
p {
  margin: 0 0 var(--sp-lg);
  color: var(--txt-2);
}
.lede {
  font-size: clamp(18px, 2.2vw, 21px);
  color: var(--txt-2);
  max-width: 34em;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--txt-3);
  margin: 0 0 var(--sp-md);
}
.stamp {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--txt-3);
}
section {
  padding-block: var(--sp-section);
}

/* --------------------------------------------------------------- pieces */

.severity-ramp {
  display: flex;
  gap: 3px;
  margin-block: var(--sp-xl);
}
.severity-ramp span {
  flex: 1;
  height: 34px;
  border-radius: 7px; /* Radii.block */
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 11px;
}

.cards {
  display: grid;
  gap: var(--sp-lg);
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}
.card {
  background: var(--ink-raised);
  border: 1px solid var(--hair-soft);
  border-radius: var(--r-card);
  padding: var(--sp-xl);
}
.card p:last-child {
  margin-bottom: 0;
}
.card p {
  font-size: 15.5px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px; /* Touch.primary */
  padding-inline: var(--sp-xl);
  border-radius: var(--r-button);
  background: var(--signal);
  color: var(--signal-on);
  font-weight: 600;
  font-size: 17px;
  text-decoration: none;
}
.btn:hover {
  background: var(--signal-hover);
  color: var(--signal-on);
}
.btn.ghost {
  background: transparent;
  border: 1px solid var(--hair-strong);
  color: var(--txt);
}
.btn.ghost:hover {
  background: var(--ink-raised);
  border-color: var(--signal-border);
}
.row {
  display: flex;
  gap: var(--sp-md);
  flex-wrap: wrap;
  align-items: center;
}

/* The document is a different substance from the app. */
.paper {
  background: linear-gradient(var(--bone-light), var(--bone));
  color: var(--doc-ink);
  border-radius: 6px; /* Radii.sheet — paper barely rounds */
  padding: clamp(var(--sp-xl), 5vw, 40px);
  font-family: var(--doc);
  box-shadow: 0 18px 50px #00000080; /* Elevation.document */
}
.paper h3,
.paper p,
.paper li {
  color: var(--doc-ink);
  font-family: var(--doc);
}
.paper .stamp,
.paper .caption {
  color: var(--doc-muted);
}
.paper hr {
  border: none;
  border-top: 1px solid var(--doc-rule);
  margin-block: var(--sp-lg);
}
.paper .caption {
  font-family: var(--ui);
  font-size: 12.5px;
  margin: 0;
}

table.claims {
  width: 100%;
  border-collapse: collapse;
  font-size: 15.5px;
}
table.claims th,
table.claims td {
  text-align: left;
  padding: var(--sp-md) var(--sp-lg);
  border-bottom: 1px solid var(--hair-soft);
  vertical-align: top;
}
table.claims th {
  color: var(--txt);
  font-weight: 600;
  white-space: nowrap;
}
table.claims td {
  color: var(--txt-2);
}

/* --------------------------------------------------------- legal pages */

article.doc {
  padding-block: var(--sp-section);
}
article.doc h2 {
  font-size: 21px;
  margin-top: var(--sp-section);
  margin-bottom: var(--sp-md);
  scroll-margin-top: 96px;
}
article.doc h1 + p.stamp {
  margin-top: var(--sp-sm);
}
article.doc p,
article.doc li {
  color: var(--txt-2);
  font-size: 16.5px;
}
article.doc ul {
  padding-left: 1.2em;
  margin: 0 0 var(--sp-lg);
}
article.doc li {
  margin-bottom: var(--sp-sm);
}
article.doc strong {
  color: var(--txt);
  font-weight: 500;
}
article.doc .footnote {
  margin-top: var(--sp-section);
  padding-top: var(--sp-lg);
  border-top: 1px solid var(--hair-soft);
  color: var(--txt-3);
  font-size: 14px;
}

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

footer.site {
  border-top: 1px solid var(--hair-soft);
  background: var(--ink-deep);
  padding-block: var(--sp-section);
  font-size: 15px;
}
footer.site .cols {
  display: grid;
  gap: var(--sp-xl);
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}
footer.site h3 {
  font-size: 12px;
  font-family: var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--txt-3);
  font-weight: 500;
  margin-bottom: var(--sp-md);
}
footer.site ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
footer.site li {
  margin-bottom: var(--sp-sm);
}
footer.site a {
  color: var(--txt-2);
  text-decoration: none;
}
footer.site a:hover {
  color: var(--txt);
  text-decoration: underline;
}
footer.site .fine {
  margin-top: var(--sp-section);
  color: var(--txt-3);
  font-size: 13.5px;
  max-width: 44em;
}

/* A sticky header that wraps onto three rows eats a third of a phone. Below
   this width it scrolls away with the page, and the nav is one row you can
   swipe rather than a stack. */
@media (max-width: 640px) {
  html {
    scroll-padding-top: var(--sp-lg);
  }
  header.site {
    position: static;
  }
  header.site .wrap {
    min-height: 0;
    padding-block: var(--sp-md);
    gap: var(--sp-sm);
  }
  nav.site {
    margin-left: 0;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  nav.site a {
    padding-inline: var(--sp-sm);
    white-space: nowrap;
  }
}

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