/* ════════════════════════════════════════════
   COMPONENTS — Enterprise-Grade Reusable System
   Depends on tokens.css
   Patterns sourced from: oksana-site, runsmart, roundglass portfolio
   Apple HIG: 44px touch targets, SF Pro, WCAG AA contrast
   ════════════════════════════════════════════ */

/* ── Animations ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 16px rgba(97,63,231,0.18); }
  50%      { box-shadow: 0 0 28px rgba(97,63,231,0.35); }
}

/* ── Page Loader (pulsing logo + expanding rings) ── */
#site-loader {
  position: fixed;
  inset: 0;
  background: #010005;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.55s ease;
}
.loader-orb {
  width: 52px; height: 52px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--violet, #5AC8FA), var(--cyan, #5AC8FA));
  box-shadow: 0 0 28px rgba(97,63,231,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  animation: loaderPulse 1.4s ease-in-out infinite;
  overflow: hidden;
}
.loader-orb img {
  width: 36px; height: 36px;
  border-radius: 6px;
}
.loader-rings {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
}
.loader-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid;
  animation: loaderRing 2.2s ease-out infinite;
}
.loader-ring.r1 { width: 84px;  height: 84px;  border-color: rgba(97,63,231,0.55); animation-delay: 0s; }
.loader-ring.r2 { width: 120px; height: 120px; border-color: rgba(90,200,250,0.32); animation-delay: -0.7s; }
.loader-ring.r3 { width: 158px; height: 158px; border-color: rgba(191,64,128,0.20); animation-delay: -1.4s; }

@keyframes loaderPulse {
  0%, 100% { transform: scale(1);    box-shadow: 0 0 28px rgba(97,63,231,0.6); }
  50%      { transform: scale(1.10); box-shadow: 0 0 48px rgba(97,63,231,0.9); }
}
@keyframes loaderRing {
  0%   { transform: scale(0.75); opacity: 0; }
  40%  { opacity: 1; }
  100% { transform: scale(1.25); opacity: 0; }
}

/* ── Scroll animations (oksana-site pattern — .anim-up + .visible) ── */
.anim-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.56s ease, transform 0.56s ease;
}
.anim-up.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .anim-up { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* Legacy class (backwards compat) */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s cubic-bezier(0.25,0.1,0.25,1),
              transform 0.5s cubic-bezier(0.25,0.1,0.25,1);
}
.reveal.is-revealed { opacity: 1; transform: translateY(0); }

/* ── Ambient Atmosphere (radial nebula wash, fixed) ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 15% 20%, rgba(97,63,231,0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 75%, rgba(90,200,250,0.07) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 50%, rgba(191,64,128,0.05) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}
.page { position: relative; z-index: 1; }

/* ════════════════════════════════════════════
   TOP NAV — frosted glass with saturate
   ════════════════════════════════════════════ */
/* ════════════════════════════════════════════
   TOP NAV — Apple developer.apple.com pattern
   Full-bleed glass, contained inner, compact text
   ════════════════════════════════════════════ */
/* Nav styles moved to nav.css — single source */

/* ════════════════════════════════════════════
   HERO — tall, immersive (oksana-site pattern)
   ════════════════════════════════════════════ */
.hero {
  padding: 130px var(--section-x) var(--sp-8);
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: clamp(360px, 55vh, 640px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.hero-eyebrow {
  display: flex; align-items: center; justify-content: center;
  gap: var(--sp-1); margin-bottom: var(--sp-3);
  animation: fadeInUp 0.5s ease 0.1s both;
}
.hero h1 {
  margin-bottom: var(--sp-3);
  animation: fadeInUp 0.5s ease 0.2s both;
}
.hero p.lead {
  font-size: var(--type-callout); color: var(--text-secondary);
  max-width: 640px; margin: 0 auto var(--sp-4); line-height: 1.6;
  animation: fadeInUp 0.5s ease 0.3s both;
}
.hero-meta {
  display: flex; align-items: center; justify-content: center;
  gap: var(--sp-2); flex-wrap: wrap;
  animation: fadeInUp 0.5s ease 0.4s both;
}

/* Hero badge (Apple Intelligence style) */
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--cyan);
  padding: 6px 16px; border-radius: var(--r-pill);
  background: rgba(90,200,250,0.08);
  border: 1px solid rgba(90,200,250,0.18);
  margin-bottom: var(--sp-3);
}

/* ════════════════════════════════════════════
   GLASS CARD — layered depth system
   ════════════════════════════════════════════ */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  padding: var(--sp-4);
  transition:
    border-color var(--transition-base),
    transform var(--transition-base),
    box-shadow var(--transition-base);
}
.glass-card:hover {
  border-color: var(--glass-border-hi);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.24);
}
.glass-card.deep {
  background: var(--glass-bg-deep);
}
.glass-card.cta {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-8, 64px) var(--sp-4, 32px);
}
.glass-card.flat:hover { transform: none; box-shadow: none; }

