/* Base: reset, type, focus, shared motion. Values come from tokens.css. */

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

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--fs-16);
  font-weight: 400;
  line-height: 1.55;
  font-optical-sizing: auto;
  background-color: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

[data-theme] {
  background-color: var(--bg);
  color: var(--text);
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 650;
  letter-spacing: -.025em;
  line-height: 1.05;
}

h2 {
  font-size: var(--fs-32);
}

h3 {
  font-size: var(--fs-20);
}

p {
  margin: 0;
}

a {
  color: var(--accent-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--d-hover) var(--ease-state);
}

/* Not on link-styled buttons: a:hover outranks .btn--primary and once hid its label. */
a:not(.btn):hover {
  color: var(--accent-ink-hi);
}

button,
input {
  font: inherit;
  color: inherit;
}

/* Components set display, which would otherwise win over the hidden attribute. */
[hidden] {
  display: none !important;
}

:focus-visible,
.is-focus {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

::selection {
  background: var(--wine);
  color: var(--on-wine);
}

.eyebrow {
  font-size: var(--fs-12);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-2);
}

.mono {
  font-family: var(--font-mono);
  font-size: var(--fs-14);
  font-variant-ligatures: none;
}

.muted {
  color: var(--text-2);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: calc(-1 * var(--s-px));
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  top: var(--s-2);
  left: var(--s-2);
  z-index: 10;
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-control);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 500;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform var(--d-hover) var(--ease-state);
}

.skip:focus-visible {
  transform: none;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

/* The wordmark: the one display use of Bitcount per screen. */
.wordmark {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-display);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  text-transform: lowercase;
  font-variation-settings: "wght" 500, "ELSH" 0, "ELXP" 0, "slnt" 0;
  animation: wordmark-in var(--d-hero) var(--ease-enter) backwards;
  transition: font-variation-settings var(--d-enter) var(--ease-enter);
}

.wordmark:hover {
  font-variation-settings: "wght" 700, "ELSH" 60, "ELXP" 20, "slnt" -8;
}

@keyframes wordmark-in {
  from {
    opacity: 0;
    font-variation-settings: "wght" 100, "ELSH" 100, "ELXP" 100, "slnt" 0;
  }
  to {
    opacity: 1;
    font-variation-settings: "wght" 500, "ELSH" 0, "ELXP" 0, "slnt" 0;
  }
}

/* Enter motion shared by interactive parts. */
@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.enter {
  animation: enter var(--d-enter) var(--ease-enter) backwards;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-property: color, background-color, border-color, opacity, box-shadow, outline-color !important;
  }

  .enter,
  .wordmark {
    animation-name: fade-in;
  }

  .wordmark,
  .wordmark:hover {
    font-variation-settings: "wght" 500, "ELSH" 0, "ELXP" 0, "slnt" 0;
  }
}

/* Theme switch: the page changes as one image (ui.js revealTheme). The default crossfade is
   turned off so only the clip-path reveal from the toggle runs. */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
