:root {
  color-scheme: dark;
  --ink: #f8f4ff;
  --muted: #d3c9dd;
  --accent: #e4c8ff;
  --background: #100e1b;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html, body {
  margin: 0;
  block-size: 100%;
  overflow: hidden;
  overflow: clip;
}

body {
  color: var(--ink);
  background:
    radial-gradient(ellipse at 22% 58%, #32204c 0%, transparent 53%),
    radial-gradient(ellipse at 94% 4%, #202045 0%, transparent 50%),
    var(--background);
}

.mystify {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: .95;
  -webkit-mask-image: linear-gradient(105deg, #000 3%, #000 37%, #0005 66%, #0008 100%);
  mask-image: linear-gradient(105deg, #000 3%, #000 37%, #0005 66%, #0008 100%);
}

.page {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: clamp(.6rem, 2.4vh, 1.4rem);
  width: min(100%, 90rem);
  height: 100vh;
  height: 100dvh;
  margin-inline: auto;
  padding: max(1rem, env(safe-area-inset-top)) max(clamp(1.35rem, 6.2vw, 6.4rem), env(safe-area-inset-right))
    max(clamp(.8rem, 2.8vh, 1.75rem), env(safe-area-inset-bottom)) max(clamp(1.35rem, 6.2vw, 6.4rem), env(safe-area-inset-left));
}

.hero {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  column-gap: clamp(2rem, 6vw, 6.8rem);
  align-items: center;
  min-width: 0;
}

.portrait {
  display: grid;
  place-items: end center;
  justify-self: end;
  width: min(100%, 29rem, 65vh);
  height: min(65vh, 34rem);
  margin-bottom: 1.7vh;
}

.portrait img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 1rem 1.2rem #100b24a8);
  -webkit-mask-image: linear-gradient(#000 0 86%, transparent 100%);
  mask-image: linear-gradient(#000 0 86%, transparent 100%);
}

.intro { min-width: 0; }

h1 {
  margin: 0 0 clamp(1rem, 3.2vh, 1.8rem);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, min(7.5vw, 15vh), 7.15rem);
  font-weight: 400;
  line-height: .88;
  letter-spacing: -.065em;
}

h1 span {
  display: block;
  color: var(--accent);
}

.roles {
  margin: 0 0 1rem;
  color: var(--ink);
  font-size: clamp(.93rem, 1.4vw, 1.15rem);
  font-weight: 650;
  line-height: 1.35;
}

.roles span { color: #d6a7fa; }

.bio {
  max-width: 39ch;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.45vw, 1.19rem);
  line-height: 1.56;
  text-wrap: pretty;
}

.playback { justify-self: end; }

.cv-link, .motion {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 2.85rem;
  border-radius: .6rem;
  font: inherit;
}

.cv-link {
  margin-top: clamp(.8rem, 2.5vh, 1.45rem);
  padding: .58rem .85rem .58rem 1rem;
  color: #221433;
  background: var(--accent);
  border: 1px solid #f0dcff;
  box-shadow: 0 2px 18px #dfabff23;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.cv-link span {
  padding: .14rem .31rem;
  border: 1px solid #3118443d;
  border-radius: .25rem;
  font-size: .75rem;
  line-height: 1.05;
}

.cv-link:hover { background: #f0ddff; }

.motion {
  padding: .45rem .55rem;
  color: var(--muted);
  border: 1px solid transparent;
  background: transparent;
  font-size: .88rem;
  cursor: pointer;
  white-space: nowrap;
}

.motion[hidden] { display: none; }
.motion:hover { background: #dabbff16; }

.motion-icon {
  width: .68rem;
  height: .7rem;
  border-inline: .15rem solid currentColor;
}

.motion[data-paused] .motion-icon {
  width: 0;
  height: 0;
  border: .39rem solid transparent;
  border-left: .64rem solid currentColor;
  border-right: 0;
}

:is(a, button):focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: .25rem;
}

@media (max-width: 820px) and (orientation: portrait) {
  .page {
    gap: .85rem;
    padding-top: max(.8rem, env(safe-area-inset-top));
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, auto) auto;
    align-content: center;
    justify-items: center;
    gap: clamp(.65rem, 2.2vh, 1.2rem);
    text-align: center;
  }

  .portrait {
    justify-self: center;
    align-self: center;
    width: min(67vw, 19rem, 34vh);
    height: auto;
    aspect-ratio: 833 / 929;
    max-height: 100%;
    margin: 0;
  }

  .intro { max-width: 33rem; }

  h1 {
    margin-bottom: .55rem;
    font-size: clamp(2.4rem, 10.6vw, 5rem);
    line-height: .98;
    letter-spacing: -.058em;
  }

  h1 span { display: inline; }

  .roles {
    margin-bottom: .65rem;
    font-size: clamp(.83rem, 3.45vw, 1rem);
  }

  .bio {
    max-width: 40ch;
    margin-inline: auto;
    font-size: 1rem;
    line-height: 1.43;
  }

  .motion { width: 2.75rem; }
  .motion-label { display: none; }

  .mystify {
    -webkit-mask-image: linear-gradient(#000 24%, #0006 57%, #0003 100%);
    mask-image: linear-gradient(#000 24%, #0006 57%, #0003 100%);
  }
}

@media (max-height: 480px) and (orientation: landscape) {
  .page { gap: .45rem; padding-top: max(.45rem, env(safe-area-inset-top)); padding-bottom: max(.45rem, env(safe-area-inset-bottom)); }
  .hero { column-gap: clamp(1rem, 3.8vw, 3.6rem); }
  .portrait { height: min(72vh, 100%); margin: 0; }
  h1 { font-size: clamp(1.9rem, min(7vw, 11vh), 4.2rem); margin-bottom: .6rem; }
  h1 span { display: inline; }
  .roles { font-size: .9rem; margin-bottom: .4rem; }
  .bio { max-width: 49ch; font-size: .94rem; line-height: 1.32; }
  .cv-link { margin-top: .7rem; }
  .cv-link, .motion { min-height: 2.55rem; }
}

@media (max-height: 480px) and (orientation: landscape) and (pointer: coarse) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, auto) auto;
    align-content: center;
    justify-items: center;
    gap: .45rem;
    text-align: center;
  }

  .portrait {
    justify-self: center;
    width: min(23vh, 6rem);
    height: auto;
    aspect-ratio: 833 / 929;
    max-height: 100%;
  }

  h1 { margin-bottom: .3rem; }
  .bio { max-width: 64ch; margin-inline: auto; }
  .motion { width: 2.75rem; }
  .motion-label { display: none; }
}

@media (max-height: 550px) and (orientation: portrait) {
  .page { gap: .55rem; }
  .hero { gap: .45rem; }
  .roles { margin-bottom: .45rem; }
  .bio { font-size: .95rem; line-height: 1.35; }
}

@media (max-width: 345px) {
  .page { padding-inline: max(.9rem, env(safe-area-inset-left)) max(.9rem, env(safe-area-inset-right)); }
  .roles { font-size: .8rem; }
}
