:root {
  --bg: #1c1924;
  --bg-2: #221e2b;
  --bg-3: #2a2535;
  --header: rgba(28, 25, 36, 0.82);
  --pink: #e0408c;
  --pink-2: #ff4da6;
  --pink-deep: #c43378;
  --text: #f4eef7;
  --muted: #c9c0d4;
  --card: #2b2638;
  --card-2: #322c41;
  --border: rgba(224, 64, 140, 0.32);
  --glow: 0 0 0 1px rgba(224, 64, 140, 0.18), 0 18px 40px rgba(8, 6, 12, 0.35);
  --radius: 18px;
  --max: 1320px;
  --header-h: 92px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  overflow-x: hidden;
}

img,
video,
iframe {
  max-width: 100%;
  display: block;
}

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

h1, h2, h3 {
  font-family: "Outfit", "Source Sans 3", sans-serif;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--pink);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 20;
}

.skip-link:focus {
  top: 12px;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: #1b1823;
}

.page-bg::before,
.page-bg::after {
  content: "";
  position: absolute;
  inset: -30%;
  pointer-events: none;
}

.page-bg::before {
  background:
    radial-gradient(38% 32% at 18% 24%, rgba(224, 64, 140, 0.16), transparent 72%),
    radial-gradient(34% 30% at 84% 16%, rgba(98, 72, 186, 0.13), transparent 70%),
    radial-gradient(36% 34% at 70% 82%, rgba(224, 64, 140, 0.1), transparent 72%),
    radial-gradient(28% 26% at 22% 86%, rgba(64, 92, 176, 0.09), transparent 70%);
  animation: aurora 24s ease-in-out infinite;
}

.page-bg::after {
  opacity: 0.45;
  background:
    radial-gradient(30% 28% at 58% 38%, rgba(224, 64, 140, 0.1), transparent 70%),
    radial-gradient(26% 24% at 36% 62%, rgba(120, 80, 200, 0.08), transparent 70%);
  animation: aurora 32s ease-in-out infinite reverse;
}

@keyframes aurora {
  0%, 100% { transform: translate(0, 0) scale(1); }
  40% { transform: translate(3.5%, -2.5%) scale(1.05); }
  70% { transform: translate(-2.5%, 3%) scale(0.98); }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
  background: rgba(20, 17, 27, 0.9);
  border-bottom: 1px solid rgba(224, 64, 140, 0.2);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}

.header-inner {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.25));
}

.brand strong {
  display: block;
  color: var(--pink);
  font-family: "Outfit", sans-serif;
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1.1;
}

.brand small {
  color: var(--muted);
  font-size: 0.95rem;
}

.nav {
  display: flex;
  gap: 28px;
}

.nav a {
  color: var(--muted);
  font-weight: 500;
  position: relative;
  padding: 6px 0;
  transition: color 0.2s ease;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--pink);
  transition: width 0.22s ease;
}

.nav a:hover,
.nav a.active {
  color: #fff;
}

.nav a:hover::after,
.nav a.active::after {
  width: 100%;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: 6px;
}

.lang-switch[hidden] {
  display: none !important;
}

.lang-switch a.is-active {
  color: var(--pink);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 10px;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: #fff;
  margin: 6px 0;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.section,
.footer-panel[id] {
  scroll-margin-top: 96px;
}

.section {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: 56px 0 24px;
}

#work {
  padding-bottom: 0;
}

#work > .project-card {
  padding-top: 72px;
}

#work + .section {
  padding-top: 20px;
}

.section-head {
  text-align: center;
  margin-bottom: 2px;
  position: relative;
}

.section-head h1,
.section-head h2,
.section-head h3 {
  color: var(--pink);
  font-size: clamp(2rem, 4vw, 2.7rem);
  display: inline-block;
  padding-bottom: 1px;
}

.section-head:not(.section-head-sm) > h2 {
  --trace-w: 196px;
  position: relative;
  padding: 2px 30px 5px;
  line-height: 1.05;
  font-size: clamp(1.6rem, 3.2vw, 2.16rem);
  background: linear-gradient(180deg, var(--card) 0%, #262131 100%);
  border: 1.5px solid var(--pink);
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(224, 64, 140, 0.18), 0 0 16px rgba(224, 64, 140, 0.28);
}

.section-head:not(.section-head-sm) > h2::before,
.section-head:not(.section-head-sm) > h2::after {
  content: "";
  position: absolute;
  top: 50%;
  width: var(--trace-w);
  height: 8px;
  transform: translateY(-50%);
  pointer-events: none;
  background-repeat: no-repeat;
}

.section-head:not(.section-head-sm) > h2::before {
  right: calc(100% - 4px);
  background-image:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06) 38%, rgba(255, 255, 255, 0.48) 50%, rgba(255, 255, 255, 0.06) 62%, transparent),
    linear-gradient(90deg, transparent, currentColor),
    radial-gradient(circle closest-side, currentColor 100%, transparent 100%);
  background-size: 56px 2px, calc(100% - 10px) 2px, 8px 8px;
  background-position: var(--trace-w) 50%, left center, right center;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 48%, #000 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 48%, #000 100%);
  animation: title-trace-left 4.2s ease-in-out infinite;
}

