body {
  background: radial-gradient(circle at 50% -10%, #e7f0fd 0%, #f6f8fc 55%);
  background-attachment: fixed;
  color: #0f1629;
  -webkit-font-smoothing: antialiased;
}

.glass {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(15, 22, 41, 0.08);
  box-shadow: 0 10px 30px rgba(15, 22, 41, 0.06);
}

.nav-glass {
  background: #ffffff;
}

/* R2 / credential callout */
.cred-badge {
  position: relative;
}

.text-balance {
  text-wrap: balance;
}

.tesla-border {
  border: 0.5px solid rgba(15, 22, 41, 0.12);
  transition: border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tesla-border:hover {
  border-color: #2e7df6;
}

.marquee {
  white-space: nowrap;
  overflow: hidden;
  display: flex;
  animation: marquee 40s linear infinite;
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* Blue + pink brand glow */
.hero-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 32% 42%, rgba(46, 125, 246, 0.14) 0%, transparent 55%),
    radial-gradient(circle at 68% 58%, rgba(236, 95, 180, 0.12) 0%, transparent 55%);
  pointer-events: none;
}

/* Typewriter hero word */
.word-cycle {
  display: inline-block;
}
.typewriter {
  border-right: 0.08em solid currentColor;
  padding-right: 0.04em;
  animation: caret-blink 0.9s step-end infinite;
}
@keyframes caret-blink {
  from,
  to {
    border-color: transparent;
  }
  50% {
    border-color: currentColor;
  }
}

/* Prevent accidental horizontal scroll on small screens */
html,
body {
  overflow-x: hidden;
}

/* ---------------------------------------------------------------
   Photo / media components
   --------------------------------------------------------------- */
.media-frame {
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem;
  background: #eef2f8;
}

.media-frame img,
.media-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.media-frame:hover img,
.group:hover .media-frame img,
.photo-card:hover .media-frame img {
  transform: scale(1.05);
}

.photo-card {
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #fff;
  isolation: isolate;
}

.photo-card > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.photo-card:hover > img {
  transform: scale(1.06);
}

.photo-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(8, 12, 24, 0.92) 8%, rgba(8, 12, 24, 0.35) 55%, rgba(8, 12, 24, 0.15) 100%);
  pointer-events: none;
}

.photo-card > * {
  position: relative;
  z-index: 2;
}

.page-hero-media {
  position: relative;
  overflow: hidden;
  border-radius: 1.75rem;
  min-height: 220px;
}

.page-hero-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(15, 22, 41, 0.25), transparent 60%);
  pointer-events: none;
}

.process-rail {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
}

.process-step {
  position: relative;
  text-align: center;
  padding: 1.25rem 0.75rem;
}

.process-step .step-num {
  width: 2.25rem;
  height: 2.25rem;
  margin: 0 auto 0.75rem;
  border-radius: 9999px;
  background: rgba(46, 125, 246, 0.12);
  color: #2e7df6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.process-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 2.1rem;
  right: -0.45rem;
  width: 0.9rem;
  height: 2px;
  background: linear-gradient(90deg, rgba(46, 125, 246, 0.45), rgba(46, 125, 246, 0.05));
}

.mosaic {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 1rem;
  min-height: 420px;
}

.mosaic .span-2 {
  grid-row: span 2;
}

.soft-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(15, 22, 41, 0.1), transparent);
}

.icon-bubble {
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(46, 125, 246, 0.1);
  color: #2e7df6;
}

/* Sticky translucent nav feel after scroll */
.nav-glass.is-scrolled {
  box-shadow: 0 8px 24px rgba(15, 22, 41, 0.06);
}

/* ---------------------------------------------------------------
   Mobile optimizations (<= 767px)
   --------------------------------------------------------------- */
@media (max-width: 767px) {
  .py-32 {
    padding-top: 4.5rem !important;
    padding-bottom: 4.5rem !important;
  }
  .py-24 {
    padding-top: 3.5rem !important;
    padding-bottom: 3.5rem !important;
  }
  .pt-24 {
    padding-top: 3.5rem !important;
  }
  .pb-24 {
    padding-bottom: 3.5rem !important;
  }

  .p-12 {
    padding: 1.75rem !important;
  }
  .p-10 {
    padding: 1.5rem !important;
  }

  .gap-16 {
    gap: 2.5rem !important;
  }
  .mb-24 {
    margin-bottom: 3rem !important;
  }
  .mb-16 {
    margin-bottom: 2.5rem !important;
  }

  .text-5xl {
    font-size: 2.5rem !important;
    line-height: 1.1 !important;
  }
  .font-body-lg {
    font-size: 1.0625rem !important;
  }

  #mobile-menu {
    max-height: min(70vh, 28rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1.25rem;
  }

  #mobile-menu a {
    padding: 0.65rem 0.25rem;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(15, 22, 41, 0.05);
  }

  #mobile-menu a:last-child {
    border-bottom: 0;
    margin-top: 0.35rem;
    font-weight: 600;
  }

  /* Hide long nav CTA label on very small screens; menu still has it */
  .nav-cta-desktop {
    display: none !important;
  }

  .process-rail {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .process-step {
    text-align: left;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem 1rem;
    align-items: start;
    padding: 1rem;
  }

  .process-step .step-num {
    margin: 0;
    grid-row: span 2;
  }

  .process-step:not(:last-child)::after {
    display: none;
  }

  .mosaic {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    min-height: 0;
  }

  .mosaic .span-2 {
    grid-row: auto;
    min-height: 240px;
  }

  .photo-card {
    min-height: 240px;
  }

  .page-hero-media {
    min-height: 180px;
    margin-top: 1.5rem;
  }
}

/* Desktop mid-width: keep nav from wrapping awkwardly */
@media (min-width: 768px) and (max-width: 1100px) {
  header nav .md\:flex.gap-8 {
    gap: 1rem !important;
  }
  header nav .md\:flex.gap-8 a {
    font-size: 12px !important;
  }
}

/* Full-width primary action stacks on phones */
@media (max-width: 639px) {
  main .flex.flex-col.sm\:flex-row > a {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}

@media (min-width: 768px) {
  .nav-cta-desktop {
    display: inline-flex;
  }
}

/* ---------------------------------------------------------------
   Subtle motion - reveal on scroll, soft hover, hero entrance
   --------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(1.25rem);
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }
.reveal-delay-5 { transition-delay: 0.4s; }
.reveal-delay-6 { transition-delay: 0.48s; }

.reveal-img {
  opacity: 0;
  transform: scale(1.04);
  transition:
    opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal-img.is-visible {
  opacity: 1;
  transform: scale(1);
}

.hero-enter {
  opacity: 0;
  transform: translateY(1rem);
  animation: hero-enter 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.15s forwards;
}
@keyframes hero-enter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.lift {
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(15, 22, 41, 0.1);
}

.float-slow {
  animation: float-slow 7s ease-in-out infinite;
}
@keyframes float-slow {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.pulse-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 9999px;
  background: #2e7df6;
  animation: pulse-dot 1.8s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.25);
  }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .marquee,
  .animate-pulse,
  .animate-bounce,
  .hero-enter,
  .typewriter,
  .float-slow,
  .pulse-dot {
    animation: none !important;
  }
  .reveal,
  .reveal-img {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .lift:hover {
    transform: none;
  }
  .media-frame:hover img,
  .photo-card:hover > img {
    transform: none;
  }
  * {
    transition-duration: 0.001ms !important;
  }
}
