/* ============================================================
   YOUSRI — Portfolio
   Design language inspired by a bold dark/typographic aesthetic:
   #0c0c0c bg · #B600A8 pink · #D7E2EA text · Kanit heavy type
   ============================================================ */

:root {
  --bg: #0c0c0c;
  --bg-soft: #111111;
  --card: #151515;
  --line: rgba(215, 226, 234, 0.12);
  --text: #d7e2ea;
  --text-dim: rgba(215, 226, 234, 0.6);
  --text-faint: rgba(215, 226, 234, 0.35);
  --pink: #b600a8;
  --pink-2: #d000c0;
  --red: #ff5252;
  --grad-head: linear-gradient(#646973 0%, #bbccd7 100%);
  --kanit: 'Kanit', sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--kanit);
  line-height: 1.6;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

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

ul {
  list-style: none;
}

img,
svg {
  display: block;
}

.pink {
  color: var(--pink-2);
}

/* ---------- SHARED ---------- */
.mono-label {
  font-family: var(--mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--text-dim);
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--pink);
  z-index: 200;
  box-shadow: 0 0 14px rgba(182, 0, 168, 0.7);
}

/* ---------- NAV ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: rgba(12, 12, 12, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav__inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 28px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.15rem;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

.nav__logo-dot {
  color: var(--pink-2);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 34px;
}

.nav__links a:not(.nav__cta) {
  font-family: var(--mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--text-dim);
  position: relative;
  transition: color 0.25s;
}

.nav__links a:not(.nav__cta)::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;
  background: var(--pink);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.nav__links a:not(.nav__cta):hover,
.nav__links a:not(.nav__cta).active {
  color: var(--text);
}

.nav__links a:not(.nav__cta):hover::after,
.nav__links a:not(.nav__cta).active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav__cta {
  font-family: var(--mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: #fff;
  background: var(--pink);
  padding: 12px 20px;
  border-radius: 999px;
  transition: background 0.25s, transform 0.25s;
}

.nav__cta:hover {
  background: var(--pink-2);
  transform: translateY(-2px);
}

.lang-toggle {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  padding: 9px 16px;
  cursor: pointer;
  letter-spacing: 0.18em;
  transition: border-color 0.25s, color 0.25s;
}

.lang-toggle:hover {
  border-color: var(--pink);
  color: var(--pink-2);
}

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav__toggle span {
  width: 26px;
  height: 2px;
  background: var(--text);
  transition: transform 0.3s;
}

/* ---------- HERO ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 140px 28px 90px;
  background:
    radial-gradient(60% 60% at 85% 10%, rgba(182, 0, 168, 0.08), transparent 60%),
    radial-gradient(50% 50% at 5% 90%, rgba(182, 0, 168, 0.05), transparent 60%);
}

.hero__inner {
  max-width: 1240px;
  margin: 0 auto;
  width: 100%;
}

.avail {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border: 1px solid rgba(255, 82, 82, 0.4);
  border-radius: 999px;
  color: var(--red);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 40px;
}

.avail__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 12px var(--red);
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

.hero__hello {
  margin-bottom: 24px;
}

.hero__head {
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(3rem, 12.5vw, 11rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
}

.hero__head span {
  display: block;
}

.head-grad {
  background: var(--grad-head);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.head-outline {
  color: transparent;
  -webkit-text-stroke: 2px rgba(215, 226, 234, 0.28);
}

.hero__sub {
  max-width: 560px;
  margin-top: 34px;
  font-weight: 300;
  font-size: 1.15rem;
  color: var(--text-dim);
}

.hero__actions {
  display: flex;
  gap: 18px;
  margin-top: 42px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--kanit);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 18px 34px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.25s, background 0.25s, border-color 0.25s, color 0.25s;
}

.btn--accent {
  background: var(--pink);
  color: #fff;
}

.btn--accent:hover {
  background: var(--pink-2);
  transform: translateY(-3px);
}

.btn--ghost {
  border-color: rgba(215, 226, 234, 0.22);
  color: var(--text);
  background: transparent;
}

.btn--ghost:hover {
  border-color: var(--text);
  transform: translateY(-3px);
}

.hero__meta {
  margin-top: 46px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.hero__meta a:hover {
  color: var(--pink-2);
}

.hero__meta .sep {
  color: var(--text-faint);
}

/* 3D Tunisia map */
.tun3d {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 14px;
  perspective: 600px;
  vertical-align: middle;
}