.section-head:not(.section-head-sm) > h2::after {
  left: calc(100% - 4px);
  background-image:
    radial-gradient(circle closest-side, currentColor 100%, transparent 100%),
    linear-gradient(90deg, currentColor, transparent),
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06) 38%, rgba(255, 255, 255, 0.48) 50%, rgba(255, 255, 255, 0.06) 62%, transparent);
  background-size: 8px 8px, calc(100% - 10px) 2px, 56px 2px;
  background-position: left center, right center, -56px 50%;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 52%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 0%, #000 52%, transparent 100%);
  animation: title-trace-right 4.2s ease-in-out infinite;
}

.section-head:has(+ .project-card) {
  height: 0;
  margin-bottom: 0;
  overflow: visible;
  z-index: 2;
}

.section-head:has(+ .project-card) > h2 {
  transform: translateY(-50%);
  z-index: 2;
}

.section-head:has(+ .project-card) + .project-card {
  padding-top: 48px;
}

.section-head:has(+ .project-card) + .project-card:hover {
  transform: none;
}

.section-head-sm h3 {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
}

.section-head::after {
  display: none;
}

.about .section-head::after,
.skills-toggle .section-head::after {
  content: "";
  display: block;
  height: 1px;
  margin-top: 8px;
  background: linear-gradient(90deg, transparent, var(--pink) 18%, var(--pink) 82%, transparent);
  box-shadow: 0 0 18px rgba(224, 64, 140, 0.45);
}

.about {
  padding-top: 14px;
}

.about .section-head {
  margin-top: 0;
  margin-bottom: 36px;
}

.about-body {
  display: grid;
  grid-template-columns: minmax(210px, 270px) 1fr;
  gap: 36px;
  align-items: stretch;
}

.about-portrait {
  margin: 0;
  display: flex;
  height: 100%;
}

.about-portrait-frame {
  position: relative;
  overflow: hidden;
  flex: 1;
  width: 100%;
  min-height: 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--card) 0%, #15121b 100%);
  box-shadow: var(--glow), 0 16px 36px rgba(0, 0, 0, 0.32);
}

.about-portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
}

.about-portrait-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(224, 64, 140, 0.16), transparent 22%, transparent 78%, rgba(98, 72, 186, 0.14)),
    radial-gradient(ellipse at 50% 42%, transparent 46%, rgba(16, 12, 22, 0.58) 100%);
}

.about-portrait-corners {
  position: absolute;
  inset: 10px;
  z-index: 2;
  pointer-events: none;
  background-image:
    linear-gradient(var(--pink), var(--pink)),
    linear-gradient(var(--pink), var(--pink)),
    linear-gradient(var(--pink), var(--pink)),
    linear-gradient(var(--pink), var(--pink)),
    linear-gradient(var(--pink), var(--pink)),
    linear-gradient(var(--pink), var(--pink)),
    linear-gradient(var(--pink), var(--pink)),
    linear-gradient(var(--pink), var(--pink));
  background-size:
    22px 2px, 2px 22px,
    22px 2px, 2px 22px,
    22px 2px, 2px 22px,
    22px 2px, 2px 22px;
  background-position:
    top left, top left,
    top right, top right,
    bottom left, bottom left,
    bottom right, bottom right;
  background-repeat: no-repeat;
  filter: drop-shadow(0 0 8px rgba(224, 64, 140, 0.55));
}

.about-copy {
  width: 100%;
  color: #efeaf4;
  font-size: 1.05rem;
}

