:root {
  --bg: #050a10;
  --bg-2: #080f17;
  --panel: rgba(16, 22, 29, 0.72);
  --panel-2: rgba(22, 30, 39, 0.84);
  --text: #eef2f5;
  --muted: #93a3b0;
  --accent: #ffffff;
  --accent-2: #22d3ee;
  --gold: #ffd166;
  --border: rgba(80, 130, 160, 0.2);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: Inter, Arial, sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(34, 211, 238, 0.045), transparent 30%),
    radial-gradient(circle at 88% 20%, rgba(56, 130, 180, 0.055), transparent 28%),
    linear-gradient(180deg, var(--bg), var(--bg-2) 48%, #03060a);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}


/* Minimal animated constellation background */
#constellation-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -3;
  pointer-events: none;
  opacity: .88;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -4;
  background: radial-gradient(circle at 50% 45%, rgba(34, 211, 238, .022), transparent 48%);
}

@media (prefers-reduced-motion: reduce) {
  #constellation-bg { opacity: .45; }
}

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

img {
  max-width: 100%;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  pointer-events: auto;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .08;
  z-index: 50;
  background-image:
    linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 18px 18px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}

.page-glow {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.08), transparent 65%);
  filter: blur(12px);
  transform: translate(-50%, -50%);
}

.hero {
  min-height: 100vh;
  padding: 68px 8% 80px;
  position: relative;
}

/* Decorative triangle pattern removed for a cleaner background. */

.navbar {
  position: fixed;
  top: 18px;
  left: 8%;
  right: 8%;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(12, 7, 16, 0.72);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  --nav-progress: 0;
  --nav-shift: 0px;
  --nav-scale: 1;
  transform: translate3d(var(--nav-shift), 0, 0) scale(var(--nav-scale));
  transform-origin: center top;
  transition: transform .22s cubic-bezier(.22,.8,.22,1), background .22s ease, box-shadow .22s ease;
  will-change: transform;
}

/* The navbar changes continuously while scrolling instead of jumping between
   two fixed sizes. The JS only updates the progress value. */
.navbar.is-scrolling {
  background: rgba(8, 10, 15, .82);
  box-shadow: 0 16px 50px rgba(0,0,0,.30);
}

.logo {
  display: flex;
  align-items: center;
  color: var(--accent);
  min-width: 245px;
}

.logo-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
}

.logo-text {
  font-weight: 900;
  letter-spacing: .4px;
  font-size: 1.12rem;
}

.logo-subtitle {
  margin-top: 5px;
  color: var(--muted);
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: 1.15px;
  white-space: nowrap;
}


.logo .mc-accent {
  color: var(--accent-2);
  text-shadow:
    0 0 2px var(--accent-2),
    0 0 6px rgba(34, 211, 238, 0.45);
}

.studio-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(12, 17, 23, 0.6);
}

.studio-badge img {
  width: 22px;
  height: 22px;
  border-radius: 4px;
}

.studio-badge .studio-text {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}

.studio-badge .studio-text b {
  color: var(--text);
  display: block;
  font-size: 12px;
}

.logo-img {
  width: 30px;
  height: 30px;
  margin-right: 10px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: .92rem;
}

.nav-links a {
  padding: 9px 12px;
  border-radius: 12px;
  transition: .25s ease;
}

.nav-links a:hover {
  color: #0c0610;
  background: var(--accent);
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.30);
}

.nav-links a.active {
  position: relative;
  color: var(--accent-2);
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: 28px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent-2);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.55);
  transform: translateX(-50%);
}

@media (max-width: 900px) {
  .logo { min-width: auto; }
  .logo-subtitle { font-size: .52rem; letter-spacing: .9px; }
}

.hero-content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.22fr .78fr;
  align-items: center;
  gap: 30px;
  min-height: calc(100vh - 120px);
}

.hero-left {
  padding-left: 16px;
}

.tag,
.section-tag {
  color: var(--accent);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  font-size: .78rem;
  margin-bottom: 14px;
}

.hero .tag {
  position: static;
  width: auto;
  margin: 0 0 78px;
  text-align: left;
  z-index: 3;
}

.hero-left {
  padding-top: 18px;
}

