:root {
  --ink: #202020;
  --muted: #737373;
  --line: #ddddda;
  --paper: #ffffff;
  --accent: #ef4f32;
  --section-label-size: 11px;
  --message-size: clamp(10px, 2.8vw, 13px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

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

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

button {
  color: inherit;
  font: inherit;
  touch-action: manipulation;
}

[hidden] {
  display: none !important;
}

.intro {
  position: relative;
  display: flex;
  min-height: 480px;
  flex-direction: column;
  justify-content: center;
  padding: 54px 4vw;
}

.intro h1,
.intro-meta {
  width: min(760px, 72vw);
  margin-right: auto;
  margin-left: auto;
}

.intro h1 {
  margin-top: 0;
  margin-bottom: 36px;
  font-size: clamp(34px, 3.25vw, 52px);
  font-weight: 440;
  letter-spacing: -0.045em;
  line-height: 1.12;
  text-align: center;
}

.intro-meta {
  color: var(--muted);
  font-size: var(--message-size);
  text-align: center;
}

.intro-meta p {
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.55;
  white-space: normal;
}

.scroll-cue {
  position: absolute;
  bottom: 28px;
  left: 50%;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--ink);
  opacity: 0.34;
  transform: translateX(-50%);
  transition: opacity 220ms ease;
}

.scroll-cue span {
  width: 15px;
  height: 15px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  animation: scroll-cue 2.4s cubic-bezier(0.45, 0, 0.2, 1) infinite;
  transform: rotate(45deg);
}

.scroll-cue:hover {
  opacity: 0.68;
}

@keyframes scroll-cue {
  0%, 100% {
    transform: translateY(-3px) rotate(45deg);
  }

  50% {
    transform: translateY(3px) rotate(45deg);
  }
}

.selected-work {
  padding: 0 4vw;
}

.work-header {
  display: flex;
  height: 58px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--section-label-size);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.work-header p {
  margin: 0;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
}

.motion-feature {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 6 / 1;
  margin-top: 2px;
  padding: 0;
  border: 0;
  color: white;
  background: linear-gradient(115deg, #141617 0%, #4a5b64 34%, #b5a89f 63%, #202326 100%);
  background-position: 10% 50%;
  background-size: 190% 190%;
  cursor: pointer;
  overflow: hidden;
  animation: motion-field 11s ease-in-out infinite alternate;
  transition: filter 350ms ease;
}

.motion-feature::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, .18), transparent 42%, rgba(0, 0, 0, .12));
  content: "";
}

.motion-feature-content {
  position: relative;
  z-index: 1;
  display: flex;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.motion-feature-content strong {
  font-size: clamp(25px, 3vw, 46px);
  font-weight: 480;
  letter-spacing: -.045em;
  line-height: 1;
}

.motion-feature-content small {
  opacity: .72;
  font-size: var(--section-label-size);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.motion-feature:hover {
  filter: brightness(1.06) saturate(1.08);
}

@keyframes motion-field {
  from { background-position: 5% 45%; }
  to { background-position: 95% 55%; }
}

.project-card {
  min-width: 0;
}

.project-tile {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  background: #ededeb;
  cursor: pointer;
  overflow: hidden;
}

.project-tile > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms cubic-bezier(.2,.7,.2,1), filter 400ms ease;
}

.project-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 25px;
  color: white;
  background: rgba(20, 20, 20, 0);
  opacity: 0;
  transition: opacity 250ms ease, background 250ms ease;
  text-align: center;
}

.project-overlay strong {
  font-size: clamp(23px, 2.4vw, 40px);
  font-weight: 500;
  letter-spacing: -0.04em;
}

.project-overlay > span {
  margin-top: 5px;
  font-size: 11px;
}

.project-tile:hover > img,
.project-tile:focus-visible > img {
  transform: scale(1.025);
  filter: saturate(.8);
}

.project-tile:hover .project-overlay,
.project-tile:focus-visible .project-overlay {
  background: rgba(20, 20, 20, .38);
  opacity: 1;
}

.project-tile:focus-visible,
.modal-shell button:focus-visible,
.motion-feature:focus-visible,
.motion-player iframe:focus-visible,
.scroll-cue:focus-visible,
.contact-link:focus-visible,
.footer-cv-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

footer {
  margin: 0 4vw;
  padding: 58px 0 30px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.footer-actions {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.footer-cv-link {
  padding-bottom: 3px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .07em;
  text-transform: uppercase;
  transition: color 180ms ease, border-color 180ms ease;
}

.footer-cv-link:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.closing-copy {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 10px 0;
  color: var(--muted);
  font-size: var(--message-size);
  letter-spacing: .01em;
  line-height: 1.4;
  text-align: center;
}

.contact-link {
  position: relative;
  display: inline-flex;
  min-width: 164px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 16px 28px 17px;
  border: 1px solid rgba(32, 32, 32, .11);
  border-radius: 999px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .88), rgba(239, 239, 236, .52));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .95),
    inset 0 -1px 0 rgba(32, 32, 32, .04),
    0 10px 30px rgba(32, 32, 32, .08);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  font-size: clamp(17px, 1.35vw, 20px);
  font-weight: 520;
  letter-spacing: -.025em;
  line-height: 1;
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.contact-link::before {
  position: absolute;
  top: 2px;
  right: 10%;
  left: 10%;
  height: 46%;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, .82), rgba(255, 255, 255, 0));
  content: "";
  opacity: .75;
  pointer-events: none;
}

