/* Art direction: Professional AI training center → Corporate innovation, trustworthy
   Palette: warm white/teal/navy — clean, corporate but modern
   Typography: DM Sans (display) + Inter (body) — geometric modern clarity
   Density: spacious — editorial, generous whitespace */

/* ===== FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --font-display: 'DM Sans', 'Helvetica Neue', sans-serif;
  --font-body: 'Inter', 'Helvetica Neue', sans-serif;

  /* ===== TYPE SCALE ===== */
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);
  --text-hero: clamp(3rem,     0.5rem  + 7vw,    8rem);

  /* ===== SPACING (4px base) ===== */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* ===== RADIUS ===== */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* ===== TRANSITIONS ===== */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* ===== CONTENT WIDTHS ===== */
  --content-narrow: 720px;
  --content-default: 1060px;
  --content-wide: 1380px;
  --content-full: 100%;
}

/* ===== LIGHT MODE (default) ===== */
:root, [data-theme="light"] {
  /* Surfaces — warm white foundation */
  --color-bg:             #F8F6F3;
  --color-surface:        #FFFFFF;
  --color-surface-2:      #F1EFEC;
  --color-surface-offset: #E8E5E0;
  --color-surface-dynamic: #DDD9D4;
  --color-divider:        #D4D0CB;
  --color-border:         #C8C4BF;

  /* Text */
  --color-text:           #0A1628;
  --color-text-muted:     #5A6578;
  --color-text-faint:     #9CA3AF;
  --color-text-inverse:   #FFFFFF;

  /* Primary Accent — Deep Teal */
  --color-primary:        #0D7377;
  --color-primary-hover:  #0A5C5F;
  --color-primary-active: #084547;
  --color-primary-light:  #14B8A6;
  --color-primary-highlight: rgba(13, 115, 119, 0.08);

  /* Dark Navy */
  --color-navy:           #0A1628;
  --color-navy-light:     #1A2A42;

  /* Semantic */
  --color-error:          #DC2626;
  --color-error-highlight: #FEF2F2;
  --color-success:        #16A34A;
  --color-success-highlight: #F0FDF4;
  --color-warning:        #D97706;
  --color-warning-highlight: #FFFBEB;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(10, 22, 40, 0.05);
  --shadow-md: 0 4px 12px rgba(10, 22, 40, 0.08);
  --shadow-lg: 0 12px 32px rgba(10, 22, 40, 0.12);
  --shadow-xl: 0 20px 48px rgba(10, 22, 40, 0.16);
}

/* ===== DARK MODE ===== */
[data-theme="dark"] {
  --color-bg:             #0A1628;
  --color-surface:        #111E33;
  --color-surface-2:      #162640;
  --color-surface-offset: #1A2A42;
  --color-surface-dynamic: #1F3050;
  --color-divider:        #253650;
  --color-border:         #2F4060;

  --color-text:           #E8ECF2;
  --color-text-muted:     #94A3B8;
  --color-text-faint:     #64748B;
  --color-text-inverse:   #0A1628;

  --color-primary:        #14B8A6;
  --color-primary-hover:  #2DD4BF;
  --color-primary-active: #5EEAD4;
  --color-primary-light:  #14B8A6;
  --color-primary-highlight: rgba(20, 184, 166, 0.12);

  --color-navy:           #E8ECF2;
  --color-navy-light:     #CBD5E1;

  --color-error:          #F87171;
  --color-error-highlight: rgba(248, 113, 113, 0.1);
  --color-success:        #4ADE80;
  --color-success-highlight: rgba(74, 222, 128, 0.1);
  --color-warning:        #FBBF24;
  --color-warning-highlight: rgba(251, 191, 36, 0.1);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 48px rgba(0, 0, 0, 0.6);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:             #0A1628;
    --color-surface:        #111E33;
    --color-surface-2:      #162640;
    --color-surface-offset: #1A2A42;
    --color-surface-dynamic: #1F3050;
    --color-divider:        #253650;
    --color-border:         #2F4060;
    --color-text:           #E8ECF2;
    --color-text-muted:     #94A3B8;
    --color-text-faint:     #64748B;
    --color-text-inverse:   #0A1628;
    --color-primary:        #14B8A6;
    --color-primary-hover:  #2DD4BF;
    --color-primary-active: #5EEAD4;
    --color-primary-light:  #14B8A6;
    --color-primary-highlight: rgba(20, 184, 166, 0.12);
    --color-navy:           #E8ECF2;
    --color-navy-light:     #CBD5E1;
    --color-error:          #F87171;
    --color-error-highlight: rgba(248, 113, 113, 0.1);
    --color-success:        #4ADE80;
    --color-success-highlight: rgba(74, 222, 128, 0.1);
    --color-warning:        #FBBF24;
    --color-warning-highlight: rgba(251, 191, 36, 0.1);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 48px rgba(0, 0, 0, 0.6);
  }
}

/* ===== SCROLL ANIMATIONS ===== */
.fade-in { opacity: 1; }

