/* ==========================================================================
   RT GROUP - MASTER PORTAL STYLESHEET
   One Ecosystem · Three Forces · One Direction
   ========================================================================== */

:root {
  /* Core Colors */
  --bg-deep: #05070b;
  --bg-surface: #0c1017;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(255, 255, 255, 0.25);

  /* Brand Accents */
  --accent-gold: #f59e0b;
  --accent-gold-glow: rgba(245, 158, 11, 0.4);
  --accent-red: #ef4444;
  --accent-red-glow: rgba(239, 68, 68, 0.4);
  --accent-cyan: #0ea5e9;
  --accent-cyan-glow: rgba(14, 165, 233, 0.4);

  /* Typography */
  --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-arabic: 'Tajawal', 'Cairo', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Transitions */
  --transition-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

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

body[dir="rtl"] {
  font-family: var(--font-arabic);
}

/* Background Canvas Layer */
#particle-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
  opacity: 0.65;
  transition: opacity 0.8s ease;
}

/* Ambient Grain Overlay */
.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Header & Glass Top Bar */
.master-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  background: linear-gradient(180deg, rgba(5, 7, 11, 0.85) 0%, rgba(5, 7, 11, 0) 100%);
  pointer-events: auto;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
}

.brand-emblem {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.05em;
  color: #fff;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
  transition: border-color 0.4s var(--transition-smooth);
}

.brand-emblem::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(60deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transform: rotate(30deg);
  transition: transform 0.8s ease;
}

.brand-badge:hover .brand-emblem::after {
  transform: rotate(30deg) translate(50%, 50%);
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ffffff;
}

.brand-tagline {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.btn-pill {
  height: 40px;
  padding: 0 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(16px);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.3s var(--transition-smooth);
  user-select: none;
}

.btn-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-active);
  transform: translateY(-1px);
}

.btn-icon-only {
  width: 40px;
  padding: 0;
  justify-content: center;
}

.lang-switch {
  font-weight: 700;
}

/* ==========================================================================
   MAIN TRIPTYCH SPLIT CONTAINER
   ========================================================================== */

.portal-container {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: row;
  width: 100vw;
  height: 100vh;
  z-index: 10;
  overflow: hidden;
}

/* Individual Portal Panels */
.portal-panel {
  position: relative;
  flex: 1 1 33.333%;
  height: 100%;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 3.5rem 3rem;
  transition: flex 0.7s var(--transition-smooth), filter 0.6s ease;
  will-change: flex;
}

/* Panel Background Image with Parallax Scale */
.panel-bg {
  position: absolute;
  inset: -5%;
  width: 110%;
  height: 110%;
  background-size: cover;
  background-position: center top;
  transition: transform 0.8s var(--transition-smooth), filter 0.6s ease;
  transform: scale(1.04);
  filter: brightness(0.82) contrast(1.08) saturate(1.05);
}

/* Gradient Shading & Vignettes */
.panel-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(5, 7, 11, 0.35) 0%,
    rgba(5, 7, 11, 0.15) 30%,
    rgba(5, 7, 11, 0.65) 65%,
    rgba(5, 7, 11, 0.95) 100%
  );
  transition: background 0.5s ease, opacity 0.5s ease;
  z-index: 2;
}

/* Color Accent Tint per Column */
.panel-tint {
  position: absolute;
  inset: 0;
  opacity: 0.15;
  mix-blend-mode: color-dodge;
  transition: opacity 0.6s ease;
  z-index: 3;
}

.panel-image-makers .panel-tint {
  background: radial-gradient(circle at 50% 80%, var(--accent-gold), transparent 70%);
}

.panel-red-team .panel-tint {
  background: radial-gradient(circle at 50% 80%, var(--accent-red), transparent 70%);
}

.panel-responsive-training .panel-tint {
  background: radial-gradient(circle at 50% 80%, var(--accent-cyan), transparent 70%);
}

/* Vertical Dividing Lines between columns */
.panel-border {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 1px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.18) 50%,
    rgba(255, 255, 255, 0.05) 100%
  );
  z-index: 4;
}

.portal-panel:last-child .panel-border {
  display: none;
}

/* Panel Content Box */
.panel-content {
  position: relative;
  z-index: 10;
  max-width: 580px;
  transform: translateY(0);
  transition: transform 0.6s var(--transition-smooth);
}

/* Logo in Column */
.panel-logo-wrap {
  margin-bottom: 1.5rem;
  max-width: 280px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.panel-logo {
  max-height: 60px;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.8));
  transition: transform 0.5s var(--transition-smooth), filter 0.5s ease;
}

/* Pillar Index Tag (01 / 02 / 03) */
.pillar-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 0.65rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
}

.pillar-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.panel-image-makers .pillar-dot { background: var(--accent-gold); box-shadow: 0 0 8px var(--accent-gold); }
.panel-red-team .pillar-dot { background: var(--accent-red); box-shadow: 0 0 8px var(--accent-red); }
.panel-responsive-training .pillar-dot { background: var(--accent-cyan); box-shadow: 0 0 8px var(--accent-cyan); }

/* Typography in Cards */
.panel-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 2.2vw, 2.5rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.015em;
  margin-bottom: 0.75rem;
  color: #ffffff;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.9);
}

.panel-tagline {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.85rem;
  opacity: 0.95;
}

