@font-face {
  font-family: Manrope;
  src: url("fonts/manrope-cyrillic.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: Manrope;
  src: url("fonts/manrope-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  font-family: Manrope, system-ui, sans-serif;
  background: #131318;
  color: #faf8ff;
}
* { box-sizing: border-box; }
body, h1, h2, p { margin: 0; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 3px solid #faff78; outline-offset: 4px; }
.portfolio {
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: clamp(12px, 2vw, 28px);
}
.heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 4px 16px; }
.wordmark { display: inline-flex; align-items: center; gap: 9px; font-size: .875rem; font-weight: 800; white-space: nowrap; }
.mark { width: 11px; aspect-ratio: 1; background: #faff78; rotate: 45deg; }
.heading h1 { color: #c2bed5; font-size: .875rem; font-weight: 650; text-align: end; }

.triptych {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(4px, .7vw, 12px);
  perspective: 1400px;
  padding-bottom: clamp(38px, 8svh, 80px);
}
.project {
  position: relative;
  min-width: 0;
  display: grid;
  transform: rotateY(var(--tilt));
  transition: transform 440ms cubic-bezier(.22, 1, .36, 1);
  animation: unfold 650ms cubic-bezier(.22, 1, .36, 1) backwards;
}
.gallery { --tilt: 0deg; --panel: #162153; --position: 34%; --cover: url("previews/gallery-cover.webp"); animation-delay: 65ms; }
.orbit { --tilt: -7deg; --panel: #321921; --position: 41%; --cover: url("previews/orbit-cover.webp"); animation-delay: 125ms; }
.night { --tilt: 7deg; --panel: #123331; --position: 39%; --cover: url("previews/arabian-night-cover.webp"); }
.project::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 100% 0 auto;
  height: clamp(38px, 8svh, 80px);
  background: var(--cover) center 44% / cover no-repeat;
  transform: scaleY(-1);
  opacity: .34;
  mask-image: linear-gradient(0deg, black, transparent 90%);
  pointer-events: none;
}
.project-link {
  position: relative;
  display: grid;
  align-content: end;
  min-height: 420px;
  isolation: isolate;
  background: var(--panel);
  box-shadow: 0 14px 32px #0006;
  border: 1px solid #e7edff25;
}
@keyframes unfold {
  from { opacity: 0; transform: translateY(14px) rotateY(calc(var(--tilt) * 2.1)); }
  to { opacity: 1; }
}
.project-link img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center var(--position);
  z-index: -2;
}
.project-link::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(0deg, #100d18 4%, #130f1ae8 18%, #19152710 62%);
}
.project:hover, .project:focus-within { transform: rotateY(0) translateZ(18px); z-index: 1; }
.project-link::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(118deg, transparent 30%, #eff6ff19 43%, #fff4d85c 49%, #eff6ff12 55%, transparent 67%) left / 300% 100%;
  opacity: 0;
}
.project-link:hover::after, .project-link:focus-visible::after { animation: gleam 790ms cubic-bezier(.22, 1, .36, 1); }
@keyframes gleam {
  0% { background-position: right; opacity: 0; }
  22%, 54% { opacity: 1; }
  100% { background-position: left; opacity: 0; }
}
.caption { position: relative; z-index: 1; padding: clamp(12px, 2.6vw, 44px); }
.caption h2 { max-width: 11ch; font-size: clamp(1.6rem, 4vw, 4.7rem); line-height: .96; letter-spacing: -.065em; font-weight: 750; text-wrap: balance; }
.caption p { margin-top: 12px; color: #e9e5f2; font-size: clamp(.8125rem, 1.15vw, 1rem); line-height: 1.4; }
.action {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  margin-top: 20px;
  padding: 8px clamp(9px, 1.2vw, 16px);
  border: 1px solid #fff2bd;
  border-radius: 5px;
  background: linear-gradient(123deg, #b27b2b, #f0cc77 24%, #fff2bd 46%, #e9bb5a 67%, #be8632);
  color: #271704;
  box-shadow: inset 0 1px #fffae6, inset 0 -2px #98611c65, 0 3px 14px #bc7a333f;
  font-size: .875rem;
  font-weight: 800;
  max-width: 100%;
}
.lock {
  position: relative;
  flex: 0 0 22px;
  width: 22px;
  height: 25px;
  color: #422506;
}
.lock-shackle {
  position: absolute;
  width: 12px;
  height: 12px;
  top: 1px;
  left: 5px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  transform-origin: 2px 100%;
  transition: transform 260ms cubic-bezier(.22, 1, .36, 1);
}
.lock-body {
  position: absolute;
  inset: 11px 2px 1px;
  border-radius: 3px;
  background: linear-gradient(160deg, #785020, #392205 64%);
  box-shadow: inset 0 1px #ffdf8f90, 0 1px 1px #6e42117a;
}
.lock-body::after {
  content: "";
  position: absolute;
  inset: 3px 7px 3px;
  background: #ffe3a0;
  clip-path: polygon(50% 0, 100% 34%, 67% 59%, 87% 100%, 13% 100%, 33% 59%, 0 34%);
}
.project-link:is(:hover, :focus-visible, :active) .action {
  background: linear-gradient(123deg, #d39a3f, #ffe298 25%, #fff9dc 47%, #f2ca6c 69%, #d29637);
  box-shadow: inset 0 1px #fff9dc, inset 0 -2px #b9782d55, 0 0 24px #e9b95d70;
}
.project-link:is(:hover, :focus-visible, :active) .lock-shackle {
  transform: translateY(-3px) rotate(-29deg);
}

@media (max-width: 700px) {
  .portfolio { padding: 8px; }
  .heading { padding-block: 5px 10px; }
  .heading h1 { font-size: .75rem; }
  .triptych { grid-template-columns: 1fr; grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 17px; padding-bottom: 14px; }
  .project { --tilt: 0deg; }
  .project::after { height: 15px; }
  .project-link { min-height: 155px; }
  .project-link::before { background: linear-gradient(90deg, #0f0d17f4, #160f1cd9 42%, #1915271a 84%); }
  .caption { padding: 13px 15px; }
  .caption h2 { max-width: 16ch; font-size: clamp(1.3rem, 6.3vw, 2.4rem); }
  .caption p { margin-top: 5px; max-width: 28ch; }
  .action { margin-top: 9px; min-height: 44px; padding-inline: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .project { animation: none; transition: none; }
  .lock-shackle { transition: none; }
  .project:hover, .project:focus-within { transform: rotateY(var(--tilt)); }
  .project-link:hover::after, .project-link:focus-visible::after { animation: none; }
}

@media (max-width: 700px), (hover: none) and (pointer: coarse) {
  .project { animation: none; transform: none; }
  .project:hover, .project:focus-within { transform: none; }
  .project-link:hover::after { animation: none; }
}
@media (max-width: 700px) {
  .portfolio { min-height: 100svh; }
  .triptych { grid-template-rows: repeat(3, minmax(166px, 1fr)); }
  .project-link { min-height: 0; }
  .caption { padding: 12px; }
  .caption h2 { font-size: clamp(1.25rem, 5.8vw, 2rem); }
  .caption p { max-width: 24ch; }
  .action { width: max-content; max-width: 100%; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .triptych { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: 1fr; gap: 5px; padding-bottom: 16px; }
  .project-link { min-height: 220px; }
  .project::after { height: 16px; }
  .caption { padding: 8px; }
  .caption h2 { font-size: clamp(1rem, 3vw, 1.8rem); }
  .caption p { font-size: .72rem; margin-top: 6px; }
  .action { font-size: .7rem; min-height: 44px; margin-top: 9px; padding-inline: 8px; gap: 4px; }
}
