/* Titan Coders — Shared Components */

/* Buttons */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: 0.95rem 1.6rem;
  border: 1px solid var(--surface-line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--text-hi);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  overflow: hidden;
  transition: border-color var(--dur-sm) var(--ease-out),
    background var(--dur-sm) var(--ease-out),
    transform var(--dur-sm) var(--ease-out),
    color var(--dur-sm) var(--ease-out);
  will-change: transform;
  isolation: isolate;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--grad-core);
  opacity: 0;
  transition: opacity var(--dur-sm) var(--ease-out);
  z-index: -1;
}

.btn:hover {
  border-color: transparent;
  color: var(--text-hi);
}

.btn:hover::before {
  opacity: 1;
}

.btn--primary {
  background: var(--grad-core);
  border-color: transparent;
  color: var(--text-hi);
  box-shadow: 0 0 0 rgba(124, 92, 255, 0);
  transition: border-color var(--dur-sm) var(--ease-out),
    background var(--dur-sm) var(--ease-out),
    transform var(--dur-sm) var(--ease-out),
    color var(--dur-sm) var(--ease-out),
    box-shadow var(--dur-sm) var(--ease-out),
    filter var(--dur-sm) var(--ease-out);
}

.btn--primary::before {
  display: none;
}

.btn--primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 10px 40px rgba(124, 92, 255, 0.35);
}

.btn--ghost {
  background: transparent;
}

.btn[disabled],
.btn.is-loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn__spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

.btn.is-loading .btn__spinner {
  display: block;
}

.btn.is-loading .btn__label {
  opacity: 0.6;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Chips / tags */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--surface-line);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mid);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color var(--dur-sm) var(--ease-out),
    color var(--dur-sm) var(--ease-out),
    box-shadow var(--dur-sm) var(--ease-out),
    transform var(--dur-sm) var(--ease-out);
}

.chip:hover {
  border-color: rgba(70, 224, 255, 0.45);
  color: var(--text-hi);
  box-shadow: 0 0 24px rgba(70, 224, 255, 0.15);
  transform: translateY(-2px);
}

/* Surface / card */
.surface {
  background: var(--surface-card);
  border: 1px solid var(--surface-card-line);
  border-radius: var(--radius-md);
}

/* Form */
.form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.form__group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.form__label {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-low);
}

.form__input,
.form__textarea {
  width: 100%;
  padding: 0.95rem 1.1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--surface-line);
  border-radius: var(--radius-xs);
  color: var(--text-hi);
  transition: border-color var(--dur-sm) var(--ease-out),
    box-shadow var(--dur-sm) var(--ease-out);
}

.form__input:focus,
.form__textarea:focus {
  outline: none;
  border-color: rgba(70, 224, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(70, 224, 255, 0.15);
}

.form__input::placeholder,
.form__textarea::placeholder {
  color: var(--text-low);
}

.form__textarea {
  min-height: 140px;
  resize: vertical;
}

.form__textarea--lg {
  min-height: 180px;
}

.form__select {
  width: 100%;
  padding: 0.95rem 2.6rem 0.95rem 1.1rem;
  background-color: rgba(255, 255, 255, 0.03);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='%238a93b0' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  border: 1px solid var(--surface-line);
  border-radius: var(--radius-xs);
  color: var(--text-hi);
  appearance: none;
  cursor: pointer;
  transition: border-color var(--dur-sm) var(--ease-out),
    box-shadow var(--dur-sm) var(--ease-out);
}

.form__select:focus {
  outline: none;
  border-color: rgba(70, 224, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(70, 224, 255, 0.15);
}

.form__select option {
  color: #0a0c14;
  background: #f5f7ff;
}

.form__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}

@media (min-width: 900px) {
  .form__row {
    grid-template-columns: 1fr 1fr;
  }
}

.form__block {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin: 0;
  padding: 0 0 var(--space-7);
  border: 0;
  border-bottom: 1px solid var(--surface-line);
}

.form__block:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}

.form__legend {
  float: none;
  width: 100%;
  padding: 0;
  margin: 0 0 var(--space-1);
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-hi);
}