.hero-card-intro.profile-card {
  position: relative;
  z-index: 5;
  width: min(650px, 100%);
  min-height: 158px;
  margin: 0 0 34px;
  padding: 22px 26px;
  border-radius: 20px;
  border: 1px solid rgba(34, 211, 238, .72);
  background:
    radial-gradient(circle at 12% 50%, rgba(34, 211, 238, .06), transparent 26%),
    linear-gradient(135deg, rgba(5, 14, 21, .92), rgba(4, 10, 16, .78));
  backdrop-filter: blur(18px) saturate(125%);
  box-shadow:
    0 18px 55px rgba(0,0,0,.42),
    inset 0 1px 0 rgba(255,255,255,.06),
    0 0 28px rgba(34,211,238,.07);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 28px;
  overflow: hidden;
  transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}

.hero-card-intro::before {
  content: "";
  position: absolute;
  top: 0;
  left: 9%;
  width: 28%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34,211,238,.95), transparent);
  box-shadow: 0 0 14px rgba(34,211,238,.75);
  pointer-events: none;
}

.hero-card-intro::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(255,255,255,.035) 48%, transparent 70%);
  transform: translateX(-110%);
  transition: transform .8s ease;
  pointer-events: none;
}

.hero-card-intro:hover {
  border-color: rgba(34, 211, 238, .95);
  box-shadow:
    0 24px 65px rgba(0,0,0,.5),
    inset 0 1px 0 rgba(255,255,255,.08),
    0 0 38px rgba(34,211,238,.12);
}

.hero-card-intro:hover::after {
  transform: translateX(110%);
}

.profile-avatar-wrap {
  position: relative;
  flex: 0 0 auto;
}

.hero-card-intro img {
  display: block;
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid rgba(34, 211, 238, .58);
  background: #080d14;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.03),
    0 12px 28px rgba(0,0,0,.34),
    0 0 24px rgba(34,211,238,.08);
}

.profile-copy {
  min-width: 0;
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-name-row .profile-brand-logo {
  display: block;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(34, 211, 238, .58);
  background: #080d14;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.03),
    0 12px 28px rgba(0,0,0,.34),
    0 0 24px rgba(34,211,238,.08);
}

.hero-card-intro h2 {
  font-size: clamp(2rem, 3vw, 2.55rem);
  line-height: .98;
  letter-spacing: -1.5px;
  margin: 0 0 8px;
  font-weight: 900;
}

.hero-card-intro p {
  font-size: .88rem;
  line-height: 1.4;
  color: #a8b6c0;
  margin: 0;
  white-space: nowrap;
}

.hero-card-intro p span {
  color: var(--accent-2);
  margin: 0 3px;
}

.profile-socials {
  display: flex;
  gap: 10px;
  margin-top: 13px;
}

.profile-socials a {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid rgba(95, 160, 185, .24);
  background: rgba(5, 12, 19, .56);
  color: #dce7ed;
  transition: transform .2s ease, color .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.profile-socials a:hover {
  color: var(--accent-2);
  border-color: rgba(34, 211, 238, .62);
  background: rgba(34, 211, 238, .06);
  box-shadow: 0 0 18px rgba(34,211,238,.12);
  transform: translateY(-2px);
}

.profile-socials svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.music-control {
  position: fixed;
  right: 24px;
  bottom: 22px;
  z-index: 60;
}

#music-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 118px;
  height: 42px;
  padding: 0 13px;
  border: 1px solid rgba(120, 205, 225, .18);
  border-radius: 999px;
  color: #cbd9df;
  background: rgba(8, 14, 20, .72);
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 35px rgba(0,0,0,.25);
  cursor: pointer;
  transition: .25s ease;
}

#music-toggle:hover {
  border-color: rgba(120, 205, 225, .34);
  background: rgba(11, 19, 27, .86);
  transform: translateY(-2px);
}

