@charset "utf-8";

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

::selection {
  color: var(--surface);
  background: var(--text);
  text-shadow: 0 0.0625rem 0 color-mix(in srgb, var(--surface), transparent 50%);
}

html {
  min-width: 20rem;
  font-size: var(--scale);
  color: var(--text);
  background: var(--ambient);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  transition: background-color var(--motion-slow) var(--ease);
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  line-height: 1.25;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

img {
  max-width: 100%;
}

hr {
  width: 100%;
  margin: 0.5rem 0;
  border: 0;
  border-top: 0.0625rem dotted var(--text);
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 0.0625rem;
  text-underline-offset: 0.2em;
  cursor: pointer;
  transition:
    color var(--motion-med) var(--ease),
    text-decoration-color var(--motion-med) var(--ease);

  &:visited {
    color: var(--linkVisited);
  }

  &:hover,
  &:active {
    color: var(--linkHover);
  }
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 1rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.005em;
  color: var(--heading);
  text-wrap: balance;
}

h1 {
  font-size: 2.5rem;
  line-height: 1.05;
  letter-spacing: -0.015em;
}

h2 {
  font-size: 2.2rem;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 2rem;
}

h4 {
  font-size: 1.75rem;
}

h5 {
  font-size: 1.5rem;
}

address {
  font-style: inherit;
}

p {
  margin: 0 0 0.5em;
  text-wrap: pretty;

  &:last-child {
    margin-bottom: 0;
  }
}

:where(ol, ul) {
  margin: 0 0 0.7em;
  padding: 0;

  &:last-child {
    margin-bottom: 0;
  }
}

:where(ol, ul) > li {
  margin: 0 0 0.3em;
  list-style-position: inside;
}

:where(ul) > li {
  list-style-type: square;

  &::marker {
    font-size: 80%;
    color: var(--primary);
  }
}

form {
  display: block;
  width: 100%;

  label {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    text-align: left;
    user-select: none;
  }
}

:where(form) :is(input, select, textarea) {
  appearance: none;
  height: var(--control-h);
  margin: 0;
  font-size: inherit;
  color: var(--ink);
  background: var(--field);
  border: 0.0625rem solid var(--field-line);
  border-radius: var(--radius-m);
  outline: 0;
  box-shadow: inset 0 0.0625rem 0.125rem color-mix(in srgb, var(--dark), transparent 94%);
  transition:
    border-color var(--motion-fast) var(--ease),
    background-color var(--motion-fast) var(--ease),
    box-shadow var(--motion-fast) var(--ease);
}

:where(form) :where(input:not([type='checkbox'], [type='radio']), select, textarea) {
  width: 100%;
  padding: 0 1em;
}

:where(form) textarea {
  height: 7.5rem;
  max-height: 7.5rem;
  padding-block: 0.8em;
  line-height: 1.5;
  resize: none;
}

:where(form) :is(input, select, textarea):hover {
  border-color: color-mix(in srgb, var(--dark), transparent 72%);
}

:where(form) :is(input, select, textarea):focus-visible {
  background-color: color-mix(in srgb, var(--light), transparent 10%);
  border-color: color-mix(in srgb, var(--primary), transparent 35%);
  outline: 0;
  box-shadow: 0 0 0 0.25rem var(--ring);
}

:where(form) input[type='checkbox'] {
  flex: none;
  width: 1.25em;
  height: 1.25em;
  padding: 0;
  border-radius: var(--radius-s);
  cursor: pointer;

  &:checked {
    background: var(--primary) url(/i/tick.svg) center / 85% no-repeat;
    border-color: var(--primary);
  }

  &:disabled {
    opacity: 0.5;
  }
}

::placeholder {
  font-family: inherit;
  color: color-mix(in srgb, var(--dark), transparent 62%);
}

.button {
  appearance: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.6em;
  height: 3em;
  padding: 0 1.5em;
  font-family: inherit;
  font-size: inherit;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-decoration: none;
  color: var(--light);
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--primary), white 10%),
    var(--primary)
  );
  border: 0;
  border-radius: var(--radius-m);
  outline-offset: 0.25rem;
  box-shadow:
    inset 0 0.0625rem 0 color-mix(in srgb, white, transparent 70%),
    0 0.0625rem 0.125rem color-mix(in srgb, var(--primaryDark), transparent 60%),
    0 0.75rem 1.5rem -0.75rem var(--glow);
  cursor: pointer;
  user-select: none;
  transition:
    translate var(--motion-fast) var(--ease),
    filter var(--motion-fast) var(--ease),
    box-shadow var(--motion-fast) var(--ease);

  &:is(:link, :visited, :hover, :active) {
    color: var(--light);
    text-decoration: none;
  }

  &:hover {
    translate: 0 -0.0625rem;
    filter: brightness(1.06);
    box-shadow:
      inset 0 0.0625rem 0 color-mix(in srgb, white, transparent 70%),
      0 0.0625rem 0.125rem color-mix(in srgb, var(--primaryDark), transparent 60%),
      0 1rem 2rem -0.75rem var(--glow);
  }

  &:active {
    translate: 0 0.0625rem;
    filter: brightness(0.95);
  }

  &:disabled {
    translate: none;
    filter: saturate(0.6);
    cursor: not-allowed;
    opacity: 0.6;
  }
}

.action {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  padding: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.3em;
  background: none;
  border: 0;
  cursor: pointer;
}

.glyph-toggle {
  appearance: none;
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0.125rem;
  font-size: inherit;
  color: var(--text);
  background: none;
  border: 0;
  border-radius: 0.25rem;
  opacity: 0.5;
  cursor: pointer;
  transition: opacity var(--motion-med) var(--ease);

  &:hover {
    opacity: 0.85;
  }

  &:is([aria-pressed='true'], [aria-checked='true']) {
    opacity: 0.95;
  }

  svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  &::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -0.375rem;
    width: 0.75rem;
    height: 0.0625rem;
    margin-left: -0.375rem;
    border-radius: 0.125rem;
    background: var(--primary);
    box-shadow: 0 0 0.55rem var(--primary);
    scale: 0 1;
    transition: scale var(--motion-med) var(--ease);
  }

  &:is([aria-pressed='true'], [aria-checked='true'])::after {
    scale: 1 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .glyph-toggle,
  .glyph-toggle::after {
    transition: none;
  }
}

:focus-visible {
  outline: 0.125rem solid var(--primary);
  outline-offset: 0.1875rem;
}

::-webkit-scrollbar {
  width: 0.5rem;
  height: 0.5rem;
}

::-webkit-scrollbar-track {
  background: var(--gray);
}

::-webkit-scrollbar-thumb {
  background: var(--grayDark);
  border-radius: 0;

  &:hover {
    background: var(--primary);
    border-radius: 2rem;
  }
}

html[data-theme='dark'] {
  hr {
    border-top-color: var(--gray);
  }

  ::-webkit-scrollbar-track {
    background: color-mix(in srgb, var(--dark), transparent 20%);
  }

  ::-webkit-scrollbar-thumb {
    background: var(--dark);
  }

  ::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
  }
}

@supports not selector(::-webkit-scrollbar) {
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--grayDark) var(--gray);
  }
}

.sr-only {
  position: absolute;
  width: 0.0625rem;
  height: 0.0625rem;
  padding: 0;
  margin: -0.0625rem;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 37.5rem) {
  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.3rem;
  }

  h4 {
    font-size: 1.25rem;
  }

  h5 {
    font-size: 1.15rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
