/* ============================================
   2026 MODERN DESIGN SYSTEM
   Trends: Grain Texture, Fluid Typography,
   Infinite Marquee, Status Badge, Ticker,
   Bento Cards, Pill Buttons, Micro-interactions
   ============================================ */

/* ===== GRAIN TEXTURE OVERLAY ===== */
.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9997;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

body.light-theme .grain-overlay {
  opacity: 0.02;
  mix-blend-mode: multiply;
}

/* ===== FLUID TYPOGRAPHY ===== */
.home__name {
  font-size: clamp(2.2rem, 5vw, 4rem) !important;
  line-height: 1.05 !important;
  letter-spacing: -0.03em !important;
}

.home__greeting {
  font-size: clamp(0.85rem, 1.5vw, 1.1rem) !important;
  letter-spacing: 0.15em !important;
  text-transform: uppercase;
  opacity: 0.8;
}

.section__title {
  font-size: clamp(1.5rem, 3.5vw, 2.5rem) !important;
  letter-spacing: -0.02em;
}

.section__subtitle {
  letter-spacing: 0.2em !important;
  text-transform: uppercase !important;
  font-size: 0.72rem !important;
  font-weight: 600;
}

/* ===== STATUS BADGE ===== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 1.2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-color);
  margin-bottom: 1.5rem;
  backdrop-filter: blur(12px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  animation: badge-float 4s ease-in-out infinite;
}

.status-badge__dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}

.status-badge__dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: #10b981;
  opacity: 0.4;
  animation: status-pulse 2s ease-in-out infinite;
}

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

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

body.light-theme .status-badge {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
}

/* ===== EXPERTISE TICKER BANNER ===== */
.ticker-banner {
  overflow: hidden;
  padding: 1.25rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin: 0;
  position: relative;
}

.ticker-banner::before,
.ticker-banner::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 80px;
  z-index: 2;
  pointer-events: none;
}

.ticker-banner::before {
  left: 0;
  background: linear-gradient(to right, var(--body-color), transparent);
}

.ticker-banner::after {
  right: 0;
  background: linear-gradient(to left, var(--body-color), transparent);
}

.ticker-track {
  display: flex;
  gap: 0;
  width: max-content;
  animation: ticker-scroll 25s linear infinite;
  align-items: center;
}

.ticker-track span {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-color-light);
  white-space: nowrap;
  padding: 0 1rem;
}

.ticker-dot {
  color: var(--first-color) !important;
  font-size: 1.4rem !important;
  line-height: 1;
  letter-spacing: 0 !important;
  padding: 0 0.25rem !important;
}

@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

body.light-theme .ticker-banner {
  border-color: rgba(0, 0, 0, 0.06);
}

/* ===== INFINITE MARQUEE SKILLS ===== */
.marquee-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2.5rem;
  width: 100%;
}

.marquee-wrapper {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 6%, black 94%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 6%, black 94%, transparent 100%);
  padding: 0.5rem 0;
}

.marquee-track {
  display: flex;
  gap: 0.85rem;
  width: max-content;
  will-change: transform;
}

.marquee-track--forward {
  animation: marquee-scroll 50s linear infinite;
}

.marquee-track--reverse {
  animation: marquee-scroll 45s linear infinite reverse;
}

.marquee-wrapper:hover .marquee-track {
  animation-play-state: paused;
}

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

.marquee-track .skill__icon-card {
  flex-direction: row !important;
  width: auto !important;
  min-width: auto !important;
  padding: 0.65rem 1.3rem !important;
  gap: 0.65rem !important;
  border-radius: 100px !important;
  white-space: nowrap;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: none !important;
}

.marquee-track .skill__icon-card::before {
  display: none !important;
}

.marquee-track .skill__icon-card:hover {
  transform: translateY(-3px) scale(1.06) !important;
  border-color: var(--first-color) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12),
              0 0 20px hsla(var(--first-hue), var(--sat), var(--lig), 0.15) !important;
}

.marquee-track .skill__icon-card img {
  width: 26px !important;
  height: 26px !important;
  margin-bottom: 0 !important;
}

.marquee-track .skill__icon-card:hover img {
  transform: none !important;
  filter: none !important;
}

