#home {
  --stage-height: clamp(300px, 48svh, 550px);
  --hero-content-lift: 24px;
  --hero-interaction-offset: clamp(112px, 14svh, 160px);
  min-height: 100svh;
  padding: clamp(100px, 13svh, 150px) 24px 48px;
  margin-bottom: clamp(18vh, 24vh, 28vh);
  position: relative;
  background: transparent;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
}

#home .hero__composition {
  width: 100%;
  min-width: 0;
  text-align: center;
}

#home .hero__name,
#home .hero__intro-name,
#home .hero__tagline,
#home .hero__more-toggle,
#home .hero__phone-status-time,
#home .hero__phone-app-label {
  -webkit-user-select: none;
  user-select: none;
}

#home .hero__phone,
#home .hero__phone * {
  -webkit-user-drag: none;
  -webkit-user-select: none;
  user-select: none;
}

#home .hero__name {
  position: relative;
  z-index: 0;
  margin: 0;
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 5rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: normal;
  white-space: nowrap;
  text-shadow: 4px 4px 0 #b5b5b6,
    8px 8px 0 #777779,
    12px 12px 0 #444446,
    16px 16px 0 #181819;
  transform: translateY(calc(-1 * var(--hero-content-lift)));
}

#home .hero__intro-name {
  position: absolute;
  top: calc(clamp(100px, 13svh, 150px) + clamp(2rem, 4.5vw, 5rem) * 1.05 + 30px);
  left: 50%;
  z-index: 1;
  width: min(calc(100% - 40px), 860px);
  margin: 0;
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4.6vw, 4.5rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: normal;
  white-space: nowrap;
  text-align: center;
  transform: translate(-50%, calc(-1 * var(--hero-content-lift)));
}

#home .hero__interaction {
  position: relative;
  z-index: 1;
  width: min(100%, 640px);
  margin: 12px auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateY(calc(var(--hero-interaction-offset) - var(--hero-content-lift)));
}

#home .hero__stage {
  width: 100%;
  height: var(--stage-height);
  position: relative;
}

#home .memoji-avatar {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#home [data-memoji-portrait] {
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: translateY(8px) scale(.98);
  transition: opacity 280ms ease, transform 450ms var(--ease);
}

#home .memoji-avatar.is-ready [data-memoji-portrait] {
  opacity: 1;
  transform: none;
}

#home .is-phone-open .memoji-avatar [data-memoji-portrait] {
  opacity: 0;
  transform: translateY(-8px) scale(.98);
  transition-duration: 180ms;
}

#home canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#home [data-memoji-status] {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  max-width: none;
  color: var(--color-muted);
  font-size: .85rem;
  text-align: center;
}

#home [data-memoji-status]:empty,
#home .is-phone-open [data-memoji-status] {
  display: none;
}

#home .hero__more-toggle {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 112px;
  min-height: 44px;
  margin-top: 8px;
  padding: 8px 20px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 7px;
  background: #c7c7c7;
  color: #151515;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  transition: background-color 200ms ease;
}

#home .hero__more-toggle:hover,
#home .hero__more-toggle:focus-visible {
  background: #e1e1e1;
}

#home .hero__more-toggle-arrow {
  transition: transform 240ms ease;
}

#home .is-phone-open .hero__more-toggle-arrow {
  transform: rotate(180deg);
}

#home .hero__phone {
  position: absolute;
  left: 50%;
  bottom: 52px;
  width: 250px;
  height: 470px;
  padding: 9px;
  border: 2px solid #2b2b2b;
  border-radius: 46px;
  background: #050505;
  box-shadow: 0 20px 50px rgba(0,0,0,.48), inset 0 0 0 1px #777;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform-origin: 50% 100%;
  transform: translateX(-50%) translateY(20px) scale(calc(var(--phone-scale, 1) * .96));
  transition: opacity 180ms ease, transform 320ms var(--ease), visibility 0s 320ms;
}

#home .is-phone-open .hero__phone {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(var(--phone-scale, 1));
  transition: opacity 260ms ease 140ms, transform 420ms var(--ease) 100ms, visibility 0s;
}

#home .hero__tagline {
  width: min(calc(100% - 40px), 860px);
  margin: 28px auto 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4.6vw, 4.5rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: normal;
  white-space: nowrap;
  text-align: center;
  color: #c8c8ca;
  position: relative;
}

#home .hero__typewriter {
  position: relative;
  display: inline-block;
  vertical-align: bottom;
  white-space: nowrap;
}

#home .hero__typewriter-caret {
  display: none;
  position: absolute;
  left: var(--hero-caret-x, 0px);
  margin-left: .12em;
  top: 50%;
  height: 1em;
  border-right: 2px solid currentColor;
  transform: translateY(-50%);
  animation: hero-caret-blink .7s steps(1, end) infinite;
}

#home .hero__typewriter.is-typewriter-started .hero__typewriter-caret {
  display: inline-block;
}

#home .hero__glitch {
  position: relative;
  display: inline-grid;
  color: inherit;
}

#home .hero__glitch::before {
  grid-area: 1 / 1;
  content: attr(data-text);
  visibility: hidden;
  white-space: nowrap;
}