.form__choices {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
}

@media (min-width: 640px) {
  .form__choices:not(.form__choices--stack) {
    grid-template-columns: 1fr 1fr;
  }
}

.form__choice {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--surface-line);
  border-radius: var(--radius-xs);
  color: var(--text-mid);
  cursor: pointer;
  transition: border-color var(--dur-sm) var(--ease-out),
    color var(--dur-sm) var(--ease-out),
    background var(--dur-sm) var(--ease-out);
}

.form__choice:hover {
  border-color: rgba(70, 224, 255, 0.35);
  color: var(--text-hi);
}

.form__choice:has(:focus-visible) {
  border-color: rgba(70, 224, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(70, 224, 255, 0.15);
}

.form__choice:has(:checked) {
  border-color: rgba(70, 224, 255, 0.5);
  background: rgba(70, 224, 255, 0.06);
  color: var(--text-hi);
}

.form__choice input {
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.12rem;
  accent-color: #46e0ff;
  flex-shrink: 0;
}

.form__choices[aria-invalid="true"] .form__choice {
  border-color: rgba(255, 93, 108, 0.45);
}

.form__select[aria-invalid="true"] {
  border-color: var(--err);
}

.form__error {
  font-size: 0.8125rem;
  color: var(--err);
  min-height: 1.2em;
}

.form__input[aria-invalid="true"],
.form__textarea[aria-invalid="true"] {
  border-color: var(--err);
}

.form__honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
  overflow: hidden;
}

.form__status {
  padding: var(--space-4);
  border-radius: var(--radius-xs);
  border: 1px solid var(--surface-line);
  font-size: 0.9375rem;
  display: none;
}

.form__status.is-visible {
  display: block;
}

.form__status.is-success {
  border-color: rgba(53, 211, 153, 0.4);
  color: var(--ok);
  background: rgba(53, 211, 153, 0.08);
}

.form__status.is-error {
  border-color: rgba(255, 93, 108, 0.4);
  color: var(--err);
  background: rgba(255, 93, 108, 0.08);
}

/* Navigation */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  height: var(--header-h);
  transition: height var(--dur-sm) var(--ease-out),
    background var(--dur-sm) var(--ease-out),
    border-color var(--dur-sm) var(--ease-out),
    backdrop-filter var(--dur-sm) var(--ease-out);
  border-bottom: 1px solid transparent;
}

.site-header.is-condensed {
  height: var(--header-h-condensed);
  background: rgba(4, 5, 10, 0.72);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom-color: var(--surface-line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: var(--space-5);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.52rem;
  color: var(--text-hi);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.065em;
  text-transform: uppercase;
  z-index: 2;
}

.logo__mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.logo__mark svg,
.logo__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo__img--mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  filter: saturate(1.22) hue-rotate(10deg)
    drop-shadow(0 0 12px rgba(70, 224, 255, 0.22))
    drop-shadow(0 0 18px rgba(124, 92, 255, 0.18));
}

.logo__img--lockup {
  width: min(200px, 52vw);
  height: auto;
}

.logo__word {
  line-height: 1;
  color: var(--text-hi);
  text-shadow: 0 0 18px rgba(70, 224, 255, 0.08);
}

.logo__text {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  line-height: 0.95;
}

.preloader__mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: saturate(1.22) hue-rotate(10deg)
    drop-shadow(0 0 16px rgba(70, 224, 255, 0.28))
    drop-shadow(0 0 24px rgba(124, 92, 255, 0.22));
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: var(--space-6);
}

.nav-desktop a {
  position: relative;
  font-size: 0.9rem;
  color: var(--text-mid);
  transition: color var(--dur-sm) var(--ease-out);
}

.nav-desktop a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--grad-brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-sm) var(--ease-out);
}

.nav-desktop a:hover,
.nav-desktop a.is-active {
  color: var(--text-hi);
}

.nav-desktop a:hover::after,
.nav-desktop a.is-active::after {
  transform: scaleX(1);
}

