/* What the landing page and the help pages share: the fonts, DESIGN.md's tokens, the page's type, the
   header and the footer. Tokens are copied from frontend/app/globals.css, because this site has no
   build step. */

@font-face {
  font-family: "DM Sans";
  src: url("/fonts/dm-sans-variable.woff2") format("woff2");
  font-weight: 100 1000;
  font-display: swap;
}

@font-face {
  font-family: "Clash Display";
  src: url("/fonts/clash-display-variable.woff2") format("woff2");
  font-weight: 200 700;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --canvas: hsl(0 0% 4%);
  --surface: hsl(0 0% 6.7%);
  --raised: hsl(0 0% 10.2%);
  --overlay: hsl(0 0% 12.2%);
  --line: hsl(0 0% 100% / 0.08);
  --line-strong: hsl(0 0% 100% / 0.14);
  --ink: hsl(0 0% 93%);
  --ink-2: hsl(0 0% 63%);
  --main: hsl(0 0% 93%);
  --main-hover: hsl(0 0% 100%);
  --ink-on-main: hsl(0 0% 4%);
  --focus: hsl(0 0% 100%);

  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-title: "Clash Display", "DM Sans", system-ui, sans-serif;
  --font-code: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Menlo, monospace;

  --text-part: 1.25rem;
  --text-lead: 1.0625rem;
  --text-body: 0.9375rem;
  --text-ui: 0.875rem;
  --text-small: 0.8125rem;

  --ease-out-strong: cubic-bezier(0.23, 1, 0.32, 1);
  --gutter: clamp(1rem, 4vw, 3.5rem);
  color-scheme: dark;
}

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

/* The landing reads larger than the dashboard (DESIGN.md): 130 %, and 116 % on a phone. */
html {
  font-size: 116%;
  scroll-padding-block: 1rem;
  -webkit-text-size-adjust: 100%;
}

@media (min-width: 48em) {
  html {
    font-size: 130%;
  }
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 0.25rem;
}

.skip {
  position: absolute;
  top: -5rem;
  left: 1rem;
  z-index: 10;
  padding: 0.5rem 0.875rem;
  border-radius: 0.5rem;
  background: var(--main);
  color: var(--ink-on-main);
}

.skip:focus {
  top: 1rem;
}

/* The header. Two levels of words only: the name, and where you can go. */
.site-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem var(--gutter);
}

.brand {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  font-family: var(--font-title);
  font-size: var(--text-lead);
  font-weight: 500;
  letter-spacing: 0.005em;
  text-decoration: none;
}

.brand img {
  display: block;
  width: auto;
  height: 1.5rem;
}

.site-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0 clamp(0.75rem, 2vw, 1.5rem);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-ui);
}

.site-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  white-space: nowrap;
  text-decoration: none;
}

/* A phone has room for the name and two links; the page's own words lead to "What it is". */
@media (max-width: 29.99em) {
  .site-links .wide {
    display: none;
  }
}

@media (hover: hover) {
  .site-links a:hover,
  .brand:hover,
  .site-foot a:hover {
    text-decoration: underline;
    text-underline-offset: 0.25em;
  }
}

/* The footer. A block of company details goes in .foot-company when there are some: it takes the
   full row above the links, on every page. */
.site-foot {
  display: grid;
  gap: 1rem;
  padding: 1.5rem var(--gutter) 2rem;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: var(--text-small);
}

.foot-company {
  display: grid;
  gap: 0.125rem;
  font-style: normal;
}

.foot-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 2rem;
}

.foot-line p {
  margin: 0;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  text-decoration: none;
}

/* The narrowest phones: the name and both links still share one row. */
@media (max-width: 22.5em) {
  .site-top {
    gap: 0.5rem;
  }

  .brand {
    gap: 0.375rem;
    font-size: var(--text-body);
  }

  .brand img {
    height: 1.25rem;
  }

  .site-links {
    flex-wrap: nowrap;
    gap: 0 0.625rem;
  }
}
