/* RESET */

/* 1. Use a more-intuitive box-sizing model */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 2. Remove default margin */
* {
  margin: 0;
}

body {
  /* 3. Add accessible line-height */
  line-height: 1.5;
  /* 4. Improve text rendering */
  -webkit-font-smoothing: antialiased;
}

/* 5. Improve media defaults */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* 6. Inherit fonts for form controls */
input,
button,
textarea,
select {
  font: inherit;
}

/* 7. Avoid text overflows */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* 8. Improve line wrapping */
p {
  text-wrap: pretty;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  text-wrap: balance;
}

/*
  9. Create a root stacking context
*/
#root,
#__next {
  isolation: isolate;
}

/* FONTS */

@font-face {
  font-family: 'dm_monomedium';
  src: url('fonts/dmmono-medium-webfont.woff2') format('woff2'),
       url('fonts/dmmono-medium-webfont.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'dm_monoregular';
  src: url('fonts/dmmono-regular-webfont.woff2') format('woff2'),
       url('fonts/dmmono-regular-webfont.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* VARIABLES */

:root {
  --transition: 0.3s ease-in-out;
  --accent: #d0fb68;
  --light: #f4f4f0;
  --dark: #0B0D06;
}

/* ANIMATION */

@keyframes FadeIn {
  0% {
    opacity:0;
  }
  100% {
    opacity:1;
  }
}

@media screen and (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }

  .stack { animation: 2s ease-out 0s 1 FadeIn; }
}

/* STYLES */

::-moz-selection {
  background: var(--accent);
  color: #262625;
}

::selection {
  background: var(--accent);
  color: #262625;
}

html {
  background: var(--accent);
}

body {
  font-size: clamp(1rem, 0.9671rem + 0.1645vw, 1.125rem);
  color: var(--light);
  min-height: 100dvh;
  line-height: 166%;
  padding: 10vw;

  background-color: var(--dark);
  background-image: linear-gradient(
    135deg,
    hsl(77deg 37% 4%) 0%,
    hsl(78deg 42% 3%) 18%,
    hsl(78deg 48% 3%) 26%,
    hsl(78deg 55% 3%) 33%,
    hsl(78deg 65% 2%) 39%,
    hsl(78deg 80% 2%) 44%,
    hsl(79deg 100% 1%) 50%,
    hsl(82deg 100% 1%) 56%,
    hsl(86deg 100% 1%) 61%,
    hsl(93deg 100% 1%) 67%,
    hsl(104deg 100% 1%) 74%,
    hsl(120deg 100% 0%) 82%,
    hsl(0deg 0% 0%) 100%
  );

  font-family: "dm_monoregular", monospace;
  font-weight: 400;
  font-style: normal;
}

strong,
b {
  font-family: "dm_monomedium", serif;
  font-weight: 500;
  font-style: normal;
}

a {
  transition: all 0.3s ease-in-out;
  text-decoration-skip-ink: none;
  text-underline-offset: 0.2em;
  color: inherit;

  &:hover,
  &:focus {
    text-underline-offset: 0.25em;
    color: var(--accent);
  }
}

.stack {
  text-wrap: balance;
  max-width: 45ch;

  > * + * {
    margin: 0;
    margin-block-start: 1.5em;
  }

  h1 {
    line-height: 100%;
    font-size: 1em;
  }

  h1 span {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.66em;
    font-weight: 400;
    opacity: 0.5;
  }

  ul {
    list-style: none;
    display: flex;
    padding: 0;

    li {
      flex-basis: 48px;
      display: flex;
    }
  }

  svg {
    transition: color 0.3s ease-in-out, opacity 0.3s ease-in-out;
    fill: var(--light);
    opacity: 0.5;
    height: 24px;
    width: 24px;

    &:hover,
    &:focus {
      fill: var(--accent);
      opacity: 1;
    }
  }
}
