.portrait img {
  position: absolute;
  inset: auto 0 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  transform: none;
  object-fit: contain;
  object-position: center bottom;
}

.portrait {
  z-index: 5;
  width: clamp(290px, 38vw, 480px);
  height: min(74vh, 680px);
  transform: translate(-50%, 46px);
}

.portrait::before,
.portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.portrait::before {
  z-index: 2;
  opacity: 0;
  background: url("foto.png?v=2") center bottom / contain no-repeat;
  filter: drop-shadow(7px 0 0 rgba(255, 0, 92, 0.8)) drop-shadow(-7px 0 0 rgba(0, 229, 255, 0.75));
  animation: portrait-glitch 3.4s steps(1, end) infinite;
}

.portrait::after {
  display: none;
}

@keyframes portrait-glitch {
  0%, 76%, 100% { opacity: 0; clip-path: inset(0); transform: translateX(0); }
  77% { opacity: .68; clip-path: inset(12% 0 65% 0); transform: translateX(10px); }
  79% { opacity: .5; clip-path: inset(58% 0 19% 0); transform: translateX(-13px); }
  81% { opacity: .65; clip-path: inset(36% 0 43% 0); transform: translateX(7px); }
  83% { opacity: 0; clip-path: inset(0); transform: translateX(0); }
}

@keyframes portrait-noise {
  0% { background-position: 0 0, 0 0; }
  33% { background-position: 7px -5px, 0 2px; }
  66% { background-position: -4px 8px, 0 -2px; }
  100% { background-position: 3px 4px, 0 1px; }
}

body,
.eyebrow,
.location,
.social-link,
.link-copy small,
.link-copy strong {
  font-family: "Abel", Arial, sans-serif;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  scrollbar-width: none;
}

body::-webkit-scrollbar {
  display: none;
}

.location {
  margin-top: 1rem;
}

.rights {
  position: absolute;
  right: 24px;
  bottom: 20px;
  z-index: 5;
  margin: 0;
  color: rgba(85, 213, 209, .58);
  font: .62rem "Abel", Arial, sans-serif;
  letter-spacing: .2em;
}

body.is-loading { overflow: hidden; }

.site-intro {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 32px;
  background: #18222c;
  opacity: 1;
  visibility: visible;
  transition: opacity .75s ease, visibility .75s;
}

.site-intro.is-finished {
  opacity: 0;
  visibility: hidden;
}

.intro-logo-wrap {
  position: relative;
  width: clamp(150px, 18vw, 220px);
  filter: drop-shadow(0 0 28px rgba(253,107,102,.2));
}

.intro-logo {
  display: block;
  width: 100%;
  height: auto;
  animation: none;
}

.intro-logo-wrap::before,
.intro-logo-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: url("logo.svg") center / contain no-repeat;
  pointer-events: none;
  animation: intro-logo-glitch .9s steps(1, end) infinite;
}