.marquee-track .skill__icon-card span {
  font-size: 0.8rem !important;
  margin-top: 0 !important;
  padding: 0 !important;
}

.skills__scroll-wrapper {
  display: none !important;
}

body.light-theme .marquee-track .skill__icon-card {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .marquee-track .skill__icon-card:hover {
  background: rgba(0, 0, 0, 0.06) !important;
  border-color: var(--first-color) !important;
}

/* ===== ABOUT BENTO REFINEMENTS ===== */
.about__box {
  border-radius: 1.25rem !important;
  padding: 1.5rem 1rem !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.about__box:hover {
  border-color: hsla(var(--first-hue), var(--sat), var(--lig), 0.25) !important;
}

.about__title {
  font-size: var(--normal-font-size) !important;
  font-weight: 600;
}

.about__subtitle {
  font-size: var(--small-font-size) !important;
  color: var(--first-color);
  font-weight: 500;
}

.about__description {
  font-size: clamp(0.88rem, 1.2vw, 1rem);
  line-height: 1.85;
}

/* ===== HERO SECTION POLISH ===== */
.home__button .button {
  border-radius: 100px;
  padding: 0.85rem 2rem;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
}

.home__button .button--ghost {
  border-radius: 100px;
}

.home__scroll-icon {
  animation: scroll-bounce 2.5s ease-in-out infinite !important;
}

@keyframes scroll-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* ===== SERVICES NUMBERING ===== */
.services__container {
  counter-reset: service-counter;
}

.services__card {
  counter-increment: service-counter;
}

.services__card .serv {
  position: relative;
}

.services__card .serv::before {
  content: counter(service-counter, decimal-leading-zero);
  font-size: 3.5rem;
  font-weight: 800;
  color: hsla(var(--first-hue), var(--sat), var(--lig), 0.06);
  position: absolute;
  top: -1rem;
  right: -0.25rem;
  line-height: 1;
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  pointer-events: none;
  z-index: 0;
  transition: all 0.4s ease;
}

.services__card:hover .serv::before {
  color: hsla(var(--first-hue), var(--sat), var(--lig), 0.12);
  transform: translateY(-4px);
}

/* ===== MODERN CONTACT FORM ===== */
.contact__form .button {
  border-radius: 100px !important;
  padding: 0.9rem 2.5rem !important;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  width: auto !important;
}

/* ===== CTA SECTION ===== */
.cta-section {
  padding: 6rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-section__bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 60% 50% at 50% 50%,
    hsla(var(--first-hue), var(--sat), var(--lig), 0.08) 0%,
    transparent 100%
  );
  pointer-events: none;
}

.cta-section__container {
  position: relative;
  z-index: 1;
}

.cta-section__badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--first-color);
  background: hsla(var(--first-hue), var(--sat), var(--lig), 0.1);
  padding: 0.4rem 1.1rem;
  border-radius: 100px;
  border: 1px solid hsla(var(--first-hue), var(--sat), var(--lig), 0.15);
  margin-bottom: 1.5rem;
}

.cta-section__title {
  font-size: clamp(1.8rem, 4.5vw, 3rem);
  font-weight: 700;
  color: var(--title-color);
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
}

.cta-section__text {
  font-size: clamp(0.88rem, 1.3vw, 1.05rem);
  color: var(--text-color);
  max-width: 480px;
  margin: 0 auto 2.5rem;
  line-height: 1.75;
}

.cta-section__actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.cta-section__button {
  border-radius: 100px !important;
  padding: 0.9rem 2.2rem !important;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
}

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
  position: fixed;
  bottom: 5.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--first-color);
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1050;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--first-color);
  color: var(--body-color);
  border-color: var(--first-color);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px hsla(var(--first-hue), var(--sat), var(--lig), 0.3);
}