/* Accent border variants (from roundglass gold-border pattern) */
.glass-card.accent-sage   { border-color: rgba(82,183,136,0.35); }
.glass-card.accent-cyan   { border-color: rgba(90,200,250,0.35); }
.glass-card.accent-violet { border-color: rgba(97,63,231,0.35); }
.glass-card.accent-gold   { border-color: rgba(233,196,106,0.35); }

/* Glow on hover for featured cards */
.glass-card.glow:hover {
  box-shadow: 0 0 24px rgba(90,200,250,0.15), 0 8px 32px rgba(0,0,0,0.24);
}

/* ════════════════════════════════════════════
   PILL BADGES
   ════════════════════════════════════════════ */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600;
  padding: 4px 12px; border-radius: var(--r-pill);
  letter-spacing: 0.3px;
}
.pill-cyan   { background: rgba(90,200,250,0.15);  color: var(--cyan);    border: 1px solid rgba(90,200,250,0.25); }
.pill-violet { background: rgba(97,63,231,0.18);   color: #9B6EFF;        border: 1px solid rgba(97,63,231,0.30); }
.pill-green  { background: rgba(52,199,89,0.15);   color: #34C759;        border: 1px solid rgba(52,199,89,0.25); }
.pill-gold   { background: rgba(233,196,106,0.15); color: var(--gold);    border: 1px solid rgba(233,196,106,0.25); }
.pill-terra  { background: rgba(188,71,73,0.15);   color: #FF6B6E;        border: 1px solid rgba(188,71,73,0.25); }
.pill-sage   { background: rgba(82,183,136,0.15);  color: var(--dew-sage);border: 1px solid rgba(82,183,136,0.25); }

/* ════════════════════════════════════════════
   BUTTONS — Apple HIG 44px touch targets
   ════════════════════════════════════════════ */
/* ── Buttons (oksana-site pattern — solid violet, r-md not pill) ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 28px; border-radius: var(--r-md);
  font-size: 15px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent;
  text-decoration: none;
  min-height: 44px;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s, border-color 0.2s;
}
.btn-secondary {
  background: transparent;
  border-color: var(--glass-border-hi);
  color: var(--text-primary);
}
.btn-secondary:hover {
  border-color: var(--cyan);
  background: rgba(90,200,250,0.06);
}
.btn-sage {
  background: var(--dew-forest);
  color: white;
}
.btn-sage:hover {
  background: var(--dew-sage);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(45,106,79,0.35);
}
.btn svg { flex-shrink: 0; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
}
.btn-ghost:hover {
  border-color: var(--glass-border-hi);
  color: var(--text-primary);
  background: rgba(90,200,250,0.06);
}

/* ════════════════════════════════════════════
   GRID SYSTEM
   ════════════════════════════════════════════ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap, var(--sp-3)); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap, var(--sp-3)); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap, var(--sp-3)); }
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════
   DIVIDER — gradient line
   ════════════════════════════════════════════ */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-border-hi), transparent);
  margin: var(--sp-6) 0;
}

/* ════════════════════════════════════════════
   STAT ROW — proof numbers
   ════════════════════════════════════════════ */
.stat-row { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.stat {
  flex: 1; min-width: 140px; text-align: center;
  padding: var(--sp-3);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}
.stat:hover {
  border-color: var(--glass-border-hi);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.stat-value {
  font-size: 28px; font-weight: 700; letter-spacing: -0.5px;
  color: var(--text-primary); line-height: 1;
}
.stat-label {
  font-size: 12px; color: var(--text-tertiary);
  margin-top: 6px; text-transform: uppercase; letter-spacing: 0.5px;
}

/* Large stat (from roundglass proof-grid pattern) */
.stat-large .stat-value {
  font-size: 40px; letter-spacing: -1px;
}

/* ════════════════════════════════════════════
   HUB CARDS — index pages linking to subpages
   ════════════════════════════════════════════ */
.hub-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  padding: var(--sp-4);
  display: flex; flex-direction: column; gap: var(--sp-2);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  transition:
    border-color var(--transition-base),
    transform var(--transition-base),
    box-shadow var(--transition-base);
  text-decoration: none; color: inherit;
}
.hub-card:hover {
  border-color: var(--glass-border-hi);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.28);
  opacity: 1;
}
.hub-card-icon {
  width: 44px; height: 44px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  background: rgba(90,200,250,0.08);
  border: 1px solid var(--glass-border);
}
.hub-card-arrow {
  margin-top: auto; padding-top: var(--sp-2);
  font-size: 13px; color: var(--cyan);
  display: inline-flex; align-items: center; gap: 6px;
  transition: gap var(--transition-base);
}
.hub-card:hover .hub-card-arrow { gap: 10px; }

/* ════════════════════════════════════════════
   TRUST BAR (from oksana-site)
   ════════════════════════════════════════════ */
.trust-bar {
  display: flex; align-items: center; justify-content: center;
  gap: var(--sp-2); flex-wrap: wrap;
  padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
  font-size: 13px; color: var(--text-tertiary);
}
.trust-bar .trust-name { color: var(--text-secondary); font-weight: 500; }
.trust-bar .trust-stat { color: var(--cyan); font-weight: 600; }
.trust-bar .trust-sep  { opacity: 0.3; }

