/* ===== Hero background: gradient + dots + sparkles ===== */
:root {
  --sparkle-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%230156d7' d='M12 0c1 5 3 7 8 8-5 1-7 3-8 8-1-5-3-7-8-8 5-1 7-3 8-8z'/%3E%3C/svg%3E");
}

.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  width: 100%;
  background: linear-gradient(180deg, #dfeefc 0%, #d9ecff 45%, #ffffff 100%);
  padding-block: var(--space-16) calc(var(--space-24) * 1.5);
}
.hero__cta {
  flex-shrink: 0;
  display: inline-block;
  padding: var(--space-3) var(--space-8);
  border-radius: var(--radius-full);
  background: linear-gradient(
    90deg,
    var(--color-blue),
    #c60505,
    var(--color-blue),
    var(--color-blue)
  );
  background-size: 200% 100%;
  color: var(--color-surface);
  font-family: var(--font-en), var(--font-tw);
  font-size: var(--scale-base);
  font-weight: var(--weight-semibold);
  text-decoration: none;
  white-space: nowrap;
  animation: ctaBorderFlow 4s linear infinite;
  transition: color 0.2s ease;
}

@keyframes ctaBorderFlow {
  to {
    background-position: 200% 0;
  }
}
.button_cta {
  display: flex;
  justify-content: center;
  flex-direction: row;
  padding-top: var(--space-4);
}
.hero__cta:hover {
  background: var(--color-blue-hover);
  color: var(--color-surface);
  transition: all 0.3s;
}
/* keep real content above the decorative dot/sparkle/curve layers */
.hero .content__margin {
  position: relative;
  z-index: 2;
}
.hero__curve {
  position: absolute;
  left: 50%;
  bottom: -365%;
  transform: translateX(-50%);
  width: 160%;
  aspect-ratio: 2.4 / 1;
  border-radius: 50%;
  background: #fff;
  z-index: 1;
  pointer-events: none;
}

/* dot grid */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(
    circle,
    rgba(1, 86, 215, 0.35) 1.5px,
    transparent 1.6px
  );
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(
    ellipse 70% 60% at 50% 40%,
    #000 0%,
    transparent 75%
  );
  mask-image: radial-gradient(
    ellipse 70% 60% at 50% 40%,
    #000 0%,
    transparent 75%
  );
  opacity: 0.5;
}

/* scattered sparkles */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    var(--sparkle-svg), var(--sparkle-svg), var(--sparkle-svg),
    var(--sparkle-svg), var(--sparkle-svg), var(--sparkle-svg);
  background-repeat: no-repeat;
  background-size:
    14px 14px,
    10px 10px,
    18px 18px,
    12px 12px,
    16px 16px,
    10px 10px;
  background-position:
    8% 12%,
    92% 8%,
    85% 78%,
    15% 85%,
    50% 6%,
    72% 45%;
  opacity: 0.55;
  animation: hero-sparkle-twinkle 4s ease-in-out infinite;
}

@keyframes hero-sparkle-twinkle {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 0.75;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero::after {
    animation: none;
  }
}

/* keep real content above the decorative layers */
.hero .two__grid {
  position: relative;
  z-index: 1;
}

.hero__intro {
  align-content: center;
  justify-content: center;
  text-align: left;
}
.hero__title {
  font-family: var(--font-en), var(--font-tw);
  font-weight: var(--weight-semibold);
  margin-top: var(--space-8);
  margin-bottom: 0;
  font-size: var(--scale-4xl);
  text-align: center;
  color: var(--color-blue-active);
}

/* fallback for browsers without background-clip: text support */
@supports not (background-clip: text) {
  .hero__title {
    background: none;
    color: var(--color-ink);
    -webkit-text-fill-color: initial;
  }
}
.skill_section__video {
  aspect-ratio: 16 / 9; /* match your actual video ratio */
  width: 100%;
}

.skill_section__video iframe {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
}
.challenge__media img {
  width: 100%;
  max-width: 520px; /* both images cap at the same width */
  margin-inline: auto;
  border-radius: var(--radius-lg);
}
.challenge__intro {
  text-align: center;
  margin-top: var(--space-8);
}
.challenge__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.challenge__item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  color: var(--color-ink);
}

.challenge__check {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin-top: 2px;
}
.challenge__check circle {
  fill: var(--color-blue);
}
.challenge__check path {
  fill: none;
  stroke: var(--color-surface);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ===== xNinja Skills Homepage carousel ===== */
.skills {
  /* padding: clamp(48px, 7vw, 96px) 0; */
  overflow: hidden; /* card peeks must not cause horizontal scroll */
  background: linear-gradient(to top, #ffffff 0%, #d2e9ff 35%, #ffffff00 90%);
}

.skills__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}
.skills__intro {
  display: flex;
  flex-direction: column;
  /* gap: var(--space-5); */
  align-items: center;
  /* padding-bottom: var(--space-12); */
}
.skills__title {
  margin: 0 0 var(--space-4);
  text-align: center;
  font-family: var(--font-en), var(--font-tw);
  font-weight: var(--weight-semibold);
  font-size: var(--scale-2xl);
  color: var(--color-ink);
}

.skills__lead {
  max-width: 760px;
  text-align: center;
  color: var(--color-ink);
}

/* ===== xNinja Skills — icon stepper ===== */
.skills__steps {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 720px;
  margin: 0 auto clamp(28px, 4vw, 48px);
}

.skills__step {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: clamp(48px, 6vw, 60px);
  height: clamp(48px, 6vw, 60px);
  padding: 0;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-ink-secondary);
  cursor: pointer;
  transition:
    background var(--transition-base),
    color var(--transition-base),
    border-color var(--transition-base),
    transform var(--transition-base),
    box-shadow var(--transition-base);
}
.skills__step:hover {
  color: var(--color-blue);
  border-color: var(--color-blue);
  transform: translateY(-1px);
}
.skills__step svg {
  width: 24px;
  height: 24px;
}

