/* Ambient background, entrance choreography and micro-interactions.
   Everything here is decorative; styles.css disables it under prefers-reduced-motion. */

/* —— Ambient background (aurora + data network) —— */
.bg-fx {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1100px;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%);
}

.bg-fx .orb {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}

.bg-fx .orb-1 {
  width: 720px;
  height: 720px;
  top: -260px;
  left: -180px;
  background: radial-gradient(circle, rgba(231, 43, 65, .16) 0%, rgba(231, 43, 65, 0) 65%);
  animation: drift-a 22s ease-in-out infinite alternate;
}

.bg-fx .orb-2 {
  width: 820px;
  height: 820px;
  top: -320px;
  right: -240px;
  background: radial-gradient(circle, rgba(37, 72, 160, .14) 0%, rgba(37, 72, 160, 0) 65%);
  animation: drift-b 26s ease-in-out infinite alternate;
}

.bg-fx .orb-3 {
  width: 560px;
  height: 560px;
  top: 360px;
  left: 38%;
  background: radial-gradient(circle, rgba(255, 107, 122, .10) 0%, rgba(255, 107, 122, 0) 65%);
  animation: drift-c 30s ease-in-out infinite alternate;
}

@keyframes drift-a {
  to { transform: translate(140px, 90px) scale(1.12); }
}

@keyframes drift-b {
  to { transform: translate(-160px, 120px) scale(.92); }
}

@keyframes drift-c {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-180px, -60px) scale(1.15); }
  100% { transform: translate(120px, -120px) scale(.95); }
}

.bg-network {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.6s var(--ease);
}

.bg-network.is-ready { opacity: 1; }

/* —— Scroll progress —— */
.scroll-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
  background: linear-gradient(90deg, var(--red), #ff6b7a 60%, #6d8bff);
  pointer-events: none;
}

/* —— Hero entrance —— */
@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(26px);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: blur(0);
  }
}

@keyframes wipe-in {
  from {
    clip-path: inset(0 0 100% 0 round 18px);
    transform: translateY(30px) scale(.98);
  }
  to {
    clip-path: inset(0 0 0 0 round 18px);
    transform: none;
  }
}

.hero-banner .eyebrow,
.hero-banner h1,
.hero-banner .hero-intro > * {
  animation: rise-in .9s var(--ease) both;
}

.hero-banner .eyebrow { animation-delay: .05s; }
.hero-banner h1 { animation-delay: .15s; }
.hero-banner .hero-intro > :nth-child(1) { animation-delay: .3s; }
.hero-banner .hero-intro > :nth-child(2) { animation-delay: .4s; }
.hero-banner .hero-intro > :nth-child(3) { animation-delay: .5s; }
.hero-banner .hero-intro > :nth-child(4) { animation-delay: .6s; }

.hero-banner .photo-frame { animation: wipe-in 1.2s var(--ease) .35s backwards; }
.hero-banner .hero-image-caption { animation: rise-in .8s var(--ease) 1s both; }

/* Living gradient on the red headline */
.hero-banner h1 .red {
  background: linear-gradient(100deg, var(--red) 0%, #ff5a6e 30%, #c51d31 55%, var(--red) 80%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: text-flow 7s ease-in-out infinite;
}

@keyframes text-flow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Hero image: glow ring, tilt and light sweep */
.hero-banner .hero-visual { perspective: 1400px; }

.hero-banner .hero-visual::after {
  content: "";
  position: absolute;
  inset: -14px -14px 34px;
  z-index: -1;
  border-radius: 28px;
  background: conic-gradient(from var(--spin, 0deg), rgba(231, 43, 65, .35), rgba(37, 72, 160, .25), rgba(255, 107, 122, .3), rgba(231, 43, 65, .35));
  filter: blur(28px);
  opacity: .55;
  animation: spin 12s linear infinite;
}

@property --spin {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@keyframes spin {
  to { --spin: 360deg; }
}

.hero-banner .photo-frame {
  transform: rotateX(var(--ry, 0deg)) rotateY(var(--rx, 0deg));
  transition: transform .6s var(--ease), box-shadow .6s var(--ease);
}

.hero-banner .photo-frame::after {
  display: block;
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .22) 48%, transparent 62%);
  transform: translateX(-120%);
  animation: sheen 7s var(--ease) 1.8s infinite;
}

