/**
 * @file
 * Generic base elements.
 */

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

:root {
  interpolate-size: allow-keywords;
}

::selection {
  color: var(--color--white);
  background-color: var(--color--primary-80);
}

html {
  font-family: var(--font-sans);
  font-size: 100%;
  font-weight: normal;
  font-style: normal;
  line-height: 1.5;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--color--night-5);
  background-repeat: no-repeat;
  background-position: top -100px left 25%;
  background-size: min(100%, 70.625rem);

  &.is-fixed {
    position: fixed;
    width: 100%;
  }
}

a {
  transition: color 0.2s;
  color: var(--text-on-neutral-primary);

  &:where(:hover) {
    color: var(--text-on-neutral-primary);
    text-decoration-color: var(--color--secondary-50);
  }

  &:where(:focus) {
    border-radius: 2px;
    outline: solid 2px var(--focus-ring-color);
    outline-offset: 2px;
  }

  &:where(:focus:not(:focus-visible)) {
    outline: 0;
  }
}

button {
  cursor: pointer;
  border: 0;
  background: 0;
  font: inherit;
  appearance: none;
  touch-action: manipulation;

  &:where(:focus) {
    border-radius: 2px;
    outline: solid 2px var(--focus-ring-color);
    outline-offset: 2px;
  }

  &:where(:focus:not(:focus-visible)) {
    outline: 0;
  }
}

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

audio {
  display: block;
  max-width: 100%;
}

h1 {
  letter-spacing: -0.02em;
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.1;

  @container style(--lg: true) {
    font-size: 3.5rem;
  }

  @container style(--grid-max: true) {
    font-size: 5rem;
  }
}

h2 {
  letter-spacing: -0.01em;
  font-size: 1.5rem;
  line-height: var(--sp2);

  @container style(--md: true) {
    font-size: 2.25rem;
    line-height: var(--sp3);
  }
}

h3 {
  font-size: 1.25rem;
  line-height: var(--sp1-5);

  @container style(--md: true) {
    font-size: 1.5rem;
    line-height: var(--sp2);
  }
}

h4 {
  font-size: 1.125rem;
  line-height: var(--sp1-5);
}

h5 {
  font-size: 1rem;
  line-height: var(--sp1-5);
}

h6 {
  font-size: 0.875rem;
  line-height: var(--sp);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: var(--sp2) 0 var(--sp1-5);
  color: var(--text-on-neutral-white);
  font-family: var(--font-sans);
  font-weight: bold;

  @container style(--md: true) {
    margin: var(--sp3) 0 var(--sp2);
  }
}

ul {
  margin-block-start: 0.25em;
  margin-block-end: 0.25em;
  margin-inline-start: 1.5em;
  margin-inline-end: 0;
  padding-inline-start: 0;
  list-style-type: disc;
  list-style-image: none;
}
