/* ============================================================
   Tech stack — brand colors & icons
   Python · HTML5 · CSS3 · JavaScript · React · MongoDB · MySQL · Django
   ============================================================ */

:root {
  --tech-python-blue: #3776ab;
  --tech-python-yellow: #ffd43b;
  --tech-html: #e34f26;
  --tech-css: #1572b6;
  --tech-js: #f7df1e;
  --tech-js-text: #1a1a1a;
  --tech-react: #61dafb;
  --tech-react-text: #149eca;
  --tech-mysql: #00758f;
  --tech-mysql-light: #f29111;
  --tech-mongo: #439934;
  --tech-mongo-text: #439934;
  --tech-node: #339933;
  --tech-express: #404040;
  --tech-django: #092e20;
  --tech-django-light: #44b78b;

  /* Unified icon scale */
  --tech-icon-hero: 28px;
  --tech-icon-course: 38px;
  --tech-icon-course-mini: 34px;
  --tech-icon-stack: 52px;
}

/* ---------- Icon images ---------- */
.tech-img {
  display: block;
  object-fit: contain;
  flex-shrink: 0;
  max-width: none;
  width: var(--tech-icon-size, 40px);
  height: var(--tech-icon-size, 40px);
}

.tech-img--xs { --tech-icon-size: 34px; }
.tech-img--sm { --tech-icon-size: 38px; }
.tech-img--md { --tech-icon-size: 40px; }
.tech-img--lg { --tech-icon-size: 52px; }

/* Fixed-size tile */
.tech-icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: var(--tech-icon-box, 48px);
  height: var(--tech-icon-box, 48px);
}

.tech-icon-box .tech-img {
  width: calc(var(--tech-icon-box, 48px) - 10px);
  height: calc(var(--tech-icon-box, 48px) - 10px);
}

/* ---------- Hero ecosystem orbit — service cards ---------- */
.hero__orbit-wrap {
  position: relative;
  width: var(--hero-orbit-size, 520px);
  height: var(--hero-orbit-size, 520px);
  flex-shrink: 0;
  margin: 0;
  overflow: visible;
}

.hero__orbit {
  width: 100%;
  height: 100%;
}

.ecosystem-journey {
  display: none;
}

.ecosystem-card {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  gap: clamp(0.55rem, calc(0.45rem + var(--hero-orbit-size, 520px) * 0.00038), 0.65rem);
  padding:
    clamp(0.55rem, calc(0.45rem + var(--hero-orbit-size, 520px) * 0.00038), 0.65rem)
    clamp(0.72rem, calc(0.6rem + var(--hero-orbit-size, 520px) * 0.0005), 0.85rem)
    clamp(0.55rem, calc(0.45rem + var(--hero-orbit-size, 520px) * 0.00038), 0.65rem)
    clamp(0.55rem, calc(0.45rem + var(--hero-orbit-size, 520px) * 0.00038), 0.65rem);
  width: max-content;
  min-width: clamp(10.5rem, calc(10rem + var(--hero-orbit-size, 520px) * 0.0043), 12.25rem);
  flex-shrink: 0;
  background: #ffffff;
  border: 1px solid rgba(139, 92, 246, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(17, 17, 20, 0.06), 0 1px 3px rgba(17, 17, 20, 0.04);
  z-index: 3;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  pointer-events: auto;
  opacity: 0;
  transform: translate(-50%, -50%) rotate(var(--orbit-angle, 0deg)) translateY(calc(-1 * var(--orbit-r, 210px))) rotate(calc(-1 * var(--orbit-angle, 0deg)));
  transition:
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.35s ease,
    filter 0.35s ease;
  animation: ecosystem-float 5.5s ease-in-out infinite;
  animation-delay: var(--float-delay, 0s);
}

.hero.is-loaded .ecosystem-card {
  animation:
    ecosystem-enter 0.55s cubic-bezier(0.4, 0, 0.2, 1) forwards,
    ecosystem-float 5.5s ease-in-out infinite;
  animation-delay: var(--enter-delay, 0s), calc(var(--enter-delay, 0s) + 0.55s);
}

.ecosystem-card--backend   { --float-delay: 0.3s; z-index: 4; }
.ecosystem-card--database  { --float-delay: 0.6s; z-index: 4; }
.ecosystem-card--frontend  { --float-delay: 0.9s; z-index: 4; }
.ecosystem-card--ai        { --float-delay: 1.2s; z-index: 5; }
.ecosystem-card--placement { --float-delay: 1.5s; z-index: 5; }

.ecosystem-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: clamp(2rem, calc(1.75rem + var(--hero-orbit-size, 520px) * 0.00048), 2.25rem);
  height: clamp(2rem, calc(1.75rem + var(--hero-orbit-size, 520px) * 0.00048), 2.25rem);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.12) 0%, rgba(109, 40, 217, 0.06) 100%);
  color: var(--purple-600);
}