.tun3d__float {
  display: block;
  width: 20px;
  height: 42px;
  transform-style: preserve-3d;
  animation: tunBob 5s ease-in-out infinite;
}

.tun3d__map {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 12px rgba(182, 0, 168, 0.55));
  animation: tunSway 6s ease-in-out infinite;
}

@keyframes tunBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

@keyframes tunSway {
  0%, 100% { transform: rotateY(-18deg) rotateX(6deg); }
  50% { transform: rotateY(18deg) rotateX(-6deg); }
}

/* Floating hero chips */
.hero__chip {
  position: absolute;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 14px 22px;
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  animation: float 4.5s ease-in-out infinite;
  pointer-events: none;
  white-space: nowrap;
}

.hero__chip b,
.hero__chip strong {
  color: var(--pink-2);
}

.chip--1 { top: 16%; right: 10%; animation-delay: 0s; }
.chip--2 { top: 30%; left: 4%; animation-delay: 0.8s; }
.chip--3 { bottom: 32%; right: 6%; animation-delay: 1.6s; }
.chip--4 { top: 48%; left: 8%; animation-delay: 2.2s; }
.chip--5 { bottom: 16%; left: 16%; animation-delay: 1.1s; }
.chip--6 { bottom: 38%; right: 20%; animation-delay: 0.4s; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}

/* ---------- 3D AVATAR (mouse-follow) ---------- */
.hero__scene {
  position: absolute;
  top: 52%;
  right: clamp(10px, 3vw, 56px);
  width: min(360px, 30vw);
  aspect-ratio: 1;
  transform: translateY(-50%);
  perspective: 900px;
  pointer-events: none;
  z-index: 1;
}

.avatar {
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.3s ease-out;
}

.avatar__float {
  transform-style: preserve-3d;
  animation: avatarFloat 6s ease-in-out infinite;
}

.avatar__card {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  animation: avatarFloat 6s ease-in-out infinite;
}

.avatar__plate {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.avatar__plate--back {
  background-image: url('../assets/avatar.png');
  filter: brightness(0.32) blur(3px) saturate(1.3);
  animation: depthPulse 5s ease-in-out infinite;
}

.avatar__plate--front {
  transform: translateZ(26px);
  backface-visibility: hidden;
}

.avatar__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 38px rgba(182, 0, 168, 0.35)) drop-shadow(0 44px 80px rgba(0, 0, 0, 0.6));
  will-change: transform;
}

.avatar__glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center bottom, rgba(182, 0, 168, 0.16) 0%, transparent 60%);
  filter: blur(30px);
  transform: translateY(20%);
}

.avatar__shadow {
  position: absolute;
  left: 50%;
  bottom: -8%;
  width: 72%;
  height: 9%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.6), transparent 72%);
  filter: blur(6px);
}

@keyframes avatarFloat {
  0%, 100% { transform: translateZ(34px) translateY(0); }
  50% { transform: translateZ(44px) translateY(-12px); }
}

@keyframes depthPulse {
  0%, 100% { transform: translateZ(-42px) translateX(0); }
  50% { transform: translateZ(-66px) translateX(-6px); }
}

/* Floating code labels */
.hcard {
  position: absolute;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  background: var(--card);
  border: 1px solid var(--line);
  padding: 10px 16px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  will-change: transform;
}

.hcard__float {
  display: inline-block;
  animation: hcardFloat 5s ease-in-out infinite;
}

.hcard--1 { top: 5%; left: -2%; animation-delay: 0.2s; color: #ff7ac0; }
.hcard--2 { top: 44%; right: -6%; animation-delay: 1.1s; }
.hcard--3 { bottom: 4%; left: 0; animation-delay: 1.9s; color: var(--text); }

@keyframes hcardFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

/* ---------- MARQUEE ---------- */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
  background: var(--bg-soft);
}

.marquee__track {
  display: flex;
  gap: 56px;
  white-space: nowrap;
  width: max-content;
  animation: marquee 26s linear infinite;
}

.marquee__track span {
  font-weight: 600;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 56px;
}