body.light-theme .back-to-top {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .back-to-top:hover {
  background: var(--first-color);
  color: #fff;
}

/* ===== FOOTER MODERN ===== */
.footer {
  border-radius: 2rem 2rem 0 0;
  margin-top: 0;
}

.footer__title {
  font-size: clamp(1.5rem, 3vw, 2rem) !important;
  letter-spacing: -0.02em;
}

.footer__social-link {
  border-radius: 50% !important;
  width: 38px;
  height: 38px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

.footer__list {
  gap: 0.5rem;
}

.footer__link {
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  transition: opacity 0.3s ease;
}

.footer__link:hover {
  opacity: 0.7;
}

.footer__copy {
  font-size: 0.72rem !important;
  letter-spacing: 0.05em;
  opacity: 0.6;
}

/* ===== AI TOOLS MODERN GRID ===== */
.ai-tools__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  max-width: 720px;
  margin: 2.5rem auto 0;
  padding: 0 1rem;
}

.ai-tool-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  padding: 2rem 1.5rem 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 1.5rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.ai-tool-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 1.5rem;
  padding: 1px;
  background: linear-gradient(135deg, transparent 30%, var(--first-color) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.ai-tool-card:hover::before {
  opacity: 1;
}

.ai-tool-card:hover {
  transform: translateY(-6px);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15),
              0 0 40px hsla(var(--first-hue), var(--sat), var(--lig), 0.08);
}

.ai-tool-card img {
  width: 52px;
  height: 52px;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-tool-card:hover img {
  transform: scale(1.15);
}

.ai-tool-card__name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--title-color);
  letter-spacing: 0.02em;
}

.ai-tool-card__tag {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--first-color);
  background: hsla(var(--first-hue), var(--sat), var(--lig), 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  border: 1px solid hsla(var(--first-hue), var(--sat), var(--lig), 0.15);
}

body.light-theme .ai-tool-card {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
}

body.light-theme .ai-tool-card:hover {
  background: rgba(0, 0, 0, 0.04);
}

body.light-theme .ai-tool-card__tag {
  background: hsla(var(--first-hue), var(--sat), var(--lig), 0.08);
  border-color: hsla(var(--first-hue), var(--sat), var(--lig), 0.12);
}

/* ===== AMBIENT GRADIENT ORBS ===== */
.ambient-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.1;
  will-change: transform;
}

.ambient-orb--1 {
  width: 450px;
  height: 450px;
  background: hsl(var(--first-hue), var(--sat), var(--lig));
  top: 5%;
  left: -8%;
  animation: orb-drift-1 25s ease-in-out infinite;
}

.ambient-orb--2 {
  width: 350px;
  height: 350px;
  background: hsl(calc(var(--first-hue) + 60), 75%, 62%);
  top: 55%;
  right: -8%;
  animation: orb-drift-2 30s ease-in-out infinite;
}

.ambient-orb--3 {
  width: 280px;
  height: 280px;
  background: hsl(calc(var(--first-hue) + 120), 65%, 58%);
  bottom: 5%;
  left: 25%;
  animation: orb-drift-3 22s ease-in-out infinite;
}

@keyframes orb-drift-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(60px, 40px) scale(1.1); }
  66% { transform: translate(-30px, 80px) scale(0.95); }
}

@keyframes orb-drift-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-50px, -30px) scale(1.05); }
  66% { transform: translate(40px, -60px) scale(0.9); }
}

@keyframes orb-drift-3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -50px) scale(1.08); }
  66% { transform: translate(-60px, 20px) scale(0.92); }
}

body.light-theme .ambient-orb {
  opacity: 0.06;
  filter: blur(120px);
}

/* ===== CURSOR SPOTLIGHT ON CARDS ===== */
.services__card,
.ai-tool-card,
.contact__card {
  --spot-x: 50%;
  --spot-y: 50%;
}

.services__card::after,
.ai-tool-card::after,
.contact__card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    280px circle at var(--spot-x) var(--spot-y),
    hsla(var(--first-hue), var(--sat), var(--lig), 0.07) 0%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 0;
}

.services__card:hover::after,
.ai-tool-card:hover::after,
.contact__card:hover::after {
  opacity: 1;
}

/* Keep card children above spotlight */
.services__card > *,
.ai-tool-card > *,
.contact__card > * {
  position: relative;
  z-index: 1;
}

/* ===== ANIMATED COUNTER ===== */
.counter {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  min-width: 1.5ch;
}

/* ===== ABOUT BUTTONS ROW ===== */
.about__buttons {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.about__resume-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
}

.about__resume-btn i {
  font-size: 1.1rem;
}

