/* Port of src/styles/{reset,typography,grid,glass-card,animations,utilities,
   mobile,buttons-global}.scss + body rules from globals.scss.
   View-transition rules dropped (no Astro ClientRouter in the PHP app). */

/* ─── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  height: 100%;
  overflow-x: hidden;
  scrollbar-gutter: stable both-edges;
}

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

body {
  text-rendering: optimizeSpeed;
  line-height: 1.5;
  min-height: 100%;
  overflow-x: hidden;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
}

button { cursor: pointer; }

a {
  text-decoration: none;
  color: inherit;
}

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

ul, ol { list-style: none; }

/* ─── Body defaults (typography.scss + globals.scss) ────────────────────── */
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: 1.75;
  color: var(--text);
  background-color: var(--background);
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (max-width: 767px) {
  body {
    padding-bottom: 0;
  }
}

body::-webkit-scrollbar { width: 10px; }
body::-webkit-scrollbar-track { background: var(--surface-2); }
body::-webkit-scrollbar-thumb {
  background: rgba(27, 84, 216, 0.25);
  border: 2px solid var(--surface-2);
  border-radius: 5px;
}
body::-webkit-scrollbar-thumb:hover { background: rgba(27, 84, 216, 0.40); }

/* ─── Typography ────────────────────────────────────────────────────────── */
h1, .h1 {
  font-size: var(--fs-h1);
  color: var(--heading);
  font-weight: var(--fw-extrabold);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

h2, .h2 {
  font-size: var(--fs-h2);
  color: var(--heading);
  font-weight: var(--fw-bold);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

h3, .h3 {
  font-size: var(--fs-h3);
  color: var(--heading);
  font-weight: var(--fw-bold);
  line-height: 1.3;
  letter-spacing: -0.02em;
}

h4, .h4 {
  font-size: var(--fs-h4);
  color: var(--heading);
  font-weight: var(--fw-semibold);
  line-height: 1.4;
  letter-spacing: -0.015em;
}

h5, .h5 {
  font-size: var(--fs-body);
  color: var(--heading);
  font-weight: var(--fw-semibold);
  line-height: 1.4;
}

h6, .h6 {
  font-size: var(--fs-small);
  color: var(--heading);
  font-weight: var(--fw-semibold);
  line-height: 1.5;
}

.hero-title {
  font-size: var(--fs-hero);
  font-weight: var(--fw-extrabold);
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.section-title {
  font-size: clamp(1.75rem, 2.2vw + 0.75rem, 2.375rem);
  font-weight: var(--fw-bold);
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--heading);
}

.card-title {
  font-size: var(--fs-h4);
  font-weight: var(--fw-semibold);
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--heading);
}

.subtitle {
  font-size: var(--fs-subtitle);
  font-weight: var(--fw-regular);
  line-height: 1.7;
  color: var(--muted);
}

.display-number {
  font-size: clamp(3rem, 6vw + 1rem, 6rem);
  font-weight: var(--fw-extrabold);
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.eyebrow-label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--primary-hover);
}

.text-muted { color: var(--muted); }

/* ─── Grid & layout ─────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 16px;
  padding-right: 16px;
}

@media (min-width: 768px) {
  .container { padding-left: 40px; padding-right: 40px; }
}

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

@media (min-width: 1280px) {
  .container { padding-left: 80px; padding-right: 80px; }
}

.content-wrapper {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.grid {
  display: grid;
  column-gap: 16px;
  row-gap: 16px;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    column-gap: 24px;
    row-gap: 24px;
  }
}

@media (min-width: 1024px) {
  .grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 32px;
    row-gap: 32px;
  }
}

.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4 { grid-column: 1 / -1; }

@media (min-width: 768px) {
  .col-sm-1 { grid-column: span 1 / span 1; }
  .col-sm-2 { grid-column: span 2 / span 2; }
  .col-sm-3 { grid-column: span 3 / span 3; }
  .col-sm-4 { grid-column: span 4 / span 4; }
  .col-md-1 { grid-column: span 1 / span 1; }
  .col-md-2 { grid-column: span 2 / span 2; }
  .col-md-3 { grid-column: span 3 / span 3; }
  .col-md-4 { grid-column: span 4 / span 4; }
  .col-md-5 { grid-column: span 5 / span 5; }
  .col-md-6 { grid-column: span 6 / span 6; }
  .col-md-7 { grid-column: span 7 / span 7; }
  .col-md-8 { grid-column: span 8 / span 8; }
}

@media (min-width: 1024px) {
  .col-1 { grid-column: span 1 / span 1; }
  .col-2 { grid-column: span 2 / span 2; }
  .col-3 { grid-column: span 3 / span 3; }
  .col-4 { grid-column: span 4 / span 4; }
  .col-5 { grid-column: span 5 / span 5; }
  .col-6 { grid-column: span 6 / span 6; }
  .col-7 { grid-column: span 7 / span 7; }
  .col-8 { grid-column: span 8 / span 8; }
  .col-9 { grid-column: span 9 / span 9; }
  .col-10 { grid-column: span 10 / span 10; }
  .col-11 { grid-column: span 11 / span 11; }
  .col-12 { grid-column: span 12 / span 12; }
}

.section {
  padding-top: 16px;
  padding-bottom: 16px;
  position: relative;
}

@media (min-width: 768px) {
  .section { padding-top: 40px; padding-bottom: 40px; }
}

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

.section--after-hero { padding-top: 10px; }

@media (min-width: 768px) {
  .section--after-hero { padding-top: 28px; }
}

@media (min-width: 1024px) {
  .section--after-hero { padding-top: 40px; }
}

@media (max-width: 767px) {
  .page-hero + .section { padding-top: 10px; }
}

.bento-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}

@media (min-width: 600px) {
  .bento-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .bento-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 600px) {
  .bento-featured { grid-column: span 2; }
}

/* ─── Glass card ────────────────────────────────────────────────────────── */
.glass-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
  box-sizing: border-box;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
              border-color 0.3s ease,
              box-shadow 0.3s ease;
  position: relative;
}

