/*
 * Design tokens: every color, font and spacing value the dashboard uses.
 * Taken from the Paper mockups. Components use these variables, never raw hex
 * codes, so the look can change in one place.
 */
:root {
  /* Surfaces */
  --color-bg: #ffffff;
  --color-panel: #fbfaf7;
  --color-line: #e6e6e6;

  /* Text */
  --color-ink: #0a0a0a;
  --color-text-2: #4a4a4a;
  --color-muted: #6e6e6e;

  /* Brand and data colors */
  --color-red: #c2001a; /* alerts and the one highlighted number */
  --color-red-soft: #f2d5d9;
  --color-navy: #1f3a5f; /* main chart color */
  --color-navy-soft: #a9b7c9;
  --color-gold: #c8a977; /* plan / forecast lines, hero badges */
  --color-green: #2f6b4f; /* on-track deltas */

  --font-sans: 'Poppins', system-ui, sans-serif;

  --radius-s: 2px;
  --radius-m: 4px;
  --radius-l: 6px;

  /*
   * Dropdown caret (components/Caret.tsx). Native selects draw the same
   * triangle as a background image, in --color-muted; keep the path and color
   * in step with Caret.tsx and --color-muted.
   */
  --caret-size: 12px;
  --caret-select-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5h6L6 8z' fill='%236e6e6e' stroke='%236e6e6e' stroke-linejoin='round'/%3E%3C/svg%3E");
  /* Room a select keeps on its right for the caret. */
  --select-caret-space: calc(var(--caret-size) + 6px);

  --space-page-x: 40px;
  --sidebar-width: 232px;
}

/*
 * Styles for the public site (altimeterapp.com). The build puts the
 * dashboard's design tokens (apps/web/src/styles/tokens.css) in front of this
 * file, so the colors and font match the app. Light only, no scripts.
 */
:root {
  --site-gutter: 16px;
  --site-measure: 720px; /* comfortable reading width for long policies */
  --site-text-size: 16px;
}

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

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: var(--site-text-size);
  line-height: 1.65;
  overflow-wrap: break-word;
}

main,
.site-header,
.site-footer {
  max-width: calc(var(--site-measure) + 2 * var(--site-gutter));
  margin: 0 auto;
  padding-left: var(--site-gutter);
  padding-right: var(--site-gutter);
}

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

a {
  color: var(--color-navy);
  text-underline-offset: 2px;
}

a:hover {
  color: var(--color-ink);
}

a:focus-visible {
  outline: 2px solid var(--color-navy);
  outline-offset: 2px;
}

/* Header and footer on the policy pages */

.site-header {
  padding-top: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-line);
}

.site-header .brand {
  display: inline-block;
}

.site-header img {
  display: block;
}

.site-footer {
  margin-top: 64px;
  padding-top: 24px;
  padding-bottom: 40px;
  border-top: 1px solid var(--color-line);
  color: var(--color-muted);
  font-size: 14px;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

/* Policy pages */

article h1 {
  margin: 40px 0 8px;
  font-size: 32px;
  line-height: 1.25;
  font-weight: 700;
  color: var(--color-navy);
}

article h2 {
  margin: 40px 0 8px;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--color-navy);
}

article h3 {
  margin: 28px 0 4px;
  font-size: 18px;
  font-weight: 600;
}

article h4 {
  margin: 20px 0 4px;
  font-size: 16px;
  font-weight: 600;
}

article p,
article ul,
article ol {
  margin: 0 0 14px;
  color: var(--color-text-2);
}

article li {
  margin-bottom: 4px;
}

article li > ul,
article li > ol {
  margin: 4px 0 0;
}

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

article blockquote {
  margin: 0 0 16px;
  padding: 8px 16px;
  border-left: 3px solid var(--color-navy-soft);
  background: var(--color-panel);
}

article code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  padding: 1px 4px;
  border-radius: var(--radius-s);
  background: var(--color-panel);
}

article hr {
  margin: 32px 0;
  border: 0;
  border-top: 1px solid var(--color-line);
}

/* A wide table scrolls inside its box, so the page itself never scrolls sideways. */
.table-scroll {
  margin: 0 0 16px;
  overflow-x: auto;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-m);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.5;
}

th,
td {
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--color-line);
}

th {
  background: var(--color-panel);
  font-weight: 600;
  color: var(--color-ink);
}

tr:last-child td {
  border-bottom: 0;
}

/* Home page */

.home main {
  padding-top: 18vh;
  padding-bottom: 64px;
}

.home-logo {
  margin: 0 0 24px;
  line-height: 0;
}

.home-logo img {
  display: block;
}

.tagline {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 500;
  color: var(--color-navy);
}

.home p {
  margin: 0 0 8px;
  color: var(--color-text-2);
}

.policy-list {
  margin: 32px 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--color-line);
}

.policy-list li {
  border-bottom: 1px solid var(--color-line);
}

.policy-list a {
  display: block;
  padding: 14px 0;
  font-weight: 500;
  text-decoration: none;
}

.policy-list a:hover {
  text-decoration: underline;
}

/* 404 page */

.not-found main h1 {
  margin: 48px 0 8px;
  font-size: 28px;
  color: var(--color-navy);
}

@media (max-width: 480px) {
  article h1 {
    margin-top: 28px;
    font-size: 26px;
  }

  article h2 {
    font-size: 20px;
  }

  .home main {
    padding-top: 12vh;
  }
}

/* Print: black on white, no navigation, and each link's address written out. */
@media print {
  :root {
    --site-text-size: 11pt;
  }

  body {
    color: #000;
  }

  main {
    max-width: none;
    padding: 0;
  }

  .site-header {
    padding: 0 0 12pt;
  }

  .site-footer nav {
    display: none;
  }

  .site-footer {
    max-width: none;
    margin-top: 24pt;
    padding: 12pt 0 0;
  }

  article p,
  article ul,
  article ol,
  article h1,
  article h2 {
    color: #000;
  }

  a {
    color: #000;
  }

  article a[href^='/']::after {
    content: ' (altimeterapp.com' attr(href) ')';
    font-size: 0.85em;
  }

  h2,
  h3 {
    break-after: avoid;
  }

  tr,
  li {
    break-inside: avoid;
  }

  .table-scroll {
    overflow: visible;
  }
}