.ecosystem-card__icon svg {
  width: clamp(18px, calc(16px + var(--hero-orbit-size, 520px) * 0.0115), 22px);
  height: clamp(18px, calc(16px + var(--hero-orbit-size, 520px) * 0.0115), 22px);
}

.ecosystem-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.ecosystem-card__title {
  font-size: clamp(0.6875rem, calc(0.625rem + var(--hero-orbit-size, 520px) * 0.00024), 0.75rem);
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-primary);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.ecosystem-card__desc {
  font-size: clamp(0.5625rem, calc(0.5rem + var(--hero-orbit-size, 520px) * 0.00024), 0.625rem);
  font-weight: 400;
  line-height: 1.35;
  color: var(--text-muted);
  white-space: nowrap;
}

.ecosystem-card:hover,
.ecosystem-card:focus-visible {
  z-index: 10;
}

.ecosystem-card:hover {
  border-color: rgba(139, 92, 246, 0.45);
  box-shadow:
    0 8px 32px rgba(139, 92, 246, 0.22),
    0 2px 8px rgba(17, 17, 20, 0.06);
  transform: translate(-50%, -50%) rotate(var(--orbit-angle, 0deg)) translateY(calc(-1 * var(--orbit-r, 210px) - 3px)) rotate(calc(-1 * var(--orbit-angle, 0deg)));
}

.ecosystem-card:focus-visible {
  outline: 2px solid var(--purple-500);
  outline-offset: 3px;
}

.hero__orbit-wrap:has(.ecosystem-card:hover) .ecosystem-card:not(:hover) {
  opacity: 0.42;
  filter: saturate(0.65);
}

.hero__orbit-wrap:has(.ecosystem-card:hover) .ecosystem-card:hover {
  opacity: 1;
  filter: none;
}

@keyframes ecosystem-enter {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--orbit-angle, 0deg)) translateY(calc(-1 * var(--orbit-r, 210px) + 8px)) rotate(calc(-1 * var(--orbit-angle, 0deg)));
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(var(--orbit-angle, 0deg)) translateY(calc(-1 * var(--orbit-r, 210px))) rotate(calc(-1 * var(--orbit-angle, 0deg)));
  }
}

@keyframes ecosystem-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -5px; }
}

[data-theme="dark"] .ecosystem-card {
  background: rgba(22, 22, 28, 0.92);
  border-color: rgba(139, 92, 246, 0.18);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(139, 92, 246, 0.06);
}

[data-theme="dark"] .ecosystem-card__icon {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(109, 40, 217, 0.08) 100%);
  color: var(--purple-400);
}

[data-theme="dark"] .ecosystem-card:hover {
  box-shadow:
    0 8px 36px rgba(139, 92, 246, 0.28),
    0 0 0 1px rgba(139, 92, 246, 0.2);
}

/* ---------- Tech stack section ---------- */
.tech-stack {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 4.5rem 0;
}

.tech-stack__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--grid-gap, 1rem);
  max-width: 100%;
}

.tech-stack__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  gap: 0.75rem;
  padding: 1.35rem 0.65rem;
  min-width: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.tech-stack__item .tech-icon-box {
  --tech-icon-box: 72px;
  margin: 0 auto;
}

.tech-stack__item .tech-icon-box .tech-img {
  width: var(--tech-icon-stack);
  height: var(--tech-icon-stack);
}

.tech-stack__item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.tech-stack__name {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
  max-width: 100%;
}

.tech-stack__hint {
  display: block;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: -0.35rem;
  line-height: 1.3;
}

.tech-stack__item--python:hover { border-color: var(--tech-python-blue); }
.tech-stack__item--python .tech-stack__name { color: var(--tech-python-blue); }

.tech-stack__item--html:hover { border-color: var(--tech-html); }
.tech-stack__item--html .tech-stack__name { color: var(--tech-html); }

.tech-stack__item--css:hover { border-color: var(--tech-css); }
.tech-stack__item--css .tech-stack__name { color: var(--tech-css); }

.tech-stack__item--js:hover { border-color: var(--tech-js); }
.tech-stack__item--js .tech-stack__name { color: var(--tech-js-text); }

.tech-stack__item--react:hover { border-color: var(--tech-react); }
.tech-stack__item--react .tech-stack__name { color: var(--tech-react-text); }

.tech-stack__item--mongodb:hover { border-color: var(--tech-mongo); }
.tech-stack__item--mongodb .tech-stack__name { color: var(--tech-mongo-text); }

.tech-stack__item--mysql:hover { border-color: var(--tech-mysql); }
.tech-stack__item--mysql .tech-stack__name { color: var(--tech-mysql); }

.tech-stack__item--django:hover { border-color: var(--tech-django-light); }
.tech-stack__item--django .tech-stack__name { color: var(--tech-django-light); }

