:root {
  color-scheme: dark;
  --background: #050506;
  --text: #e2e1e1;
  --focus: #f4d47c;
  --content-width: 980px;
}

* {
  box-sizing: border-box;
  &::selection {
    color: var(--background);
    background: var(--text);
  }
}

html {
  min-height: 100%;
  background: var(--background);
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(5, 5, 6, 0.7), rgba(5, 5, 6, 0.96)),
    var(--background);
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  text-rendering: geometricPrecision;
}

body::selection {
  background: rgba(156, 228, 220, 0.34);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible {
  border-radius: 4px;
  outline: 2px solid var(--focus);
  outline-offset: 5px;
}

#scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  background: var(--background);
}

.ambient-layer {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(5, 5, 6, 0.58) 0%,
    rgba(5, 5, 6, 0.5) 48%,
    rgba(5, 5, 6, 0.36) 76%,
    rgba(5, 5, 6, 0.48) 100%
  );
}

.site-shell {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  padding: 60px 50px 40px;
}

.hero {
  display: grid;
  align-content: start;
  gap: 50px;
  width: min(100%, var(--content-width));
  min-height: calc(100svh - 104px);
  margin: 0 auto;
}

h1 {
  max-width: 100%;
  margin: 0;
  font-size: clamp(4rem, 6.1vw, 5.5rem);
  font-weight: 680;
  letter-spacing: 0;
  line-height: 0.96;
  overflow-wrap: normal;
  white-space: nowrap;
}

.works {
  --marker-offset: 20px;

  width: 100%;
  max-width: calc(680px + var(--marker-offset));
  padding-left: var(--marker-offset);
  margin-left: calc(var(--marker-offset) * -1);
}

.work-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.work-list li {
  position: relative;
  min-height: 116px;
  padding: 12px 0;
  --accent: #d8a442;
}

.work-list li:nth-child(2) {
  --accent: #b8d59a;
}

body:not(.more-page) .work-list li:first-child {
  --accent-gradient: linear-gradient(
    135deg,
    rgb(214, 63, 120),
    rgb(216, 164, 66),
    rgb(47, 95, 127)
  );
}

.work-list li:nth-child(3) {
  --accent: #e7dfca;
}

.work-list li:nth-child(4) {
  --accent: #dfff67;
}

.work-list li:nth-child(5),
.more-page .work-list li:nth-child(6) {
  --accent: #13a6ff;
}

.more-page .work-list li:nth-child(1) {
  --accent: #0cc3aa;
}

.more-page .work-list li:nth-child(2) {
  --accent: #d9abd0;
}

.more-page .work-list li:nth-child(3) {
  --accent: #d44f22;
}

.more-page .work-list li:nth-child(4) {
  --accent: #fffa7cab;
}

.more-page .work-list li:nth-child(5) {
  --accent: #ffae13;
}

.work-list li::before {
  position: absolute;
  top: 20px;
  left: calc(var(--marker-offset) * -1);
  width: 7px;
  height: 7px;
  border: 1px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, var(--background));
  content: "";
  transform: rotate(45deg);
}

body:not(.more-page) .work-list li:first-child::before {
  border-color: transparent;
  background:
    linear-gradient(
        color-mix(in srgb, var(--accent) 16%, var(--background)),
        color-mix(in srgb, var(--accent) 16%, var(--background))
      )
      padding-box,
    var(--accent-gradient) border-box;
}

.work-list a {
  display: inline-block;
  max-width: 100%;
  font-size: 1.05rem;
  font-weight: 610;
  line-height: 1.3;
  overflow-wrap: anywhere;
  transition: transform 300ms ease;
}

.work-list a:hover {
  color: var(--accent);
  transform: skew(-10deg);
}

@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  body:not(.more-page) .work-list li:first-child a:hover {
    background-image: var(--accent-gradient);
    background-clip: text;
    color: transparent;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

.work-list p {
  max-width: 42ch;
  margin: 10px 0 0;
  font-size: 0.95rem;
}

.esoteric {
  text-decoration: 2px dotted underline #d300ff5c;
}

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

@media (max-width: 900px) {
  .hero {
    min-height: calc(100svh - 72px);
  }

  h1 {
    font-size: clamp(3.4rem, 7.2vw, 4.1rem);
  }

  .works {
    max-width: none;
  }

  .work-list li {
    min-height: 112px;
  }
}

@media (max-width: 640px) {
  h1 {
    white-space: normal;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 15px;
  }

  .site-shell {
    padding: 28px 50px 26px;
  }

  .hero {
    gap: 40px;
    padding-top: 2vh;
    min-height: calc(100svh - 54px);
  }

  h1 {
    font-size: clamp(2.5rem, 10vw, 3.2rem);
  }

  .work-list li {
    min-height: 102px;
    padding: 10px 0;

    &::before {
      top: 17px;
    }
  }

  .work-list a {
    font-size: 1rem;
  }

  .work-list p {
    font-size: 0.92rem;
  }
}

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

  .work-list a:hover {
    transform: none;
  }
}
