/* ==========================================================================
   ITRC Academy - Core Design System & Interactive Styling
   ========================================================================== */

:root {
  /* Brand Palette from Logo */
  --color-brand-blue-dark: #002e5b;
  --color-brand-blue: #005bb5;
  --color-brand-blue-light: #0077d7;
  --color-brand-cyan: #38bdf8;
  --color-brand-orange: #ff7a00;
  --color-brand-orange-glow: #ffa500;
  --color-brand-gold: #ffbe0b;

  /* Theme Backgrounds & Surfaces */
  --bg-dark-base: #040914;
  --bg-dark-surface: #091326;

  /* Text Colors */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #38bdf8;

  /* Geometry & Spacing */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  /* Font Stack */
  --font-family-base: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Interaction Variables (dynamically adjusted via JS) */
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --sheen-x: 50%;
  --sheen-y: 50%;
  --sheen-opacity: 0;
  --spotlight-x: 50vw;
  --spotlight-y: 50vh;
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  font-family: var(--font-family-base);
  background-color: var(--bg-dark-base);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Interactive Background Canvas */
#ambient-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.75;
}

/* Dynamic Radial Mouse Follower */
.cursor-spotlight {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    700px circle at var(--spotlight-x) var(--spotlight-y),
    rgba(0, 119, 215, 0.15) 0%,
    rgba(255, 122, 0, 0.07) 35%,
    transparent 70%
  );
  will-change: background;
}

/* Main Layout Wrapper */
.page-container {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(1rem, 3vw, 2rem) clamp(1.25rem, 4vw, 3.5rem);
}

/* ==========================================================================
   Header Styling
   ========================================================================== */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  gap: 1rem;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.status-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981, 0 0 18px rgba(16, 185, 129, 0.6);
  animation: status-pulse 2.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes status-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.status-text {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.header-tagline {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

.header-tagline .dot {
  color: var(--color-brand-orange);
}

/* ==========================================================================
   Hero Stage & 3D Interactive Logo Centerpiece
   ========================================================================== */
.hero-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  padding: clamp(1.5rem, 4vh, 3.5rem) 0;
}

.stage-perspective-wrapper {
  perspective: 1200px;
  perspective-origin: center center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.interactive-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(320px, 86vw, 660px);
  transform-style: preserve-3d;
  transform: rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
  transition: transform 0.12s cubic-bezier(0.2, 0, 0.2, 1);
  will-change: transform;
  outline: none;
  cursor: pointer;
  border-radius: var(--radius-lg);
  user-select: none;
}

/* Floating animation when idle */
.interactive-card.idle-float {
  animation: gentle-float 6s ease-in-out infinite alternate;
}

@keyframes gentle-float {
  0% {
    transform: rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translateY(0px);
  }
  50% {
    transform: rotateX(calc(var(--tilt-x) + 1.5deg)) rotateY(calc(var(--tilt-y) - 1.5deg)) translateY(-10px);
  }
  100% {
    transform: rotateX(calc(var(--tilt-x) - 1deg)) rotateY(calc(var(--tilt-y) + 1.2deg)) translateY(4px);
  }
}

/* Dynamic Ambient Backlight Orbs */
.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  z-index: 1;
  opacity: 0.65;
  transition: opacity 0.4s ease, filter 0.4s ease;
}

.glow-amber {
  top: 6%;
  left: 8%;
  width: clamp(180px, 28vw, 270px);
  height: clamp(180px, 28vw, 270px);
  background: radial-gradient(circle, rgba(255, 122, 0, 0.65) 0%, rgba(255, 165, 0, 0.25) 55%, transparent 75%);
}

.glow-blue {
  bottom: 8%;
  right: 6%;
  width: clamp(220px, 34vw, 340px);
  height: clamp(220px, 34vw, 340px);
  background: radial-gradient(circle, rgba(0, 119, 215, 0.7) 0%, rgba(10, 88, 202, 0.25) 55%, transparent 75%);
}

.interactive-card:hover .glow-orb {
  opacity: 0.95;
  filter: blur(50px);
}

/* Card Shell - Crisp Pure White Card */
.card-glass-shell {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: clamp(2.2rem, 5.5vw, 3.8rem) clamp(1.8rem, 5vw, 3.4rem);
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-lg);
  box-shadow:
    0 25px 65px -10px rgba(0, 0, 0, 0.7),
    0 0 45px rgba(0, 119, 215, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.8),
    inset 0 1px 2px rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: translateZ(32px);
  transform-style: preserve-3d;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
  overflow: hidden;
}

.interactive-card:hover .card-glass-shell,
.interactive-card:focus-visible .card-glass-shell {
  border-color: #ffffff;
  box-shadow:
    0 35px 85px -12px rgba(0, 0, 0, 0.82),
    0 0 60px rgba(56, 189, 248, 0.4),
    0 0 75px rgba(255, 122, 0, 0.25),
    inset 0 2px 4px rgba(255, 255, 255, 1);
}