.intro-logo-wrap::before { filter: drop-shadow(10px 0 #00e5ff); }
.intro-logo-wrap::after { filter: drop-shadow(-10px 0 #ff005c); animation-delay: 45ms; }

.intro-progress {
  width: min(220px, 56vw);
  height: 2px;
  overflow: hidden;
  background: rgba(85,213,209,.16);
}

.intro-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #55d5d1, #fd6b66);
  transform: scaleX(0);
  transform-origin: left;
  animation: intro-loading 3.5s linear forwards;
}

@keyframes intro-logo-pulse {
  from { transform: scale(.96); opacity: .72; }
  to { transform: scale(1.04); opacity: 1; }
}

@keyframes intro-logo-glitch {
  0%, 38%, 100% { opacity: 0; transform: translateX(0); clip-path: inset(0); }
  42% { opacity: .85; transform: translateX(9px); clip-path: inset(8% 0 62% 0); }
  48% { opacity: .7; transform: translateX(-12px); clip-path: inset(58% 0 12% 0); }
  54% { opacity: .9; transform: translateX(7px); clip-path: inset(31% 0 42% 0); }
  60% { opacity: .65; transform: translateX(-5px); clip-path: inset(76% 0 5% 0); }
  66% { opacity: .8; transform: translateX(11px); clip-path: inset(18% 0 55% 0); }
  72% { opacity: 0; }
}

@keyframes intro-loading { to { transform: scaleX(1); } }

h1,
h1 span {
  font-family: "Roboto Slab", Georgia, serif;
}

.social-link {
  border-radius: 999px;
  translate: var(--repel-x, 0px) var(--repel-y, 0px);
  transition: color .25s, background .25s, transform .25s, opacity .5s, translate .18s ease-out;
  will-change: translate;
}

.social-link.row-top { top: 42%; }
.social-link.row-middle { top: 57%; }
.social-link.row-bottom { top: 72%; }

.social-link.left.row-top { left: clamp(50px, 9vw, 112px); }
.social-link.right.row-top { right: clamp(50px, 9vw, 112px); }
.social-link.left.row-middle { left: clamp(32px, 6vw, 74px); }
.social-link.right.row-middle { right: clamp(32px, 6vw, 74px); }
.social-link.left.row-bottom { left: clamp(16px, 3vw, 36px); }
.social-link.right.row-bottom { right: clamp(16px, 3vw, 36px); }

.site::after {
  content: "";
  position: fixed;
  inset: -25%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.28;
  mix-blend-mode: screen;
  background-image:
    radial-gradient(ellipse at 24% 48%, rgba(0,229,255,.42), transparent 22%),
    radial-gradient(ellipse at 76% 38%, rgba(255,0,92,.34), transparent 20%),
    linear-gradient(105deg, transparent 35%, rgba(85,213,209,.16) 50%, transparent 65%);
  filter: blur(58px);
  transform: scale(1.08);
  animation: background-motion-blur 4.5s ease-in-out infinite alternate;
}

@keyframes background-motion-blur {
  0% { transform: translate3d(-5%, -2%, 0) scale(1.08) skewX(-3deg); }
  45% { transform: translate3d(3%, 2%, 0) scale(1.15) skewX(2deg); }
  100% { transform: translate3d(7%, -1%, 0) scale(1.1) skewX(-1deg); }
}

.link-icon .social-logo {
  position: static;
  width: 25px;
  height: 25px;
  object-fit: contain;
  transform: none;
}

.link-icon .social-logo-linkedin {
  filter: brightness(0) saturate(100%) invert(81%) sepia(47%) saturate(523%) hue-rotate(128deg) brightness(91%) contrast(92%);
}

.link-icon .cv-logo {
  width: 28px;
  height: 34px;
}

.social-link:hover .social-logo,
.social-link:focus-visible .social-logo {
  filter: brightness(0) saturate(100%) invert(11%) sepia(18%) saturate(1064%) hue-rotate(164deg) brightness(92%) contrast(89%);
}

/* Scale the whole composition proportionally on 2K and ultrawide displays. */
@media (min-width: 1600px) and (min-height: 850px) {
  .hero {
    width: min(80vw, 2048px);
  }

  .intro {
    top: clamp(72px, 8vh, 150px);
  }

  .eyebrow,
  .location {
    font-size: clamp(.82rem, .62vw, 1.08rem);
  }

  h1 {
    font-size: clamp(8rem, 7.5vw, 12rem);
  }

  .portrait {
    width: clamp(520px, 28vw, 760px);
    height: min(74vh, 1050px);
    transform: translate(-50%, 58px);
  }

  .social-link {
    width: clamp(330px, 18vw, 440px);
    min-height: clamp(66px, 4.2vw, 84px);
  }

  .link-copy {
    padding-inline: clamp(20px, 1.5vw, 30px);
  }

  .link-copy small { font-size: clamp(.62rem, .42vw, .78rem); }
  .link-copy strong { font-size: clamp(.78rem, .52vw, .96rem); }
  .link-icon { flex-basis: clamp(78px, 4.8vw, 98px); }

  .social-link.left.row-top { left: clamp(110px, 8vw, 180px); }
  .social-link.right.row-top { right: clamp(110px, 8vw, 180px); }
  .social-link.left.row-middle { left: clamp(72px, 5vw, 120px); }
  .social-link.right.row-middle { right: clamp(72px, 5vw, 120px); }
  .social-link.left.row-bottom { left: clamp(34px, 2vw, 64px); }
  .social-link.right.row-bottom { right: clamp(34px, 2vw, 64px); }
}

/* Additional growth for native 4K viewports at 100% browser zoom. */
@media (min-width: 3000px) and (min-height: 1500px) {
  .hero { width: min(76vw, 2500px); }
  .intro { top: clamp(110px, 8vh, 190px); }
  .eyebrow,
  .location { font-size: 1.2rem; }
  h1 { font-size: clamp(12rem, 6.8vw, 16rem); }

  .portrait {
    width: clamp(760px, 25vw, 960px);
    height: min(72vh, 1380px);
    transform: translate(-50%, 72px);
  }

  .social-link {
    width: clamp(440px, 14vw, 540px);
    min-height: 96px;
  }

  .link-copy small { font-size: .86rem; }
  .link-copy strong { font-size: 1.05rem; }
  .link-icon { flex-basis: 108px; }
  .link-icon .social-logo { width: 34px; height: 34px; }
  .link-icon .cv-logo { width: 36px; height: 44px; }
}

@media (max-width: 760px) {
  .rights { display: none; }

  h1 {
    font-size: clamp(1.8rem, 17vw, 5.2rem);
    letter-spacing: .03em;
  }

  .portrait {
    z-index: 2;
    width: min(94vw, 430px);
    height: auto;
    aspect-ratio: 504 / 704;
    margin: -8px auto 18px;
    transform: none;
    overflow: visible;
    mask-image: none;
  }

  .portrait > img {
    position: relative;
    inset: auto;
    display: block;
    width: 100%;
    height: auto;
    object-fit: initial;
  }

  .portrait::before,
  .portrait::after {
    display: none;
  }

  .social-link.row-top,
  .social-link.row-middle,
  .social-link.row-bottom {
    top: auto;
  }

  .social-link.left.row-top,
  .social-link.left.row-middle,
  .social-link.left.row-bottom,
  .social-link.right.row-top,
  .social-link.right.row-middle,
  .social-link.right.row-bottom {
    left: auto;
    right: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site::after { animation: none; }
  .portrait::before { display: none; }
  .portrait::after { animation: none; }
  .intro-logo,
  .intro-logo-wrap::before,
  .intro-logo-wrap::after { animation: none; }
}
