html {
  scroll-behavior: smooth;
}

:root {
  color-scheme: dark;
  --page-bg: #050816;
  --surface: #0b1020;
  --surface-soft: rgba(255, 255, 255, .04);
  --text-color: #fff;
  --muted-color: rgba(255, 255, 255, .58);
  --border-color: rgba(255, 255, 255, .1);
  --header-color: rgba(5, 8, 22, .9);
  --accent-color: #fff;
  --accent-text-color: #050816;
}

html[data-theme="light"] {
  color-scheme: light;
  --page-bg: #f4f6fb;
  --surface: #fff;
  --surface-soft: rgba(20, 30, 55, .045);
  --text-color: #151a2a;
  --muted-color: rgba(21, 26, 42, .66);
  --border-color: rgba(21, 26, 42, .13);
  --header-color: rgba(244, 246, 251, .92);
  --accent-color: #151a2a;
  --accent-text-color: #fff;
  --tag-bg: #e7eaf1;
  --tag-text: #354057;
  --tag-border: #d1d7e2;
}

html[data-theme="colorful"] {
  color-scheme: dark;
  --page-bg: #0b0820;
  --surface: #17122f;
  --surface-soft: rgba(167, 139, 250, .08);
  --text-color: #fff;
  --muted-color: rgba(230, 224, 255, .68);
  --border-color: rgba(196, 181, 253, .2);
  --header-color: rgba(11, 8, 32, .92);
  --accent-color: #a78bfa;
  --accent-text-color: #160d30;
}

body,
body main {
  background-color: var(--page-bg) !important;
  color: var(--text-color) !important;
}

body header {
  border-color: var(--border-color) !important;
  background-color: var(--header-color) !important;
}

body #mobile-menu {
  border-color: var(--border-color) !important;
  background-color: var(--surface) !important;
}

body footer {
  border-color: var(--border-color) !important;
  background-color: var(--surface) !important;
}

body [class*="bg-[#"] {
  background-color: var(--surface) !important;
}

body main[class*="bg-[#"] {
  background-color: var(--page-bg) !important;
}

body [class*="bg-white/"][class*="border"] {
  background-color: var(--surface-soft) !important;
}

body [class~="bg-white"] {
  background-color: var(--accent-color) !important;
  color: var(--accent-text-color) !important;
}

body [class*="text-white/"] {
  color: var(--muted-color) !important;
}

body [class~="text-white"] {
  color: var(--text-color) !important;
}

body [class*="border-white/"] {
  border-color: var(--border-color) !important;
}

body .hero-core-icon {
  background-color: var(--accent-color);
}

body .hero-visual {
  isolation: isolate;
}

body .hero-visual::before,
body .hero-visual::after {
  position: absolute;
  inset: 2%;
  z-index: 0;
  pointer-events: none;
  content: "";
}