@media (min-width: 481px) {
  .glass-card { padding: 28px; }
}

.glass-card.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(27, 84, 216, 0.20);
}

.glass-card.border-highlight {
  border-color: rgba(27, 84, 216, 0.25);
  background: linear-gradient(180deg, rgba(27, 84, 216, 0.03) 0%, var(--card) 100%);
}

.glass-card.border-highlight:hover { border-color: var(--primary); }

.glass-card.has-glow::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% -20%, rgba(27, 84, 216, 0.06) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
  border-radius: inherit;
}

/* ─── Animations ────────────────────────────────────────────────────────── */
.transition-all { transition: all 0.3s var(--ease-soft); }
.transition-fast { transition: all 0.2s var(--ease-soft); }

.reveal {
  opacity: 0;
  will-change: opacity, transform, filter;
  transition: none;
}

.reveal[data-reveal='up'], .reveal:not([data-reveal]) { transform: translateY(28px); }
.reveal[data-reveal='fade'] { transform: none; }
.reveal[data-reveal='scale'] { transform: scale(0.94); }
.reveal[data-reveal='left'] { transform: translateX(-32px); }
.reveal[data-reveal='right'] { transform: translateX(32px); }
.reveal[data-reveal='blur'] { transform: translateY(12px); filter: blur(8px); }
.reveal[data-reveal='tilt'] { transform: translateY(20px) rotate(-1.5deg); }

.reveal.is-revealed {
  opacity: 1;
  transform: none;
  filter: blur(0);
  transition:
    opacity var(--motion-reveal),
    transform var(--motion-reveal),
    filter var(--motion-reveal);
  transition-delay: var(--reveal-delay, 0s);
}

@keyframes pageEnter {
  from { opacity: 0; }
  to { opacity: 1; }
}

body { animation: pageEnter 0.55s var(--ease-out) both; }

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

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in-up { animation: fadeInUp 0.8s var(--ease-out) forwards; }
.floating-glow { animation: drift 25s ease-in-out infinite; }

.hover-lift {
  transition:
    transform var(--motion-fast),
    box-shadow var(--motion-base),
    border-color var(--motion-fast);
}

.hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md), var(--glow-blue);
}

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

.float-badge { animation: floatBadge 4s ease-in-out infinite; }

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(27, 84, 216, 0.2); }
  50% { box-shadow: 0 0 40px rgba(27, 84, 216, 0.45); }
}

.pulse-glow { animation: pulseGlow 3s ease-in-out infinite; }

:where(a, button, input, textarea, select) {
  transition:
    color var(--motion-fast),
    background-color var(--motion-fast),
    border-color var(--motion-fast),
    opacity var(--motion-fast),
    transform var(--motion-fast),
    box-shadow var(--motion-fast);
}

:where(img, picture) {
  transition: transform var(--motion-slow), opacity var(--motion-base);
}

:where(
  body,
  .header,
  .footer,
  .glass-card,
  .section,
  .nav-pill,
  .mobile-menu-panel,
  .sticky-contact,
  .faq-item,
  .direct-card
) {
  transition:
    background-color 0.5s var(--ease-soft),
    border-color 0.5s var(--ease-soft),
    color 0.4s var(--ease-soft),
    box-shadow 0.5s var(--ease-soft);
}

