.portfolio-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem 1.2rem; }
.portfolio-nav a, .portfolio-footer a { color: var(--text-secondary); text-decoration: none; font-weight: 700; }
.portfolio-nav a:hover, .portfolio-nav a[aria-current], .portfolio-footer a:hover { color: var(--text-primary); text-decoration: underline; text-underline-offset: .3em; }
.portfolio-page { --portfolio-accent: #54dbcb; --portfolio-ink: #041e1a; }
.portfolio-page.light-theme { --portfolio-accent: #086459; --portfolio-ink: #fff; }
.portfolio-page :focus-visible { outline: 3px solid var(--portfolio-accent); outline-offset: 4px; }
.portfolio-frame { width: min(1120px, calc(100% - 2.5rem)); margin-inline: auto; }
.portfolio-hero, .portfolio-heading { padding-block: clamp(3rem, 8vw, 7rem) clamp(2rem, 5vw, 4rem); }
.portfolio-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2rem; }
.portfolio-hero h1, .portfolio-heading h1 { font: 700 clamp(2.8rem, 8vw, 6.8rem)/.99 var(--font-display); letter-spacing: -.07em; }
.portfolio-hero p, .portfolio-heading p { max-width: 56ch; color: var(--text-secondary); margin-top: 1rem; font-size: clamp(1rem, 2vw, 1.23rem); }
.portfolio-portrait { width: clamp(100px, 20vw, 230px); aspect-ratio: 1; object-fit: cover; object-position: center 30%; border-radius: 20%; }
.portfolio-label { color: var(--portfolio-accent); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.portfolio-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.portfolio-card { display: flex; flex-direction: column; align-items: flex-start; gap: .65rem; background: var(--bg-secondary); border: 1px solid var(--glass-border); border-radius: 1rem; padding: clamp(1.2rem, 3vw, 2.1rem); }
.portfolio-card h2 { font: 700 clamp(1.45rem, 3vw, 2.15rem)/1.1 var(--font-display); letter-spacing: -.035em; }
.portfolio-card p { color: var(--text-secondary); max-width: 52ch; }
.software-features { width: 100%; }
.software-features summary { cursor: pointer; color: var(--portfolio-accent); font-weight: 700; }
.software-features ul { color: var(--text-secondary); padding-inline-start: 1.25rem; margin-block: .65rem; }
.software-features li + li { margin-top: .45rem; }
.portfolio-card a { margin-top: auto; padding-top: .55rem; color: var(--portfolio-accent); font-weight: 700; text-underline-offset: .25em; }
.portfolio-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.4rem; }
.portfolio-action { display: inline-block; background: var(--portfolio-accent); color: var(--portfolio-ink); text-decoration: none; border-radius: .55rem; padding: .65rem 1rem; font-weight: 700; }
.portfolio-action.outline { background: transparent; border: 1px solid var(--glass-border); color: var(--text-primary); }
.portfolio-footer { margin-top: 4rem; padding: 1.6rem 0; border-top: 1px solid var(--glass-border); }
.portfolio-footer .portfolio-frame { display: flex; gap: 1rem; justify-content: space-between; flex-wrap: wrap; }
.portfolio-page #projects, .portfolio-page #interesting-news, .portfolio-page #contact, .portfolio-page #about { scroll-margin-top: 8rem; }
.portfolio-page .portfolio-gallery { padding-top: 0; }
.portfolio-page .portfolio-gallery .media-tile { cursor: zoom-in; }
.portfolio-page .portfolio-gallery .gallery-group { margin-bottom: 2rem; }
.portfolio-page .portfolio-assistant { max-width: 690px; margin: 2rem auto 0; }
.portfolio-page .portfolio-assistant summary { cursor: pointer; font-weight: 700; }
.portfolio-page .portfolio-assistant .chatbot-hero { max-width: none; margin-top: .75rem; }
.portfolio-page .portfolio-navbar { position: sticky; top: 0; }

.studio-home {
  --studio-violet: #c9b7ff;
  --studio-orange: #ff965f;
  --studio-lime: #e2f88c;
  --studio-paper: #21192c;
  --portfolio-accent: #c9b7ff;
  --portfolio-ink: #221637;
  --font-display: "Trebuchet MS", system-ui, sans-serif;
}
.studio-home.light-theme {
  --studio-violet: #6442bc;
  --studio-paper: #fbf8f1;
  --portfolio-accent: #52319f;
  --portfolio-ink: white;
  --bg-primary: #fffdf8;
  --text-primary: #211632;
  --text-secondary: #554962;
}
.studio-home .nav-logo span { color: var(--portfolio-accent); }
.studio-home .portfolio-hero {
  grid-template-columns: minmax(0, 1fr) minmax(0, .94fr);
  gap: clamp(1.5rem, 4vw, 4.5rem);
  padding-block: clamp(2.25rem, 6vw, 5rem) clamp(2rem, 5vw, 4rem);
}
.studio-intro { animation: studio-appear .55s ease-out both; }
.studio-byline { display: flex; align-items: center; gap: .65rem; margin-bottom: 1rem; font-weight: 700; }
.studio-avatar { border-radius: 50%; object-fit: cover; object-position: center 30%; }
.studio-home .portfolio-hero h1 { font-size: clamp(2.65rem, 6.5vw, 6rem); line-height: 1; }
.studio-ink { display: block; color: var(--studio-violet); }
.studio-home .portfolio-action { border-radius: 100vw; padding-inline: 1.2rem; transition: transform .18s ease; }
.studio-home .portfolio-action:hover { transform: translateY(-3px); }
.studio-chat-stage {
  position: relative;
  isolation: isolate;
  background: #cab8fa;
  border-radius: 2rem .8rem 2rem .8rem;
  padding: clamp(1rem, 3.5vw, 2.6rem);
  animation: studio-appear .65s .12s ease-out both;
}
.studio-art { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; border-radius: inherit; }
.studio-art span { position: absolute; line-height: 1; }
.studio-art span:first-child { color: var(--studio-orange); font-size: 12rem; top: -3.75rem; right: -2rem; animation: studio-turn 5s ease-out both; }
.studio-art span:last-child { color: var(--studio-lime); font-size: 10rem; bottom: -3.4rem; left: -1.7rem; animation: studio-turn 5s .25s ease-out both reverse; }
.studio-home .studio-chat {
  max-height: none;
  min-width: 0;
  background: var(--studio-paper);
  border: 1px solid var(--glass-border);
  border-radius: 1.2rem;
  padding: clamp(.85rem, 2vw, 1.35rem);
  box-shadow: 0 14px 25px #22163728;
}
.studio-home .studio-chat::before { content: none; }
.studio-chat .chatbot-header { justify-content: flex-start; gap: .7rem; padding-bottom: .65rem; margin-bottom: .7rem; }
.studio-chat h2 { color: var(--text-primary); font-size: 1.1rem; line-height: 1.25; }
.studio-chat-caption { color: var(--text-secondary); font-size: .8rem; }
.studio-chat-mark { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: .7rem; background: #e2f88c; color: #211632; }
.studio-chat .chatbot-messages { min-height: 7rem; max-height: 13rem; margin-bottom: .6rem; padding: .45rem; background: transparent; }
.studio-chat .chat-msg { max-width: 92%; overflow-wrap: anywhere; }
.studio-chat .chat-msg p { margin: 0; font-size: inherit; color: inherit; }
.studio-chat .chat-msg.bot { border: 1px solid var(--glass-border); background: var(--glass-bg); }
.studio-chat .chat-msg.user { background: var(--portfolio-accent); color: var(--portfolio-ink); }
.studio-chat-prompts { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .7rem; }
.studio-chat-prompts button { font: inherit; font-size: .8rem; background: transparent; color: var(--portfolio-accent); padding: .3rem .6rem; border: 1px solid var(--glass-border); border-radius: 100vw; cursor: pointer; }
.studio-chat-prompts button:hover { background: var(--glass-bg); }
.studio-chat .chatbot-input { padding-top: .65rem; align-items: stretch; }
.studio-chat .chatbot-input input { min-width: 0; background: var(--glass-bg); font-size: 1rem; }
.studio-chat .chatbot-input input:focus-visible { outline: 2px solid var(--portfolio-accent); outline-offset: 2px; }
.studio-chat .chat-send { flex: 0 0 44px; height: auto; min-height: 44px; background: var(--portfolio-accent); color: var(--portfolio-ink); }
.studio-home .studio-work-card, .studio-home .studio-media-card { color: #211632; border: 0; border-radius: .8rem 1.7rem .8rem 1.7rem; }
.studio-home .studio-work-card { background: #e2f88c; }
.studio-home .studio-media-card { background: #ffd1b9; }
.studio-home .studio-work-card :is(p,a), .studio-home .studio-media-card :is(p,a) { color: #352441; }
.studio-home .studio-work-card :focus-visible, .studio-home .studio-media-card :focus-visible { outline-color: #352441; }
.studio-card-icon { font-size: 1.55rem; font-weight: 700; line-height: 1; transition: transform .25s ease; }
.portfolio-card:hover .studio-card-icon, .portfolio-card:focus-within .studio-card-icon { transform: rotate(-10deg) scale(1.1); }

.studio-home {
  --studio-violet: #a9bbff;
  --portfolio-accent: #a9bbff;
  --studio-paper: #121a2e;
  --studio-orange: #7acbff;
  --studio-lime: #aaffdd;
}
.studio-home.light-theme {
  --studio-violet: #2942ad;
  --portfolio-accent: #243ca5;
  --studio-paper: #f4f7ff;
  --bg-primary: #fbfcff;
  --text-primary: #131c36;
  --text-secondary: #44506b;
}
.studio-home .portfolio-hero {
  background-image: radial-gradient(#647da344 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: right center;
}
.studio-home .studio-chat-stage {
  background: linear-gradient(135deg, #6d87ff, #4b42aa 45%, #162d56);
  border-radius: 1.8rem .35rem 1.8rem .35rem;
}
.studio-home .studio-chat { border-radius: 1.25rem .35rem 1.25rem .35rem; }
.studio-home .studio-work-card { background: #d4e1ff; }
.studio-home .studio-media-card { background: #c6f2eb; }
.studio-services-title { grid-column: 1 / -1; font: 800 clamp(1.8rem, 4vw, 2.75rem)/1.1 var(--font-display); }
.studio-services .portfolio-card h3 { font: 700 clamp(1.45rem, 3vw, 2rem)/1.1 var(--font-display); letter-spacing: -.035em; }
.studio-services, .studio-services article { scroll-margin-top: 9rem; }
.studio-service-links { display: grid; gap: .35rem; margin-top: auto; }
.studio-service-list { padding-inline-start: 1.1rem; font-size: .95rem; color: inherit; }
.studio-service-list li + li { margin-top: .35rem; }
.studio-home .studio-bpo-card { color: #102348; background: #d9d5ff; border: 0; border-radius: .8rem 1.7rem .8rem 1.7rem; }
.studio-home .studio-bpo-card :is(p,a) { color: #273759; }
.studio-home .studio-bpo-card a:focus-visible { outline-color: #243ca5; }
.software-bpo { margin-bottom: 1rem; }
@media (min-width: 930px) {
  .studio-services { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.portfolio-nav .course-nav, .studio-course-link { color: var(--portfolio-accent); }
.studio-course-link {
  display: inline-block;
  margin-top: 1rem;
  font-weight: 700;
  text-underline-offset: .25em;
}
.english-course {
  display: grid;
  grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr);
  border: 1px solid var(--glass-border);
  border-radius: 1.7rem;
  margin-block: .75rem clamp(2.25rem, 5vw, 4rem);
  scroll-margin-top: 8rem;
}
.course-poster {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  min-height: 26rem;
  padding: clamp(1.5rem, 4vw, 3.25rem);
  background:
    radial-gradient(ellipse at 18% 13%, #365eaf 0%, transparent 57%),
    linear-gradient(145deg, #172a50, #11172e 70%);
  color: #f7fbff;
  border-radius: 1.65rem 0 0 1.65rem;
}
.course-poster::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image: linear-gradient(#a0c1ff19 1px, transparent 1px), linear-gradient(90deg, #a0c1ff19 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(#000, transparent 74%);
}
.course-orbit {
  position: absolute;
  z-index: -1;
  width: min(83%, 23rem);
  aspect-ratio: 1;
  inset: 6% auto auto 18%;
  border-radius: 50%;
  border: 1px solid #9deaff55;
  box-shadow: inset 0 0 0 18px #a3cbff12, inset 0 0 0 41px #a3cbff0a;
}
.course-signal {
  position: absolute;
  z-index: -1;
  opacity: .5;
  inset: 12% 8% auto auto;
  height: 28%;
  display: flex;
  align-items: center;
  gap: clamp(4px, 1vw, 10px);
}
.course-signal i { width: clamp(5px, 1.15vw, 14px); height: 30%; background: #7ef0df; border-radius: 10px; box-shadow: 0 0 22px #73ffe97d; }
.course-signal i:nth-child(3n) { height: 61%; }
.course-signal i:nth-child(2n) { height: 42%; }
.course-signal i:nth-child(5) { height: 92%; background: #e2fff9; }
.course-poster-enter .course-poster-copy { animation: course-pop .55s cubic-bezier(.2,.8,.3,1.2) both; }
.course-poster-enter .course-signal i { animation: course-signal .65s ease-in-out 3 alternate; }
.course-poster-enter .course-signal i:nth-child(2n) { animation-delay: .15s; }
.course-poster-enter .course-signal i:nth-child(3n) { animation-delay: .28s; }
.course-poster-copy { position: relative; }
.course-poster-copy p:first-child { color: #92f4e4; font-size: .8rem; font-weight: 800; letter-spacing: .1em; }
.course-poster h2 { font: 800 clamp(2.4rem, 5vw, 4.65rem)/.99 var(--font-display); letter-spacing: -.062em; margin: .55rem 0 .9rem; }
.course-pitch { color: #dce7ff; max-width: 39ch; }
.course-practice { margin: .85rem 0 1rem; padding-inline-start: 1.15rem; color: #dce7ff; }
.course-practice li + li { margin-top: .35rem; }
.course-practice li::marker { color: #92f4e4; }
.course-live {
  display: inline-block;
  background: #92f4e4;
  color: #112038;
  font-weight: 800;
  text-decoration: none;
  border-radius: .6rem;
  padding: .65rem .85rem;
}
.course-live:hover { background: #c1fff4; }
.course-live-note { font-size: .85rem; color: #dce7ff; margin-top: .4rem; }
.course-careers { margin-top: 1rem; padding-top: .85rem; border-top: 1px solid #a0c1ff55; color: #dce7ff; font-size: .9rem; }
.course-careers a { display: inline-block; margin-top: .4rem; color: #92f4e4; text-underline-offset: .25em; font-weight: 700; }
.course-poster a:focus-visible { outline-color: #92f4e4; }
.course-registration { background: var(--studio-paper); border-radius: 0 1.65rem 1.65rem 0; padding: clamp(1.2rem, 3vw, 2.25rem); }
.course-registration h3 { font: 800 clamp(1.55rem, 3vw, 2.1rem)/1.12 var(--font-display); }
.course-registration > p { margin: .4rem 0 1rem; color: var(--text-secondary); }
.course-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem .8rem; margin-bottom: .7rem; }
.course-field { display: grid; gap: .25rem; }
.course-field label { font-size: .9rem; font-weight: 700; }
.course-field :is(input, select, textarea) { color: var(--text-primary); background: var(--bg-primary); border: 1px solid var(--glass-border); width: 100%; min-width: 0; border-radius: .55rem; padding: .55rem .65rem; font: inherit; }
.course-field textarea { resize: vertical; }
#course-privacy { font-size: .84rem; color: var(--text-secondary); margin: .6rem 0 .8rem; }
#english-enrollment button { cursor: pointer; border: 0; font: inherit; font-weight: 700; }
#english-enrollment button:disabled { cursor: wait; opacity: .75; }
.course-result:not(:empty) { margin-top: .65rem; font-weight: 700; }
.course-result[data-state="success"] { color: var(--portfolio-accent); }
.course-result[data-state="error"] { color: #a71940; }
.studio-home:not(.light-theme) .course-result[data-state="error"] { color: #ff99b7; }
@keyframes course-pop { from { opacity: .75; transform: translateY(8px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes course-signal { from { transform: scaleY(.48); } to { transform: scaleY(1); } }
@media (max-width: 800px) {
  .english-course { grid-template-columns: minmax(0, 1fr); }
  .course-poster { min-height: 23rem; border-radius: 1.65rem 1.65rem 0 0; }
  .course-registration { border-radius: 0 0 1.65rem 1.65rem; }
}
@media (max-width: 480px) {
  .course-fields { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .course-poster-enter .course-poster-copy, .course-poster-enter .course-signal i { animation: none; }
}
@keyframes studio-appear { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes studio-turn { from { transform: rotate(-32deg); } to { transform: rotate(12deg); } }
@media (max-width: 800px) {
  .studio-home .portfolio-hero { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .studio-intro, .studio-chat-stage, .studio-art span { animation: none; }
  .studio-home .portfolio-action, .studio-card-icon { transition: none; }
}
@media (max-width: 680px) {
  .portfolio-navbar .nav-wrapper { flex-wrap: wrap; justify-content: space-between; gap: .5rem .8rem; }
  .portfolio-navbar .portfolio-nav { order: 3; width: 100%; font-size: .87rem; gap: .45rem 1rem; }
  .portfolio-hero { gap: 1rem; }
  .portfolio-hero h1 { font-size: clamp(2.3rem, 9vw, 3.8rem); }
  .portfolio-grid { grid-template-columns: 1fr; }
}

/* ═════════════════════════════════════════════════════════════════
   FUTURISTIC MOTION SYSTEM (Abdullah Award-Inspired)
   Modern CSS Scroll-Driven Animations + Progressive Fallbacks
   ═════════════════════════════════════════════════════════════════ */

html {
  scroll-padding-top: 5.5rem;
}

/* 1. Top Scroll Progress Beam */
.scroll-progress-beam {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 2500;
  pointer-events: none;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, #54dbcb, #6d87ff, #a9bbff, #7ef0df);
  box-shadow: 0 0 12px rgba(109, 135, 255, 0.55);
}

.studio-home.light-theme .scroll-progress-beam {
  background: linear-gradient(90deg, #243ca5, #52319f, #0891b2, #6d87ff);
  box-shadow: 0 0 10px rgba(36, 60, 165, 0.35);
}

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    @keyframes beam-progress {
      from { transform: scaleX(0); }
      to { transform: scaleX(1); }
    }

    .scroll-progress-beam {
      animation: beam-progress auto linear;
      animation-timeline: scroll(root block);
    }
  }
}

/* 2. Floating Glass Navbar Refinement on Scroll */
.studio-home .portfolio-navbar {
  transition: padding 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              background-color 0.35s ease;
}

.studio-home .portfolio-navbar.is-scrolled {
  padding-block: 0.65rem;
  box-shadow: 0 12px 32px -12px rgba(16, 28, 64, 0.22);
}

@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: scroll()) and (animation-range: 0% 100%)) {
    @keyframes nav-elevate {
      from {
        box-shadow: 0 0 0 0 rgba(16, 28, 64, 0);
      }
      to {
        box-shadow: 0 14px 36px -14px rgba(16, 28, 64, 0.26);
      }
    }

    .studio-home .portfolio-navbar {
      animation: nav-elevate auto linear both;
      animation-timeline: scroll(root block);
      animation-range: 0px 140px;
    }
  }
}

/* 3. Hero Kinetic Stagger + Ambient Orbital Art + Shimmer Accent */
@keyframes hero-rise {
  from {
    opacity: 0;
    transform: translateY(22px);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes spark-orbit-a {
  0%, 100% { transform: translate(0, 0) rotate(-18deg) scale(1); }
  50% { transform: translate(-10px, 12px) rotate(14deg) scale(1.06); }
}

@keyframes spark-orbit-b {
  0%, 100% { transform: translate(0, 0) rotate(12deg) scale(1); }
  50% { transform: translate(12px, -10px) rotate(-18deg) scale(1.08); }
}

@keyframes ink-shimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes orbit-breathe {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.85; }
  50% { transform: scale(1.05) rotate(18deg); opacity: 1; }
}

@keyframes signal-wave {
  0%, 100% { transform: scaleY(0.45); }
  50% { transform: scaleY(1); }
}

.studio-home .studio-ink {
  background: linear-gradient(110deg, var(--studio-violet), #54dbcb, #6d87ff, var(--studio-violet));
  background-size: 240% 240%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.studio-home.light-theme .studio-ink {
  background: linear-gradient(110deg, #243ca5, #52319f, #0891b2, #243ca5);
  background-size: 240% 240%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

@media (prefers-reduced-motion: no-preference) {
  .studio-home .studio-intro {
    animation: none;
  }
  .studio-home .studio-byline {
    animation: hero-rise 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
  }
  .studio-home .portfolio-hero h1 {
    animation: hero-rise 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.14s both;
  }
  .studio-home .studio-intro > p {
    animation: hero-rise 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.24s both;
  }
  .studio-home .studio-course-link,
  .studio-home .portfolio-actions {
    animation: hero-rise 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.34s both;
  }
  .studio-home .studio-chat-stage {
    animation: hero-rise 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.22s both;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
    will-change: transform;
  }
  .studio-home .studio-ink {
    animation: ink-shimmer 7s ease-in-out infinite;
  }
  .studio-home .studio-art span:first-child {
    animation: spark-orbit-a 11s ease-in-out infinite;
  }
  .studio-home .studio-art span:last-child {
    animation: spark-orbit-b 13s ease-in-out infinite;
  }
  .course-orbit {
    animation: orbit-breathe 14s ease-in-out infinite;
  }
  .course-poster-enter .course-signal i {
    animation: signal-wave 2.2s ease-in-out infinite;
  }
  .course-poster-enter .course-signal i:nth-child(2n) { animation-delay: 0.25s; }
  .course-poster-enter .course-signal i:nth-child(3n) { animation-delay: 0.5s; }
  .course-poster-enter .course-signal i:nth-child(5n) { animation-delay: 0.75s; }
}

/* 4. Smooth Scroll-Driven Section & Card Reveals */
@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    @keyframes futuristic-reveal {
      from {
        opacity: 0;
        transform: translateY(34px) scale(0.97);
      }
      to {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }

    .studio-home .social-panel,
    .studio-home .english-course,
    .studio-home .studio-services .portfolio-card,
    .studio-home .stat-box,
    .studio-home .blog-editor,
    .studio-home .contact-card {
      animation: futuristic-reveal auto cubic-bezier(0.22, 1, 0.36, 1) both;
      animation-timeline: view();
      animation-range: entry 0% entry 42%;
    }
  }
}

/* Fallback class toggled by IntersectionObserver when view() is unsupported */
.motion-reveal-pending {
  opacity: 0;
  transform: translateY(28px) scale(0.97);
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}
.motion-reveal-pending.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* 5. Futuristic Interactive Hover Depth + Pointer Glare on Cards */
.studio-home .portfolio-card,
.studio-home .social-panel,
.studio-home .stat-box {
  position: relative;
  overflow: hidden;
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.38s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.3s ease;
}

.studio-home .portfolio-card::after,
.studio-home .stat-box::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    360px circle at var(--mx, 50%) var(--my, 50%),
    rgba(255, 255, 255, 0.35),
    transparent 65%
  );
  transition: opacity 0.35s ease;
}

.studio-home:not(.light-theme) .portfolio-card::after,
.studio-home:not(.light-theme) .stat-box::after {
  background: radial-gradient(
    360px circle at var(--mx, 50%) var(--my, 50%),
    rgba(122, 203, 255, 0.2),
    transparent 65%
  );
}

.studio-home .portfolio-card:hover,
.studio-home .stat-box:hover {
  transform: translateY(-7px);
  box-shadow: 0 22px 44px -18px rgba(19, 28, 54, 0.26);
}

.studio-home .portfolio-card:hover::after,
.studio-home .stat-box:hover::after {
  opacity: 1;
}

.studio-home .portfolio-action {
  position: relative;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.25s ease;
}

.studio-home .portfolio-action:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 28px -10px rgba(36, 60, 165, 0.45);
}

/* 6. Abdullah-Style Floating Pill Constellation for Core Competencies */
body.studio-home .competencies-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem 1.05rem;
  opacity: 1;
  animation: none;
}

body.studio-home.light-theme .competency-tag,
body.studio-home .competency-tag {
  border-radius: 999px;
  padding: 0.7rem 1.35rem;
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  border: 1px solid rgba(36, 60, 165, 0.2);
  background: rgba(212, 225, 255, 0.78);
  color: #131c36;
  box-shadow: 0 10px 22px -12px rgba(19, 28, 54, 0.25);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.3s ease,
              border-color 0.25s ease;
}

body.studio-home.light-theme .competency-tag:nth-child(4n + 2) {
  background: rgba(198, 242, 235, 0.85);
  border-color: rgba(8, 145, 178, 0.28);
}
body.studio-home.light-theme .competency-tag:nth-child(4n + 3) {
  background: rgba(217, 213, 255, 0.85);
  border-color: rgba(82, 49, 159, 0.26);
}
body.studio-home.light-theme .competency-tag:nth-child(4n + 4) {
  background: rgba(255, 224, 198, 0.85);
  border-color: rgba(217, 119, 6, 0.28);
}

body.studio-home:not(.light-theme) .competency-tag {
  background: rgba(109, 135, 255, 0.16);
  border-color: rgba(169, 187, 255, 0.3);
  color: #eaf0ff;
}
body.studio-home:not(.light-theme) .competency-tag:nth-child(4n + 2) {
  background: rgba(84, 219, 203, 0.16);
  border-color: rgba(126, 240, 223, 0.32);
}
body.studio-home:not(.light-theme) .competency-tag:nth-child(4n + 3) {
  background: rgba(169, 187, 255, 0.18);
  border-color: rgba(201, 183, 255, 0.34);
}
body.studio-home:not(.light-theme) .competency-tag:nth-child(4n + 4) {
  background: rgba(255, 150, 95, 0.18);
  border-color: rgba(255, 150, 95, 0.34);
}

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

@media (prefers-reduced-motion: no-preference) {
  body.studio-home .competency-tag {
    animation: pill-levitate 4.4s ease-in-out infinite;
  }
  body.studio-home .competency-tag:nth-child(2n) { animation-duration: 5.2s; animation-delay: -1.4s; }
  body.studio-home .competency-tag:nth-child(3n) { animation-duration: 5.8s; animation-delay: -2.8s; }
  body.studio-home .competency-tag:nth-child(4n) { animation-duration: 4.9s; animation-delay: -0.8s; }
}

body.studio-home .competency-tag:hover {
  animation-play-state: paused;
  transform: translateY(-8px) scale(1.06);
  box-shadow: 0 16px 30px -12px rgba(36, 60, 165, 0.42);
}

/* 7. Abdullah-Style Infinite Futuristic Marquee Strip */
.studio-marquee {
  margin-top: 3.5rem;
  padding-block: 1.15rem;
  border-top: 1px solid var(--glass-border);
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.studio-marquee-track {
  display: flex;
  width: max-content;
}

.studio-marquee-group {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  padding-inline-end: 2.5rem;
  flex-shrink: 0;
}

.studio-marquee-group span {
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 1.5vw, 1.15rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  white-space: nowrap;
  opacity: 0.78;
  transition: color 0.25s ease, opacity 0.25s ease;
}

.studio-marquee-group span:hover {
  color: var(--portfolio-accent);
  opacity: 1;
}

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

@media (prefers-reduced-motion: no-preference) {
  .studio-marquee-track {
    animation: marquee-scroll 30s linear infinite;
  }
  .studio-marquee:hover .studio-marquee-track,
  .studio-marquee:focus-within .studio-marquee-track {
    animation-play-state: paused;
  }
}

.studio-marquee + .portfolio-footer {
  margin-top: 0;
}

@media (prefers-reduced-motion: reduce) {
  .scroll-progress-beam { display: none; }
  .studio-marquee-track {
    animation: none;
    flex-wrap: wrap;
    justify-content: center;
    width: auto;
  }
  .studio-marquee-group[aria-hidden="true"] { display: none; }
  .motion-reveal-pending {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
