:root {
  --paper: #f4f1ea;
  --ink: #1b1a18;
  --muted: #706a62;
  --hairline: rgba(27, 26, 24, 0.15);
  --focus: #315f8c;
  --page-max: 1240px;
  --reel-max: 1120px;
  --gutter: clamp(1.125rem, 5vw, 4rem);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  width: 100%;
  max-width: 100%;
  background: var(--paper);
  color-scheme: light;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 50% -12rem, rgba(255, 255, 255, 0.92), transparent 42rem),
    var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button,
a {
  color: inherit;
}

button {
  font: inherit;
}

a {
  text-decoration: none;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

.page-width,
.page-width-narrow {
  width: min(calc(100% - (2 * var(--gutter))), var(--page-max));
  margin-inline: auto;
}

.page-width-narrow {
  max-width: var(--reel-max);
}

.site-header {
  padding-top: clamp(0.75rem, 1.8vh, 1.5rem);
}

.utility-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 2.5rem;
}

.social-nav {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.125rem;
}

.icon-link,
.language-switch button {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
}

.icon-link {
  position: relative;
  color: var(--ink);
  transition:
    color 220ms ease,
    background-color 220ms ease,
    transform 360ms var(--ease-out);
}

.icon-link svg {
  width: 0.92rem;
  height: 0.92rem;
  fill: currentColor;
}

.icon-link:hover {
  color: #000;
  background: rgba(23, 23, 22, 0.055);
  transform: translateY(-1px);
}

.language-switch {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.06rem;
  padding: 0.14rem;
  border: 1px solid rgba(27, 26, 24, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
  box-shadow: 0 0.35rem 1.2rem rgba(27, 26, 24, 0.035);
  color: rgba(23, 23, 22, 0.35);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.09em;
}

.language-switch button {
  appearance: none;
  width: 2.25rem;
  height: 2rem;
  border: 0;
  background: transparent;
  color: rgba(23, 23, 22, 0.62);
  cursor: pointer;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  transition:
    color 200ms ease,
    background-color 240ms ease,
    transform 240ms var(--ease-out);
}

.language-switch button[aria-pressed="true"] {
  background: var(--ink);
  color: #fffdf9;
  transform: scale(0.96);
}

.language-switch button:hover:not([aria-pressed="true"]) {
  background: rgba(27, 26, 24, 0.055);
  color: var(--ink);
}

.identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: clamp(0.75rem, 2.1vh, 1.35rem);
  text-align: center;
  animation: settle-in 720ms var(--ease-out) both;
}

.identity h1,
.identity p {
  margin: 0;
}

.identity--mobile-divider {
  display: none;
}

.identity h1 {
  font-size: 0.81rem;
  font-weight: 500;
  letter-spacing: -0.008em;
  line-height: 1.35;
}

.identity a {
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.71rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  transition: color 200ms ease;
}

.identity a:hover {
  color: var(--ink);
}

.identity p {
  margin-top: clamp(0.65rem, 1.6vh, 0.95rem);
  font-size: clamp(1.3rem, 2vw, 1.68rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1;
}

.showreel {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin-top: clamp(1.35rem, 3vh, 2.25rem);
  animation: settle-in 900ms 80ms var(--ease-out) both;
}

.video-frame {
  position: relative;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border: 1px solid rgba(27, 26, 24, 0.1);
  border-radius: 0.7rem;
  background: #e5e1da;
  isolation: isolate;
}

.video-frame--showreel {
  aspect-ratio: 16 / 9;
  width: 100%;
  height: auto;
  max-width: 100%;
  margin-inline: auto;
  box-shadow: 0 1.25rem 4rem rgba(31, 27, 20, 0.07);
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #111;
}

.video-trigger {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.video-trigger:disabled {
  cursor: default;
}

.video-trigger__surface {
  position: absolute;
  inset: -1px;
  z-index: -2;
  background-position: center;
  background-size: cover;
  transform: scale(1);
  transition:
    filter 520ms var(--ease-out),
    transform 720ms var(--ease-out);
}

.video-trigger__poster {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}

.video-trigger::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(10, 10, 10, 0.01), rgba(10, 10, 10, 0.1));
  content: "";
  opacity: 0.5;
  transition: opacity 400ms ease;
}

.video-trigger:not(:disabled):hover .video-trigger__surface,
.video-trigger:not(:disabled):focus-visible .video-trigger__surface {
  filter: saturate(0.94) brightness(0.94);
  transform: scale(1.012);
}