@media screen and (min-width: 992px) {
  .about__buttons {
    justify-content: flex-start;
  }
}

@media screen and (max-width: 991px) {
  .about__buttons {
    justify-content: center;
  }
}

/* ===== TEXT SCRAMBLE EFFECT ===== */
.home__name[data-scramble] {
  font-family: 'Courier New', monospace;
  letter-spacing: 0.02em;
}

/* ===== 3D TILT CARDS ===== */
.tilt-card {
  transform-style: preserve-3d;
  will-change: transform;
}

.tilt-card > * {
  transform: translateZ(20px);
}

/* ===== ANIMATED SHIMMER ON CTA TITLE ===== */
.cta-section__title {
  background: linear-gradient(
    90deg,
    var(--title-color) 0%,
    var(--first-color) 40%,
    hsl(calc(var(--first-hue) + 60), 80%, 70%) 60%,
    var(--title-color) 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer-text 4s ease-in-out infinite;
}

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

/* ===== GLOW PULSE ON PRIMARY BUTTONS ===== */
.button:not(.button--ghost) {
  position: relative;
}

.button:not(.button--ghost)::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  background: var(--gradient-primary);
  z-index: -1;
  opacity: 0;
  filter: blur(12px);
  transition: opacity 0.4s ease;
}

.button:not(.button--ghost):hover::after {
  opacity: 0.6;
  animation: glow-pulse 1.5s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.4; filter: blur(12px); }
  50% { opacity: 0.7; filter: blur(18px); }
}

/* ===== SMOOTH TRANSITIONS ===== */
.section {
  transition: opacity 0.6s ease, transform 0.6s ease !important;
}

/* ===== ENHANCED SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 5px !important;
}

::-webkit-scrollbar-thumb {
  border-radius: 100px !important;
  background: hsla(var(--first-hue), var(--sat), var(--lig), 0.25) !important;
}

::-webkit-scrollbar-track {
  background: transparent !important;
}

/* ===== SELECTION ===== */
::selection {
  background: hsla(var(--first-hue), var(--sat), var(--lig), 0.3);
  color: var(--title-color);
}

/* ===== RESPONSIVE ===== */
@media screen and (max-width: 630px) {
  .home__name {
    font-size: clamp(1.8rem, 9vw, 2.5rem) !important;
  }

  .marquee-track .skill__icon-card {
    padding: 0.55rem 1rem !important;
  }

  .marquee-track .skill__icon-card img {
    width: 22px !important;
    height: 22px !important;
  }

  .marquee-track .skill__icon-card span {
    font-size: 0.72rem !important;
  }

  .status-badge {
    font-size: 0.65rem;
    padding: 0.35rem 0.9rem;
  }

  .ticker-track span {
    font-size: 0.7rem;
    padding: 0 0.75rem;
  }

  .services__card .serv::before {
    font-size: 2.5rem;
    top: -0.5rem;
    right: 0;
  }

  .ai-tools__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
    max-width: 100%;
  }

  .ai-tool-card {
    padding: 1.5rem 1rem 1.25rem;
    gap: 0.65rem;
  }

  .ai-tool-card img {
    width: 42px;
    height: 42px;
  }

  .ai-tool-card__name {
    font-size: 0.82rem;
  }

  .ai-tool-card__tag {
    font-size: 0.58rem;
    padding: 0.2rem 0.6rem;
  }

  .cta-section {
    padding: 4rem 1rem;
  }

  .cta-section__actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  .cta-section__button {
    width: 100%;
    text-align: center;
  }

  .back-to-top {
    bottom: 5rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
}

@media screen and (min-width: 992px) {
  .marquee-track .skill__icon-card {
    padding: 0.75rem 1.5rem !important;
  }

  .marquee-track .skill__icon-card img {
    width: 30px !important;
    height: 30px !important;
  }

  .marquee-track .skill__icon-card span {
    font-size: 0.85rem !important;
  }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  .marquee-track,
  .ticker-track {
    animation: none !important;
  }

  .status-badge {
    animation: none !important;
  }

  .status-badge__dot::after {
    animation: none !important;
  }

  .ambient-orb {
    animation: none !important;
  }
}
