:root {
  color-scheme: light dark;
  --background: light-dark(#f8f8f8, #131313);
  --ink: light-dark(#161616, #f2f2f2);
  --muted: light-dark(#555555, #aaaaaa);
  --rule: light-dark(#d8d8d8, #373737);
  --control-hover: light-dark(#e9e9e9, #313131);
  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  background: var(--background);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

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

body {
  display: flex;
  flex-direction: column;
  min-block-size: 100vh;
  min-block-size: 100svh;
  margin: 0;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.frame {
  inline-size: min(calc(100% - 2 * var(--gutter)), 75rem);
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  min-block-size: 5.5rem;
  padding-block: 0.75rem;
  border-block-end: 1px solid var(--rule);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-block-size: 44px;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.brand-mark {
  flex: none;
  padding: 0.25rem;
  border-radius: 0.375rem;
  background: var(--ink);
  color: var(--background);
}

.brand-labs {
  color: var(--muted);
  font-weight: 500;
}

.theme-control {
  position: relative;
  display: flex;
  align-items: center;
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.theme-control::before {
  content: "";
  position: absolute;
  inset: 5.5px 7px;
  border: 1px solid var(--rule);
  border-radius: 2rem;
  pointer-events: none;
}

.theme-control[hidden] { display: none; }

.theme-control label {
  display: grid;
  place-items: center;
  inline-size: 44px;
  block-size: 44px;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
}

.theme-control svg {
  box-sizing: content-box;
  inline-size: 0.875rem;
  block-size: 0.875rem;
  padding: 7px;
  border-radius: 50%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-control label:first-of-type svg { translate: 3px 0; }
.theme-control label:last-of-type svg { translate: -3px 0; }

.theme-control label:hover svg { background-color: var(--control-hover); }

.theme-control input:checked + label svg {
  background-color: var(--ink);
  color: var(--background);
}

.theme-control input:focus-visible + label {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

@media (forced-colors: active) {
  .theme-control input:checked + label { border-color: Highlight; }
}

.site-main {
  display: grid;
  align-content: center;
  flex: 1;
}

.hero {
  inline-size: fit-content;
  max-inline-size: 100%;
  margin-inline: auto;
  padding-block: 1rem;
  text-align: start;
}

.hero h1 {
  margin: 0;
  font-size: clamp(3.5rem, 8vw, 7.25rem);
  font-weight: 750;
  letter-spacing: -0.043em;
  word-spacing: 0.04em;
  line-height: 1.02;
}

.hero-slogan {
  margin: clamp(1rem, 2vw, 1.375rem) 0 0;
  font-size: clamp(1.375rem, 2.45vw, 2rem);
  font-weight: 580;
  letter-spacing: -0.03em;
  line-height: 1.2;
  text-wrap: balance;
}

.hero-description {
  /* Wrap the summary within the measure set by the title and slogan. */
  contain: inline-size;
  max-inline-size: 42ch;
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.55vw, 1.1875rem);
  line-height: 1.55;
  text-wrap: balance;
}

.site-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  min-block-size: 5rem;
  padding-block: 1rem;
  border-block-start: 1px solid var(--rule);
  color: var(--muted);
}

.site-footer small { font-size: 0.875rem; }

.error-page {
  padding-block: clamp(3rem, 10vh, 7rem);
}

.error-page h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4.25rem);
  letter-spacing: -0.05em;
  line-height: 1.1;
}

.error-page a { text-underline-offset: 0.2em; }

@media (max-width: 43rem) {
  .site-header { min-block-size: 4.5rem; }

  .hero {
    inline-size: 100%;
    padding-block-end: clamp(1rem, calc(100svh - 24rem), 5.5rem);
  }

  .hero h1 { font-size: clamp(3rem, 14vw, 5.25rem); }

  .site-footer { min-block-size: 4.25rem; }
}