.video-trigger:not(:disabled):hover::after,
.video-trigger:not(:disabled):focus-visible::after {
  opacity: 0.8;
}

.tone-showreel .video-trigger__surface {
  background:
    radial-gradient(circle at 70% 38%, rgba(255, 255, 255, 0.32), transparent 29%),
    linear-gradient(128deg, #a9aaa5 0%, #d9d5cc 43%, #888b89 100%);
}

.tone-one .video-trigger__surface {
  background:
    radial-gradient(circle at 22% 28%, rgba(244, 241, 231, 0.5), transparent 25%),
    linear-gradient(138deg, #5e6361 0%, #aeb1aa 46%, #dad4c8 100%);
}

.tone-two .video-trigger__surface {
  background:
    linear-gradient(28deg, rgba(252, 246, 234, 0.28), transparent 40%),
    linear-gradient(122deg, #c2b9aa 0%, #77736f 52%, #454b50 100%);
}

.tone-three .video-trigger__surface {
  background:
    radial-gradient(circle at 68% 65%, rgba(236, 229, 210, 0.32), transparent 31%),
    linear-gradient(132deg, #424544 0%, #777b75 47%, #bab1a0 100%);
}

.tone-four .video-trigger__surface {
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 239, 221, 0.3), transparent 29%),
    linear-gradient(142deg, #6c5752 0%, #ad8b7e 48%, #d8c8b8 100%);
}

.tone-five .video-trigger__surface {
  background:
    radial-gradient(circle at 72% 30%, rgba(237, 232, 255, 0.32), transparent 28%),
    linear-gradient(126deg, #4e5060 0%, #838297 50%, #c4beb6 100%);
}

.video-trigger.has-poster .video-trigger__surface {
  background-color: #a6a39d;
}

.play-symbol {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: clamp(2.75rem, 5vw, 4rem);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: rgba(18, 18, 18, 0.18);
  box-shadow: 0 0.35rem 1.5rem rgba(0, 0, 0, 0.08);
  opacity: 0.93;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(0.35rem);
  transition:
    background-color 280ms ease,
    transform 480ms var(--ease-out);
}

.play-symbol span {
  width: 0;
  height: 0;
  margin-left: 0.18rem;
  border-top: 0.3rem solid transparent;
  border-bottom: 0.3rem solid transparent;
  border-left: 0.48rem solid rgba(255, 255, 255, 0.95);
}

.video-trigger:disabled .play-symbol {
  opacity: 0.55;
}

.video-trigger:not(:disabled):hover .play-symbol,
.video-trigger:not(:disabled):focus-visible .play-symbol {
  background: rgba(18, 18, 18, 0.29);
  transform: translate(-50%, -50%) scale(1.04);
}

.projects {
  margin-top: clamp(4.5rem, 9vh, 6.5rem);
}

.project {
  --project-accent: #7895a5;
  --project-glow: rgba(82, 116, 136, 0.15);
}

.project:nth-of-type(2) {
  --project-accent: #9c8f7a;
  --project-glow: rgba(128, 108, 77, 0.14);
}

.project:nth-of-type(3) {
  --project-accent: #77817a;
  --project-glow: rgba(74, 92, 80, 0.14);
}

.project:nth-of-type(4) {
  --project-accent: #a47c6f;
  --project-glow: rgba(135, 88, 73, 0.14);
}

.project:nth-of-type(5) {
  --project-accent: #7c7b9d;
  --project-glow: rgba(92, 91, 135, 0.14);
}

.project + .project {
  margin-top: clamp(2.75rem, 6vh, 4.5rem);
}

.project__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  max-width: 26rem;
  margin-inline: auto;
  gap: 1.25rem;
}

.project__media {
  width: 100%;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.42) inset,
    0 0.9rem 3rem rgba(31, 27, 20, 0.06);
  transition:
    box-shadow 480ms var(--ease-out),
    transform 480ms var(--ease-out);
}

.project__title {
  display: none;
}

.details-trigger {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  width: max-content;
  gap: 0.7rem;
  padding: 0.12rem 0.4rem 0.12rem 1.15rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  box-shadow: 0 0.55rem 1.5rem rgba(27, 26, 24, 0.12);
  color: var(--paper);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.045em;
  line-height: 1;
  transition:
    background-color 220ms ease,
    color 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease,
    transform 220ms var(--ease-out);
}

.details-trigger::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 2.18rem;
  height: 2.18rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: currentColor;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1;
}

.details-trigger:hover,
.details-trigger:focus-visible {
  border-color: #34312d;
  background: #34312d;
  box-shadow: 0 0.75rem 1.8rem rgba(27, 26, 24, 0.16);
  color: #fffdf9;
  transform: translateY(-1px);
}

.project__copy {
  max-width: 21.5rem;
}

.project__copy p {
  margin: 0;
}

.project__copy p {
  color: var(--muted);
  font-size: clamp(0.83rem, 1.2vw, 0.94rem);
  line-height: 1.68;
  text-wrap: pretty;
}

.details-dialog {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(23, 23, 22, 0.5);
  backdrop-filter: blur(0.35rem);
}

.details-dialog__backdrop {
  position: absolute;
  inset: 0;
}

.details-dialog__panel {
  position: relative;
  width: min(100%, 27rem);
  max-height: min(calc(100dvh - 2rem), 36rem);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(23, 23, 22, 0.1);
  border-radius: 1.2rem;
  background: var(--paper);
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.2);
}