.skills__step--active {
  background: var(--color-blue);
  border-color: var(--color-blue);
  color: var(--color-surface);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--color-blue) 28%, transparent);
}
.skills__step--active:hover {
  color: var(--color-surface);
  border-color: var(--color-blue);
}

/* hatched connector between steps */
.skills__step-line {
  flex: 0 0 clamp(48px, 10vw, 120px); /* was: 0 1 clamp(...) */
  height: 12px;
  background-image: repeating-linear-gradient(
    90deg,
    var(--color-ink-tertiary) 0 3px,
    transparent 3px 8px
  );
  opacity: 0.55;
}

@media (max-width: 720px) {
  .skills__step-line {
    flex-basis: clamp(32px, 14vw, 80px);
  }
}
.skills__carousel {
  position: relative;
}

.skills__viewport {
  overflow: hidden;
  touch-action: pan-y;
  cursor: grab;
}
.skills__viewport:active {
  cursor: grabbing;
}

.skills__track {
  position: relative;
  display: flex;
  gap: clamp(16px, 3vw, 32px);
  padding: var(--space-6) 0; /* room for the active card's shadow */
  transition: transform var(--transition-slow);
  will-change: transform;
}

/* cards (inactive look by default) */
.skill-card {
  flex: 0 0 var(--card-w, min(680px, 88vw));
  padding: clamp(20px, 3vw, 32px);
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--color-surface) 50%, transparent);
  border: 1px solid var(--color-border);
  transform: scale(0.9);
  filter: blur(2px);
  opacity: 0.7;
  user-select: none;
  transition:
    transform var(--transition-slow),
    filter var(--transition-slow),
    opacity var(--transition-slow),
    background var(--transition-slow);
}

.skill-card--active {
  z-index: var(--z-raised);
  transform: scale(1);
  filter: none;
  opacity: 1;
  background: color-mix(in srgb, var(--color-surface) 90%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  border-color: var(--color-border);
  box-shadow: var(--shadow-xl);
  cursor: default;
}

.skill-card__title {
  margin: 0 0 clamp(18px, 2.5vw, 26px);
  text-align: center;
  font-family: var(--font-en), var(--font-tw);
  font-weight: var(--weight-semibold);
  font-size: var(--scale-lg);
  color: var(--color-blue);
}

.skill-card__body {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(20px, 3vw, 36px);
  align-items: stretch;
}

/* video placeholder */
.skill-card__video {
  position: relative;
  min-height: 200px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-blue);
  background: color-mix(in srgb, var(--color-surface) 60%, transparent);
  overflow: hidden;
}

.skill-card__play {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--color-ink);
  background: color-mix(in srgb, var(--color-surface) 85%, transparent);
  color: var(--color-ink);
  cursor: pointer;
  transition: transform var(--transition-base);
}
.skill-card__play:hover {
  transform: scale(1.06);
}
.skill-card__play svg {
  margin-left: 3px; /* optical centering of the triangle */
}

.skill-card__text {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.skill-card__desc {
  margin: 0;
  color: var(--color-ink);
}

.skill-card__more {
  align-self: flex-start;
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-full);
  border: 1.5px solid var(--color-blue);
  font-family: var(--font-en), var(--font-tw);
  font-size: var(--scale-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-blue);
  text-decoration: none;
  transition:
    background var(--transition-base),
    color var(--transition-base);
}
.skill-card__more:hover {
  background: var(--color-blue);
  color: var(--color-surface);
}
.skill_section__video {
  position: relative;
  width: 100%;
  border-radius: 12px; /* swap for your radius token if you have one */
  overflow: hidden;
}

.skill_section__media {
  display: block;
  width: 100%;
  height: auto; /* native ratio — avoids the aspect-ratio sizing trap */
  border-radius: 18px;
}

.skill_section__controls {
  position: absolute;
  inset: 0; /* cover the whole video, not just the bottom strip */
  display: flex;
  align-items: center; /* vertical center → transport row floats in the middle */
  justify-content: center; /* horizontal center */
  padding: var(--space-8);
  pointer-events: none; /* scrim never blocks the video */
}

