/* ==========================================================================
   DeltaXY — Base
   Reset, document defaults, raw element typography. No components here.
   ========================================================================== */

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

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--sp-8));
}

body {
  min-height: 100%;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--fw-regular);
  font-feature-settings: "cv05" 1, "cv08" 1, "ss03" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color var(--dur) var(--ease),
              color var(--dur) var(--ease);
}

/* Theme flips shouldn't animate every single node on the page. */
body.is-theme-switching *,
body.is-theme-switching *::before,
body.is-theme-switching *::after {
  transition: background-color var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              color var(--dur) var(--ease) !important;
}

::selection {
  background-color: var(--selection-bg);
  color: var(--selection-text);
}

/* ---- Headings ---------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--fw-medium);
  color: var(--display);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-display-1);
  line-height: var(--lh-display);
  letter-spacing: var(--ls-display);
}

h2 {
  font-size: var(--fs-display-2);
  line-height: 1.01;
  letter-spacing: var(--ls-display);
}

h3 { font-size: var(--fs-display-3); }
h4 { font-size: var(--fs-h4); }
h5 { font-size: var(--fs-h5); }

p {
  text-wrap: pretty;
}

/* ---- Links ------------------------------------------------------------- */

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}

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

/* ---- Lists ------------------------------------------------------------- */

ul, ol {
  list-style: none;
}

/* ---- Media ------------------------------------------------------------- */

img, svg, video, canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

svg {
  flex: none;
}

/* ---- Forms ------------------------------------------------------------- */

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
}

button {
  cursor: pointer;
}

textarea {
  resize: vertical;
}

/* ---- Rules & code ------------------------------------------------------ */

hr {
  border: none;
  border-top: 1px solid var(--border);
}

code, kbd, pre, samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* ---- Tables ------------------------------------------------------------ */

table {
  border-collapse: collapse;
  width: 100%;
}

/* ---- Accessibility ----------------------------------------------------- */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

:focus:not(:focus-visible) {
  outline: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: var(--sp-3);
  left: var(--sp-3);
  z-index: 999;
  padding: var(--sp-3) var(--sp-5);
  background-color: var(--accent);
  color: var(--on-accent);
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  transform: translateY(-160%);
  transition: transform var(--dur) var(--ease);
}

.skip-link:focus-visible {
  transform: translateY(0);
  color: var(--on-accent);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