.marquee__track span::after {
  content: '✦';
  color: var(--pink-2);
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ---------- SECTIONS ---------- */
.section {
  position: relative;
  padding: 140px 28px;
  overflow: hidden;
}

.section--alt {
  background: var(--bg-soft);
}

.section__inner {
  max-width: 1240px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.section__title {
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin: 26px 0 64px;
}

.section__ghost {
  position: absolute;
  top: 30px;
  right: 0;
  font-weight: 900;
  font-size: clamp(6rem, 20vw, 22rem);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(215, 226, 234, 0.05);
  pointer-events: none;
  user-select: none;
  z-index: 1;
}

.section__ghost--right {
  right: -2vw;
}

.section__tag {
  margin-bottom: 12px;
}

/* ---------- ABOUT ---------- */
.about {
  display: flex;
}

.about__card {
  max-width: 860px;
}

.about__title {
  font-weight: 300;
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 1.2;
  margin-bottom: 34px;
}

.about__text {
  color: var(--text-dim);
  font-size: 1.12rem;
  max-width: 640px;
  margin-bottom: 22px;
}

.about__text strong {
  color: var(--text);
  font-weight: 600;
}

.about__skills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 34px 0 42px;
  max-width: 640px;
}

.about__skills li {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-dim);
  transition: border-color 0.25s, color 0.25s, transform 0.25s;
}

.about__skills li:hover {
  border-color: var(--pink);
  color: var(--text);
  transform: translateY(-3px);
}

/* ---------- SERVICES ---------- */
.services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 26px;
}

.service-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 42px;
  padding: 42px 36px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.3s, box-shadow 0.4s;
}

.card-hover:hover {
  transform: translateY(-8px);
  border-color: rgba(182, 0, 168, 0.5);
  box-shadow: 0 30px 80px rgba(182, 0, 168, 0.12);
}

.service-card__num {
  color: var(--pink-2);
}

.service-card h3 {
  font-weight: 700;
  font-size: 1.6rem;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.service-card p {
  color: var(--text-dim);
  font-weight: 300;
}

.service-card__list {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.service-card__list li {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-dim);
  padding-left: 18px;
  position: relative;
}

.service-card__list li::before {
  content: '▹';
  position: absolute;
  left: 0;
  color: var(--pink-2);
}

.service-card__link {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--pink-2);
  margin-top: 26px;
  transition: transform 0.25s;
  display: inline-block;
  width: max-content;
}

.service-card__link:hover {
  transform: translateX(6px);
}

/* ---------- SELECTED WORK SCENE ---------- */
.work-wrap {
  position: relative;
  height: 340vh;
  background: var(--text);
}

.work-scene {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background: var(--text);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.work-scene__label {
  position: absolute;
  top: 110px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--bg);
  opacity: 0.65;
  z-index: 3;
  letter-spacing: 0.4em;
}

.work-scene__word {
  display: flex;
  perspective: 800px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.w-letter {
  display: inline-block;
  font-weight: 900;
  font-size: clamp(6rem, 22vw, 22rem);
  line-height: 0.85;
  color: var(--bg);
  -webkit-text-stroke: 2px var(--bg);
  transform-origin: center center;
  will-change: transform, opacity;
}

.work-scene__cards {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.w-card {
  width: min(330px, 82vw);
  --shown: 0;
  opacity: var(--shown);
  transform: translateY(calc((1 - var(--shown)) * 80px)) scale(calc(0.85 + var(--shown) * 0.15));
  transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.7s ease;
  background: var(--bg);
  color: var(--text);
  border-radius: 36px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.35);
}

.w-card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.w-card__cat {
  color: var(--pink-2);
}

.w-card__year {
  color: var(--text-dim);
}

.w-card__title {
  font-family: var(--kanit);
  font-weight: 800;
  font-size: 1.9rem;
  line-height: 1;
  text-transform: uppercase;
}

.w-card__desc {
  color: var(--text-dim);
  font-weight: 300;
  font-size: 0.95rem;
}

.w-card__tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.w-card__tags span {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-dim);
}

.w-card__link {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--pink-2);
  margin-top: 8px;
}

.work-scene__all {
  position: absolute;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.5s ease;
  color: var(--bg);
  border: 2px solid var(--bg);
  border-radius: 999px;
  padding: 16px 32px;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  background: transparent;
  z-index: 4;
}

.work-scene__all.is-visible {
  opacity: 1;
}