/* transport row — centered, fades in on hover */
.skill_section__controls-group {
  display: inline-flex;
  align-items: center;
  gap: var(--space-12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.skill_section__video:hover .skill_section__controls-group,
.skill_section__video:focus-within .skill_section__controls-group {
  opacity: 1;
  pointer-events: auto;
}

/* touch devices have no hover — keep controls visible */
@media (hover: none) {
  .skill_section__controls {
    opacity: 1;
    pointer-events: auto;
  }
}

.skill_section__controls-group {
  display: inline-flex;
  align-items: center;
  gap: var(--space-12);
}
.skill_section__controls [data-sound-toggle] {
  position: absolute;
  right: var(--space-6);
  bottom: var(--space-6);
  pointer-events: auto;
}
.button-position {
  position: absolute;
  bottom: var(--space-12);
  right: var(--space-8);
}
.spedup-position {
  display: flex;
  position: absolute;
  align-items: center;
  justify-content: center;
}
.skill_section__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: none;
  border-radius: var(--radius-full);
  color: var(--color-surface);
  background: color-mix(in srgb, var(--color-ink) 55%, transparent);
  cursor: pointer;
  transition: background 160ms ease;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.skill_section__btn:hover {
  background: color-mix(in srgb, var(--color-ink) 75%, transparent);
}

.skill_section__btn:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 2px;
}

.skill_section__icon {
  width: 18px;
  height: 18px;
}

/* play/pause icon swap */
.skill_section__icon--pause {
  display: none;
}
.skill_section__btn[data-playing="true"] .skill_section__icon--play {
  display: none;
}
.skill_section__btn[data-playing="true"] .skill_section__icon--pause {
  display: block;
}

/* mute/sound icon swap */
.skill_section__icon--sound {
  display: none;
}
.skill_section__btn[aria-pressed="true"] .skill_section__icon--muted {
  display: none;
}
.skill_section__btn[aria-pressed="true"] .skill_section__icon--sound {
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .skill_section__controls,
  .skill_section__btn {
    transition: none;
  }
}
/* nav arrows */
.skills__nav {
  position: absolute;
  top: 50%;
  z-index: var(--z-raised);
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--color-blue);
  color: var(--color-surface);
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition:
    transform var(--transition-base),
    opacity var(--transition-base);
}
.skills__nav:hover {
  background: var(--color-blue-hover);
  transform: translateY(-50%) scale(1.08);
}
.skills__nav--prev {
  left: clamp(8px, 4vw, 60px);
}
.skills__nav--next {
  right: clamp(8px, 4vw, 60px);
}
.skills__nav:disabled {
  opacity: 0.35;
  cursor: default;
}
.skills__nav:disabled:hover {
  background: var(--color-blue);
  transform: translateY(-50%) scale(1);
}

@media (max-width: 720px) {
  .skill-card {
    --card-w: 88vw;
  }
  .skill-card__body {
    grid-template-columns: 1fr;
  }
  .skills__nav--prev {
    left: 6px;
  }
  .skills__nav--next {
    right: 6px;
  }
}

/* ===== Skills — phone: stacked list, no carousel/icons ===== */
@media (max-width: 720px) {
  /* hide carousel chrome */
  .skills__steps,
  .skills__nav {
    display: none;
  }

  /* breathing room from the screen edges */
  .skills__inner {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }

  /* stack the cards vertically */
  .skills__viewport {
    overflow: visible;
    cursor: default;
  }
  .skills__track {
    flex-direction: column;
    gap: clamp(20px, 5vw, 32px);
    padding: 0;
    transform: none;
    transition: none;
  }

  /* every card reads as a full, static panel — kept inside the gutter */
  .skill-card {
    --card-w: auto;
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box; /* padding stays inside the width */
    transform: none;
    filter: none;
    opacity: 1;
    cursor: default;
    user-select: auto;
    background: var(--color-surface);
    border-color: var(--color-border);
    box-shadow: var(--shadow-lg);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  /* single-column body: video on top, text below */
  .skill-card__body {
    grid-template-columns: 1fr;
    min-width: 0;
  }
  .skill-card__video,
  .skill-card__text {
    min-width: 0;
  }
}

@media (max-width: 860px) {
  .hero {
    padding-block: var(--space-10) calc(var(--space-16) * 1.4);
  }

  .hero__intro {
    text-align: center;
    align-items: center;
  }

  .hero__title {
    font-size: var(
      --scale-4xl
    ); /* one step down now that it's stacked, not sharing width with the video */
  }

  .hero::before {
    background-size: 22px 22px; /* slightly tighter dot grid on a shorter section */
  }

  .hero__curve {
    aspect-ratio: 1.6 / 1;
    bottom: -12%;
  }
}
@media (max-width: 1600px) {
  .hero__curve {
    position: absolute;
    left: 50%;
    bottom: -145%;
    transform: translateX(-50%);
    width: 160%;
    aspect-ratio: 2.4 / 1;
    border-radius: 50%;
    background: #fff;
    z-index: 1;
    pointer-events: none;
  }
}
@media (max-width: 480px) {
  .hero {
    padding-block: var(--space-8) var(--space-12);
  }

  .hero__curve {
    display: none; /* on short viewports the swoop eats too much vertical space relative to content */
  }

  .hero::after {
    opacity: 0.35; /* sparkles get busy at small sizes — dial back rather than remove */
  }
}