.music-icon { color: #8fe6f3; font-size: 1rem; }
.music-label { font-size: .68rem; letter-spacing: 1.3px; text-transform: uppercase; }
.music-bars { display: flex; align-items: center; gap: 2px; margin-left: auto; height: 15px; }
.music-bars i { width: 2px; height: 6px; border-radius: 2px; background: #78d8e8; opacity: .45; }
#music-toggle.is-playing .music-bars i { animation: musicBars .9s ease-in-out infinite alternate; opacity: .85; }
#music-toggle.is-playing .music-bars i:nth-child(2) { animation-delay: .2s; }
#music-toggle.is-playing .music-bars i:nth-child(3) { animation-delay: .4s; }

@keyframes musicBars {
  from { height: 5px; }
  to { height: 14px; }
}

@media (max-width: 600px) {
  .music-control { right: 14px; bottom: 14px; }
  #music-toggle { min-width: 48px; width: 48px; justify-content: center; padding: 0; }
  .music-label { display: none; }
  .music-bars { margin-left: 0; }
}

h1 {
  font-size: clamp(2.8rem, 5.4vw, 5.2rem);
  line-height: .96;
  letter-spacing: -4px;
  max-width: 960px;
}

h1 .accent-word {
  color: var(--accent-2);
}

.hero-text {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.12rem;
  margin: 26px 0 34px;
}

.hero-buttons,
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.btn,
.contact-links a {
  position: relative;
  overflow: hidden;
  padding: 14px 20px;
  border-radius: 14px;
  border: 1px solid var(--border);
  font-weight: 900;
  transition: .25s ease;
  isolation: isolate;
}

.btn::before,
.contact-links a::before,
.project-card::before,
.skill-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: .25s ease;
  z-index: -1;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.28), transparent);
  transform: translateX(-100%);
}

.btn:hover::before,
.contact-links a:hover::before,
.project-card:hover::before,
.skill-card:hover::before {
  opacity: 1;
  transform: translateX(100%);
}

.primary {
  background: var(--accent-2);
  color: #0a1015;
  border-color: transparent;
  box-shadow: 0 14px 42px rgba(34, 211, 238, 0.20);
}

.secondary,
.contact-links a {
  background: rgba(255,255,255,.045);
}

.btn:hover,
.contact-links a:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: rgba(34, 211, 238, 0.45);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 50px;
  max-width: 680px;
}

.stats div {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,.04);
  backdrop-filter: blur(10px);
}

.stats strong {
  display: block;
  color: var(--accent-2);
  font-size: 1.35rem;
  margin-bottom: 3px;
}

.stats span {
  color: var(--muted);
  font-size: .86rem;
}

.hero-card {
  position: relative;
  min-height: 300px;
  padding: 36px;
  border-radius: 28px;
  border: 1px solid rgba(34, 211, 238, 0.22);
  background: linear-gradient(180deg, rgba(20, 28, 36, 0.88), rgba(10, 14, 18, 0.72));
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: auto -40px -80px -40px;
  height: 190px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.20), transparent 70%);
}

.hero-card h2 {
  font-size: 2rem;
}

.hero-card p {
  color: var(--muted);
  margin: 8px 0 0;
}

.section {
  padding: 96px 8%;
  border-top: 1px solid rgba(255,255,255,.07);
  position: relative;
}

.section h2 {
  font-size: clamp(2.1rem, 4vw, 3.8rem);
  line-height: 1.05;
  letter-spacing: -2px;
  margin-bottom: 28px;
}

.about {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 50px;
  align-items: center;
}

.about-image-slot {
  min-height: 380px;
  display: grid;
  place-items: center;
}

.about-render {
  width: 112%;
  max-width: 500px;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 28px 40px rgba(0,0,0,.48));
  animation: modelFloat 6s ease-in-out infinite;
}

.about p:last-child,
.contact p,
.heading-note,
.section-intro {
  color: var(--muted);
  font-size: 1.05rem;
}

.section-intro {
  max-width: 900px;
  margin-bottom: 26px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 20px;
}

.skills-grid,
.services-grid,
.projects-grid,
.timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.skill-card,
.project-card,
.timeline div {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  box-shadow: 0 12px 50px rgba(0,0,0,.18);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.skill-card {
  padding: 24px;
  min-height: 210px;
}

.skill-card:hover,
.project-card:hover,
.timeline div:hover {
  transform: translateY(-8px);
  border-color: rgba(34, 211, 238, 0.5);
  box-shadow: 0 22px 70px rgba(34, 211, 238, 0.10);
}

.skill-card span {
  color: var(--accent-2);
  font-weight: 900;
}

.skill-card h3,
.project-card h3,
.timeline h3 {
  font-size: 1.18rem;
  margin: 12px 0 8px;
}

.skill-card p,
.project-card p,
.timeline p {
  color: var(--muted);
}

.project-card {
  min-height: 260px;
  padding: 24px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.portada {
  width: 100%;
  max-width: 220px;
  aspect-ratio: 1 / 1;
  height: auto;
  display: block;
  margin: 0 auto 18px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
}

.placeholder-card {
  cursor: default;
  border-style: dashed;
  border-color: var(--border);
  background: rgba(255,255,255,.02);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.placeholder-card:hover {
  transform: none;
  border-color: rgba(34, 211, 238, 0.4);
  box-shadow: none;
}

.placeholder-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--accent-2);
  margin-bottom: 14px;
}

.placeholder-card h3 {
  color: var(--muted);
}

.project-card span {
  display: inline-block;
  margin-top: auto;
  padding-top: 16px;
  color: var(--accent);
  font-size: .84rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .8px;
}

.timeline div {
  padding: 28px;
}

.timeline span {
  width: 18px;
  height: 18px;
  display: inline-block;
  border-radius: 4px;
  margin-bottom: 20px;
  background: var(--accent);
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.35);
  transform: rotate(45deg);
}