.work-scene__all:hover {
  background: var(--bg);
  color: var(--text);
}

/* ---------- CONTACT ---------- */
.contact {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 70px;
  align-items: start;
}

.contact__info {
  display: grid;
  gap: 0;
  /* kept as label rows */
}

.contact__line {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px;
}

.contact__line a {
  font-size: 1.02rem;
  font-weight: 500;
  transition: color 0.2s;
}

.contact__line a:hover {
  color: var(--pink-2);
}

.contact__socials {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.contact__socials a {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color 0.25s, color 0.25s, transform 0.25s;
}

.contact__socials a:hover {
  border-color: var(--pink);
  color: var(--text);
  transform: translateY(-3px);
}

.contact__cta {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 42px;
  padding: 46px;
  display: grid;
  gap: 20px;
}

.contact__cta-title {
  font-weight: 700;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  text-transform: uppercase;
  line-height: 1.05;
}

.contact__cta-text {
  color: var(--text-dim);
  font-weight: 300;
  font-size: 1.05rem;
  max-width: 460px;
}

.contact__cta-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 14px;
}

/* ---------- FOOTER ---------- */
.footer {
  padding: 48px 28px;
  text-align: center;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 14px;
  justify-items: center;
}

.footer__note {
  color: var(--text-dim);
  font-weight: 300;
  font-size: 0.95rem;
}

.footer__top {
  margin-top: 8px;
}

.footer__top:hover {
  color: var(--pink-2);
}

/* ---------- REVEAL ---------- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* Hover transitions must win over reveal transform */
.card-hover.reveal.visible:hover {
  transform: translateY(-8px);
  border-color: rgba(182, 0, 168, 0.5);
  box-shadow: 0 30px 80px rgba(182, 0, 168, 0.12);
}

/* ---------- 3D DECOR OBJECTS ---------- */
.obj3d {
  position: absolute;
  pointer-events: none;
  z-index: 3;
  perspective: 600px;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: transform;
}

.obj3d__anim {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  animation: objFloat 6s ease-in-out infinite;
}

@keyframes objFloat {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -16px, 0); }
}

/* Cube (web dev) */
.obj3d--cube { width: 54px; height: 54px; top: 10%; left: 3%; }

.obj3d--cube .cube {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  animation: cubeSpin 14s linear infinite;
}

.cubef {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(215, 226, 234, 0.28);
  background: rgba(182, 0, 168, 0.08);
  box-shadow: inset 0 0 22px rgba(182, 0, 168, 0.12);
}

.cubef--f { transform: translateZ(27px); }
.cubef--b { transform: rotateY(180deg) translateZ(27px); }
.cubef--l { transform: rotateY(-90deg) translateZ(27px); }
.cubef--r { transform: rotateY(90deg) translateZ(27px); }
.cubef--t { transform: rotateX(90deg) translateZ(27px); }
.cubef--d { transform: rotateX(-90deg) translateZ(27px); }

@keyframes cubeSpin {
  from { transform: rotateX(0) rotateY(0); }
  to { transform: rotateX(360deg) rotateY(360deg); }
}

/* Play button (video editing) */
.obj3d--play { width: 54px; height: 54px; bottom: 12%; right: 2.5%; }