.nav-cta {
  display: none;
  flex-shrink: 0;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 2;
  padding: 10px;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text-hi);
  border-radius: 2px;
  transition: transform var(--dur-sm) var(--ease-out),
    opacity var(--dur-sm) var(--ease-out);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  background: rgba(4, 5, 10, 0.96);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--gutter);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--dur-md) var(--ease-out),
    visibility var(--dur-md) var(--ease-out);
}

.nav-overlay__head {
  position: absolute;
  top: var(--space-5);
  right: var(--space-5);
  z-index: 2;
}

.nav-overlay__close {
  width: 44px;
  height: 44px;
  border: 1px solid var(--surface-line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  position: relative;
  cursor: pointer;
}

.nav-overlay__close span {
  position: absolute;
  left: 13px;
  top: 21px;
  width: 16px;
  height: 1px;
  background: var(--text-hi);
}

.nav-overlay__close span:first-child {
  transform: rotate(45deg);
}

.nav-overlay__close span:last-child {
  transform: rotate(-45deg);
}

.nav-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.nav-overlay::before {
  content: "";
  position: absolute;
  inset: 20% -20%;
  background:
    radial-gradient(ellipse 46% 60% at 72% 40%, rgba(79, 125, 255, 0.18), transparent 62%),
    radial-gradient(ellipse 30% 40% at 84% 72%, rgba(168, 85, 247, 0.14), transparent 60%);
  pointer-events: none;
  animation: ambientDrift 12s ease-in-out infinite alternate;
}

@keyframes ambientDrift {
  from {
    transform: translate(-4%, -2%);
  }
  to {
    transform: translate(4%, 3%);
  }
}

.nav-overlay__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  position: relative;
  z-index: 1;
}

.nav-overlay__list a {
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 3.5rem);
  font-weight: 600;
  color: var(--text-hi);
  letter-spacing: -0.02em;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.nav-overlay__cta {
  margin-top: var(--space-7);
  position: relative;
  z-index: 1;
  align-self: flex-start;
}

@media (min-width: 1024px) {
  .nav-desktop {
    display: flex;
  }

  .nav-cta {
    display: inline-flex;
  }

  .nav-toggle {
    display: none;
  }
}

/* Custom cursor */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-hi);
  pointer-events: none;
  z-index: var(--z-cursor);
  /* No blend mode here: a fixed element blending against the whole page forces
     the hero's WebGL canvas to be rasterised into the backdrop, which
     intermittently drops the scene entirely. */
  transform: translate(-50%, -50%);
  transition: width var(--dur-xs) var(--ease-out),
    height var(--dur-xs) var(--ease-out),
    opacity var(--dur-xs) var(--ease-out);
  opacity: 0;
}

.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(245, 247, 255, 0.45);
  border-radius: 50%;
  pointer-events: none;
  z-index: var(--z-cursor);
  transform: translate(-50%, -50%);
  transition: width var(--dur-sm) var(--ease-out),
    height var(--dur-sm) var(--ease-out),
    border-color var(--dur-sm) var(--ease-out),
    opacity var(--dur-sm) var(--ease-out);
  opacity: 0;
}

.cursor.is-visible,
.cursor-ring.is-visible {
  opacity: 1;
}

.cursor.is-hover {
  width: 0;
  height: 0;
}

.cursor-ring.is-hover {
  width: 56px;
  height: 56px;
  border-color: rgba(70, 224, 255, 0.8);
}

.cursor-ring.is-view::after {
  content: "View";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-hi);
}

body.has-custom-cursor,
body.has-custom-cursor * {
  cursor: none !important;
}

@media (hover: none), (pointer: coarse) {
  .cursor,
  .cursor-ring {
    display: none !important;
  }

  body.has-custom-cursor,
  body.has-custom-cursor * {
    cursor: auto !important;
  }
}

/* Preloader */
.preloader {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-cursor) + 10);
  background: var(--bg-950);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-5);
}

.preloader.is-done {
  pointer-events: none;
}

.preloader__mark {
  width: 48px;
  height: 48px;
}

.preloader__bar {
  width: 120px;
  height: 2px;
  background: var(--surface-line);
  overflow: hidden;
  border-radius: 2px;
}