@keyframes sheen {
  0% { transform: translateX(-120%); }
  28%, 100% { transform: translateX(120%); }
}

/* —— Buttons: light sweep —— */
.button {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.button::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, .35) 50%, transparent 75%);
  transform: translateX(-110%);
  transition: transform .7s var(--ease);
}

.button:hover::after { transform: translateX(110%); }
.button span { transition: transform .3s var(--ease); }
.button:hover span { transform: translate(2px, -2px); }

.text-link span { transition: transform .3s var(--ease); display: inline-block; }
.text-link:hover span { transform: translateY(3px); }

/* —— Expertise chips —— */
.expertise-focus b {
  opacity: 0;
  transform: translateY(10px) scale(.96);
  transition: opacity .5s var(--ease), transform .5s var(--ease), border-color .25s, color .25s, box-shadow .25s;
}

.expertise.is-visible .expertise-focus b { opacity: 1; transform: none; }
.expertise.is-visible .expertise-focus b:nth-child(2) { transition-delay: .06s, .06s, 0s, 0s, 0s; }
.expertise.is-visible .expertise-focus b:nth-child(3) { transition-delay: .12s, .12s, 0s, 0s, 0s; }
.expertise.is-visible .expertise-focus b:nth-child(4) { transition-delay: .18s, .18s, 0s, 0s, 0s; }
.expertise.is-visible .expertise-focus b:nth-child(5) { transition-delay: .24s, .24s, 0s, 0s, 0s; }

.expertise-focus b:hover {
  border-color: rgba(231, 43, 65, .35);
  color: var(--red);
  box-shadow: 0 6px 16px rgba(231, 43, 65, .12);
  transform: translateY(-2px);
}

/* —— Reveal: softer, with a touch of blur —— */
.reveal {
  filter: blur(4px);
  transition: opacity .8s var(--ease), transform .8s var(--ease), filter .8s var(--ease);
}

.reveal.is-visible { filter: none; }

/* —— Cards: pointer spotlight + gradient edge —— */
.focus-card,
.also-card {
  --mx: 50%;
  --my: 50%;
}

.focus-card::after,
.also-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity .35s var(--ease);
  background: radial-gradient(360px circle at var(--mx) var(--my), rgba(231, 43, 65, .08), transparent 60%);
}

.focus-card.lead::after {
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(255, 255, 255, .1), transparent 60%);
}

.focus-card:hover::after,
.also-card:hover::after { opacity: 1; }

.also-card { position: relative; }

.focus-card:not(.lead):hover {
  border-color: rgba(231, 43, 65, .28);
}

.focus-card::before {
  transform: scaleX(.18);
  transform-origin: left;
  transition: transform .45s var(--ease);
}

.focus-card:hover::before { transform: scaleX(1); }

.service-icon { transition: transform .45s var(--ease), background .3s; }
.focus-card:hover .service-icon { transform: rotate(-8deg) scale(1.08); }

.focus-card > a span,
.also-card > a span { display: inline-block; transition: transform .3s var(--ease); }
.focus-card > a:hover span,
.also-card > a:hover span { transform: translate(3px, -3px); }

/* Lead card: slowly moving aurora */
.focus-card.lead {
  background:
    radial-gradient(ellipse 90% 55% at 100% 0%, rgba(231, 43, 65, .32), transparent 58%),
    linear-gradient(165deg, #0c1730 0%, #152447 68%, #0a1428 100%);
  isolation: isolate;
}

.focus-card.lead::before {
  display: block;
  content: "";
  position: absolute;
  inset: auto;
  top: -30%;
  right: -40%;
  width: 120%;
  height: 90%;
  z-index: -1;
  background: radial-gradient(circle, rgba(231, 43, 65, .28), transparent 60%);
  transform: none;
  animation: lead-glow 14s ease-in-out infinite alternate;
}

.focus-card.lead:hover::before { transform: none; }

@keyframes lead-glow {
  0% { translate: 0 0; scale: 1; }
  50% { translate: -40% 45%; scale: 1.2; }
  100% { translate: -70% 10%; scale: .9; }
}

.lead-points li::before {
  box-shadow: 0 0 0 0 rgba(231, 43, 65, .5);
  animation: ping 2.8s var(--ease) infinite;
}

.lead-points li:nth-child(2)::before { animation-delay: .9s; }
.lead-points li:nth-child(3)::before { animation-delay: 1.8s; }

@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(231, 43, 65, .55); }
  70%, 100% { box-shadow: 0 0 0 8px rgba(231, 43, 65, 0); }
}