/* Dynamic Glare / Specular Highlight */
.card-sheen {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(
    500px circle at var(--sheen-x) var(--sheen-y),
    rgba(255, 255, 255, 0.95) 0%,
    rgba(235, 245, 255, 0.6) 35%,
    rgba(255, 255, 255, 0) 70%
  );
  opacity: var(--sheen-opacity);
  mix-blend-mode: soft-light;
  transition: opacity 0.3s ease;
  z-index: 3;
}

/* Logo Image Container */
.logo-wrapper {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  transform: translateZ(52px);
  transform-style: preserve-3d;
}

.brand-logo {
  width: 100%;
  max-width: 500px;
  height: auto;
  aspect-ratio: 1536 / 1024;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 6px 16px rgba(0, 43, 91, 0.12));
  transition: transform 0.25s ease, filter 0.25s ease;
}

.interactive-card:hover .brand-logo {
  filter: drop-shadow(0 10px 24px rgba(0, 43, 91, 0.18));
}

.interactive-card:active .brand-logo {
  transform: scale(0.985);
}

/* Interaction Hint below logo */
.interaction-hint {
  margin-top: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.725rem;
  font-weight: 600;
  color: #475569;
  letter-spacing: 0.05em;
  opacity: 0.85;
  transition: opacity 0.4s ease, color 0.4s ease;
  transform: translateZ(35px);
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-full);
  background: rgba(0, 43, 91, 0.05);
}

.interaction-hint .hint-icon {
  width: 14px;
  height: 14px;
  color: var(--color-brand-orange);
}

.interactive-card:hover .interaction-hint {
  opacity: 1;
  color: #0f172a;
  background: rgba(0, 43, 91, 0.09);
}

/* Active Click Wave Pulse */
.click-ripple {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.45) 0%, rgba(255, 122, 0, 0.25) 50%, transparent 80%);
  transform: scale(0);
  animation: ripple-wave 0.8s ease-out forwards;
  pointer-events: none;
  z-index: 5;
}

@keyframes ripple-wave {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ==========================================================================
   Footer Area & Mail Login Button
   ========================================================================== */
.site-footer {
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.copyright-notice {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.copyright-notice strong {
  color: var(--text-secondary);
  font-weight: 600;
}

/* Mail Login Button (Small, Refined, Tactile) */
.mail-login-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.78125rem; /* ~12.5px */
  font-weight: 600;
  letter-spacing: 0.03em;
  text-decoration: none;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.25s cubic-bezier(0.2, 0, 0.2, 1);
  overflow: hidden;
  cursor: pointer;
}

.mail-btn-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  background: radial-gradient(
    circle at var(--btn-mouse-x, 50%) var(--btn-mouse-y, 50%),
    rgba(56, 189, 248, 0.25) 0%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.mail-login-btn:hover .mail-btn-glow {
  opacity: 1;
}

.mail-login-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(56, 189, 248, 0.45);
  transform: translateY(-1.5px);
  box-shadow: 
    0 6px 20px -4px rgba(0, 119, 215, 0.35),
    0 0 14px rgba(56, 189, 248, 0.25);
}

.mail-login-btn:active {
  transform: translateY(0px) scale(0.98);
}

.mail-login-btn:focus-visible {
  outline: 2px solid var(--color-brand-cyan);
  outline-offset: 3px;
}

.mail-icon {
  width: 14px;
  height: 14px;
  color: var(--color-brand-orange);
  transition: transform 0.25s ease, color 0.25s ease;
  flex-shrink: 0;
}

.mail-login-btn:hover .mail-icon {
  color: var(--color-brand-gold);
  transform: scale(1.1);
}

.mail-btn-text {
  position: relative;
  z-index: 1;
}

.external-icon {
  width: 11px;
  height: 11px;
  color: var(--text-muted);
  transition: transform 0.25s ease, color 0.25s ease;
  flex-shrink: 0;
}

.mail-login-btn:hover .external-icon {
  color: var(--color-brand-cyan);
  transform: translate(1px, -1px);
}

/* ==========================================================================
   Responsive Breakpoints & Mobile Accessibility
   ========================================================================== */
@media (max-width: 640px) {
  .site-header {
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
  }

  .header-tagline {
    font-size: 0.6875rem;
  }

  .card-glass-shell {
    padding: 1.6rem 1.25rem 1.4rem;
  }

  .interaction-hint {
    font-size: 0.6875rem;
    text-align: center;
  }

  .footer-content {
    flex-direction: column-reverse;
    align-items: center;
    text-align: center;
    gap: 0.85rem;
  }
}

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

  .interactive-card {
    transform: none !important;
  }

  .interactive-card.idle-float {
    animation: none !important;
  }

  #ambient-canvas {
    display: none;
  }
}
