/* ===========================================================================
   Quantum Qoders — site styles (Balanced Light/Soft Theme)
   =========================================================================== */

:root {
  color-scheme: light;
  --bg: #f3f6fc;
  --bg-surface: #ffffff;
  --bg-subtle: #e2e8f0;
  --text: #0f172a;
  --text-muted: #334155;
  --text-subtle: #475569;
  --blue: #2563eb;
  --purple: #7c3aed;
  --cyan: #0891b2;
  --border: rgba(15, 23, 42, 0.12);
  --border-hover: rgba(37, 99, 235, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

::selection {
  background: var(--blue);
  color: #fff;
}

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

section[id] {
  scroll-margin-top: 5.5rem;
}

/* ---------------------------------------------------------------- Layout --- */
.container-page {
  width: 100%;
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

@media (min-width: 640px) {
  .container-page {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container-page {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.section {
  padding-top: 5rem;
  padding-bottom: 5rem;
}

@media (min-width: 640px) {
  .section {
    padding-top: 6rem;
    padding-bottom: 6rem;
  }
}

@media (min-width: 1024px) {
  .section {
    padding-top: 7rem;
    padding-bottom: 7rem;
  }
}

/* ------------------------------------------------------------- Typography --- */
.h1 {
  margin: 0;
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #0f172a;
  text-wrap: balance;
}

.h2 {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f172a;
  text-wrap: balance;
}

.h3 {
  margin: 0;
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #0f172a;
  text-wrap: balance;
}

.lead {
  margin: 0;
  font-size: 1rem;
  line-height: 1.7;
  color: #334155;
  text-wrap: pretty;
}

.muted {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.65;
  color: #475569;
}

@media (min-width: 640px) {
  .lead {
    font-size: 1.125rem;
  }
  .muted {
    font-size: 1rem;
  }
}

.gradient-text {
  background: linear-gradient(115deg, #1d4ed8 0%, #6d28d9 48%, #0e7490 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  border: 1px solid rgba(37, 99, 235, 0.3);
  border-radius: 9999px;
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* -------------------------------------------------------------- Utilities --- */
.glass-card {
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: 0 12px 32px -10px rgba(15, 23, 42, 0.08);
}

.divider {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.bg-grid {
  background-image: linear-gradient(to right, rgba(15, 23, 42, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.06) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 35%, transparent 75%);
  mask-image: radial-gradient(ellipse at center, #000 35%, transparent 75%);
}

.orb {
  position: absolute;
  border-radius: 9999px;
  filter: blur(90px);
  pointer-events: none;
}

.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 100;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0.75rem 1.25rem;
  clip: auto;
  border-radius: 9999px;
  background: #2563eb;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
}

/* ---------------------------------------------------------------- Buttons --- */
.btn,
.btn-primary,
.btn-outline,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border: 0;
  border-radius: 9999px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease,
    border-color 0.25s ease, color 0.25s ease;
}

.btn-primary {
  background: linear-gradient(90deg, #2563eb, #7c3aed);
  color: #fff;
  box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px -8px rgba(37, 99, 235, 0.5);
}

.btn-outline {
  border: 1px solid rgba(15, 23, 42, 0.2);
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.btn-outline:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.5);
  background: #f8fafc;
}

.btn-ghost {
  padding: 0.6rem 1rem;
  background: transparent;
  color: #334155;
}

.btn-ghost:hover {
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
}

.btn-block {
  width: 100%;
}

.btn-primary:active,
.btn-outline:active {
  transform: translateY(0);
}

/* -------------------------------------------------------------- Navigation --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(243, 246, 252, 0.9);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 40px -20px rgba(15, 23, 42, 0.12);
}

.nav-link {
  position: relative;
  padding: 0.5rem 0.875rem;
  border-radius: 9999px;
  color: #334155;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: #0f172a;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0.875rem;
  right: 0.875rem;
  bottom: 0.3rem;
  height: 2px;
  border-radius: 9999px;
  background: linear-gradient(90deg, #2563eb, #7c3aed);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.nav-link:hover::after,
.nav-link[aria-current="page"]::after {
  transform: scaleX(1);
}

.nav-link[aria-current="page"] {
  color: #0f172a;
  font-weight: 600;
}

.mobile-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  color: #1e293b;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.mobile-link:hover {
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
}

.mobile-link[aria-current="page"] {
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  font-weight: 600;
}

.logo-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  overflow: hidden;
  border-radius: 0.75rem;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.15), 0 4px 12px rgba(15, 23, 42, 0.08);
  transition: transform 0.3s ease;
}

@media (min-width: 640px) {
  .logo-tile {
    width: 2.75rem;
    height: 2.75rem;
  }
}

.group:hover .logo-tile {
  transform: rotate(-4deg) scale(1.03);
}

.menu-toggle .icon-close {
  display: none;
}

.menu-toggle.is-open .icon-menu {
  display: none;
}

.menu-toggle.is-open .icon-close {
  display: block;
}

.mobile-nav {
  max-height: 0;
  overflow: hidden;
  background: #ffffff;
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 20px 30px -10px rgba(15, 23, 42, 0.1);
  transition: max-height 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.mobile-nav.is-open {
  max-height: 34rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body.nav-open {
  overflow: hidden;
}

/* ------------------------------------------------------------------ Cards --- */
.icon-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(37, 99, 235, 0.25);
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
}

.service-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: 1rem;
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.06);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
  transform: translateY(-4px);
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: 0 24px 50px -20px rgba(15, 23, 42, 0.12);
}

/* ------------------------------------------------------------------ Forms --- */
.field-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
}

.field {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(15, 23, 42, 0.2);
  border-radius: 0.75rem;
  background: #ffffff;
  color: #0f172a;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.field::placeholder {
  color: #64748b;
}

.field:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.85);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.field-select {
  appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 1.1rem;
}

.form-status {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid transparent;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  font-weight: 500;
}

.form-status[hidden] {
  display: none;
}

.form-status.is-success {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
}

.form-status.is-error {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
}

.btn-primary.is-loading {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* ------------------------------------------------------- Reveal on scroll --- */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ------------------------------------------------------ Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