#home .hero__glitch-current {
  grid-area: 1 / 1;
  width: 100%;
  color: transparent;
  white-space: nowrap;
  text-align: left;
  background: radial-gradient(ellipse at 15% 35%, #e54cff 0 10%, transparent 27%),
    radial-gradient(ellipse at 45% 70%, #00c2ff 0 12%, transparent 30%),
    radial-gradient(ellipse at 76% 28%, #33ff8c 0 11%, transparent 28%),
    radial-gradient(ellipse at 90% 74%, #ffc640 0 9%, transparent 24%),
    #c8c8ca;
  background-size: 180% 260%;
  background-position: 0% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: hero-text-aurora 3.5s ease-in-out infinite alternate;
}

@keyframes hero-caret-blink {
  0%,
  49% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}

@keyframes hero-text-aurora {
  from {
    background-position: 0% 50%;
  }

  to {
    background-position: 100% 50%;
  }
}

@media (min-width: 601px) {

  #home {
    --stage-height: min(48svh, calc(100svh - clamp(100px, 13svh, 150px) - clamp(30.8px, 3.74vw, 57.2px) - clamp(3.04rem, 10.64vw, 15.2rem) - 140px));
  }


  #home .hero__composition {
    padding-top: calc(clamp(2rem, 4.5vw, 5rem) * 1.05);
    padding-bottom: calc(clamp(2.375rem, 8.74vw, 12.54rem) + 28px);
  }


  #home .hero__name {
    position: absolute;
    top: clamp(100px, 13svh, 150px);
    left: 24px;
    right: 24px;
  }

  #home .hero__tagline {
    position: absolute;
    left: 50%;
    right: auto;
    bottom: calc(10px - .035em + var(--hero-content-lift));
    transform: translateX(-50%);
    margin: 0;
  }
}

@media (min-width: 601px) and (max-width: 900px) {
  #home {
    --hero-interaction-offset: 72px;
  }
}

body.intro-reveal #home .hero__name {
  animation: hero-name-shadows 1.2s ease-in-out infinite;
}

@keyframes hero-name-shadows {
  0%,
  100% {
    text-shadow: 4px 4px 0 #b5b5b6, 8px 8px 0 #777779, 12px 12px 0 #444446, 16px 16px 0 #181819;
  }

  50% {
    text-shadow: 1px 1px 0 #b5b5b6, 2px 2px 0 #777779, 3px 3px 0 #444446, 4px 4px 0 #181819;
  }
}

@media (max-width: 600px) {
  #home {
    --stage-height: clamp(310px, 43svh, 390px);
    --hero-content-lift: 0px;
    --hero-interaction-offset: 18px;
    padding: 100px 20px 40px;
  }

  #home .hero__intro-name {
    position: relative;
    top: auto;
    left: auto;
    margin: 26px auto 0;
    transform: none;
  }

  #home .hero__tagline {
    margin-top: calc(24px + var(--hero-interaction-offset));
  }
}

@media (max-height: 600px) and (min-width: 601px) {
  #home {
    --stage-height: 280px;
    padding-top: 90px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #home *,
  #home *::before,
  #home *::after {
    animation: none !important;
    transition: none !important;
  }
}

.hero__phone-island {
  position: absolute;
  top: 16px;
  left: 50%;
  z-index: 3;
  width: 52px;
  height: 16px;
  border-radius: 9px;
  background: #000;
  transform: translateX(-50%);
}

.hero__phone-screen {
  position: relative;
  height: 100%;
  padding: 7px 14px 12px;
  border-radius: 38px;
  background: url("../icons/web-phone/wallpaper.png") center / cover no-repeat;
  overflow: hidden;
}

.hero__phone-status {
  position: relative;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  height: 16px;
  padding: 0 8px;
  color: #fff;
  font-family: var(--font-body);
  font-size: .68rem;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}

.hero__phone-status-time {
  display: flex;
  align-items: flex-end;
  height: 100%;
  gap: .3rem;
  transform: translate(8px, 2px);
}

.hero__phone-status-icons {
  display: flex;
  align-items: flex-end;
  height: 100%;
  gap: .3rem;
  transform: translate(7px, 5px);
  filter: invert(1) drop-shadow(0 1px 2px rgba(0, 0, 0, .35));
}

.hero__phone-status-icons img {
  height: 22px;
  width: auto;
}

.hero__phone-apps {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px 14px;
  margin-top: 30px;
}

.hero__phone-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-self: center;
  gap: .45rem;
  transition: transform .25s ease;
}

.hero__phone-app:hover,
.hero__phone-app:focus-visible {
  transform: translateY(-3px);
}

.hero__phone-app-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 15px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), 0 6px 14px rgba(0, 0, 0, .28);
}

.hero__phone-app-icon img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.hero__phone-app-icon--github {
  background: #fff;
}

.hero__phone-app-icon--github img {
  filter: invert(1);
}

.hero__phone-app-icon--behance {
  background: #1769ff;
}

.hero__phone-app-icon--linkedin {
  background: #0a66c2;
}

.hero__phone-app-icon--cv {
  background: #fff;
}

.hero__phone-app-icon--cv img {
  width: 33px;
  height: 33px;
}

.hero__phone-app-label {
  position: relative;
  z-index: 4;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.15;
  color: rgba(255, 255, 255, .95);
  text-align: center;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 0 4px rgba(0, 0, 0, .2);
}

.hero__phone-dock {
  position: absolute;
  right: 14px;
  bottom: 14px;
  left: 14px;
  z-index: 4;
  display: flex;
  justify-content: space-around;
  padding: 10px 6px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .16);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.hero__phone-dock-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16), 0 4px 10px rgba(0, 0, 0, .25);
}

.hero__phone-dock-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__phone-home {
  position: absolute;
  bottom: 6px;
  left: 50%;
  z-index: 4;
  width: 60px;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .85);
  transform: translateX(-50%);
}


.hero__origin {
  font-family: 'Cabinet Grotesk', sans-serif;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 0;
  margin-top: var(--s4);
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.5;
}

.hero__origin-region {
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--color-faint);
  font-size: 0.75rem;
}