.panel-image-makers .panel-tagline { color: #fde68a; }
.panel-red-team .panel-tagline { color: #fca5a5; }
.panel-responsive-training .panel-tagline { color: #7dd3fc; }

.panel-desc {
  font-size: 0.92rem;
  line-height: 1.6;
  color: #cbd5e1;
  margin-bottom: 1.75rem;
  max-width: 440px;
  opacity: 0.75;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s var(--transition-smooth);
}

/* Feature Badges List */
.panel-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.5s ease 0.1s, transform 0.5s var(--transition-smooth) 0.1s;
}

.badge-item {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  backdrop-filter: blur(10px);
}

/* Interactive CTA Button */
.panel-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.95rem 1.85rem;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.4s var(--transition-smooth);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.panel-cta-arrow {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s var(--transition-bounce);
}

body[dir="rtl"] .panel-cta-arrow {
  transform: rotate(180deg);
}

/* Button Colors per Column */
.panel-image-makers .panel-cta {
  background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
  color: #000;
}
.panel-image-makers .panel-cta:hover {
  box-shadow: 0 0 35px var(--accent-gold-glow);
  transform: translateY(-2px);
}

.panel-red-team .panel-cta {
  background: linear-gradient(135deg, #ef4444 0%, #991b1b 100%);
  color: #fff;
}
.panel-red-team .panel-cta:hover {
  box-shadow: 0 0 35px var(--accent-red-glow);
  transform: translateY(-2px);
}

.panel-responsive-training .panel-cta {
  background: linear-gradient(135deg, #0ea5e9 0%, #0369a1 100%);
  color: #fff;
}
.panel-responsive-training .panel-cta:hover {
  box-shadow: 0 0 35px var(--accent-cyan-glow);
  transform: translateY(-2px);
}

.panel-cta:hover .panel-cta-arrow {
  transform: translateX(4px);
}
body[dir="rtl"] .panel-cta:hover .panel-cta-arrow {
  transform: rotate(180deg) translateX(4px);
}

/* ==========================================================================
   EXPANSION & HOVER BEHAVIORS (THE MAGIC TRIPTYCH)
   ========================================================================== */

/* When hovering any panel: expand to 50% width */
.portal-container:hover .portal-panel {
  flex: 1 1 25%;
  filter: brightness(0.65) saturate(0.8);
}

.portal-container .portal-panel:hover {
  flex: 1 1 50%;
  filter: brightness(1) saturate(1.1);
}

.portal-panel:hover .panel-bg {
  transform: scale(1.08) translateY(-1%);
}

.portal-panel:hover .panel-tint {
  opacity: 0.35;
}

.portal-panel:hover .panel-desc {
  opacity: 1;
  transform: translateY(0);
}

.portal-panel:hover .panel-badges {
  opacity: 1;
  transform: translateY(0);
}

.portal-panel:hover .panel-logo {
  transform: scale(1.05);
}

/* Active Indicator Glow along top */
.panel-glow-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 20;
}

.panel-image-makers .panel-glow-bar { background: var(--accent-gold); box-shadow: 0 0 20px var(--accent-gold); }
.panel-red-team .panel-glow-bar { background: var(--accent-red); box-shadow: 0 0 20px var(--accent-red); }
.panel-responsive-training .panel-glow-bar { background: var(--accent-cyan); box-shadow: 0 0 20px var(--accent-cyan); }

.portal-panel:hover .panel-glow-bar {
  opacity: 1;
}

/* ==========================================================================
   FOOTER BAR / ECOSYSTEM OVERVIEW
   ========================================================================== */

.master-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  background: linear-gradient(0deg, rgba(5, 7, 11, 0.95) 0%, rgba(5, 7, 11, 0) 100%);
  pointer-events: none;
}

.footer-left, .footer-right {
  pointer-events: auto;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.footer-highlight {
  color: #cbd5e1;
  font-weight: 600;
}

/* ==========================================================================
   INFO MODAL / ECOSYSTEM DRAWER
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 4, 8, 0.82);
  backdrop-filter: blur(20px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 100%;
  max-width: 760px;
  background: #0b1019;
  border: 1px solid var(--border-active);
  border-radius: 24px;
  padding: 3rem;
  position: relative;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.5s var(--transition-bounce);
}

.modal-backdrop.active .modal-card {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

body[dir="rtl"] .modal-close {
  right: auto;
  left: 1.5rem;
}

.modal-header {
  margin-bottom: 2rem;
}

.modal-suptitle {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-red);
  margin-bottom: 0.5rem;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.95rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.3;
  color: #fff;
}

.modal-body p {
  color: #94a3b8;
  line-height: 1.7;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
}

.pillars-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

.pillar-summary-card {
  padding: 1.25rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
}

.pillar-summary-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: #fff;
}

.pillar-summary-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0;
}

/* ==========================================================================
   RESPONSIVE DESIGN (TABLET & MOBILE)
   ========================================================================== */

@media (max-width: 1024px) {
  .master-header {
    padding: 0 1.5rem;
  }
  .portal-panel {
    padding: 2.5rem 1.75rem;
  }
  .panel-title {
    font-size: 1.85rem;
  }
  .panel-desc {
    display: none;
  }
}

@media (max-width: 820px) {
  html, body {
    overflow-y: auto;
  }

  .portal-container {
    position: relative;
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  .portal-panel {
    flex: 0 0 100vh;
    height: 100vh;
    padding: 3rem 1.75rem 4rem;
  }

  .portal-container:hover .portal-panel {
    flex: 0 0 100vh;
    filter: none;
  }

  .portal-container .portal-panel:hover {
    flex: 0 0 100vh;
  }

  .panel-border {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 1px;
  }

  .panel-desc {
    display: block;
    opacity: 1;
    transform: none;
  }

  .panel-badges {
    opacity: 1;
    transform: none;
  }

  .pillars-summary-grid {
    grid-template-columns: 1fr;
  }
}
