@font-face {
  font-family: "Google Sans Flex";
  src: url("/fonts/google-sans-flex-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --accent: #1eaefb;
  --accent-hover: #0f9fe9;
  --background: #10161f;
  --surface-tint: rgb(29 38 51 / 80%);
  --surface-active: #222c3d;
  --text: #d9e6f2;
  --muted: #93a5b8;
  --white: #ffffff;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

/* A column layout where main takes the spare height keeps the footer on the
   bottom edge even when the page content is short. */
body {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(60rem 36rem at 10% -10%, rgb(30 174 251 / 14%), transparent 70%),
    var(--background);
  color: var(--text);
  font: 400 16px/1.5 "Google Sans Flex", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.topbar, main, footer {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding-inline: 32px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.1em;
  color: var(--white);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  text-decoration: none;
}

/* Trimming each text box to cap height makes flex and grid centering act on
   the capitals themselves rather than on the font's taller line box, which
   would otherwise leave the letters sitting high. */
.wordmark .letters {
  display: block;
  text-box: trim-both cap alphabetic;
}

/* The circle is exactly as wide as "TON" (2em at this weight), so the two
   halves of the wordmark carry equal width. */
.wordmark .ws {
  display: grid;
  place-items: center;
  width: 2em;
  height: 2em;
  border-radius: 50%;
  background: var(--white);
  color: var(--accent);
}

.topbar nav { display: flex; gap: 2rem; }

.topbar nav > a, footer a {
  color: var(--white);
  font-weight: 500;
  text-decoration: none;
}

.topbar nav > a:hover, .menu-button:hover, footer a:hover { color: var(--accent); }

main { flex: 1; padding-top: 9rem; padding-bottom: 4rem; }

h1 {
  margin: 0;
  color: var(--white);
  font-size: 56px;
  font-weight: 500;
  line-height: 1.16;
  letter-spacing: -0.9px;
}

.lede {
  max-width: 36rem;
  margin: 1.5rem 0 2rem;
  color: var(--muted);
  font-size: 1.125rem;
}

.pill {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 100px;
  background: var(--surface-active);
  color: var(--white);
  font-weight: 500;
  line-height: 18px;
  text-decoration: none;
  transition: background 0.15s;
}

.pill:hover { background: #2b374b; }

.pill.primary { background: var(--accent); }

.pill.primary:hover { background: var(--accent-hover); }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* The menu panel is positioned against the whole nav rather than the Tools
   button, so on narrow screens it opens within the page instead of past the
   left edge. */
.topbar nav { position: relative; align-items: center; }

.menu-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--white);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.menu-button::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.15s, margin 0.15s;
}

/* The top padding bridges the gap between button and list, so the pointer
   can travel down without leaving the hover area and closing the menu. */
.menu-panel {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 10;
  padding-top: 0.75rem;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}

.menu-button[aria-expanded="true"] + .menu-panel {
  visibility: visible;
  opacity: 1;
  transform: none;
}

.menu-button[aria-expanded="true"]::after { margin-top: 3px; transform: rotate(-135deg); }

/* Only devices with a real pointer open on hover; on touch screens a tap
   would otherwise leave the menu stuck open. */
@media (hover: hover) {
  .menu:hover .menu-panel {
    visibility: visible;
    opacity: 1;
    transform: none;
  }

  .menu:hover .menu-button::after { margin-top: 3px; transform: rotate(-135deg); }
}

.menu-panel ul {
  width: min(20rem, calc(100vw - 64px));
  margin: 0;
  padding: 8px;
  list-style: none;
  border-radius: 22px;
  corner-shape: squircle;
  background: #1a2230;
}

.menu-panel a {
  display: grid;
  gap: 0.15rem;
  padding: 12px 14px;
  border-radius: 14px;
  corner-shape: squircle;
  text-decoration: none;
}

.menu-panel a:hover { background: var(--surface-active); }

.menu-name { color: var(--white); font-weight: 500; }

.menu-description { color: var(--muted); font-size: 0.875rem; }

footer {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
  padding-top: 2rem;
  padding-bottom: 3rem;
}

footer .disclaimer { margin-left: auto; color: var(--muted); font-size: 0.875rem; }

@media (max-width: 720px) {
  main { padding-top: 5rem; padding-bottom: 3rem; }
  h1 { font-size: 40px; }
  footer .disclaimer { margin-left: 0; }
}
