/* ==========================================================================
   Visual enhancement layer
   --------------------------------------------------------------------------
   Loaded after style.css. It does not restyle the layout, it makes the
   existing navy + gold design richer: ambient light, glass surfaces, depth,
   and motion.

   Everything is expressed through the custom properties already declared in
   style.css, so a partner that overrides --gold / --primary / --surface keeps
   its branding and inherits the whole enhancement for free. No brand colour is
   hardcoded here on purpose.

   All motion is disabled under prefers-reduced-motion.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. EXTRA TOKENS
   Derived from the base palette so partner overrides cascade.
   -------------------------------------------------------------------------- */
:root {
  --enh-glow-gold: 212, 175, 55;
  --enh-glow-accent: 110, 198, 232;
  --enh-radius-lg: 20px;
  --enh-radius-xl: 28px;
  --enh-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --enh-lift: -6px;
  --enh-sheen: linear-gradient(115deg, transparent 20%, rgba(255, 255, 255, 0.16) 45%, transparent 70%);
}

/* --------------------------------------------------------------------------
   2. AMBIENT BACKGROUND
   Three slow-drifting colour blooms plus a fine dot grid, sitting behind all
   content and fixed to the viewport so scrolling does not reveal seams.
   -------------------------------------------------------------------------- */
body {
  position: relative;
  isolation: isolate;
}

body::before {
  content: "";
  position: fixed;
  inset: -20vmax;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(38vmax 38vmax at 12% 8%,  rgba(var(--enh-glow-gold), 0.14), transparent 62%),
    radial-gradient(34vmax 34vmax at 88% 12%, rgba(var(--enh-glow-accent), 0.10), transparent 60%),
    radial-gradient(46vmax 46vmax at 50% 96%, rgba(var(--enh-glow-gold), 0.10), transparent 65%);
  animation: enh-drift 26s var(--enh-ease) infinite alternate;
  will-change: transform;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.6;
  background-image: radial-gradient(rgba(15, 23, 42, 0.05) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 20%, transparent 75%);
          mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 20%, transparent 75%);
}

@keyframes enh-drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(2.5%, -2%, 0) scale(1.06); }
  100% { transform: translate3d(-2%, 2.5%, 0) scale(1.02); }
}

/* --------------------------------------------------------------------------
   3. GLASS SURFACES
   Cards and panels gain a translucent top highlight and blur. Falls back to a
   solid surface where backdrop-filter is unsupported.
   -------------------------------------------------------------------------- */
.card,
.program-card,
.course-card,
.module-card,
.testimonial-card,
.benefit-card,
.quote-card,
.faq-item,
.stat-card,
.sidebar-card,
.panel,
.pricing-card,
.form-container {
  position: relative;
  border-radius: var(--enh-radius-lg);
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0) 42%),
    var(--surface);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transition:
    transform 0.4s var(--enh-ease),
    box-shadow 0.4s var(--enh-ease),
    border-color 0.4s var(--enh-ease);
  overflow: hidden;
}

@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .card,
  .program-card,
  .course-card,
  .module-card,
  .testimonial-card,
  .benefit-card,
  .quote-card,
  .stat-card,
  .sidebar-card,
  .panel {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0) 45%),
      rgba(var(--enh-glow-gold), 0.035);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
            backdrop-filter: blur(14px) saturate(140%);
  }
}

/* A gold hairline that brightens on hover, drawn with a mask so it does not
   add a pixel of layout. */
.card::before,
.program-card::before,
.course-card::before,
.module-card::before,
.benefit-card::before,
.quote-card::before,
.stat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg,
    rgba(var(--enh-glow-gold), 0.55),
    rgba(var(--enh-glow-gold), 0) 38%,
    rgba(var(--enh-glow-accent), 0) 62%,
    rgba(var(--enh-glow-accent), 0.35));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0.35;
  transition: opacity 0.45s var(--enh-ease);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   4. HOVER LIFT + GLOW
   -------------------------------------------------------------------------- */
@media (hover: hover) {
  .card:hover,
  .program-card:hover,
  .course-card:hover,
  .module-card:hover,
  .stat-card:hover,
  .testimonial-card:hover {
    transform: translateY(var(--enh-lift));
    border-color: var(--border-strong);
    box-shadow:
      var(--shadow-lg),
      0 0 0 1px rgba(var(--enh-glow-gold), 0.18),
      0 18px 46px rgba(2, 6, 16, 0.62),
      0 0 44px rgba(var(--enh-glow-gold), 0.16);
  }
  .card:hover::before,
  .program-card:hover::before,
  .course-card:hover::before,
  .module-card:hover::before,
  .benefit-card:hover::before,
  .quote-card:hover::before,
  .stat-card:hover::before {
    opacity: 1;
  }
}

/* --------------------------------------------------------------------------
   5. TYPOGRAPHY
   Gradient headings and a slightly looser body rhythm. Heading colour is the
   gold token, so it follows partner branding.
   -------------------------------------------------------------------------- */