.contact-link > span {
  position: relative;
  z-index: 1;
}

.contact-link:hover {
  border-color: rgba(32, 32, 32, .17);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 -1px 0 rgba(32, 32, 32, .05),
    0 14px 34px rgba(32, 32, 32, .12);
  transform: translateY(-2px);
}

.contact-link:active {
  box-shadow:
    inset 0 1px 4px rgba(32, 32, 32, .08),
    0 5px 16px rgba(32, 32, 32, .08);
  transform: translateY(0) scale(.985);
}

.footer-meta {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding-top: 80px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.project-modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  animation: modal-fade 200ms ease both;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 15, 15, .82);
  cursor: zoom-out;
}

.modal-shell {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(1400px, 96vw);
  height: min(900px, 94vh);
  grid-template-rows: 58px 1fr auto;
  padding: 0 18px 16px;
  background: white;
}

.modal-shell > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-shell > header > div {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.modal-shell header span,
.modal-shell header button {
  font-size: 10px;
}

.modal-shell header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 550;
  letter-spacing: -.03em;
}

.modal-shell header button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-transform: uppercase;
}

.modal-shell header button b {
  font-size: 20px;
  font-weight: 300;
}

.modal-image {
  position: relative;
  min-height: 0;
  background: #ededeb;
  overflow: hidden;
}

.modal-image > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.motion-player {
  background: #17191b;
}

.motion-player > iframe,
.motion-video-host,
.motion-video-host > iframe,
.motion-video-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.motion-video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: white;
  background: linear-gradient(115deg, #141617 0%, #4a5b64 34%, #b5a89f 63%, #202326 100%);
  background-position: 10% 50%;
  background-size: 190% 190%;
  animation: motion-field 11s ease-in-out infinite alternate;
  text-align: center;
}

.motion-video-placeholder span {
  font-size: clamp(32px, 5vw, 72px);
  font-weight: 460;
  letter-spacing: -.05em;
  line-height: 1;
}

.motion-video-placeholder small {
  opacity: .72;
  font-size: var(--section-label-size);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.modal-prev,
.modal-next {
  position: absolute;
  top: 50%;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(255, 255, 255, .82), rgba(255, 255, 255, .38));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .95),
    inset 0 -1px 0 rgba(32, 32, 32, .08),
    0 9px 26px rgba(20, 20, 20, .16);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  z-index: 2;
  transform: translateY(-50%);
  transition: transform 200ms ease, background 200ms ease, box-shadow 200ms ease;
}

.modal-prev { left: 12px; }
.modal-next { right: 12px; }

.modal-prev:hover,
.modal-next:hover {
  background: linear-gradient(145deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .52));
  box-shadow:
    inset 0 1px 0 white,
    inset 0 -1px 0 rgba(32, 32, 32, .08),
    0 12px 30px rgba(20, 20, 20, .2);
  transform: translateY(-50%) scale(1.06);
}

.modal-prev:active,
.modal-next:active {
  box-shadow:
    inset 0 2px 5px rgba(32, 32, 32, .1),
    0 5px 16px rgba(20, 20, 20, .14);
  transform: translateY(-50%) scale(.96);
}

.modal-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 30px;
  padding-top: 15px;
}

.modal-footer p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.modal-count {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
}

.modal-count i {
  width: 25px;
  height: 1px;
  background: var(--line);
}

@keyframes modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 850px) {
  .intro {
    min-height: 430px;
  }

  .intro h1,
  .intro-meta {
    width: min(620px, 84vw);
  }

  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .motion-feature {
    aspect-ratio: 4 / 1;
  }

}

@media (max-width: 560px) {
  .intro,
  .selected-work {
    padding-right: 18px;
    padding-left: 18px;
  }

  .intro {
    min-height: 430px;
    padding-top: 38px;
    padding-bottom: 38px;
  }

  .scroll-cue {
    bottom: 20px;
  }

  .intro h1,
  .intro-meta {
    width: 100%;
  }

  .intro h1 {
    margin-bottom: 30px;
    font-size: 31px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .motion-feature {
    aspect-ratio: 2 / 1;
  }

  .project-overlay {
    align-items: flex-start;
    justify-content: flex-end;
    background: linear-gradient(transparent 55%, rgba(20,20,20,.45));
    opacity: 1;
    text-align: left;
  }

  .project-overlay strong {
    font-size: 27px;
  }

  footer {
    margin-right: 18px;
    margin-left: 18px;
  }

  .footer-meta {
    padding-top: 45px;
  }

  .modal-shell {
    width: 100%;
    height: calc(100svh - 16px);
    padding: 0 10px 12px;
  }

  .modal-footer p {
    display: none;
  }
}

@media (hover: none) {
  .project-overlay {
    align-items: flex-start;
    justify-content: flex-end;
    background: linear-gradient(transparent 55%, rgba(20,20,20,.48));
    opacity: 1;
    text-align: left;
  }
}

@media (max-width: 380px) {
  .intro h1 {
    font-size: 27px;
  }

  .work-header {
    font-size: 10px;
  }

}

@media (max-height: 600px) and (orientation: landscape) {
  .intro {
    min-height: 360px;
    padding-top: 35px;
    padding-bottom: 35px;
  }

  .modal-shell {
    height: calc(100vh - 12px);
  }
}

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

  .scroll-cue span {
    animation: none;
  }
}