.play {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, #202020, #0e0e0e);
  border: 1px solid rgba(182, 0, 168, 0.6);
  box-shadow: 0 0 30px rgba(182, 0, 168, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: playBob 4s ease-in-out infinite;
}

.play__ring {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1px solid rgba(182, 0, 168, 0.5);
  animation: ringPulse 2.4s ease-out infinite;
}

.play__tri {
  margin-left: 4px;
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 14px solid var(--pink-2);
  filter: drop-shadow(0 0 8px var(--pink-2));
}

@keyframes playBob {
  0%, 100% { transform: rotateX(18deg) rotateZ(-8deg); }
  50% { transform: rotateX(34deg) rotateZ(4deg); }
}

@keyframes ringPulse {
  0% { transform: scale(0.8); opacity: 0.9; }
  100% { transform: scale(1.45); opacity: 0; }
}

/* Orbit ring (creative / motion) */
.obj3d--ring { width: 72px; height: 72px; top: 58%; right: 5%; }

.obj3d--ring .ring {
  position: absolute;
  inset: 12px;
  border: 2px solid rgba(215, 226, 234, 0.2);
  border-radius: 50%;
  transform: rotateX(68deg);
  box-shadow: 0 0 22px rgba(182, 0, 168, 0.2);
}

.obj3d--ring .orbit {
  position: absolute;
  inset: 0;
  animation: orbitSpin 8s linear infinite;
}

.orbit__dot {
  position: absolute;
  top: -4px;
  left: 50%;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  background: var(--pink-2);
  box-shadow: 0 0 14px var(--pink-2);
}

@keyframes orbitSpin {
  from { transform: rotateX(68deg) rotateZ(0deg); }
  to { transform: rotateX(68deg) rotateZ(360deg); }
}

/* Growth bars (SEO / analytics) */
.obj3d--bars { width: 46px; height: 40px; bottom: 7%; left: 3.5%; }

.obj3d--bars .bars__bar {
  position: absolute;
  bottom: 0;
  width: 12px;
  height: var(--h, 40%);
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--pink-2), #6d005f);
  box-shadow: 0 0 16px rgba(182, 0, 168, 0.35);
  transform-origin: bottom;
  animation: barBounce 1.7s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}

.obj3d--bars .bars__bar:nth-of-type(1) { left: 0; }
.obj3d--bars .bars__bar:nth-of-type(2) { left: 17px; }
.obj3d--bars .bars__bar:nth-of-type(3) { left: 34px; }

@keyframes barBounce {
  0%, 100% { transform: scaleY(1) rotateX(16deg); }
  50% { transform: scaleY(0.7) rotateX(0deg); }
}

/* Code badge (web dev) */
.obj3d--code { width: 64px; height: 64px; top: 34%; left: 3%; }

.codeb {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  background: rgba(21, 21, 21, 0.85);
  border: 1px solid rgba(182, 0, 168, 0.5);
  border-radius: 18px;
  box-shadow: 0 0 36px rgba(182, 0, 168, 0.28);
  animation: codeSway 4.5s ease-in-out infinite;
}

@keyframes codeSway {
  0%, 100% { transform: rotateY(-24deg) rotateX(10deg); }
  50% { transform: rotateY(24deg) rotateX(-6deg); }
}

/* Terminal (web dev) */
.obj3d--term { width: 84px; height: 60px; top: 12%; right: 22%; }

.term {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 17, 0.92);
  border: 1px solid rgba(215, 226, 234, 0.18);
  border-radius: 12px;
  box-shadow: 0 0 26px rgba(0, 0, 0, 0.55), 0 0 28px rgba(182, 0, 168, 0.22);
  overflow: hidden;
  animation: termTilt 5s ease-in-out infinite;
}

.term__bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 16px;
  background: rgba(215, 226, 234, 0.08);
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 0 6px;
}

.term__dot { width: 6px; height: 6px; border-radius: 50%; }