.about-copy p {
  margin: 0 0 1.15rem;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

.about-copy p:last-child {
  margin-bottom: 0;
}

.about-copy a.hl {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.about-copy .about-aside {
  color: var(--muted);
}

.about-cv {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}

.about-cv .btn {
  margin-top: 0;
}

.about-skills {
  margin-top: 56px;
}

.about-skills .pills {
  justify-content: center;
}

.skills-toggle {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: center;
}

.skills-toggle .section-head {
  display: block;
  margin-bottom: 36px;
}

.skills-toggle-title {
  display: inline;
  color: var(--pink);
  font-family: "Outfit", "Source Sans 3", sans-serif;
  font-size: clamp(2rem, 4vw, 2.7rem);
  font-weight: 600;
  letter-spacing: inherit;
  line-height: 1.15;
  padding-bottom: 1px;
}

.skills-arrow {
  display: none;
  width: 0.72em;
  height: 0.72em;
  vertical-align: middle;
}

.skills-arrow::before {
  content: "";
  display: block;
  width: 0.42em;
  height: 0.42em;
  margin: 0.08em auto 0;
  border-right: 2.5px solid currentColor;
  border-bottom: 2.5px solid currentColor;
  transform: rotate(45deg);
}

.skills-toggle-hint {
  display: none;
}

.skills-toggle-hint .hint-close {
  display: none;
}

.about-skills.is-open .skills-toggle-hint .hint-open {
  display: none;
}

.about-skills.is-open .skills-toggle-hint .hint-close {
  display: inline;
}

.head-split {
  color: rgba(224, 64, 140, 0.45);
  font-weight: 400;
  padding: 0 0.15em;
}

.hl {
  color: var(--pink);
  font-weight: 600;
}

.project {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin: 0 0 48px;
  padding-bottom: 0;
  border-bottom: none;
}

.section > .project:last-of-type {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.project-flip .project-body {
  grid-template-columns: 0.85fr 1.15fr;
  grid-template-areas: "copy media";
}

.project-card {
  background: linear-gradient(180deg, var(--card) 0%, #262131 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px;
  box-shadow: var(--glow);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(224, 64, 140, 0.55);
  box-shadow: 0 16px 40px rgba(224, 64, 140, 0.12);
}

.project-card .btn {
  align-self: center;
  position: relative;
  isolation: isolate;
}

.project-card .btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: linear-gradient(
    105deg,
    transparent 0%,
    transparent 38%,
    rgba(255, 255, 255, 0.036) 46%,
    rgba(255, 255, 255, 0.168) 50%,
    rgba(255, 255, 255, 0.036) 54%,
    transparent 62%,
    transparent 100%
  );
  background-repeat: no-repeat;
  background-size: 260% 220%;
  animation: btn-shine 4s linear infinite;
  pointer-events: none;
  mix-blend-mode: screen;
}

.project-card h3 {
  color: var(--pink);
  font-size: 1.25rem;
  margin-bottom: 12px;
  text-align: center;
}

.project-copy h3 {
  display: inline-block;
  text-align: inherit;
  margin-bottom: 14px;
}

.project-copy h3::after {
  content: "";
  display: block;
  height: 1px;
  width: 100%;
  margin-top: 7px;
  background: linear-gradient(90deg, var(--pink) 0%, var(--pink) 18%, transparent 100%);
  box-shadow: 0 0 10px rgba(224, 64, 140, 0.4);
}

.project-flip .project-copy h3::after {
  background: linear-gradient(90deg, transparent 0%, var(--pink) 82%, var(--pink) 100%);
}

.project-wide h3 {
  display: inline-block;
  align-self: center;
}

.project-wide h3::after {
  content: "";
  display: block;
  height: 1px;
  width: 100%;
  margin-top: 7px;
  background: linear-gradient(90deg, transparent, var(--pink) 22%, var(--pink) 78%, transparent);
  box-shadow: 0 0 10px rgba(224, 64, 140, 0.4);
}

.project-card p {
  margin: 0 0 1rem;
  color: #ebe6f1;
  text-align: center;
  hyphens: auto;
}

.project-points {
  margin: 0 0 1rem;
  padding: 0;
  color: #ebe6f1;
  text-align: center;
  list-style: none;
}

.project-points li {
  margin: 0 0 0.5rem;
  white-space: nowrap;
  font-size: clamp(0.72rem, 2.15vw, 0.95rem);
}

.project-points li:last-child {
  margin-bottom: 0;
}

.project-stack {
  display: flex;
  flex-direction: column;
}

.project-group {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.project-group:hover {
  transform: none;
  border-color: var(--border);
  box-shadow: var(--glow);
}

.project-group > .project {
  margin: 0;
  padding: 0;
  border-bottom: none;
  gap: 0;
}

.project-group .project-card {
  background: none;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  padding: 22px 0;
}

.project-group .project-card:hover {
  transform: none;
  border-color: transparent;
  box-shadow: none;
}

.project-group > .project + .project::before,
.project-group > .experiments-block::before {
  content: "";
  display: block;
  flex-shrink: 0;
  height: 1px;
  margin: 36px 3px 32px;
  background: linear-gradient(90deg, transparent, rgba(224, 64, 140, 0.65) 18%, rgba(224, 64, 140, 0.65) 82%, transparent);
  box-shadow: 0 0 12px rgba(224, 64, 140, 0.32);
}

.project-group > .project.project-stack {
  gap: 20px;
}

.project-group > .project:not(:last-child) > .project-card:last-child,
.project-group .project-stack > .project-card:not(:last-child) {
  padding-bottom: 0;
}

.project-group > .project + .project > .project-card:first-child,
.project-group .project-stack > .project-card + .project-card {
  padding-top: 0;
}

.project-group > .experiments-block {
  padding-top: 0;
}

.project-group > .project:first-of-type > .project-card:first-child {
  padding-top: 12px;
}

.project-group > .project:last-of-type > .project-card:last-child {
  padding-bottom: 6px;
}

.project-group .media.featured {
  max-width: none;
  margin: 0 0 18px;
}

.project-body {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  grid-template-areas: "media copy";
  gap: 22px;
  align-items: center;
}

.project-body > .media {
  grid-area: media;
  width: 100%;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}

.project-copy {
  grid-area: copy;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-width: 0;
  text-align: left;
}

.project-copy p,
.project-copy .project-points {
  text-align: left;
}

.project-copy .btn {
  align-self: flex-start;
  margin-top: 0.35rem;
}

.project-flip .project-copy {
  align-items: flex-end;
  text-align: right;
}

.project-flip .project-copy p,
.project-flip .project-copy .project-points {
  text-align: right;
}

.project-flip .project-copy .btn {
  align-self: flex-end;
}

.project-cols {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  align-items: stretch;
}

.project-wide {
  width: 100%;
}

.project-wide p:last-child {
  margin-bottom: 0;
}

.btn-icon {
  width: 1.2em;
  height: 1.2em;
  flex-shrink: 0;
  display: block;
  fill: currentColor;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: auto;
  background: linear-gradient(180deg, var(--pink-2), var(--pink));
  color: #fff;
  font-weight: 700;
  font-family: inherit;
  border: 0;
  border-radius: 999px;
  padding: 12px 22px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(224, 64, 140, 0.28);
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover {
  transform: translateY(-2px) scale(1.01);
  filter: brightness(1.06);
  box-shadow: 0 14px 28px rgba(224, 64, 140, 0.38);
}

.btn:active {
  transform: translateY(0);
}

.media {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #120f18;
  aspect-ratio: 16 / 9;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.32);
}

.media.featured {
  max-width: 980px;
  margin: 0 auto 22px;
}

.media img,
.media video,
.media iframe {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
}

.media iframe {
  position: absolute;
  inset: 0;
}

.media.still img {
  object-fit: cover;
}

.gallery-trigger {
  cursor: zoom-in;
}

.gallery-trigger:hover img,
.gallery-trigger:hover video {
  filter: brightness(1.06);
  transform: scale(1.015);
}

.media img,
.media video,
.experiment-card img,
.experiment-card video {
  transition: filter 0.22s ease, transform 0.22s ease;
}

.zoom-btn {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.zoom-btn::before,
.zoom-btn::after {
  content: "";
  position: absolute;
  background: #1a1620;
}

.zoom-btn::before {
  width: 16px;
  height: 2px;
  left: 15px;
  top: 22px;
}

.zoom-btn::after {
  width: 2px;
  height: 16px;
  left: 22px;
  top: 15px;
}

.zoom-btn-sm {
  width: 36px;
  height: 36px;
  right: 10px;
  bottom: auto;
  top: 10px;
}

.zoom-btn-sm::before {
  width: 12px;
  left: 12px;
  top: 17px;
}

.zoom-btn-sm::after {
  height: 12px;
  left: 17px;
  top: 12px;
}

.gallery-count {
  position: absolute;
  left: 14px;
  bottom: 14px;
  background: rgba(16, 12, 22, 0.78);
  border: 1px solid var(--border);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  pointer-events: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5vh 2.5vw;
  background: rgba(8, 6, 14, 0.84);
  backdrop-filter: blur(14px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.lightbox-stage {
  margin: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  max-width: 95vw;
  max-height: 95vh;
  transform: translateY(12px) scale(0.96);
  transition: transform 0.32s ease;
  pointer-events: none;
}

.lightbox.open .lightbox-stage {
  transform: none;
}

.lightbox-stage img,
.lightbox-stage video {
  display: none;
  width: auto;
  height: auto;
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.lightbox-stage img.is-active,
.lightbox-stage video.is-active {
  display: block;
  pointer-events: auto;
}

.lightbox-stage figcaption {
  position: absolute;
  bottom: 44px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  max-width: 90vw;
  color: var(--muted);
  font-weight: 600;
  text-align: center;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  z-index: 5;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(28, 23, 38, 0.88);
  color: #fff;
  cursor: pointer;
  font-size: 1.8rem;
  line-height: 1;
  touch-action: manipulation;
}

.lightbox-close {
  top: max(12px, env(safe-area-inset-top, 0px));
  right: max(12px, env(safe-area-inset-right, 0px));
  font-size: 2rem;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-prev { left: 18px; }
.lightbox-next { right: 18px; }

.lightbox-close:hover,
.lightbox-nav:hover {
  border-color: var(--pink);
  background: rgba(224, 64, 140, 0.18);
}

.lightbox-counter {
  position: absolute;
  z-index: 5;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.lightbox.single .lightbox-nav,
.lightbox.single .lightbox-counter {
  display: none;
}

body.lightbox-open,
body.slot-full {
  overflow: hidden;
}

.section-head:has(+ .slot-teaser) {
  margin-top: 72px;
}

.slot-teaser {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
}

.slot-lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
}

.slot-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 16px;
  background: #2a160c;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.32);
}

.slot-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  border: 0;
}

.slot-roles,
.slot-tech {
  display: grid;
  gap: 10px;
}

.slot-roles {
  grid-template-columns: 1fr 1fr;
}

.slot-tech {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.slot-tech .ref {
  flex: 0 0 132px;
  width: 132px;
}

.slot-teaser .ref {
  padding: 12px 10px;
}

.slot-teaser .ref strong {
  display: block;
  margin-bottom: 8px;
  font-family: "Outfit", "Source Sans 3", sans-serif;
}

.slot-teaser .ref ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.slot-teaser .ref li,
.slot-teaser .ref p {
  margin: 0;
  color: #ebe6f1;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.35;
  white-space: normal;
}

.slot-teaser .ref li + li {
  margin-top: 4px;
}

body.slot-full .slot-embed {
  position: fixed;
  inset: 0;
  z-index: 200;
  width: 100vw;
  height: 100dvh;
  aspect-ratio: auto;
  margin: 0;
  border-radius: 0;
}

.play-btn {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 74px;
  height: 74px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, background 0.2s ease;
}

.play-btn::before {
  content: "";
  position: absolute;
  left: 29px;
  top: 24px;
  border-style: solid;
  border-width: 13px 0 13px 22px;
  border-color: transparent transparent transparent #1a1620;
}

.play-btn:hover {
  transform: scale(1.08);
  background: #fff;
}

.experiments {
  padding-bottom: 12px;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  position: relative;
}

.timeline-item {
  display: block;
  position: relative;
  padding-left: 0;
  padding-bottom: 10px;
  --year: #c07098;
  --heading: #c07098;
  --frame: rgba(192, 112, 152, 0.26);
  --year-glow: rgba(192, 112, 152, 0.12);
  --line: rgba(192, 112, 152, 0.36);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item:nth-child(1) {
  --year: #e0408c;
  --heading: #e0408c;
  --frame: rgba(224, 64, 140, 0.42);
  --year-glow: rgba(224, 64, 140, 0.28);
  --line: rgba(224, 64, 140, 0.55);
}

.timeline-item:nth-child(2) {
  --year: #d45290;
  --heading: #d45290;
  --frame: rgba(212, 82, 144, 0.34);
  --year-glow: rgba(212, 82, 144, 0.18);
  --line: rgba(212, 82, 144, 0.42);
}

.timeline-item:nth-child(3) {
  --year: #cc6494;
  --heading: #cc6494;
  --frame: rgba(204, 100, 148, 0.3);
  --year-glow: rgba(204, 100, 148, 0.15);
  --line: rgba(204, 100, 148, 0.38);
}

.timeline-item:nth-child(4) {
  --year: #c46e96;
  --heading: #c46e96;
  --frame: rgba(196, 110, 150, 0.28);
  --year-glow: rgba(196, 110, 150, 0.13);
  --line: rgba(196, 110, 150, 0.36);
}

.timeline-item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 2px;
  height: 15px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, var(--year), color-mix(in srgb, var(--year) 35%, #c07098));
  pointer-events: none;
}

.timeline-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 8px;
  height: 8px;
  border-left: 2px solid var(--year);
  border-top: 2px solid var(--year);
  transform: translate(-50%, 0) rotate(45deg);
  animation: timeline-arrow-float 2.8s ease-in-out infinite;
  z-index: 2;
  pointer-events: none;
}

.timeline-item:nth-child(2)::before { animation-delay: 0.4s; }
.timeline-item:nth-child(3)::before { animation-delay: 0.8s; }
.timeline-item:nth-child(4)::before { animation-delay: 1.2s; }

.timeline-years {
  display: block;
  color: var(--year);
  font-family: "Outfit", "Source Sans 3", sans-serif;
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-align: center;
  line-height: 1.2;
  margin: -10px -16px 10px;
  padding: 7px 16px 6px;
  border-bottom: 1px solid var(--frame);
}

.timeline-item:nth-child(1) .timeline-years {
  font-weight: 700;
}

.timeline-role + .timeline-role {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--frame);
}

.timeline-card {
  position: relative;
  background: color-mix(in srgb, var(--bg-2) 18%, var(--card));
  border: 1px solid var(--frame);
  border-radius: 12px;
  padding: 10px 16px;
  box-shadow: none;
  text-align: center;
}

.timeline-item:nth-child(1) .timeline-card {
  background: var(--bg-2);
}

.timeline-item:nth-child(2) .timeline-card {
  background: color-mix(in srgb, var(--bg-2) 70%, var(--card));
}

.timeline-item:nth-child(3) .timeline-card {
  background: color-mix(in srgb, var(--bg-2) 48%, var(--card));
}

.timeline-item:nth-child(4) .timeline-card {
  background: color-mix(in srgb, var(--bg-2) 30%, var(--card));
}

.timeline-card h3 {
  display: block;
  color: var(--heading);
  font-size: 0.98rem;
  margin-bottom: 6px;
  text-align: center;
}

.timeline-card p {
  margin: 0;
  color: #ebe6f1;
  font-size: 0.86rem;
  text-align: center;
}

.ref-slider {
  margin-top: 10px;
}

.ref-viewport {
  overflow: hidden;
}

.ref-track {
  display: flex;
  align-items: stretch;
  height: 100%;
  transition: transform 0.45s ease;
}

.ref-track .ref {
  flex: 0 0 100%;
  min-width: 100%;
  box-sizing: border-box;
}

.ref-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
}

.ref-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.ref-arrow {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(28, 23, 38, 0.88);
  color: #fff;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.ref-arrow:hover {
  border-color: var(--pink);
  background: rgba(224, 64, 140, 0.18);
}

.ref-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(224, 64, 140, 0.28);
  box-shadow: 0 0 0 3px rgba(224, 64, 140, 0.08);
  cursor: pointer;
}

.ref-dot.is-active {
  background: var(--pink);
  box-shadow: 0 0 0 3px rgba(224, 64, 140, 0.22);
}

.ref {
  margin: 0;
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.ref-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 6px;
}

.ref-head span:last-child {
  display: grid;
  gap: 2px;
  justify-items: center;
  min-width: 0;
  text-align: center;
}

.ref-avatar {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card-2);
  color: var(--pink);
  display: grid;
  place-items: center;
  font-family: "Outfit", "Source Sans 3", sans-serif;
  font-weight: 600;
}

.ref-head strong {
  color: var(--text);
  font-family: "Outfit", "Source Sans 3", sans-serif;
  font-weight: 600;
}

.ref-stars {
  color: var(--pink);
  letter-spacing: 0.12em;
  line-height: 1;
  font-size: 0.95rem;
}

.ref blockquote {
  margin: 0;
  width: 100%;
  text-align: center;
}

.client-reviews {
  padding: 22px 26px 18px;
  user-select: none;
  -webkit-user-select: none;
}

.client-reviews:hover {
  transform: none;
  border-color: var(--border);
  box-shadow: var(--glow);
}

.ref-slider {
  cursor: grab;
}

.ref-slider:active {
  cursor: grabbing;
}

.client-lead {
  margin: 0 0 14px;
  color: var(--muted);
  text-align: center;
}

.client-reviews .ref-slider {
  margin-top: 0;
}

.ref blockquote p {
  color: #ebe6f1;
}

.experiment-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.experiment-card {
  margin: 0;
  overflow: hidden;
  border-radius: 12px;
  background: #15121b;
  position: relative;
  aspect-ratio: 16 / 9;
  cursor: zoom-in;
}

.experiment-card img,
.experiment-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.experiment-card figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 12px;
  background: linear-gradient(transparent, rgba(10, 8, 14, 0.85));
  font-size: 0.92rem;
  font-weight: 600;
}

.footer-panel {
  background: rgba(16, 13, 22, 0.92);
  border-top: 1px solid rgba(224, 64, 140, 0.2);
  box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.16);
  margin-top: 40px;
  padding: 56px 0 28px;
}

.footer-grid {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  column-gap: 48px;
  row-gap: 48px;
}

.footer-panel h2 {
  color: var(--pink);
  font-size: clamp(2rem, 4vw, 2.7rem);
  margin-bottom: 22px;
}

.contact h2 {
  text-align: center;
}

.udemy-note {
  margin: 0;
  color: #ebe6f1;
  text-align: center;
  font-size: 1.15rem;
  line-height: 1.45;
}

.skills {
  text-align: center;
}

.skills .pills {
  position: relative;
  justify-content: center;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  position: relative;
}

.pills span {
  position: relative;
  overflow: hidden;
  --skill-bg: rgba(97, 88, 116, 0.18);
  --skill-border: rgba(152, 140, 168, 0.30);
  border: 1px solid var(--skill-border);
  color: #f0dff5;
  background: var(--skill-bg);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.92rem;
  font-weight: 600;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.pills .skill-front {
  --skill-bg: rgba(120, 84, 102, 0.18);
  --skill-border: rgba(168, 132, 152, 0.32);
}

.pills .skill-lang {
  --skill-bg: rgba(224, 64, 140, 0.16);
  --skill-border: rgba(224, 64, 140, 0.38);
  color: #f6d4e6;
}

.pills span:hover {
  transform: translateY(-2px);
  background: color-mix(in srgb, var(--skill-bg) 62%, rgba(255, 255, 255, 0.1));
  border-color: color-mix(in srgb, var(--skill-border) 72%, white);
}

.pills span::after {
  content: "";
  position: absolute;
  left: var(--shine-x, 0);
  top: var(--shine-y, 0);
  width: var(--shine-w, 18%);
  height: var(--shine-h, 190%);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.036) 28%,
    rgba(255, 255, 255, 0.168) 50%,
    rgba(255, 255, 255, 0.036) 72%,
    transparent 100%
  );
  transform: translateX(var(--shine-pos, -240px)) skewX(-24deg);
  pointer-events: none;
  mix-blend-mode: screen;
}

.contact form {
  display: grid;
  gap: 14px;
}

.contact-fields {
  display: flex;
  flex-direction: column;
}

.contact-label {
  color: #d8d0e2;
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.contact-fields input[type="text"]:not(.hp),
.contact-fields input[type="email"] {
  margin-bottom: 14px;
}

.contact-fields textarea {
  margin-bottom: 6px;
}

.contact-actions {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.field-name {
  display: inline-flex;
  align-items: center;
}

.req {
  color: #ff5a7a;
  margin-right: 0.28em;
}

.contact input,
.contact textarea {
  width: 100%;
  background: #1d1a24;
  border: 1px solid #4a4458;
  color: var(--text);
  border-radius: 10px;
  padding: 12px 14px;
  font: inherit;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.contact textarea {
  resize: vertical;
  min-height: 140px;
}

.contact input:focus,
.contact textarea:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(224, 64, 140, 0.18);
}

.counter {
  align-self: flex-end;
  color: #9b93a8;
  font-size: 0.85rem;
}

.contact .btn {
  width: fit-content;
  min-width: 120px;
  justify-self: center;
}

.form-status {
  min-height: 1.3em;
  margin: 0;
  color: var(--pink);
  font-weight: 600;
  text-align: center;
}

.form-status.error {
  color: #ff7b8b;
}

.hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
}

.copyright {
  text-align: center;
  color: #b7adc4;
  margin: 36px 0 0;
  font-size: 0.95rem;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  animation: rise 0.7s ease forwards;
}

.reveal:nth-child(2) { animation-delay: 0.08s; }
.reveal:nth-child(3) { animation-delay: 0.14s; }

@keyframes title-trace-left {
  0%, 18% {
    background-position: var(--trace-w) 50%, left center, right center;
  }
  72%, 100% {
    background-position: -56px 50%, left center, right center;
  }
}

@keyframes title-trace-right {
  0%, 18% {
    background-position: left center, right center, -56px 50%;
  }
  72%, 100% {
    background-position: left center, right center, var(--trace-w) 50%;
  }
}

@keyframes btn-shine {
  0% {
    background-position: 135% 40%;
  }
  62% {
    background-position: -35% 60%;
  }
  62.01%,
  100% {
    background-position: -35% 60%;
  }
}

@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes skills-arrow {
  0%, 100% { opacity: 0.35; transform: translateY(-3px); }
  50% { opacity: 1; transform: translateY(4px); }
}

@keyframes skills-hint {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

@keyframes skills-line {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

@keyframes timeline-rail-flow {
  0% { background-position: 0 125%; }
  100% { background-position: 0 -30%; }
}

@keyframes timeline-stub-flow {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

@keyframes timeline-arrow-float {
  0%, 100% {
    transform: translate(-50%, 3px) rotate(45deg);
    opacity: 0.5;
  }
  50% {
    transform: translate(-50%, -4px) rotate(45deg);
    opacity: 1;
  }
}

@media (max-width: 920px) {
  .project-cols,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .project-body,
  .project-flip .project-body {
    display: flex;
    flex-direction: column;
    grid-template-columns: 1fr;
    grid-template-areas: none;
    gap: 16px;
  }

  .project-copy {
    display: contents;
  }

  .project-copy h3 {
    order: -1;
    align-self: center;
    text-align: center;
  }

  .project-copy,
  .project-flip .project-copy {
    align-items: center;
    text-align: center;
  }

  .project-copy p,
  .project-copy .project-points,
  .project-flip .project-copy p,
  .project-flip .project-copy .project-points {
    text-align: center;
  }

  .project-copy .btn,
  .project-flip .project-copy .btn {
    align-self: center;
  }

  .project-copy h3::after,
  .project-flip .project-copy h3::after,
  .project-wide h3::after {
    display: none;
  }

  .section-head h1,
  .section-head h2 {
    white-space: nowrap;
    max-width: 95%;
    letter-spacing: -0.02em;
  }

  .section-head h1 {
    font-size: clamp(1.35rem, 7.6vw, 2.4rem);
  }

  .section-head h2,
  .skills-toggle-title,
  .footer-panel h2 {
    font-size: clamp(1.01rem, 5.7vw, 1.8rem);
  }

  .section-head:not(.section-head-sm) > h2 {
    --trace-w: 52px;
    padding: 2px 16px 5px;
  }

  .about-body {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 28px;
  }

  .about-portrait {
    width: min(240px, 68vw);
    height: auto;
  }

  .about-portrait-frame {
    aspect-ratio: 3 / 4;
    flex: none;
  }

  .about-copy {
    justify-self: stretch;
  }

  .about-cv {
    justify-content: center;
  }

  .experiment-grid {
    grid-template-columns: 1fr;
  }

  .slot-embed {
    aspect-ratio: 3 / 4;
  }

  .slot-roles {
    grid-template-columns: 1fr;
  }

  .slot-tech .ref {
    flex: 1 1 calc(50% - 5px);
    width: auto;
  }

  .timeline-card {
    width: 100%;
  }

  .timeline-card h3 {
    max-width: 100%;
  }

  .skills-arrow {
    display: inline-block;
    animation: skills-arrow 1.4s ease-in-out infinite;
  }

  .about-skills.is-open .skills-arrow {
    animation: none;
    opacity: 0.7;
    transform: none;
  }

  .about-skills.is-open .skills-arrow::before {
    margin-top: 0.22em;
    transform: rotate(-135deg);
  }

  .skills-toggle-hint {
    display: block;
    margin-top: 8px;
    color: var(--pink);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    animation: skills-hint 2.6s ease-in-out infinite;
  }

  .about-skills:not(.is-open) .skills-toggle .section-head {
    margin-bottom: 0;
  }

  .about-skills:not(.is-open) .skills-toggle .section-head::after {
    animation: skills-line 2.6s ease-in-out infinite;
  }

  .about-skills.is-open .skills-toggle-hint {
    animation: none;
    opacity: 0.65;
  }

  .about-skills .pills {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin: 0;
    pointer-events: none;
    transition: max-height 0.35s ease, opacity 0.28s ease, margin 0.28s ease;
  }

  .about-skills.is-open .pills {
    max-height: 640px;
    opacity: 1;
    margin-top: 14px;
    pointer-events: auto;
  }

  .nav-toggle {
    display: block;
  }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 0;
    background: #231f2c;
    border-bottom: 1px solid var(--border);
    padding: 8px 0 16px;
  }

  .nav.open {
    display: flex;
  }

  .nav a {
    padding: 12px 24px;
  }

  .header-inner {
    width: calc(100% - 28px);
  }

  .brand img {
    width: 56px;
    height: 56px;
  }

  .brand strong {
    font-size: 1.3rem;
  }
}

@media (min-width: 921px) {
  .skills-toggle {
    pointer-events: none;
  }

  .footer-grid {
    grid-template-rows: auto auto auto auto auto auto auto auto auto;
    row-gap: 0;
  }

  .skills,
  .contact {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: 1 / -1;
    align-items: start;
  }

  .skills .pills {
    grid-row: 3 / 8;
    align-self: start;
    align-content: start;
    align-items: center;
    gap: 10px;
  }

  .contact form,
  .contact-fields {
    display: contents;
  }

  .contact-fields textarea {
    margin-bottom: 0;
  }

  .counter {
    margin-top: 6px;
    justify-self: end;
  }

  .contact-actions {
    padding-top: 14px;
  }
}

@media (max-width: 600px) {
  .section,
  .footer-grid {
    width: calc(100% - 24px);
  }

  .project-card,
  .about-copy {
    font-size: 1rem;
  }

  .lightbox-close {
    width: 52px;
    height: 52px;
  }

  .lightbox-prev,
  .lightbox-next {
    top: auto;
    bottom: 58px;
    transform: none;
  }

  .play-btn {
    width: 62px;
    height: 62px;
  }

  .play-btn::before {
    left: 24px;
    top: 20px;
    border-width: 11px 0 11px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal,
  .project-card,
  .btn,
  .pills span,
  .nav a::after {
    animation: none !important;
    transition: none !important;
    opacity: 1;
    transform: none;
  }

  .ref-track {
    transition: none !important;
  }

  .page-bg::before,
  .page-bg::after {
    animation: none !important;
    transform: none;
  }

  .lightbox,
  .lightbox-stage {
    animation: none !important;
    transition: none !important;
    transform: none;
  }

  .section-head:not(.section-head-sm) > h2::before,
  .section-head:not(.section-head-sm) > h2::after,
  .skills-toggle-hint,
  .skills-arrow,
  .pills span,
  .project-card .btn::after,
  .about-skills:not(.is-open) .skills-toggle .section-head::after,
  .timeline-item:not(:last-child)::before {
    animation: none !important;
  }
}