.preloader__bar-fill {
  height: 100%;
  width: 0%;
  background: var(--grad-brand);
}

.preloader__text {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-low);
}

/* Floating WhatsApp support widget */
.wa-support {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right, 0px));
  bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  z-index: calc(var(--z-nav) - 5);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.85rem;
}

.wa-support__toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border: 0;
  border-radius: 50%;
  background: #1fad5a;
  color: #fff;
  cursor: pointer;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.35),
    0 0 18px rgba(31, 173, 90, 0.28);
  transition:
    transform var(--dur-sm) var(--ease-out),
    background var(--dur-sm) var(--ease-out),
    box-shadow var(--dur-sm) var(--ease-out);
}

.wa-support__toggle:hover {
  background: #19a050;
  transform: translateY(-2px) scale(1.03);
}

.wa-support__toggle:focus-visible {
  outline: 2px solid #46e0ff;
  outline-offset: 3px;
}

.wa-support__icon,
.wa-support__close-icon {
  position: relative;
  z-index: 1;
  grid-area: 1 / 1;
  display: block;
  overflow: visible;
  transition: opacity var(--dur-sm) var(--ease-out), transform var(--dur-sm) var(--ease-out);
}

.wa-support__glyph {
  display: block;
  flex-shrink: 0;
  overflow: visible;
  shape-rendering: geometricPrecision;
}

.wa-support__close-icon {
  opacity: 0;
  transform: scale(0.7) rotate(-45deg);
  pointer-events: none;
}

.wa-support.is-open .wa-support__icon {
  opacity: 0;
  transform: scale(0.7) rotate(45deg);
}

.wa-support.is-open .wa-support__close-icon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.wa-support__pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(37, 211, 102, 0.5);
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .wa-support:not(.is-open) .wa-support__pulse {
    animation: wa-pulse 2.4s ease-out infinite;
  }
}

@keyframes wa-pulse {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  70% {
    transform: scale(1.45);
    opacity: 0;
  }
  100% {
    transform: scale(1.45);
    opacity: 0;
  }
}

html[data-motion="reduce"] .wa-support__pulse {
  animation: none !important;
}

.wa-support__panel {
  width: min(20.5rem, calc(100vw - 2rem));
  border-radius: 1.15rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(16, 24, 38, 0.98), rgba(8, 12, 22, 0.98));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  transform-origin: bottom right;
}

.wa-support__panel[hidden] {
  display: none !important;
}

.wa-support.is-open .wa-support__panel:not([hidden]) {
  display: block;
  animation: wa-panel-in 0.28s var(--ease-out) both;
}

@keyframes wa-panel-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

html[data-motion="reduce"] .wa-support.is-open .wa-support__panel:not([hidden]) {
  animation: none;
}

.wa-support__head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.9rem 0.9rem 0.85rem;
  background: linear-gradient(135deg, #1fad5a, #128c45);
}

.wa-support__avatar {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.wa-support__meta {
  min-width: 0;
}

.wa-support__name,
.wa-support__status {
  margin: 0;
  color: #fff;
}

.wa-support__name {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.2;
}

.wa-support__status {
  margin-top: 0.15rem;
  font-size: 0.75rem;
  opacity: 0.88;
}

.wa-support__close {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.18);
  color: #fff;
  cursor: pointer;
}

.wa-support__close:hover {
  background: rgba(0, 0, 0, 0.28);
}

.wa-support__body {
  padding: 1rem 0.95rem 0.35rem;
}

.wa-support__bubble {
  margin: 0;
  padding: 0.8rem 0.9rem;
  border-radius: 0.85rem 0.85rem 0.85rem 0.25rem;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-mid);
  font-size: 0.9rem;
  line-height: 1.45;
}

.wa-support__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: calc(100% - 1.9rem);
  margin: 0.85rem 0.95rem 1rem;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  background: #1fad5a;
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background var(--dur-sm) var(--ease-out), transform var(--dur-sm) var(--ease-out);
}

.wa-support__cta:hover {
  background: #19a050;
  color: #fff;
  transform: translateY(-1px);
}
