@font-face {
  font-family: "Hagrid";
  src: url("../fonts/hagrid-black.otf") format("opentype");
  font-style: normal;
  font-weight: 950;
  font-display: swap;
}

@font-face {
  font-family: "Hagrid Text";
  src: url("../fonts/hagrid-text-light.otf") format("opentype");
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}

:root {
  color-scheme: light;
  --page-left: 3.555vw;
  --page-right: 1.965vw;
  --text-size: max(14px, 1.4032vw);
  --icon-size: min(2.85vw, 40px);
  --icon-gap: 2.058vw;
  --text-color: #303030;
}

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

html {
  min-width: 320px;
  background: #fff;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text-color);
  font-family: "Hagrid Text", Arial, sans-serif;
  font-size: var(--text-size);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

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

a[href]:hover {
  color: #757575;
}

a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 7px;
  border-radius: 2px;
}

.custom-cursor {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: difference;
  transition: opacity 120ms ease;
}

.custom-cursor.is-visible {
  opacity: 1;
}

.cursor-dot,
.cursor-ring {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
}

.cursor-dot::before,
.cursor-ring::before {
  content: "";
  position: absolute;
  border-radius: 50%;
  transition: transform 220ms ease, background-color 220ms ease,
    border-color 220ms ease;
}

.cursor-dot::before {
  width: 5px;
  height: 5px;
  top: -2.5px;
  left: -2.5px;
  background: #fff;
}

.cursor-ring::before {
  width: 30px;
  height: 30px;
  top: -15px;
  left: -15px;
  border: 1px solid rgb(255 255 255 / 55%);
}

.custom-cursor[data-mode="link"] .cursor-ring::before {
  transform: scale(1.6);
  border-color: #fff;
  background: rgb(255 255 255 / 10%);
}

.custom-cursor[data-mode="logo"] .cursor-ring::before {
  transform: scale(1.3);
  border-color: rgb(255 255 255 / 85%);
}

.custom-cursor[data-mode="link"] .cursor-dot::before {
  transform: scale(0.65);
}

.custom-cursor.is-pressed .cursor-ring::before {
  transform: scale(0.85);
}

@media (hover: hover) and (pointer: fine) {
  html.cursor-active,
  html.cursor-active * {
    cursor: none !important;
  }
}

.portfolio {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100svh;
}

.site-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 2.012vw var(--page-right) 0 var(--page-left);
  line-height: 1.5;
}

.site-name,
.site-nav a {
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.45vw;
  font-size: max(11px, 0.85em);
}

.hero {
  display: grid;
  place-items: center;
  padding: 8vw 24px;
}

.hero-content {
  width: 100%;
  text-align: center;
  transform: translateY(-0.8vw);
}

.hero-heading {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
}

.hero-hint {
  display: none;
  position: absolute;
  right: -44px;
  bottom: calc(100% - 18px);
  color: #757575;
  font-size: clamp(12px, 0.85vw, 15px);
  line-height: 1.45;
  text-align: left;
  white-space: nowrap;
  pointer-events: none;
}

.hero-hint span {
  display: block;
  font-style: italic;
  transform: rotate(7deg);
}

.hero-hint svg {
  display: block;
  width: 56px;
  height: 42px;
  margin-top: 4px;
  margin-left: -19px;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (hover: hover) and (pointer: fine) {
  .hero-hint {
    display: block;
  }
}

.hero-title {
  margin: 0;
  color: #000;
  font-family: "Hagrid", "Arial Black", sans-serif;
  font-size: 6.735vw;
  font-weight: 950;
  line-height: 1;
  letter-spacing: normal;
  transform: translateY(0.3vw);
}

.hero-word {
  display: block;
}

.ransom-letter {
  position: relative;
  display: inline-block;
}

.ransom-glyph {
  transition: opacity 120ms ease;
}

.ransom-image {
  position: absolute;
  left: 50%;
  top: 43%;
  width: calc(100% + 0.14em);
  height: 1.06em;
  object-fit: contain;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(0deg) scale(0.88);
  transition: opacity 140ms ease, transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ransom-letter[data-letter="l"] .ransom-image {
  width: 0.82em;
}

@media (hover: hover) and (pointer: fine) {
  .ransom-letter:hover {
    z-index: 2;
  }

  .ransom-letter:hover .ransom-glyph {
    opacity: 0;
  }

  .ransom-letter:hover .ransom-image {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(var(--letter-tilt)) scale(1);
  }
}

.hero-description {
  margin: 2.245vw auto 0;
  font-size: var(--text-size);
  line-height: 1.4333;
}

.hero-description span {
  display: block;
}

.toolbox {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 0 var(--page-right) 2.666vw var(--page-left);
}

.tool-list {
  display: flex;
  align-items: center;
  gap: var(--icon-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.tool {
  position: relative;
  flex: 0 0 auto;
}

.tool-label {
  --label-shift: -50%;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  z-index: 3;
  padding: 6px 9px;
  border-radius: 4px;
  background: #252525;
  color: #fff;
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(var(--label-shift), 5px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.tool img {
  display: block;
  width: auto;
  height: var(--icon-size);
  max-height: 40px;
  object-fit: contain;
  filter: grayscale(1);
  transition: filter 220ms ease, transform 220ms ease;
}

@media (hover: hover) {
  .tool:hover .tool-label {
    opacity: 1;
    transform: translate(var(--label-shift), 0);
  }

  .tool:hover img {
    filter: grayscale(0);
    transform: translateY(-3px) scale(1.04);
  }
}

@media (max-width: 700px) {
  :root {
    --page-left: 24px;
    --page-right: 24px;
    --text-size: 16px;
    --icon-size: 28px;
    --icon-gap: 15px;
  }

  .site-header {
    padding-top: 24px;
    gap: 16px;
    font-size: 14px;
  }

  .site-nav {
    gap: 16px;
  }

  .hero {
    padding: 80px 20px;
  }

  .hero-content {
    transform: translateY(-12px);
  }

  .hero-hint {
    right: 0;
    font-size: 11px;
  }

  .hero-title {
    font-size: clamp(40px, 10.5vw, 47.15px);
    line-height: 1.04;
  }

  .hero-description {
    max-width: 480px;
    margin-top: 28px;
    font-size: 16px;
    line-height: 1.5;
    text-wrap: pretty;
  }

  .hero-description span {
    display: inline;
  }

  .toolbox {
    padding-bottom: 26px;
    gap: 28px;
  }
}

@media (max-width: 420px) {
  :root {
    --page-left: 20px;
    --page-right: 20px;
    --icon-size: 24px;
    --icon-gap: 11px;
  }

  .site-header {
    font-size: 12px;
  }

  .site-nav {
    gap: 12px;
  }

  .toolbox {
    gap: 18px;
  }

  .tool-list:first-child .tool:nth-child(-n+2) .tool-label {
    --label-shift: 0%;
    left: 0;
  }
}

@media (max-width: 360px) {
  :root {
    --icon-size: 21px;
    --icon-gap: 9px;
  }
}

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

  .tool img,
  .tool-label {
    transition: none;
  }

  .tool:hover img {
    transform: none;
  }

  .custom-cursor,
  .cursor-dot::before,
  .cursor-ring::before {
    transition: none;
  }

  .custom-cursor[data-mode] .cursor-dot::before,
  .custom-cursor[data-mode] .cursor-ring::before {
    transform: none;
  }

  .ransom-glyph,
  .ransom-image {
    transition: none;
  }

  .ransom-letter:hover .ransom-image {
    transform: translate(-50%, -50%);
  }
}
