/* portal.css – Premium Editorial Monolithic Split‑Screen Layout */

:root {
  /* Brand colors */
  --primary-blue: #0d6efd;
  --primary-green: #10b981;
  --dark: #0f172a;
  --white: #ffffff;
  --slate-dark: #090d16;
  
  /* Initial split percent */
  --split-percent: 50%;
}

/* Base resets & fonts */
body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: var(--slate-dark);
  font-family: 'Lato', sans-serif;
  color: var(--white);
}

/* Hidden h1 for accessibility and SEO */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------------
   Navbar – floating, minimalist, premium
   ------------------------------------------------------------------ */
.navbar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 2.5rem 0;
  background: transparent;
  z-index: 100;
  pointer-events: none; /* Let clicks pass to portal below except links */
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 3rem;
  pointer-events: auto; /* Enable clicks on navbar contents */
}

.navbar .brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: 5px;
  color: var(--white);
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.navbar .brand-logo {
  height: 36px;
  width: auto;
  object-fit: contain;
}

.navbar .brand:hover {
  opacity: 0.8;
}

.navbar .nav-links {
  display: flex;
  gap: 3rem;
}

.navbar .nav-links a {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  text-transform: uppercase;
  position: relative;
  padding-bottom: 0.25rem;
  transition: color 0.3s ease;
}

.navbar .nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--white);
  transition: width 0.3s ease;
}

.navbar .nav-links a:hover {
  color: var(--white);
}

.navbar .nav-links a:hover::after {
  width: 100%;
}

/* ------------------------------------------------------------------
   Monolithic Split Screen Portal
   ------------------------------------------------------------------ */
.portal-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.portal-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: pointer;
}

/* Panel content styling */
.portal-content {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 85%;
  max-width: 460px;
  z-index: 5;
  color: var(--white);
  pointer-events: auto;
  transition: opacity 0.3s ease;
}

/* Business panel - bottom layer */
.portal-business {
  z-index: 1;
}

.portal-business .portal-content {
  left: 25%;
  text-align: left;
}

/* Renewable panel - top clipped layer */
.portal-renewable {
  z-index: 2;
  /* Slanted split path using variable with fallback */
  clip-path: polygon(
    var(--split-percent, 50%) 0,
    100% 0,
    100% 100%,
    calc(var(--split-percent, 50%) - 15vw) 100%
  );
}

.portal-renewable .portal-content {
  left: 75%;
  text-align: left;
}

/* Background elements */
.background-image,
.background-image-renewable {
  position: absolute;
  inset: 0;
  z-index: 1;
  filter: grayscale(0.1) brightness(0.7);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.background-image {
  background: url('../assets/img/business-bg.jpg') center/cover no-repeat;
}

.background-image-renewable {
  background: url('../assets/img/renewable-bg.jpg') center/cover no-repeat;
}

/* Zoom effect on panel hover */
.portal-panel:hover .background-image,
.portal-panel:hover .background-image-renewable {
  transform: scale(1.03);
}

/* Overlays for depth and readability */
.portal-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  transition: background 0.4s ease;
}

.portal-business .portal-overlay {
  background: linear-gradient(
    135deg,
    rgba(9, 13, 22, 0.92) 20%,
    rgba(13, 110, 253, 0.35) 100%
  );
}

.portal-renewable .portal-overlay {
  background: linear-gradient(
    135deg,
    rgba(9, 13, 22, 0.88) 20%,
    rgba(16, 185, 129, 0.3) 100%
  );
}

.portal-business:hover .portal-overlay {
  background: linear-gradient(
    135deg,
    rgba(9, 13, 22, 0.85) 20%,
    rgba(13, 110, 253, 0.25) 100%
  );
}

.portal-renewable:hover .portal-overlay {
  background: linear-gradient(
    135deg,
    rgba(9, 13, 22, 0.78) 20%,
    rgba(16, 185, 129, 0.2) 100%
  );
}

/* ------------------------------------------------------------------
   Content Typography & Accents
   ------------------------------------------------------------------ */

.panel-tag {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  display: block;
}

.portal-business .panel-tag {
  color: var(--primary-blue);
}

.portal-renewable .panel-tag {
  color: var(--primary-green);
}

.portal-content h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(2.2rem, 3.8vw, 4rem);
  font-weight: 900;
  letter-spacing: 3px;
  line-height: 1.1;
  margin-bottom: 1rem;
  color: var(--white);
}

.portal-content p {
  font-family: 'Lato', sans-serif;
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 2.5rem;
}

/* Minimalist link buttons */
.portal-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--white);
  text-decoration: none;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 0.5rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.portal-btn span {
  display: inline-block;
}

.arrow-icon {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.portal-business .portal-btn:hover {
  color: var(--white);
  border-bottom-color: var(--primary-blue);
}

.portal-renewable .portal-btn:hover {
  color: var(--white);
  border-bottom-color: var(--primary-green);
}

.portal-btn:hover .arrow-icon {
  transform: translateX(6px);
}

/* ------------------------------------------------------------------
   Divider & Handle
   ------------------------------------------------------------------ */
.portal-divider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
  /* Clipped line: offset by 2px on the same slope */
  clip-path: polygon(
    calc(var(--split-percent, 50%) - 2px) 0,
    var(--split-percent, 50%) 0,
    calc(var(--split-percent, 50%) - 15vw) 100%,
    calc(var(--split-percent, 50%) - 15vw - 2px) 100%
  );
  background: linear-gradient(
    to bottom,
    var(--primary-blue),
    var(--primary-green)
  );
  opacity: 0.85;
}

.portal-divider-handle {
  position: absolute;
  top: 50%;
  left: calc(var(--split-percent, 50%) - 7.5vw);
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--dark);
  border: 2px solid rgba(255, 255, 255, 0.4);
  z-index: 11;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  pointer-events: none; /* Pass mouse events to container */
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.portal-container:hover .portal-divider-handle {
  border-color: var(--white);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
}

.portal-divider-handle svg {
  width: 20px;
  height: 20px;
  animation: pulseX 2s infinite alternate ease-in-out;
}

@keyframes pulseX {
  0% { transform: scale(0.95); }
  100% { transform: scale(1.05); }
}

/* ------------------------------------------------------------------
   Responsive Design
   ------------------------------------------------------------------ */
@media (max-width: 768px) {
  .navbar {
    padding: 1.5rem 0;
  }
  .navbar .container {
    padding: 0 1.5rem;
  }
  .navbar .brand {
    font-size: 1.25rem;
    letter-spacing: 3px;
    gap: 8px;
  }
  .navbar .brand-logo {
    height: 28px;
  }
  .navbar .nav-links {
    gap: 1.5rem;
  }
  .navbar .nav-links a {
    font-size: 0.7rem;
    letter-spacing: 1.5px;
  }
  
  /* Stack split on mobile */
  .portal-container {
    display: flex;
    flex-direction: column;
  }
  
  .portal-panel {
    position: relative;
    height: 50vh;
    width: 100vw;
    flex: 1;
  }
  
  .portal-renewable {
    clip-path: none !important;
  }
  
  .portal-content {
    position: relative;
    top: auto;
    left: auto !important;
    transform: none !important;
    width: 100%;
    max-width: 100%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    text-align: left;
  }
  
  .portal-content h2 {
    font-size: 2.2rem;
  }
  
  .portal-content p {
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
  }
  
  .portal-divider, .portal-divider-handle {
    display: none !important;
  }
}