.contact {
  text-align: center;
}

.contact p {
  max-width: 720px;
  margin: 0 auto 28px;
}

.contact-links {
  justify-content: center;
}

footer {
  padding: 32px 8%;
  text-align: center;
  color: var(--muted);
  border-top: 1px solid rgba(255,255,255,.07);
}

/* IMPORTANTE:
   Por defecto todo queda visible.
   Solo se oculta para animación cuando JavaScript funciona.
   Así GitHub Pages no deja los proyectos invisibles si script.js falla.
*/
.reveal {
  opacity: 1;
  visibility: visible;
  transform: none;
}

body.js-enabled .reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity .75s ease, transform .75s ease;
}

body.js-enabled .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.tilt-card {
  transform-style: preserve-3d;
}

@media (max-width: 920px) {
  .hero-content,
  .about {
    grid-template-columns: 1fr;
  }

  @media (max-width: 900px) {
  .logo { min-width: auto; }
  .logo-subtitle { font-size: .52rem; letter-spacing: .9px; }
}

.hero-content {
    padding-top: 50px;
  }

  .hero-card {
    max-width: 520px;
  }
}

@media (max-width: 680px) {
  .navbar {
    align-items: flex-start;
    flex-direction: column;
    top: 8px;
    left: 20px;
    right: 20px;
  }

  h1 {
    letter-spacing: -2px;
  }

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

  .section-heading {
    display: block;
  }
}