.term__dot:nth-child(1) { background: var(--red); }
.term__dot:nth-child(2) { background: #ffd166; }
.term__dot:nth-child(3) { background: #3ddc97; }

.term__line {
  position: absolute;
  top: 27px;
  left: 7px;
  font-family: var(--mono);
  font-size: 0.5rem;
  color: #3ddc97;
  letter-spacing: 0.05em;
}

@keyframes termTilt {
  0%, 100% { transform: rotateY(-18deg) rotateX(8deg); }
  50% { transform: rotateY(18deg) rotateX(-4deg); }
}

/* Mini UI card / video thumbnail (design) */
.obj3d--frame { width: 56px; height: 68px; bottom: 10%; left: 4%; }

.frame {
  position: absolute;
  inset: 0;
  background: #131313;
  border: 1px solid rgba(215, 226, 234, 0.2);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 26px rgba(182, 0, 168, 0.25);
  display: flex;
  flex-direction: column;
  animation: frameTilt 6s ease-in-out infinite;
}

.frame__thumb {
  height: 58%;
  background: linear-gradient(135deg, #b600a8, #646973);
  position: relative;
}

.frame__play2 {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.frame__play2::after {
  content: '';
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid #fff;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.7));
}

.frame__lines {
  flex: 1;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.frame__lines i {
  height: 4px;
  border-radius: 2px;
  background: rgba(215, 226, 234, 0.25);
}

.frame__lines i:nth-child(2) {
  width: 65%;
  background: rgba(182, 0, 168, 0.5);
}

@keyframes frameTilt {
  0%, 100% { transform: rotateY(-20deg) rotateX(8deg); }
  50% { transform: rotateY(20deg) rotateX(-6deg); }
}

/* Glassy sphere (graphic design) */
.obj3d--orb { width: 46px; height: 46px; top: 16%; right: 5%; }

.orb {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, rgba(255, 255, 255, 0.85), rgba(215, 226, 234, 0.25) 28%, rgba(182, 0, 168, 0.65) 65%, #6d005f 100%);
  box-shadow: 0 0 28px rgba(182, 0, 168, 0.4);
  animation: orbGlow 4s ease-in-out infinite;
}

@keyframes orbGlow {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.12); filter: brightness(1.25); }
}

/* Sparkle star (creative / motion) */
.obj3d--spark { width: 40px; height: 40px; bottom: 20%; right: 6%; }

.spark {
  position: absolute;
  inset: 0;
  animation: sparkSpin 6s linear infinite;
}

.spark::before,
.spark::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  background: radial-gradient(#fff, rgba(182, 0, 168, 0.6) 60%, transparent);
  border-radius: 999px;
}

.spark::before {
  width: 4px;
  height: 100%;
  margin: -50% 0 0 -2px;
  transform: rotate(45deg);
}

.spark::after {
  width: 100%;
  height: 4px;
  margin: -2px 0 0 -50%;
  transform: rotate(45deg);
}

@keyframes sparkSpin {
  0% { transform: rotate(0deg) scale(0.85); opacity: 0.6; }
  50% { transform: rotate(180deg) scale(1.15); opacity: 1; }
  100% { transform: rotate(360deg) scale(0.85); opacity: 0.6; }
}

/* ---------- RESPONSIVE ---------- */
@media (min-width: 1101px) {
  .hero__inner {
    padding-right: min(400px, 32vw);
  }
}

@media (max-width: 1100px) {
  .hero__scene {
    display: none;
  }
}

@media (max-width: 960px) {
  .hero__chip {
    display: none;
  }

  .obj3d {
    display: none;
  }

  .contact {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .section {
    padding: 100px 22px;
  }

  .work-wrap {
    height: auto;
  }

  .work-scene {
    position: static;
    height: auto;
    flex-direction: column;
    padding: 120px 22px 140px;
    align-items: center;
    text-align: center;
  }

  .work-scene__label {
    position: static;
    transform: none;
    margin-bottom: 40px;
  }

  .work-scene__word {
    position: static;
    transform: none;
    margin-bottom: 60px;
    justify-content: center;
  }

  .work-scene__cards {
    flex-direction: column;
    gap: 24px;
  }

  .w-card {
    --shown: 1;
    transform: none;
    width: min(420px, 88vw);
    margin: 0 auto;
  }

  .work-scene__all {
    position: static;
    transform: none;
    opacity: 1;
    margin-top: 50px;
    display: inline-block;
  }

  .nav__toggle {
    display: flex;
  }

  .nav__links {
    position: fixed;
    top: 72px;
    right: 0;
    height: calc(100vh - 72px);
    width: min(78vw, 340px);
    flex-direction: column;
    align-items: flex-start;
    padding: 40px 34px;
    gap: 28px;
    background: var(--bg-soft);
    border-left: 1px solid var(--line);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
  }

  .nav__links.open {
    transform: translateX(0);
  }
}

@media (max-width: 560px) {
  .field-row {
    grid-template-columns: 1fr;
  }

  .hero__actions .btn {
    width: 100%;
    justify-content: center;
  }

  .hero {
    padding-top: 120px;
  }
}

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

  .hero__chip,
  .marquee__track,
  .avail__dot,
  .avatar__card,
  .avatar__plate--back,
  .hcard__float {
    animation: none !important;
  }

  .tun3d__map,
  .tun3d__float {
    animation: none !important;
  }

  .obj3d,
  .obj3d * {
    animation: none !important;
    transform: none !important;
  }

  .avatar {
    transform: none !important;
  }

  .marquee__track {
    flex-wrap: wrap;
  }

  .w-card {
    --shown: 1;
    transform: none;
  }

  .work-wrap {
    height: auto;
  }

  .work-scene {
    position: static;
  }
}