/* The site's one stylesheet: every page's type, colour, nav and footer, and
 * the document layout the legal pages and the 404 share. The landing page adds
 * its own sections in a <style> block, since nothing else has them.
 *
 * Colours are the app's own light scheme, as ColorScheme.fromSeed derives it
 * from #3F51B5 (lib/presentation/theme.dart), so the page and the screenshots
 * on it are the same palette rather than a near miss. See docs/brand/.
 *
 * The fonts are the ones the app bundles, copied to /fonts by
 * tool/build_web.dart and served from this origin: a page that says nothing is
 * watching what you do should not open by asking Google for a font.
 */

@font-face {
  font-family: "Google Sans Flex";
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/GoogleSansFlex-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "Google Sans Flex";
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/GoogleSansFlex-Medium.ttf") format("truetype");
}
@font-face {
  font-family: "Google Sans Flex";
  font-weight: 600 700;
  font-display: swap;
  src: url("/fonts/GoogleSansFlex-SemiBold.ttf") format("truetype");
}

:root {
  /* surface, onSurface, onSurfaceVariant, outline, outlineVariant */
  --paper: #fbf8ff;
  --ink: #1b1b21;
  --slate: #46464f;
  --muted: #46464f;
  --line: #e4e1e9;
  --edge: #c7c5d0;
  /* surfaceContainerLow, surfaceContainer */
  --wash: #f5f2fa;
  --wash-strong: #efedf4;
  /* primary, onPrimaryContainer, primaryContainer */
  --primary: #515b92;
  --on-primary-container: #394379;
  --primary-container: #dee0ff;

  --sans: "Google Sans Flex", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* The reader's own monospace: inline code is the only thing set in it. */
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --measure: 1160px;
  --gutter: clamp(16px, 5vw, 40px);

  /* Shadow tinted with the brand's onPrimaryContainer rather than grey, layered so a
     screen reads as lifted off the page rather than outlined. */
  --lift: 0 1px 2px rgb(57 67 121 / 0.08), 0 8px 24px -8px rgb(57 67 121 / 0.16), 0 32px 64px -24px rgb(57 67 121 / 0.24);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover {
  color: var(--on-primary-container);
}

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

::selection {
  background: var(--primary-container);
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 8px;
  z-index: 10;
}
.skip:focus {
  top: 12px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* The mark and icons, drawn once per page in an inline <svg> and referenced
   with <use>. Hidden by size rather than display: none, which would also
   switch off the mask the mark's cut is made with. */
.mark-defs {
  position: absolute;
  width: 0;
  height: 0;
}

/* Nav ---------------------------------------------------------------------*/

.sitenav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.sitenav-links {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 28px);
}

.sitenav-links a {
  color: var(--slate);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}
.sitenav-links a:hover {
  color: var(--ink);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 20px;
  letter-spacing: -0.02em;
}
.wordmark:hover {
  color: var(--ink);
}
.wordmark svg {
  width: 28px;
  height: 28px;
  flex: none;
}
.wordmark b {
  font-weight: 600;
}

/* Buttons -----------------------------------------------------------------*/

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid var(--primary);
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 0.15s,
    border-color 0.15s,
    color 0.15s;
}
.button svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.button-filled {
  background: var(--primary);
  color: #fff;
}
.button-filled:hover {
  background: var(--on-primary-container);
  border-color: var(--on-primary-container);
  color: #fff;
}

.button-outlined {
  background: transparent;
  border-color: var(--edge);
  color: var(--ink);
}
.button-outlined:hover {
  background: var(--wash);
  border-color: var(--primary);
  color: var(--ink);
}

.button-small {
  min-height: 40px;
  padding: 0 18px;
  font-size: 15px;
}

/* Document pages ----------------------------------------------------------*/

.doc {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(40px, 8vw, 88px) var(--gutter) 112px;
}

.doc h1 {
  font-size: clamp(34px, 5vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 600;
  margin: 0 0 24px;
}

.doc .updated {
  font-size: 15px;
  color: var(--muted);
  margin: -12px 0 40px;
}

.doc h2 {
  font-size: 22px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 48px 0 12px;
}

.doc h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 28px 0 8px;
}

.doc p,
.doc li {
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--slate);
}
.doc p {
  margin: 0 0 16px;
}
.doc ul {
  padding-left: 22px;
  margin: 0 0 16px;
}
.doc li {
  margin-bottom: 8px;
}
.doc strong {
  font-weight: 600;
  color: var(--ink);
}

.doc code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--wash-strong);
  padding: 1px 5px;
  border-radius: 4px;
}

.doc .doc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

/* A callout for the one disclaimer each document carries. */
.note {
  margin: 28px 0;
  padding: 18px 22px;
  border-radius: 16px;
  background: var(--wash);
}
.doc .note p {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.6;
}
.doc .note p + p {
  margin-top: 12px;
}

/* Footer ------------------------------------------------------------------*/

.sitefooter {
  border-top: 1px solid var(--line);
  padding-top: 48px;
  padding-bottom: 40px;
  color: var(--muted);
  font-size: 15px;
}

.sitefooter-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 40px 64px;
}

.sitefooter-about {
  max-width: 300px;
}
.sitefooter-tagline {
  margin: 14px 0 0;
  line-height: 1.55;
}

.sitefooter nav {
  display: flex;
  flex-wrap: wrap;
  gap: 32px 64px;
}

.sitefooter h2 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

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

.sitefooter-top a {
  color: var(--slate);
  text-decoration: none;
}
.sitefooter-top a:hover {
  color: var(--primary);
}

.sitefooter-base {
  margin: 48px 0 0;
  font-size: 14px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  /* Overrides every page's own animations, which is what !important is for. */
  *,
  *::before,
  *::after {
    /* biome-ignore lint/complexity/noImportantStyles: has to beat any page's own animation rules. */
    animation: none !important;
    /* biome-ignore lint/complexity/noImportantStyles: as above, for transitions. */
    transition: none !important;
  }
}