h1, h2, h3, .hero-title, .section-title, .card-title {
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.hero-title,
.section-title {
  background: linear-gradient(120deg,
    var(--ink) 0%,
    var(--gold-soft) 48%,
    var(--gold) 72%,
    var(--gold-soft) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: enh-shimmer-text 9s ease-in-out infinite alternate;
}

@keyframes enh-shimmer-text {
  from { background-position: 0% 50%; }
  to   { background-position: 100% 50%; }
}

p, li, td, .card p, .card li {
  line-height: 1.72;
}

/* --------------------------------------------------------------------------
   6. BUTTONS
   A sheen that sweeps across on hover, on top of the existing fills.
   -------------------------------------------------------------------------- */
.btn,
.btn-primary,
.btn-secondary,
.btn-gold,
button.btn,
a.btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition:
    transform 0.28s var(--enh-ease),
    box-shadow 0.28s var(--enh-ease),
    filter 0.28s var(--enh-ease);
}

.btn::after,
.btn-primary::after,
.btn-secondary::after,
.btn-gold::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--enh-sheen);
  transform: translateX(-120%);
  transition: transform 0.7s var(--enh-ease);
  pointer-events: none;
}

@media (hover: hover) {
  .btn:hover,
  .btn-primary:hover,
  .btn-secondary:hover,
  .btn-gold:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
    box-shadow: 0 12px 30px rgba(var(--enh-glow-gold), 0.26);
  }
  .btn:hover::after,
  .btn-primary:hover::after,
  .btn-secondary:hover::after,
  .btn-gold:hover::after {
    transform: translateX(120%);
  }
  .btn:active,
  .btn-primary:active,
  .btn-secondary:active,
  .btn-gold:active {
    transform: translateY(0);
  }
}

/* --------------------------------------------------------------------------
   7. COURSE MEDIA
   Slow zoom on the thumbnail plus a gradient scrim so the overlaid text always
   has contrast, whatever the photo underneath happens to be.
   -------------------------------------------------------------------------- */
.course-card img,
.program-card img,
.card img[src*="ytimg"],
.course-thumb img {
  transition: transform 0.85s var(--enh-ease), filter 0.6s var(--enh-ease);
  will-change: transform;
}

@media (hover: hover) {
  .course-card:hover img,
  .program-card:hover img,
  .course-thumb:hover img {
    transform: scale(1.09);
    filter: saturate(115%) contrast(1.05);
  }
}

.course-card .course-body,
.program-card .program-body,
.card .card-body {
  position: relative;
}

/* --------------------------------------------------------------------------
   8. ICONS, BADGES, PILLS
   -------------------------------------------------------------------------- */
.badge,
.pill,
.tag,
.chip,
.course-badge,
.level-badge {
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.03em;
  border: 1px solid var(--border);
  background: linear-gradient(135deg,
    rgba(var(--enh-glow-gold), 0.18),
    rgba(var(--enh-glow-gold), 0.05));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

i.fas, i.far, i.fab, .fa-solid, .fa-regular, .fa-brands {
  transition: transform 0.35s var(--enh-ease), color 0.35s var(--enh-ease);
}

.stat-card:hover i.fas,
.course-card:hover i.fas,
.program-card:hover i.fas {
  transform: scale(1.18) rotate(-6deg);
  color: var(--gold-soft);
}

/* --------------------------------------------------------------------------
   9. FORMS
   -------------------------------------------------------------------------- */
input, select, textarea {
  transition:
    border-color 0.28s var(--enh-ease),
    box-shadow 0.28s var(--enh-ease),
    background-color 0.28s var(--enh-ease);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(var(--enh-glow-gold), 0.18);
}

/* --------------------------------------------------------------------------
   10. TABLES AND DIVIDERS
   -------------------------------------------------------------------------- */
table thead th {
  background: linear-gradient(180deg, rgba(var(--enh-glow-gold), 0.10), transparent);
  letter-spacing: 0.04em;
}

tbody tr {
  transition: background-color 0.25s var(--enh-ease);
}
tbody tr:hover {
  background-color: rgba(var(--enh-glow-gold), 0.05);
}

/* --------------------------------------------------------------------------
   11. SCROLL REVEAL
   main.js adds .reveal to blocks as they enter the viewport. Without JS the
   class is never added, so content stays visible - this never hides anything
   permanently.
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.8s var(--enh-ease),
    transform 0.8s var(--enh-ease);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* --------------------------------------------------------------------------
   12. ACCESSIBILITY
   A visible focus ring, and no motion for anyone who asked for less of it.
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  body::before {
    animation: none;
  }

  .hero-title,
  .section-title {
    animation: none;
    background: none;
    color: var(--gold-soft);
    -webkit-text-fill-color: currentColor;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  @media (hover: hover) {
    .card:hover,
    .program-card:hover,
    .course-card:hover,
    .module-card:hover,
    .benefit-card:hover,
    .quote-card:hover,
    .stat-card:hover {
      transform: none;
    }
  }
}

/* --------------------------------------------------------------------------
   13. PRINT
   Decorative layers must not print.
   -------------------------------------------------------------------------- */
@media print {
  body::before,
  body::after {
    display: none !important;
  }
  .card,
  .program-card,
  .course-card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }
}