/* ════════════════════════════════════════════
   SECTION HEADER (from oksana-site pattern)
   ════════════════════════════════════════════ */
.section-header { text-align: center; max-width: 640px; margin: 0 auto var(--sp-5); }
.section-label {
  font-size: 11px; font-weight: 600; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--cyan);
  margin-bottom: var(--sp-1);
}
.section-title { margin-bottom: var(--sp-2); }
.section-sub   { color: var(--text-secondary); }

/* ════════════════════════════════════════════
   PAGE NAV (bottom of pages — prev/next)
   ════════════════════════════════════════════ */
.page-nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--sp-4) 0;
  margin-top: var(--sp-6);
  border-top: 1px solid var(--glass-border);
  gap: var(--sp-2);
}
.page-nav a {
  font-size: 14px; font-weight: 500;
  color: var(--cyan);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 0;
  transition: gap var(--transition-base);
}
.page-nav a:hover { gap: 10px; opacity: 1; }

/* ════════════════════════════════════════════
   FOOTER — enterprise minimal
   ════════════════════════════════════════════ */
footer.site-footer {
  border-top: 1px solid var(--glass-border);
  padding: var(--sp-4) 0;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
}
footer.site-footer .footer-meta {
  display: flex; gap: var(--sp-2); justify-content: center;
  margin-top: 6px; flex-wrap: wrap;
}
footer.site-footer a { color: var(--text-tertiary); }
footer.site-footer a:hover { color: var(--cyan); }

/* ════════════════════════════════════════════
   SECTION DEPTH — subtle alternating backgrounds
   (Apple uses very subtle bg shifts between sections)
   ════════════════════════════════════════════ */
section {
  padding: calc(var(--section-y) + 10px) 0;
  position: relative;
  z-index: 1;
}
section + section { border-top: 1px solid rgba(255,255,255,0.04); }

/* Alternate section: slightly deeper background */
section.section-deep {
  background: rgba(1,0,5,0.4);
}
section.section-raised {
  background: rgba(19,26,54,0.3);
}

/* Section with subtle top gradient line */
section.section-accent {
  border-top: 1px solid transparent;
  background-image: linear-gradient(rgba(90,200,250,0.08), transparent 1px);
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: top;
}

/* ════════════════════════════════════════════
   ENTERPRISE FOOTER — roundglass pattern
   Logo + columns + socials + copyright
   ════════════════════════════════════════════ */
.enterprise-footer {
  padding: var(--sp-4) 0 var(--sp-2);
}
.footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--section-x);
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--sp-6);
}
.footer-brand { display: flex; flex-direction: column; }
.footer-logo-link {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; margin-bottom: var(--sp-1);
}
.footer-logo-link:hover { opacity: 0.85; }
.footer-logo-icon {
  width: 32px; height: 32px; border-radius: 6px;
}
.footer-logo-text {
  font-size: 14px; font-weight: 700;
  letter-spacing: -0.3px; color: var(--text-primary);
}
.footer-tagline {
  font-size: 13px; color: var(--text-tertiary);
  line-height: 1.5; margin-bottom: var(--sp-2);
  font-style: italic;
}
.footer-socials { display: flex; gap: 6px; }
.footer-social {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--glass-border);
  color: var(--text-tertiary);
  transition: all var(--transition-base);
}
.footer-social:hover {
  background: rgba(90,200,250,0.08);
  border-color: var(--glass-border-hi);
  color: var(--text-primary);
  transform: translateY(-1px);
}
.footer-col-title {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--text-tertiary); margin-bottom: var(--sp-2);
}
.footer-links {
  display: flex; flex-direction: column; gap: 6px;
}
.footer-link {
  font-size: 13px; color: var(--text-tertiary);
  text-decoration: none; width: fit-content;
  transition: color var(--transition-base);
}
.footer-link:hover { color: var(--text-primary); opacity: 1; }

.footer-copyright {
  max-width: var(--container-max);
  margin: var(--sp-4) auto 0;
  padding: var(--sp-3) var(--section-x) 0;
  border-top: 1px solid rgba(255,255,255,0.04);
  text-align: center;
  font-size: 11px; color: var(--text-tertiary);
  letter-spacing: 0.2px;
}
.footer-copyright a {
  color: var(--text-tertiary); text-decoration: none;
}
.footer-copyright a:hover { color: var(--text-secondary); }

@media (max-width: 768px) {
  .footer-inner { grid-template-columns: 1fr; gap: var(--sp-4); }
}

/* ════════════════════════════════════════════
   UTILITY
   ════════════════════════════════════════════ */
.text-center { text-align: center; }
.text-cyan   { color: var(--cyan); }
.text-sage   { color: var(--dew-sage); }
.text-muted  { color: var(--text-tertiary); }
.mt-1 { margin-top: var(--sp-1); }
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-3 { margin-bottom: var(--sp-3); }
.gap-2 > * + * { margin-top: var(--sp-2); }
.gap-3 > * + * { margin-top: var(--sp-3); }