@media (max-width: 768px) {
  .logo-img {
    width: 20px;
    height: 20px;
  }

  body {
    overflow-x: hidden;
  }

  .hero {
    padding: 120px 20px 60px;
    min-height: auto;
  }

  .navbar {
    position: fixed;
    top: 8px;
    left: 12px;
    right: 12px;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 18px;
  }

  .logo {
    font-size: 1.5rem;
  }

  .nav-links {
    width: 100%;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
  }

  @media (max-width: 900px) {
  .logo { min-width: auto; }
  .logo-subtitle { font-size: .52rem; letter-spacing: .9px; }
}

.hero-content {
    display: flex;
    flex-direction: column-reverse;
    gap: 40px;
    min-height: auto;
    text-align: center;
    padding-top: 40px;
  }

  .hero-left {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero .tag {
    position: static;
    margin-bottom: 22px;
  }

  .hero-card-intro.profile-card {
    width: min(430px, 100%);
    margin: 0 auto 28px;
    text-align: left;
  }

  .hero-left {
    padding-top: 0;
  }

  h1 {
    font-size: 2.8rem;
    line-height: 1.05;
    letter-spacing: -1px;
  }

  .hero-text {
    font-size: 1rem;
    max-width: 100%;
  }

  .hero-buttons {
    justify-content: center;
    width: 100%;
  }

  .btn {
    width: 100%;
    max-width: 280px;
    text-align: center;
  }

  .hero-card {
    width: 100%;
    max-width: 380px;
    min-height: auto;
    margin: auto;
  }

  .stats {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .about {
    display: flex;
    flex-direction: column;
    gap: 30px;
    text-align: center;
  }

  .section {
    padding: 70px 20px;
  }

  .section h2 {
    font-size: 2rem;
    text-align: center;
  }

  .skills-grid,
  .projects-grid,
  .timeline {
    grid-template-columns: 1fr;
  }

  .project-card {
    width: 100%;
    min-height: auto;
  }

  .portada {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 14px;
  }

  .contact-links {
    flex-direction: column;
    align-items: center;
  }

  .contact-links a {
    width: 100%;
    max-width: 280px;
    text-align: center;
  }
}
/* Showcase gallery */
.showcase-marquee {
  position: relative;
  width: 100%;
  overflow: hidden;
  margin: 22px 0 18px;
  padding: 2px 0 12px;
  mask-image: linear-gradient(to right, transparent 0, #000 4%, #000 96%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 4%, #000 96%, transparent 100%);
}

.showcase-track {
  display: flex;
  width: max-content;
  gap: 20px;
  will-change: transform;
  animation: showcase-marquee 58s linear infinite;
}

.showcase-marquee:hover .showcase-track,
.showcase-marquee:focus-within .showcase-track {
  animation-play-state: paused;
}

@keyframes showcase-marquee {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

.showcase-marquee .showcase-card {
  flex: 0 0 300px;
  width: 300px;
}

.showcase-card {
  appearance: none;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  color: inherit;
  font: inherit;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 12px 50px rgba(0,0,0,.18);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.showcase-card:hover,
.showcase-card:focus-visible {
  transform: translateY(-6px);
  border-color: rgba(34, 211, 238, 0.5);
  box-shadow: 0 20px 60px rgba(34, 211, 238, 0.10);
  outline: none;
}

.showcase-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  display: block;
  border-radius: 13px;
  background: rgba(255,255,255,.025);
}

.showcase-card span {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 800;
  letter-spacing: .4px;
}

.showcase-more-wrap,
.showcase-collapse-wrap {
  display: flex;
  justify-content: center;
}

.showcase-more-button,
.showcase-collapse-button {
  appearance: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: .84rem;
  font-weight: 800;
  letter-spacing: .2px;
  transition: color .2s ease, border-color .2s ease, background .2s ease, transform .2s ease;
}

.showcase-more-button:hover,
.showcase-more-button:focus-visible,
.showcase-collapse-button:hover,
.showcase-collapse-button:focus-visible {
  color: var(--text);
  border-color: rgba(34, 211, 238, 0.45);
  background: var(--panel-2);
  transform: translateY(-1px);
  outline: none;
}

.showcase-more-button span:last-child {
  font-size: 1.1rem;
  line-height: 1;
  transition: transform .2s ease;
}

.showcase-more-button[aria-expanded="true"] span:last-child {
  transform: rotate(45deg);
}

.showcase-expanded {
  margin-top: 24px;
  padding-top: 4px;
}

.showcase-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0 0 26px;
}

.showcase-tab {
  appearance: none;
  cursor: pointer;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  font: inherit;
  font-size: .84rem;
  font-weight: 700;
  letter-spacing: .2px;
  transition: color .2s ease, border-color .2s ease, background .2s ease, transform .2s ease;
}

.showcase-tab:hover {
  color: var(--text);
  border-color: rgba(34, 211, 238, 0.4);
  transform: translateY(-1px);
}

.showcase-tab.active {
  color: #04141a;
  background: var(--accent-2);
  border-color: var(--accent-2);
  box-shadow: 0 8px 26px rgba(34, 211, 238, 0.22);
}

.showcase-card.is-hidden {
  display: none;
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 20px;
}

.showcase-collapse-wrap {
  margin-top: 22px;
}

.showcase-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}

.showcase-modal.open {
  opacity: 1;
  visibility: visible;
}

.showcase-modal-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(3, 7, 18, .86);
  backdrop-filter: blur(9px);
  cursor: pointer;
}

.showcase-modal-content {
  position: relative;
  z-index: 1;
  width: min(900px, 92vw);
  max-height: 88vh;
  padding: 18px 18px 16px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  box-shadow: 0 30px 100px rgba(0,0,0,.55);
}

.showcase-modal-content img {
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  display: block;
  border-radius: 16px;
  background: rgba(255,255,255,.02);
}

.showcase-modal-content h3 {
  margin: 14px 44px 0 4px;
  font-size: .95rem;
  color: var(--muted);
  font-weight: 800;
}


.showcase-modal-prev,
.showcase-modal-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(5,10,22,.75);
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
}

.showcase-modal-prev { left: -24px; }
.showcase-modal-next { right: -24px; }

.showcase-modal-prev:hover,
.showcase-modal-next:hover {
  background: rgba(34,211,238,.25);
}