/* —— Approach: drifting grid, glow and drawn step lines —— */
.approach::before {
  animation: grid-drift 24s linear infinite;
}

@keyframes grid-drift {
  to { background-position: 48px 48px, 48px 48px; }
}

.approach::after {
  content: "";
  position: absolute;
  width: 640px;
  height: 640px;
  left: -200px;
  bottom: -320px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(109, 139, 255, .16), transparent 62%);
  animation: approach-orb 20s ease-in-out infinite alternate;
}

@keyframes approach-orb {
  to { transform: translate(70vw, -180px) scale(1.2); }
}

.approach > .container { position: relative; z-index: 1; }

.step-number {
  position: relative;
  border-bottom-color: rgba(255, 255, 255, .1);
}

.step-number::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--red), #ff6b7a 60%, transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.1s var(--ease) .35s;
}

.steps article.is-visible .step-number::after { transform: scaleX(.45); }
.steps article:hover .step-number::after { transform: scaleX(1); transition-delay: 0s; }

.steps article .step-number {
  transition: color .3s var(--ease), text-shadow .3s var(--ease);
}

.steps article:hover .step-number {
  text-shadow: 0 0 24px rgba(255, 107, 122, .55);
}

/* —— Team —— */
.team-stat {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.team-stat::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .08) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: sheen 6s var(--ease) 1s infinite;
}

.team-stat strong { font-variant-numeric: tabular-nums; }

.team-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(231, 43, 65, .18), transparent 45%);
  opacity: 0;
  transition: opacity .6s var(--ease);
}

.team-photo:hover::before { opacity: 1; }
.team-caption { z-index: 2; }

/* —— FAQ —— */
.faq-section {
  position: relative;
  overflow: hidden;
}

.faq-section::before {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  right: -160px;
  top: -200px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(231, 43, 65, .08), transparent 65%);
  animation: drift-b 24s ease-in-out infinite alternate;
}

.faq-section > .container { position: relative; }

.faq-list details[open] p { animation: rise-in .45s var(--ease) both; }
.faq-list summary:hover { color: var(--red); }
.faq-list summary:hover::after { background: #ffe1e6; }

/* —— Start panel: rotating gradient edge —— */
.start-panel {
  position: relative;
  isolation: isolate;
}

.start-panel::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  padding: 1px;
  border-radius: inherit;
  background: conic-gradient(from var(--spin, 0deg), transparent 0deg, rgba(231, 43, 65, .6) 60deg, transparent 140deg, transparent 220deg, rgba(109, 139, 255, .45) 280deg, transparent 340deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: spin 10s linear infinite;
  pointer-events: none;
}

/* Email card: floating icon and drifting glow */
.email-card { isolation: isolate; }

.email-card::before {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  right: -120px;
  bottom: -160px;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(109, 139, 255, .22), transparent 65%);
  animation: drift-b 16s ease-in-out infinite alternate;
}

.email-icon { animation: float 4s ease-in-out infinite; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(-6deg); }
}

/* —— Footer —— */
.site-footer::before {
  background-size: 200% 100%;
  animation: footer-line 8s linear infinite;
}

@keyframes footer-line {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

@media (max-width: 850px) {
  .bg-fx { height: 900px; }
  .bg-fx .orb-1 { width: 480px; height: 480px; }
  .bg-fx .orb-2 { width: 520px; height: 520px; }
  .bg-fx .orb-3 { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .expertise-focus b { filter: none; opacity: 1; transform: none; }
  .bg-network { display: none; }
}

@media (hover: none) {
  .hero-banner .photo-frame { transform: none; }
}