@supports (animation-timeline: scroll()) {
  .fade-in {
    opacity: 0;
    animation: reveal-fade linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 100%;
  }
}

@keyframes reveal-fade {
  to { opacity: 1; }
}

/* ===== 3D SCROLL SYSTEM ===== */
.scroll3d {
  will-change: transform, opacity;
  transition:
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--scroll3d-delay, 0s);
}

/* Fade up — translate Y + opacity */
.scroll3d[data-scroll3d="fade-up"] {
  opacity: 0;
  transform: translateY(60px) perspective(800px) rotateX(4deg);
}
.scroll3d[data-scroll3d="fade-up"].scroll3d--visible {
  opacity: 1;
  transform: translateY(0) perspective(800px) rotateX(0);
}

/* Fade right — translate X + slight rotate */
.scroll3d[data-scroll3d="fade-right"] {
  opacity: 0;
  transform: translateX(-80px) perspective(800px) rotateY(-6deg);
}
.scroll3d[data-scroll3d="fade-right"].scroll3d--visible {
  opacity: 1;
  transform: translateX(0) perspective(800px) rotateY(0);
}

/* Tilt in — perspective tilt from below */
.scroll3d[data-scroll3d="tilt-in"] {
  opacity: 0;
  transform: perspective(1000px) rotateX(12deg) rotateY(-4deg) translateY(40px) scale(0.94);
}
.scroll3d[data-scroll3d="tilt-in"].scroll3d--visible {
  opacity: 1;
  transform: perspective(1000px) rotateX(0) rotateY(0) translateY(0) scale(1);
}

/* Flip up — card-flip reveal */
.scroll3d[data-scroll3d="flip-up"] {
  opacity: 0;
  transform: perspective(600px) rotateX(-15deg) translateY(30px);
  transform-origin: bottom center;
}
.scroll3d[data-scroll3d="flip-up"].scroll3d--visible {
  opacity: 1;
  transform: perspective(600px) rotateX(0) translateY(0);
}

/* Rotate in — 3D rotation from side */
.scroll3d[data-scroll3d="rotate-in"] {
  opacity: 0;
  transform: perspective(800px) rotateY(8deg) translateX(-30px) scale(0.96);
}
.scroll3d[data-scroll3d="rotate-in"].scroll3d--visible {
  opacity: 1;
  transform: perspective(800px) rotateY(0) translateX(0) scale(1);
}

/* Scale in — zoom up from small */
.scroll3d[data-scroll3d="scale-in"] {
  opacity: 0;
  transform: scale(0.88) translateY(30px);
}
.scroll3d[data-scroll3d="scale-in"].scroll3d--visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .scroll3d {
    transition-duration: 0.01s !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

/* ===== UTILITY CLASSES ===== */
.container {
  width: 100%;
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.container--narrow {
  max-width: var(--content-default);
}

.section-padding {
  padding-block: clamp(var(--space-12), 8vw, var(--space-24));
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background var(--transition-interactive),
              color var(--transition-interactive),
              box-shadow var(--transition-interactive),
              transform var(--transition-interactive);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); box-shadow: var(--shadow-sm); }

.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}
.btn-primary:hover {
  background: var(--color-primary-hover);
}

.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
}
.btn-secondary:hover {
  background: var(--color-primary-highlight);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
}
.btn-ghost:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  background: var(--color-primary-highlight);
  color: var(--color-primary);
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: box-shadow var(--transition-interactive),
              transform var(--transition-interactive),
              border-color var(--transition-interactive);
}

.card--hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
  cursor: pointer;
}

.text-gradient {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== ZOOM PAGE TRANSITION ===== */

/* Phase 2: Gradient bubble expands from button center */
.zoom-transition-overlay {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(13, 115, 119, 0.8) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 25%, rgba(20, 184, 166, 0.7) 0%, transparent 45%),
    radial-gradient(ellipse at 55% 70%, rgba(37, 99, 235, 0.5) 0%, transparent 50%),
    radial-gradient(ellipse at 30% 80%, rgba(232, 133, 74, 0.35) 0%, transparent 45%),
    linear-gradient(160deg, #0A1628 0%, #0D7377 30%, #14B8A6 50%, #2563EB 70%, #0D7377 90%, #0A1628 100%);
  background-size: 250% 250%;
  animation: zoom-gradient-shift 3s ease infinite;
  /* Initial: small pill at button position */
  width: 80px;
  height: 44px;
  border-radius: 22px;
  transition: all 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Bubble appears at button shape */
.zoom-transition-overlay.zoom-transition--show {
  opacity: 1;
}

/* Bubble expands to fill entire viewport as a circle */
.zoom-transition-overlay.zoom-transition--active {
  opacity: 1;
  border-radius: 50%;
  transition: all 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Fade out after navigation */
.zoom-transition-overlay.zoom-transition--fade-out {
  opacity: 0;
  transition: opacity 0.55s ease;
}

@keyframes zoom-gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .zoom-transition-overlay {
    transition-duration: 0.01s !important;
    animation: none !important;
  }
}