.details-dialog__close {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 50%;
  background: rgba(23, 23, 22, 0.06);
  color: var(--ink);
  cursor: pointer;
  font-size: 1.45rem;
  font-weight: 300;
  line-height: 1;
  transition: background-color 200ms ease;
}

.details-dialog__close:hover,
.details-dialog__close:focus-visible {
  background: rgba(23, 23, 22, 0.13);
}

.details-dialog__body {
  padding: clamp(2.9rem, 8vw, 4rem) clamp(1.35rem, 7vw, 2.8rem) clamp(1.7rem, 6vw, 2.6rem);
}

.details-dialog__title h2,
.details-dialog__copy p {
  margin: 0;
}

.details-dialog__title h2 {
  max-width: 14rem;
  font-size: clamp(1.35rem, 5vw, 1.8rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.details-dialog__copy p {
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.65;
}

body.modal-open {
  overflow: hidden;
}

.site-footer {
  padding-top: clamp(5.5rem, 11vw, 8rem);
  padding-bottom: clamp(1.75rem, 4vw, 2.8rem);
  text-align: center;
}

.footer-socials {
  justify-content: center;
  gap: 0.42rem;
}

.footer-socials .icon-link {
  width: 3rem;
  height: 3rem;
  border: 1px solid rgba(27, 26, 24, 0.12);
  background: rgba(255, 255, 255, 0.24);
}

.footer-socials .icon-link:hover,
.footer-socials .icon-link:focus-visible {
  border-color: rgba(27, 26, 24, 0.2);
  background: rgba(255, 255, 255, 0.72);
}

.back-to-top {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 40;
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(27, 26, 24, 0.92);
  box-shadow: 0 0.8rem 2rem rgba(27, 26, 24, 0.2);
  color: #fffdf9;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.8rem) scale(0.94);
  visibility: hidden;
  transition:
    opacity 240ms ease,
    transform 320ms var(--ease-out),
    visibility 0s linear 320ms,
    background-color 200ms ease;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  visibility: visible;
  transition-delay: 0s;
}

.back-to-top:hover,
.back-to-top:focus-visible {
  background: #34312d;
  transform: translateY(-2px) scale(1);
}

.back-to-top svg {
  width: 1.25rem;
  height: 1.25rem;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.video-trigger:focus-visible {
  outline-offset: -5px;
}

@media (min-width: 52rem) {
  .identity--header {
    margin-top: -1.8rem;
  }

  .video-frame--showreel {
    width: auto;
    height: min(calc(63dvh + 1.5625rem), calc(45vw + 1.5625rem), 40.9375rem);
  }

  .project__inner {
    --project-frame-width: min(calc(46.125dvh + 1.7578125rem), 48vw, 28.7578125rem);
    --project-half-width: min(calc(23.0625dvh + 0.87890625rem), 24vw, 14.37890625rem);
    position: relative;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    justify-items: center;
    max-width: 72rem;
    gap: 0;
  }

  .project__media {
    width: var(--project-frame-width);
    justify-self: center;
  }

  .project__title {
    position: absolute;
    top: 50%;
    right: calc(50% + var(--project-half-width) + clamp(1.5rem, 4vw, 3.5rem));
    display: block;
    width: clamp(10.5rem, 19vw, 18rem);
    text-align: right;
    transform: translateY(-50%);
  }

  .project__title h2 {
    margin: 0;
    font-size: clamp(1.15rem, 1.65vw, 1.58rem);
    font-weight: 500;
    letter-spacing: -0.035em;
    line-height: 1.12;
    text-wrap: balance;
  }

  .project__title::after {
    content: "";
    display: block;
    width: 2.7rem;
    height: 2px;
    margin-top: 1rem;
    margin-left: auto;
    border-radius: 999px;
    background: var(--project-accent);
    opacity: 0.42;
    transform: scaleX(0.34);
    transform-origin: right center;
    transition:
      opacity 360ms ease,
      transform 520ms var(--ease-out);
  }

  .project__copy {
    position: absolute;
    top: 50%;
    left: calc(50% + var(--project-half-width) + clamp(1.5rem, 4vw, 3.5rem));
    width: clamp(11rem, 22vw, 21.5rem);
  }

  .back-to-top {
    right: max(1.5rem, env(safe-area-inset-right));
    bottom: max(1.5rem, env(safe-area-inset-bottom));
    width: 3.5rem;
    height: 3.5rem;
  }
}

@media (max-width: 51.999rem) {
  .identity--header {
    display: none;
  }

  .showreel {
    width: calc(100% - (2 * clamp(0.65rem, 3vw, 0.85rem)));
    margin-top: clamp(1rem, 3.5vw, 1.5rem);
  }

  .identity--mobile-divider {
    position: relative;
    display: flex;
    margin-top: clamp(2.4rem, 9vw, 3.5rem);
    padding-block: clamp(1.9rem, 7vw, 2.6rem);
  }

  .identity--mobile-divider::before,
  .identity--mobile-divider::after {
    content: "";
    position: absolute;
    left: 50%;
    width: min(76%, 18rem);
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--hairline) 24%, var(--hairline) 76%, transparent);
    transform: translateX(-50%);
  }

  .identity--mobile-divider::before {
    top: 0;
  }

  .identity--mobile-divider::after {
    bottom: 0;
  }

  .identity--mobile-divider p {
    margin-top: clamp(1.15rem, 4.8vw, 1.5rem);
    font-size: clamp(2.65rem, 12vw, 3.4rem);
    letter-spacing: -0.058em;
  }

  .identity--mobile-divider h1 {
    font-size: clamp(1.25rem, 5.8vw, 1.55rem);
    font-weight: 550;
    letter-spacing: -0.028em;
  }

  .identity--mobile-divider a {
    margin-top: 0.38rem;
    font-size: clamp(0.92rem, 4.2vw, 1.08rem);
    letter-spacing: -0.018em;
  }

  .projects {
    width: calc(100% - (2 * clamp(0.65rem, 3vw, 0.85rem)));
    margin-top: clamp(2.2rem, 8vw, 3rem);
  }

  .project__inner {
    max-width: 23.5rem;
    gap: 0.72rem;
  }

  .details-trigger {
    display: inline-flex;
    justify-self: center;
  }

  .project__copy {
    display: none;
  }

  .project + .project {
    margin-top: clamp(2rem, 7vw, 2.75rem);
  }

  .back-to-top {
    right: max(0.5rem, calc(50vw - 8.7rem));
    bottom: max(clamp(1.75rem, 4vw, 2.8rem), env(safe-area-inset-bottom));
  }
}

@media (hover: hover) and (pointer: fine) and (min-width: 52rem) {
  .project__copy {
    pointer-events: none;
    opacity: 0;
    transform: translate(0.8rem, -50%);
    transition:
      opacity 380ms ease,
      transform 480ms var(--ease-out);
  }

  .project:hover .project__copy,
  .project:focus-within .project__copy,
  .project.is-playing .project__copy {
    pointer-events: auto;
    opacity: 1;
    transform: translate(0, -50%);
  }

  .project:hover .project__media,
  .project:focus-within .project__media,
  .project.is-playing .project__media {
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.48) inset,
      0 1.5rem 4.4rem var(--project-glow);
    transform: translateY(-2px);
  }

  .project:hover .project__title::after,
  .project:focus-within .project__title::after,
  .project.is-playing .project__title::after {
    opacity: 0.9;
    transform: scaleX(1);
  }
}

@media (max-width: 27rem) {
  .icon-link {
    width: 2.4rem;
    height: 2.6rem;
  }

  .language-switch button {
    width: 2.1rem;
    height: 2rem;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@keyframes settle-in {
  from {
    opacity: 0;
    transform: translateY(0.55rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