.showcase-modal-close {
  position: absolute;
  top: 26px;
  right: 26px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 50%;
  background: rgba(5, 10, 22, .78);
  color: #fff;
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
}

body.showcase-open {
  overflow: hidden;
}

@media (max-width: 1100px) {
  .showcase-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 850px) {
  .showcase-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .showcase-marquee .showcase-card { flex-basis: 270px; width: 270px; }
}

@media (max-width: 700px) {
  .showcase-track { gap: 14px; animation-duration: 50s; }

  .showcase-marquee .showcase-card {
    flex-basis: min(72vw, 280px);
    width: min(72vw, 280px);
    padding: 10px;
    border-radius: 16px;
  }

  .showcase-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .showcase-expanded {
    width: 100%;
  }

  .showcase-tabs {
    gap: 8px;
  }

  .showcase-tab {
    padding: 9px 14px;
  }

  .showcase-modal {
    padding: 12px;
  }

  .showcase-modal-content {
    width: 100%;
    padding: 12px;
    border-radius: 18px;
  }

  .showcase-modal-prev,
.showcase-modal-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(5,10,22,.75);
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
}

.showcase-modal-prev { left: -24px; }
.showcase-modal-next { right: -24px; }

.showcase-modal-prev:hover,
.showcase-modal-next:hover {
  background: rgba(34,211,238,.25);
}

.showcase-modal-close {
    top: 18px;
    right: 18px;
  }
}

@media (max-width: 420px) {
  .showcase-grid { gap: 10px; }
  .showcase-card { padding: 9px; border-radius: 14px; }
  .showcase-card span { font-size: .76rem; }
}

@media (prefers-reduced-motion: reduce) {
  .showcase-track { animation: none; transform: none; }
}

/* ===== Stable navigation indicator ===== */
.nav-links {
  position: relative;
}

.nav-links a.active::after {
  display: none;
}

.nav-active-line {
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 28px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent-2);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.55);
  pointer-events: none;
  opacity: 0;
  transform: translateX(0);
  transition: transform .28s cubic-bezier(.2,.8,.2,1), width .28s ease, opacity .3s ease;
}

.navbar.is-scrolling .nav-active-line {
  opacity: 1;
}

/* ===== 3D renders integrated into the visual design ===== */
.hero-visual {
  position: relative;
  min-height: 620px;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.model-stage {
  position: relative;
  width: min(100%, 700px);
  height: 650px;
  display: grid;
  place-items: center;
}

.model-stage-glow {
  position: absolute;
  width: 390px;
  height: 390px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34,211,238,.17), rgba(34,211,238,.035) 42%, transparent 72%);
  filter: blur(10px);
  z-index: -1;
  animation: modelGlow 5s ease-in-out infinite;
}

.model-render {
  position: absolute;
  width: 88%;
  height: 101%;
  object-fit: contain;
  object-position: center;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 28px 40px rgba(0,0,0,.48));
  transition: transform .55s cubic-bezier(.2,.8,.2,1), filter .55s ease;
}

.model-render-main {
  z-index: 3;
  transform: translateY(-8px) scale(1.08);
  animation: modelFloat 6s ease-in-out infinite;
}

.model-render-back {
  width: 66%;
  height: 80%;
  opacity: .42;
  filter: saturate(.82) brightness(.72) blur(.15px) drop-shadow(0 20px 30px rgba(0,0,0,.4));
  z-index: 1;
}

.model-render-green {
  transform: translate(150px, 58px) rotate(4deg) scale(.92);
  animation: modelFloatRight 7s ease-in-out infinite;
}

.model-render-red {
  transform: translate(-150px, 70px) rotate(-4deg) scale(.90);
  animation: modelFloatLeft 7.5s ease-in-out infinite;
}


