@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;900&family=JetBrains+Mono:wght@400;500&display=swap');

/* When anchor-linked sections scroll into view, push the target down by the
   header height so the section heading isn't hidden behind the fixed bar */
html {
  scroll-padding-top: var(--header-height);
  /* Primary horizontal scroll guard — clips at the true viewport edge */
  overflow-x: hidden;
  max-width: var(--screen-width);
}

body {
  background-color: var(--color-bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 15% 0%, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse 50% 60% at 85% 50%, rgba(168, 85, 247, 0.08) 0%, transparent 40%),
    radial-gradient(ellipse 70% 50% at 40% 100%, rgba(124, 58, 237, 0.12) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--color-white);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  line-height: 1.6;
  overflow-x: hidden;
  max-width: var(--screen-width);
}
body.modal-open {
  overflow: hidden;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb {
  background: var(--color-purple);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--color-purple-light); }

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--weight-bold);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }

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

.purple-text {
  color: var(--color-purple-light);
}

.container {
  width: 100%;
  /* Never exceed the screen width, even if --container-max is larger */
  max-width: min(var(--container-max), var(--screen-width));
  margin-inline: auto;
  padding-inline: var(--space-xl);
}

.section    { padding-block: var(--space-5xl); }
.section-sm { padding-block: var(--space-3xl); }

.section-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}
.section-header h2 {
  margin-bottom: var(--space-md);
  text-shadow: 0 0 60px rgba(168, 85, 247, 0.25);
}
.section-header p {
  color: var(--color-muted);
  font-size: var(--text-lg);
  max-width: 560px;
  margin-inline: auto;
}

.section-label {
  display: inline-block;
  color: var(--color-purple-light);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
}

/* Purple underline accent for section headings */
.accent-underline {
  position: relative;
  display: inline-block;
}
.accent-underline::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--gradient-purple);
  border-radius: var(--radius-full);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  transition: all var(--transition-base);
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: var(--gradient-purple);
  color: #fff;
  box-shadow: 0 4px 20px var(--color-purple-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--color-purple-glow);
  filter: brightness(1.1);
}
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  color: var(--color-white);
  border: 1px solid var(--color-border);
}
.btn-outline:hover {
  border-color: var(--color-purple);
  color: var(--color-purple-light);
  background: var(--color-purple-glow-sm);
}

.btn-ghost {
  background: transparent;
  color: var(--color-muted);
  padding: 0.5rem 1rem;
}
.btn-ghost:hover { color: var(--color-white); }

.btn-lg {
  padding: 1rem 2.5rem;
  font-size: var(--text-lg);
  border-radius: var(--radius-lg);
}
.btn-sm {
  padding: 0.4rem 1rem;
  font-size: var(--text-sm);
}

.card {
  background: var(--gradient-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  transition: all var(--transition-base);
}
.card:hover {
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-card);
  transform: translateY(-4px);
}

.divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin-block: var(--space-xl);
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.badge-purple {
  background: var(--color-purple-glow);
  color: var(--color-purple-light);
  border: 1px solid rgba(168, 85, 247, 0.3);
}
.badge-success {
  background: rgba(34, 197, 94, 0.12);
  color: var(--color-success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.badge-muted {
  background: rgba(136, 136, 136, 0.1);
  color: var(--color-muted);
  border: 1px solid var(--color-border);
}

.stars {
  display: flex;
  gap: 2px;
  color: var(--color-purple-light);
  font-size: var(--text-sm);
}

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
}

.dot-grid {
  background-image: radial-gradient(circle, rgba(124, 58, 237, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
}

/* ─── Ambient floating orbs ───────────────────────────────────────────── */

main {
  position: relative;
  /* isolation:isolate creates the stacking context the bg-orbs (z-index:-1)
     need to stay visible, WITHOUT assigning an explicit z-index that some
     mobile browsers use to incorrectly paint main above the fixed header */
  isolation: isolate;
  /* overflow-x: clip clips bg-orb overflow WITHOUT creating a scroll container.
     overflow-x: hidden forces overflow-y to auto → nested scroll container →
     iOS Safari captures vertical swipe gestures → page scroll gets stuck.
     overflow-x: clip avoids this entirely. */
  overflow-x: clip;
  max-width: var(--screen-width);
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  filter: blur(120px);
  will-change: transform;
}
.bg-orb-1 {
  top: -5%;
  left: -10%;
  width: 700px;
  height: 700px;
  background: var(--orb-1-color);
  animation: float-orb-1 25s ease-in-out infinite;
}
.bg-orb-2 {
  top: 40%;
  right: -12%;
  width: 500px;
  height: 500px;
  background: var(--orb-2-color);
  animation: float-orb-2 30s ease-in-out infinite;
}
.bg-orb-3 {
  bottom: -5%;
  left: 25%;
  width: 600px;
  height: 600px;
  background: var(--orb-1-color);
  opacity: 0.6;
  animation: float-orb-1 35s ease-in-out infinite reverse;
}

@keyframes float-orb-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(40px, -60px) scale(1.08); }
  66%       { transform: translate(-30px, 40px) scale(0.94); }
}
@keyframes float-orb-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  40%       { transform: translate(-50px, 30px) scale(1.12); }
  70%       { transform: translate(35px, -40px) scale(0.92); }
}

@keyframes ripple-out {
  to { transform: scale(4); opacity: 0; }
}
.btn { overflow: hidden; position: relative; }
.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transform: scale(0);
  animation: ripple-out 600ms linear;
  pointer-events: none;
  width: 80px;
  height: 80px;
  margin-left: -40px;
  margin-top: -40px;
}

@keyframes page-enter {
  from { opacity: 0; }
  to   { opacity: 1; }
}
body { animation: page-enter 0.4s ease both; }

.fade-in {
  opacity: 0;
  transform: translateY(28px) scale(0.97);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.fade-in-delay-1 { transition-delay: 0.10s; }
.fade-in-delay-2 { transition-delay: 0.20s; }
.fade-in-delay-3 { transition-delay: 0.30s; }
.fade-in-delay-4 { transition-delay: 0.40s; }

/* Slide in from left/right */
.slide-left {
  opacity: 0;
  transform: translateX(-32px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.slide-right {
  opacity: 0;
  transform: translateX(32px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.slide-left.visible,
.slide-right.visible {
  opacity: 1;
  transform: translateX(0);
}

@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-3xl); }
}

@media (max-width: 768px) {
  .container { padding-inline: var(--space-md); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .section { padding-block: var(--space-3xl); }
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  .btn-lg { padding: 0.875rem 1.75rem; font-size: var(--text-base); }
  /* Disable fixed background on mobile — causes scroll jank on iOS */
  body { background-attachment: scroll; }
  /* Shrink bg-orbs so their physical extent + blur(120px) stays within
     the clipped overflow-x:hidden boundary on narrow screens */
  .bg-orb-1 { width: 320px; height: 320px; }
  .bg-orb-2 { width: 260px; height: 260px; }
  .bg-orb-3 { width: 280px; height: 280px; }
}

@media (max-width: 480px) {
  .section { padding-block: var(--space-2xl); }
  .section-sm { padding-block: var(--space-xl); }
}