html:not([data-theme="light"]):not([data-theme="colorful"]) body .hero-visual::before {
  opacity: .62;
  background-image:
    radial-gradient(1px 1px at 8% 18%, #fff 55%, transparent 100%),
    radial-gradient(1.5px 1.5px at 17% 72%, #d9d3ff 55%, transparent 100%),
    radial-gradient(1px 1px at 27% 36%, #fff 55%, transparent 100%),
    radial-gradient(1px 1px at 38% 88%, #c4b5fd 55%, transparent 100%),
    radial-gradient(1.5px 1.5px at 48% 12%, #fff 55%, transparent 100%),
    radial-gradient(1px 1px at 61% 81%, #fff 55%, transparent 100%),
    radial-gradient(1px 1px at 70% 29%, #d9d3ff 55%, transparent 100%),
    radial-gradient(1.5px 1.5px at 82% 62%, #fff 55%, transparent 100%),
    radial-gradient(1px 1px at 93% 14%, #c4b5fd 55%, transparent 100%),
    radial-gradient(1px 1px at 5% 43%, #c4b5fd 55%, transparent 100%),
    radial-gradient(1.5px 1.5px at 13% 91%, #fff 55%, transparent 100%),
    radial-gradient(1px 1px at 22% 56%, #fff 55%, transparent 100%),
    radial-gradient(1px 1px at 32% 7%, #d9d3ff 55%, transparent 100%),
    radial-gradient(1.5px 1.5px at 43% 48%, #fff 55%, transparent 100%),
    radial-gradient(1px 1px at 57% 26%, #c4b5fd 55%, transparent 100%),
    radial-gradient(1px 1px at 65% 68%, #fff 55%, transparent 100%),
    radial-gradient(1.5px 1.5px at 74% 86%, #d9d3ff 55%, transparent 100%),
    radial-gradient(1px 1px at 86% 34%, #fff 55%, transparent 100%),
    radial-gradient(1px 1px at 96% 77%, #c4b5fd 55%, transparent 100%);
}

html:not([data-theme="light"]):not([data-theme="colorful"]) body .hero-visual::after {
  opacity: .38;
  background-image:
    radial-gradient(1px 1px at 12% 52%, #fff 55%, transparent 100%),
    radial-gradient(1px 1px at 23% 9%, #c4b5fd 55%, transparent 100%),
    radial-gradient(1.5px 1.5px at 34% 64%, #fff 55%, transparent 100%),
    radial-gradient(1px 1px at 54% 42%, #d9d3ff 55%, transparent 100%),
    radial-gradient(1px 1px at 67% 93%, #fff 55%, transparent 100%),
    radial-gradient(1.5px 1.5px at 77% 15%, #fff 55%, transparent 100%),
    radial-gradient(1px 1px at 89% 45%, #c4b5fd 55%, transparent 100%),
    radial-gradient(1px 1px at 4% 83%, #fff 55%, transparent 100%),
    radial-gradient(1.5px 1.5px at 19% 28%, #c4b5fd 55%, transparent 100%),
    radial-gradient(1px 1px at 29% 96%, #d9d3ff 55%, transparent 100%),
    radial-gradient(1px 1px at 41% 19%, #fff 55%, transparent 100%),
    radial-gradient(1.5px 1.5px at 51% 73%, #c4b5fd 55%, transparent 100%),
    radial-gradient(1px 1px at 63% 8%, #fff 55%, transparent 100%),
    radial-gradient(1px 1px at 72% 51%, #d9d3ff 55%, transparent 100%),
    radial-gradient(1.5px 1.5px at 84% 91%, #fff 55%, transparent 100%),
    radial-gradient(1px 1px at 97% 25%, #c4b5fd 55%, transparent 100%);
}

body .hero-float {
  left: 50%;
  top: 50%;
  offset-anchor: center;
  offset-rotate: 0deg;
  offset-position: normal;
  offset-distance: var(--hero-orbit-start, 0%);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

body .hero-float-outer {
  offset-path: circle(40% at 50% 50%);
}

body .hero-float-inner {
  offset-path: circle(31% at 50% 50%);
}

body .hero-orbit {
  z-index: 1;
}

body .hero-core {
  z-index: 2;
}

body .hero-float {
  z-index: 3;
}

body .hero-float-one {
  --hero-orbit-start: 0%;
}

body .hero-float-two {
  --hero-orbit-start: 87.5%;
}

body .hero-float-three {
  --hero-orbit-start: 50%;
}

body .hero-float-four {
  --hero-orbit-start: 62.5%;
}

body .hero-float-five {
  --hero-orbit-start: 25%;
}

body .hero-float-six {
  --hero-orbit-start: 37.5%;
}

body .hero-float-seven {
  --hero-orbit-start: 75%;
}

body .hero-float-eight {
  --hero-orbit-start: 12.5%;
}

body .hero-float.is-dragging,
body .hero-float.is-manually-positioned {
  left: calc(50% + var(--drag-x, 0px));
  top: calc(50% + var(--drag-y, 0px));
  offset-path: none;
  transform: translate(-50%, -50%);
}

body .hero-float.is-dragging {
  z-index: 20;
  cursor: grabbing;
  transition: none;
}

body .theme-control {
  border-color: var(--border-color);
  background-color: var(--surface-soft);
}

body .theme-select,
body .theme-select option {
  color: var(--text-color);
}

body .theme-select option {
  background-color: var(--surface);
}

body .project-card,
body .career-card {
  border-color: var(--border-color);
  background-color: var(--surface-soft);
}

html[data-theme="light"] #technology .tag {
  border-color: var(--tag-border);
  background-color: var(--tag-bg);
  color: var(--tag-text);
}

.project-card {
  transition: transform 220ms ease, border-color 220ms ease,
    background-color 220ms ease;
}

.project-icon {
  display: flex;
  width: 2.75rem;
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  border-radius: .8rem;
}

.back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 60;
  display: flex;
  width: 2.75rem;
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: .9rem;
  background: var(--surface);
  color: var(--text-color);
  opacity: 0;
  pointer-events: none;
  transform: translateY(.5rem);
  transition: opacity 180ms ease, transform 180ms ease;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.floating-whatsapp {
  position: fixed;
  right: 1.25rem;
  bottom: 4.75rem;
  z-index: 59;
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 9999px;
  background: #128c7e;
  padding: .7rem 1rem;
  color: #fff;
  font-size: .875rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  transition: background-color 180ms ease, transform 180ms ease;
}

.floating-whatsapp:hover {
  background: #0f766e;
  transform: translateY(-2px);
}

.floating-whatsapp:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.floating-whatsapp svg {
  width: 1.15rem;
  height: 1.15rem;
}

.landing-main > section:not(#home) {
  padding-block: clamp(3.5rem, 7vw, 5.5rem) !important;
}

body main:not(.landing-main) > section:not(:first-of-type) {
  padding-block: clamp(3rem, 6vw, 4.5rem) !important;
}

@media (prefers-reduced-motion: no-preference) {
  html.has-reveal [data-reveal] {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 650ms ease, transform 650ms cubic-bezier(.2, .7, .2, 1);
  }

  html.has-reveal [data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
  }

  .career-card {
    transition: transform 220ms ease, border-color 220ms ease,
      background-color 220ms ease;
  }

  .career-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, .24);
    background-color: rgba(255, 255, 255, .055);
  }

  .project-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-color);
  }

  .career-orb {
    animation: career-drift 8s ease-in-out infinite alternate;
  }

  html:not([data-theme="light"]):not([data-theme="colorful"]) body .hero-visual::before,
  html:not([data-theme="light"]):not([data-theme="colorful"]) body .hero-visual::after {
    animation: hero-stars-twinkle 4s ease-in-out infinite alternate;
  }

  html:not([data-theme="light"]):not([data-theme="colorful"]) body .hero-visual::after {
    animation-delay: -2s;
  }

  .hero-orbit {
    animation: hero-orbit-spin 32s linear infinite;
  }

  .hero-orbit::after {
    position: absolute;
    top: 50%;
    left: -3px;
    width: 6px;
    height: 6px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, .65);
    box-shadow: 0 0 14px 3px rgba(255, 255, 255, .2);
    content: "";
  }

  .hero-orbit-inner::after {
    background: rgba(167, 139, 250, .9);
    box-shadow: 0 0 16px 4px rgba(139, 92, 246, .32);
  }

  .hero-orbit-outer {
    animation-direction: reverse;
    animation-duration: 46s;
  }

  .hero-orbit-outer::after {
    opacity: .6;
  }

  .hero-core {
    animation: hero-core-breathe 5s ease-in-out infinite;
  }

  .hero-core-icon {
    animation: hero-icon-glow 5s ease-in-out infinite;
  }

  .hero-float {
    animation: hero-chip-orbit 48s linear infinite;
  }

  .hero-float-inner {
    animation-direction: reverse;
    animation-duration: 38s;
  }

  .hero-float-one {
    animation-delay: 0s;
  }

  .hero-float-two {
    animation-delay: -4.75s;
  }

  .hero-float-three {
    animation-delay: -12s;
  }

  .hero-float-four {
    animation-delay: -14s;
  }

  .hero-float-five {
    animation-delay: -24s;
  }

  .hero-float-six {
    animation-delay: -23s;
  }

  .hero-float-seven {
    animation-delay: -36s;
  }

  .hero-float-eight {
    animation-delay: -33s;
  }

}

@media (max-width: 639px) {
  .landing-main > section:not(#home) {
    padding-block: 3.5rem !important;
  }

  body main:not(.landing-main) > section:not(:first-of-type) {
    padding-block: 3rem !important;
  }

  body .hero-float-inner {
    offset-path: circle(30% at 50% 50%);
  }
}

@keyframes career-drift {
  from {
    transform: translate3d(0, -8px, 0);
  }

  to {
    transform: translate3d(0, 12px, 0);
  }
}

@keyframes hero-orbit-spin {
  to {
    transform: rotate(1turn);
  }
}

@keyframes hero-chip-orbit {
  from {
    offset-distance: 0%;
  }

  to {
    offset-distance: 100%;
  }
}

@keyframes hero-core-breathe {
  0%,
  100% {
    box-shadow: 0 25px 50px -20px rgba(0, 0, 0, .7);
  }

  50% {
    box-shadow: 0 25px 55px -16px rgba(139, 92, 246, .24);
  }
}

@keyframes hero-icon-glow {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }

  50% {
    box-shadow: 0 0 28px 2px rgba(255, 255, 255, .14);
  }
}

@keyframes hero-stars-twinkle {
  from {
    opacity: .28;
  }

  to {
    opacity: .72;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