[data-theme="dark"] .tech-stack__item--js .tech-stack__name {
  color: var(--tech-js);
}

[data-theme="dark"] .tech-stack__item--react .tech-stack__name {
  color: var(--tech-react);
}

[data-theme="dark"] .tech-stack__item--mongodb .tech-stack__name {
  color: var(--tech-mongo);
}

/* ---------- Course card icons ---------- */
.course-card__tech {
  display: flex;
  align-items: center;
  min-height: 48px;
  margin-bottom: 1.25rem;
}

.course-card__tech > .tech-img {
  width: var(--tech-icon-course);
  height: var(--tech-icon-course);
}

.course-card__tech-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.course-card__tech-group--mern {
  gap: 0.55rem;
}

.course-card__tech-group--mern .tech-img {
  width: 38px;
  height: 38px;
}

.course-card__tech-group .tech-img {
  width: var(--tech-icon-course);
  height: var(--tech-icon-course);
}

.tech-stack-mini {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  max-width: 100%;
}

.tech-stack-mini .tech-img {
  width: var(--tech-icon-course-mini);
  height: var(--tech-icon-course-mini);
}

.course-card--featured .course-card__tech {
  min-height: 48px;
  margin-bottom: 1rem;
}

.course-card:has(.course-card__tech) .course-card__num {
  display: none;
}

/* Light theme */
[data-theme="light"] .tech-stack__item {
  background: #ffffff;
  box-shadow: 0 2px 12px rgba(17, 17, 20, 0.06);
  border-color: rgba(17, 17, 20, 0.08);
}

[data-theme="light"] .tech-stack {
  background: var(--bg-primary);
}

/* ---------- Responsive — tech stack & orbit ---------- */

/* Tablet — stacked hero layout (768–1199) */
@media (min-width: 768px) and (max-width: 1199px) {
  .tech-stack__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--grid-gap, 1.25rem);
  }
}

/* Mobile — compact two-column tech grid; decorative orbit is removed */
@media (max-width: 767px) {
  .tech-stack__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--grid-gap, 1rem);
  }

  .hero__visual {
    display: none;
  }

  .ecosystem-journey {
    display: none;
    grid-column: 1 / -1;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
  }

  .ecosystem-journey__intro {
    text-align: left;
    padding-top: 1.5rem;
    margin-top: 1.25rem;
    border-top: 1px solid var(--border);
  }

  .ecosystem-journey__eyebrow {
    margin: 0;
    font-size: clamp(0.8125rem, 3.5vw, 0.9375rem);
    font-weight: 600;
    letter-spacing: var(--tracking-normal);
    text-transform: none;
    color: var(--text-primary);
    line-height: 1.3;
  }

  .ecosystem-journey__cards {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    width: 100%;
    margin-top: 1rem;
  }

  .ecosystem-journey__step {
    display: flex;
    align-items: center;
    gap: clamp(0.65rem, 3vw, 0.85rem);
    width: 100%;
    min-height: 3.75rem;
    padding: clamp(0.8rem, 3.2vw, 0.9rem) clamp(0.85rem, 3.5vw, 1rem);
    background: #ffffff;
    border: 1px solid rgba(139, 92, 246, 0.12);
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 10px rgba(17, 17, 20, 0.04);
    text-decoration: none;
    color: inherit;
    opacity: 0;
    transform: translateY(8px);
    transition:
      border-color 0.25s ease,
      box-shadow 0.25s ease,
      transform 0.25s ease;
  }

  .hero.is-loaded .ecosystem-journey__step {
    animation: journey-step-enter 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-delay: calc(0.07s * var(--step-index, 1));
  }

  .ecosystem-journey__step:active {
    border-color: rgba(139, 92, 246, 0.35);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.12);
  }

  .ecosystem-journey__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12) 0%, rgba(109, 40, 217, 0.06) 100%);
    color: var(--purple-600);
  }

  .ecosystem-journey__body {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    flex: 1;
    text-align: left;
  }

  .ecosystem-journey__body strong {
    font-size: clamp(0.8125rem, 3.5vw, 0.875rem);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .ecosystem-journey__body small {
    font-size: clamp(0.6875rem, 3vw, 0.75rem);
    color: var(--text-muted);
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  [data-theme="dark"] .ecosystem-journey__step {
    background: rgba(22, 22, 28, 0.92);
    border-color: rgba(139, 92, 246, 0.18);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  }

  [data-theme="dark"] .ecosystem-journey__icon {
    color: var(--purple-400);
  }
}

@keyframes journey-step-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 480px) {
  .ecosystem-journey__intro {
    padding-top: 1.25rem;
    margin-top: 1rem;
  }

  .tech-stack__item {
    padding: 1.15rem 0.75rem;
  }
}