.model-orbit {
  position: absolute;
  border: 1px solid rgba(34,211,238,.09);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.model-orbit-left {
  width: 390px;
  height: 150px;
  transform: rotate(-22deg);
}

.model-orbit-right {
  width: 450px;
  height: 180px;
  transform: rotate(28deg);
}

@keyframes modelFloat {
  0%,100% { transform: translateY(-8px) scale(1.08); }
  50% { transform: translateY(-20px) scale(1.035); }
}

@keyframes modelFloatLeft {
  0%,100% { transform: translate(-150px, 70px) rotate(-4deg) scale(.90); }
  50% { transform: translate(-138px, 64px) rotate(-6deg) scale(.86); }
}

@keyframes modelFloatRight {
  0%,100% { transform: translate(150px, 58px) rotate(4deg) scale(.92); }
  50% { transform: translate(138px, 50px) rotate(6deg) scale(.9); }
}

@keyframes modelGlow {
  0%,100% { transform: scale(.95); opacity: .72; }
  50% { transform: scale(1.08); opacity: 1; }
}

@media (max-width: 920px) {
  .hero-visual {
    min-height: 560px;
  }

  .model-stage {
    height: 560px;
  }
}

@media (max-width: 768px) {
  .hero-visual {
    min-height: 500px;
    width: 100%;
  }

  .model-stage {
    height: 500px;
  }

  .model-render-main {
    width: 78%;
    height: 88%;
  }

  .model-render-back {
    width: 54%;
    height: 68%;
    opacity: .30;
  }

  .model-render-green {
    transform: translate(92px, 64px) rotate(4deg) scale(.82);
  }

  .model-render-red {
    transform: translate(-92px, 70px) rotate(-4deg) scale(.78);
  }

  .hero-visual .hero-card {
    right: 50%;
    transform: translateX(50%);
    bottom: 8px;
    width: min(360px, 88%);
  }

  .nav-active-line {
    bottom: -3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .model-render,
  .model-stage-glow {
    animation: none;
  }
}


/* About model: centered and more prominent without pushing the text away. */
@media (min-width: 921px) {
  .about-image-slot {
    min-height: 430px;
  }

  .about-render {
    width: 118%;
    max-width: 520px;
  }
}

@media (max-width: 920px) {
  .about-image-slot {
    min-height: 330px;
  }

  .about-render {
    width: min(92vw, 430px);
    max-width: none;
  }
}


/* ===== Contact refresh ===== */
.contact {
  position: relative;
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
}

.contact h2 {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

.contact > p:not(.section-tag) {
  max-width: 700px;
  color: var(--muted);
}

.contact-links {
  align-items: stretch;
  margin-top: 10px;
}

.contact-links a {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}

.contact-links a svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: currentColor;
  opacity: .92;
  transition: transform .25s ease, opacity .25s ease;
}

.contact-links a:hover svg {
  transform: scale(1.1);
  opacity: 1;
}

/* ===== Mobile polish ===== */
@media (max-width: 768px) {
  .navbar {
    top: 8px;
    left: 10px;
    right: 10px;
    padding: 11px 12px;
    gap: 10px;
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    transform: none !important;
  }

  .navbar .logo {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 1.18rem;
  }

  .logo-subtitle {
    font-size: .43rem;
    letter-spacing: .7px;
  }

  .studio-badge {
    flex: 0 0 auto;
    padding: 5px 8px;
    gap: 6px;
    font-size: .58rem;
  }

  .studio-badge img {
    width: 25px;
    height: 25px;
  }

  .nav-links {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-links a {
    flex: 0 0 auto;
    padding: 7px 9px;
    font-size: .72rem;
    white-space: nowrap;
  }

  .nav-active-line {
    display: none;
  }

  .hero {
    padding: 112px 16px 48px;
  }

  .hero-content {
    gap: 20px;
    padding-top: 20px;
  }

  .hero-card-intro.profile-card {
    width: 100%;
    min-height: 0;
    padding: 16px;
    gap: 14px;
    border-radius: 17px;
  }

  .hero-card-intro img {
    width: 68px;
    height: 68px;
    border-radius: 12px;
  }

  .profile-name-row {
    gap: 10px;
  }

  .profile-name-row .profile-brand-logo {
    width: 54px;
    height: 54px;
    border-radius: 10px;
  }

  .hero-card-intro h2 {
    font-size: 1.65rem;
    letter-spacing: -1px;
  }

  .hero-card-intro p {
    font-size: .68rem;
    line-height: 1.45;
    white-space: normal;
  }

  .profile-socials {
    margin-top: 9px;
    gap: 7px;
  }

  .profile-socials a {
    width: 32px;
    height: 32px;
  }

  .hero-text {
    margin: 18px 0 24px;
    line-height: 1.55;
  }

  .hero-visual {
    min-height: 420px;
  }

  .model-stage {
    width: 100%;
    height: 420px;
  }

  .model-render-main {
    width: 86%;
    height: 90%;
  }

  .model-render-green {
    transform: translate(64px, 50px) rotate(4deg) scale(.72);
  }

  .model-render-red {
    transform: translate(-64px, 56px) rotate(-4deg) scale(.70);
  }

  .model-orbit-left,
  .model-orbit-right {
    width: 280px;
    height: 120px;
  }

  .hero-buttons {
    gap: 10px;
  }

  .btn {
    max-width: none;
    padding: 13px 16px;
  }

  .stats {
    gap: 10px;
    margin-top: 30px;
  }

  .stats div {
    padding: 14px;
  }

  .section {
    padding: 58px 16px;
  }

  .section h2 {
    font-size: clamp(1.75rem, 8vw, 2.2rem);
    line-height: 1.08;
  }

  .contact {
    padding-left: 16px;
    padding-right: 16px;
  }

  .contact > p:not(.section-tag) {
    font-size: .94rem;
    line-height: 1.6;
  }

  .contact-links {
    width: 100%;
    gap: 9px;
  }

  .contact-links a {
    width: 100%;
    max-width: none;
    min-height: 50px;
    padding: 12px 14px;
    font-size: .82rem;
    overflow-wrap: anywhere;
  }

  footer {
    padding: 26px 16px;
    font-size: .78rem;
  }
}

@media (max-width: 420px) {
  .navbar {
    padding: 9px 10px;
  }

  .navbar .logo {
    font-size: 1.05rem;
  }

  .logo-subtitle {
    display: none;
  }

  .studio-badge {
    font-size: .52rem;
  }

  .studio-text {
    line-height: 1.05;
  }

  .hero {
    padding-top: 106px;
  }

  .hero-card-intro.profile-card {
    padding: 13px;
  }

  .hero-card-intro h2 {
    font-size: 1.45rem;
  }

  .hero-card-intro p {
    font-size: .61rem;
  }

  .hero-visual {
    min-height: 370px;
  }

  .model-stage {
    height: 370px;
  }

  .model-render-main {
    width: 92%;
    height: 86%;
  }

  .model-render-green {
    transform: translate(52px, 52px) rotate(4deg) scale(.62);
  }

  .model-render-red {
    transform: translate(-52px, 58px) rotate(-4deg) scale(.60);
  }
}


/* ===== Final mobile centering pass ===== */
@media (max-width: 768px) {
  .hero,
  .section {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero-content,
  .hero-left,
  .hero-text,
  .hero-buttons,
  .stats,
  .about,
  .section-heading,
  .skills-grid,
  .projects-grid,
  .timeline,
  .showcase-grid,
  .contact,
  .contact-links {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-content,
  .hero-left,
  .about,
  .section-heading,
  .contact {
    align-items: center;
  }

  .hero-content {
    text-align: center;
  }

  .hero-left {
    padding-left: 0;
    padding-right: 0;
  }

  .hero-card-intro.profile-card,
  .hero-card,
  .stats,
  .skills-grid,
  .services-grid,
  .projects-grid,
  .timeline,
  .showcase-grid {
    max-width: 430px;
  }

  .hero-text {
    max-width: 430px;
  }

  .hero-buttons {
    max-width: 430px;
    justify-content: center;
  }

  .about-image-slot {
    width: 100%;
    display: grid;
    place-items: center;
  }

  .about-render {
    display: block;
    margin-left: auto;
    margin-right: auto;
  }

  .section-tag {
    text-align: center;
    transform: none;
  }

  .section h2,
  .section-intro,
  .contact > p:not(.section-tag) {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }

  .skills-grid,
  .services-grid,
  .projects-grid,
  .timeline {
    justify-items: center;
  }

  .skill-card,
  .project-card,
  .timeline div {
    width: 100%;
  }

  .showcase-tabs {
    justify-content: center;
  }

  .contact-links {
    align-items: center;
  }

  .contact-links a {
    width: min(100%, 430px);
  }
}

@media (max-width: 420px) {
  .hero,
  .section {
    padding-left: 14px;
    padding-right: 14px;
  }

  .hero-card-intro.profile-card,
  .hero-card,
  .stats,
  .skills-grid,
  .services-grid,
  .projects-grid,
  .timeline,
  .showcase-grid,
  .hero-text,
  .hero-buttons {
    max-width: 100%;
  }
}