/* ─── Utilities ─────────────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.h-full { height: 100%; }

.glass {
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.text-accent { color: var(--accent); }

.text-primary, .accent { color: var(--primary); }

.text-gradient {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-gold {
  background: linear-gradient(135deg, var(--accent) 0%, #E8B820 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bg-glow-blue { background: radial-gradient(circle at center, rgba(27, 84, 216, 0.06) 0%, transparent 70%); }
.bg-glow-purple { background: radial-gradient(circle at center, rgba(91, 79, 207, 0.05) 0%, transparent 70%); }
.bg-glow-gold { background: radial-gradient(circle at center, rgba(212, 160, 18, 0.06) 0%, transparent 70%); }

.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mb-40 { margin-bottom: 40px; }
.mb-48 { margin-bottom: 48px; }
.mb-64 { margin-bottom: 64px; }

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

/* ─── Mobile design system (≤767px) ─────────────────────────────────────── */
@media (max-width: 767px) {
  :root {
    --fs-hero:     clamp(1.2rem, 4.5vw + 0.3rem, 1.75rem);
    --fs-h1:       clamp(1.45rem, 5vw + 0.2rem, 2.2rem);
    --fs-h2:       clamp(1.25rem, 4vw + 0.15rem, 1.75rem);
    --fs-h3:       clamp(0.9rem, 2.5vw + 0.3rem, 1.1rem);
    --fs-h4:       clamp(0.875rem, 1.5vw + 0.4rem, 1rem);
    --fs-body:     clamp(0.82rem, 1vw + 0.7rem, 0.9rem);
    --fs-subtitle: clamp(0.82rem, 2vw + 0.2rem, 1rem);
    --fs-small:    0.78rem;
    --fs-xs:       0.69rem;
  }

  .container { padding-left: 14px; padding-right: 14px; }

  .section { padding-top: 18px; padding-bottom: 18px; }

  .section--after-hero { padding-top: 12px; }

  .section-title {
    font-size: clamp(1.2rem, 4.5vw + 0.1rem, 1.55rem);
    margin-bottom: 6px;
  }

  .subtitle {
    font-size: var(--fs-body);
    line-height: 1.55;
  }

  .display-number { font-size: clamp(2rem, 7vw + 0.5rem, 3rem); }

  .btn {
    min-height: 40px;
    font-size: 13px;
  }
}

/* ─── Buttons global (buttons-global.scss) ──────────────────────────────── */
.submit-btn,
.sticky-primary,
.sticky-call {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.submit-btn > *,
.sticky-primary > *,
.sticky-call > * {
  position: relative;
  z-index: 2;
}

.submit-btn::after,
.sticky-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: soft-light;
  filter: blur(2px);
  background: linear-gradient(
    100deg,
    transparent 0%,
    transparent 36%,
    var(--btn-shine-fade) 44%,
    var(--btn-shine-core) 50%,
    var(--btn-shine-fade) 56%,
    transparent 64%,
    transparent 100%
  );
  background-size: 240% 100%;
  background-position: 115% 50%;
  background-repeat: no-repeat;
  transition: background-position 0.75s cubic-bezier(0.4, 0, 0.2, 1);
}

.submit-btn:hover::after,
.submit-btn:focus-visible::after,
.sticky-primary:hover::after,
.sticky-primary:focus-visible::after {
  background-position: -15% 50%;
  transition-duration: 0.52s;
  transition-timing-function: cubic-bezier(0.33, 1, 0.68, 1);
}

.sticky-call::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: normal;
  filter: blur(1.5px);
  background: linear-gradient(
    100deg,
    transparent 0%,
    transparent 38%,
    var(--btn-shine-surface-fade) 46%,
    var(--btn-shine-surface-core) 50%,
    var(--btn-shine-surface-fade) 54%,
    transparent 62%,
    transparent 100%
  );
  background-size: 240% 100%;
  background-position: 115% 50%;
  background-repeat: no-repeat;
  transition: background-position 0.75s cubic-bezier(0.4, 0, 0.2, 1);
}

.sticky-call:hover::after,
.sticky-call:focus-visible::after {
  background-position: -15% 50%;
  transition-duration: 0.52s;
  transition-timing-function: cubic-bezier(0.33, 1, 0.68, 1);
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: rgba(27, 84, 216, 0.35);
  color: var(--primary);
  background: var(--primary-light);
}

.sticky-primary:active { transform: scale(0.98); }
.sticky-call:active { transform: scale(0.96); }
.submit-btn:active:not(:disabled) { transform: scale(0.98); }

/* ─── Reduced motion ────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  body { animation: none; }

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

  .animate-fade-in-up,
  .floating-glow,
  .float-badge,
  .pulse-glow {
    animation: none;
  }

  .hover-lift:hover { transform: none; }

  :where(a, button, input, textarea, select, img, picture) {
    transition: none;
  }

  .submit-btn::after,
  .sticky-primary::after,
  .sticky-call::after {
    transition: none;
    background-position: 115% 50%;
  }
}

html.motion-reduce .reveal {
  opacity: 1;
  transform: none;
  transition: none;
}

html.motion-reduce .animate-fade-in-up,
html.motion-reduce .floating-glow,
html.motion-reduce .float-badge,
html.motion-reduce .pulse-glow {
  animation: none;
}
