/* ============================================
   HERO SECTION COMPONENT
   Society & AI Design System
   ============================================

   Homepage hero section including:
   - Hero layout grid
   - Rotating title
   - Sidebar with research items
   - Video container
   - Interactive background effects

   Requires: tokens.css to be loaded first
   ============================================ */

/* ==========================================
   HERO SECTION BASE
   ========================================== */
.hero-section {
  width: 100%;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  background: var(--color-white);
  border-bottom: var(--border-width) solid var(--color-border);
  padding: 0;
  position: relative;
  overflow: hidden;
}

/* Subtle scholarly dot grid pattern */
.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(circle, #cbd5e1 1.5px, transparent 1.5px);
  background-size: 32px 32px;
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
  z-index: 0;
}

.hero-section:hover::before {
  opacity: 0.3;
}

/* Mouse-following spotlight effect */
.hero-section::after {
  content: '';
  position: absolute;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle,
      rgba(0, 94, 162, 0.04) 0%,
      rgba(0, 150, 136, 0.03) 30%,
      rgba(94, 114, 228, 0.02) 50%,
      transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  left: var(--mouse-x, 50%);
  top: var(--mouse-y, 50%);
  opacity: 0;
  transition: opacity var(--transition-slower);
  z-index: 0;
  filter: blur(20px);
}

.hero-section:hover::after {
  opacity: 1;
}

/* Canvas for trail effects */
#hero-trail-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 1s ease;
}

.hero-section:hover #hero-trail-canvas {
  opacity: 1;
}

/* ==========================================
   HERO CONTAINER & INNER
   ========================================== */
.hero-container {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  background: var(--color-white);
  border-bottom: var(--border-width) solid var(--color-border);
  padding: 0;
  position: relative;
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: var(--content-width);
  max-width: var(--max-width-site);
  margin: 0 auto;
  padding: var(--space-16) 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--hero-sidebar-width);
  gap: var(--space-8);
  align-items: center;
}

/* ==========================================
   HERO LEFT CONTENT
   ========================================== */
.hero-left {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  max-width: 900px;
  min-width: 0;
}

.main-title {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
  margin: 0;
  color: var(--color-black);
  font-style: normal;
  letter-spacing: -0.02em;
  line-height: var(--leading-tight);
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

#rotating-title {
  white-space: normal;
  overflow-wrap: break-word;
  word-wrap: break-word;
  max-width: 100%;
}

@media (min-width: 1800px) {
  #rotating-title {
    white-space: nowrap;
  }
}

.main-description {
  font-size: 1.15rem;
  line-height: 1.65;
  color: var(--color-text-secondary);
}

/* ==========================================
   ACTION BUTTONS
   ========================================== */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 360px;
}

.primary-button,
.secondary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  border-radius: var(--btn-radius);
  font-weight: var(--font-medium);
  text-decoration: none;
  transition: all var(--transition-base);
  font-size: var(--text-base);
}

.primary-button {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.primary-button:hover {
  background-color: var(--color-primary-dark);
}

.secondary-button {
  border: var(--border-width) solid var(--color-primary);
  color: var(--color-primary);
  background: transparent;
}

.secondary-button:hover {
  background-color: rgba(15, 98, 254, 0.08);
}

.arrow-icon {
  margin-left: 0.75rem;
  font-size: 1.1rem;
}

/* ==========================================
   HERO CENTER (IMAGE/VIDEO AREA)
   ========================================== */
.hero-center {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-6);
  margin: 0;
}

.hero-image-container {
  width: 100%;
  max-width: 640px;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  margin: 0 auto;
  padding: 0;
}

.hero-image {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: var(--radius-2xl);
  display: block;
  margin: 0;
  padding: 0;
}

/* ==========================================
   HERO VIDEO CONTAINER
   ========================================== */
.hero-video-container {
  width: 100%;
  max-width: 680px;
  overflow: visible;
  box-shadow: var(--shadow-xl);
  margin: 0 auto var(--space-8);
  padding: 0;
  position: relative;
  border-radius: var(--radius-2xl);
}

.hero-video {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: var(--radius-2xl);
  display: block;
  margin: 0;
  padding: 0;
}

.video-caption-left {
  position: absolute;
  bottom: -28px;
  left: 0;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text);
  font-style: italic;
  max-width: 90%;
  word-wrap: break-word;
  line-height: 1.4;
}

/* ==========================================
   HERO SIDEBAR
   ========================================== */
.hero-sidebar {
  background: var(--hero-sidebar-bg);
  border-left: var(--border-width) solid var(--color-border);
  margin: calc(var(--space-16) * -1) 0;
  padding: 5.25rem var(--space-6) 6.5rem;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  position: relative;
  align-items: flex-start;
  text-align: left;
  width: var(--hero-sidebar-width);
  max-width: var(--hero-sidebar-width);
  min-width: var(--hero-sidebar-width);
  box-sizing: border-box;
  overflow: hidden;
  align-self: stretch;
}

.sidebar-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.3rem;
  color: var(--color-black);
  font-weight: var(--font-semibold);
  margin: 0;
  width: 100%;
  word-wrap: break-word;
}

.research-items {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  align-items: flex-start;
  text-align: left;
  width: 100%;
}

.research-item {
  border-bottom: 1px solid rgba(0, 67, 206, 0.15);
  padding-bottom: 0.85rem;
  width: 100%;
  box-sizing: border-box;
}

.research-link {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--color-link);
  font-family: 'Open Sans', sans-serif;
  font-size: 16px;
  font-weight: var(--font-medium);
  line-height: 1.4;
  width: 100%;
  box-sizing: border-box;
}

.research-link:hover {
  text-decoration: underline;
}

.research-link span:first-child {
  flex: 1;
  text-align: left;
  min-width: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.research-link span:last-child {
  flex-shrink: 0;
  margin-left: var(--space-2);
}

.view-all {
  margin-top: 0.95rem;
  width: 100%;
}

.view-all-link {
  color: var(--color-link);
  text-decoration: none;
  font-family: 'Open Sans', sans-serif;
  font-size: 16px;
  font-weight: var(--font-medium);
  display: block;
  text-align: left;
  width: 100%;
  word-wrap: break-word;
}

.view-all-link:hover {
  text-decoration: underline;
}

/* ==========================================
   RESPONSIVE STYLES
   ========================================== */

/* Tablet - reduce sidebar width */
@media (max-width: 1400px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: var(--space-6);
  }

  .hero-sidebar {
    width: 360px;
    max-width: 360px;
    min-width: 360px;
  }
}

/* Stack to single column */
@media (max-width: 1100px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .hero-left {
    max-width: 100%;
  }

  .hero-sidebar {
    order: 1;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border-left: none;
    border-top: var(--border-width) solid var(--color-border);
    margin: 0;
    padding: var(--space-8) var(--space-6);
    align-self: auto;
  }
}

/* Smaller video size */
@media (max-width: 850px) {
  .hero-video-container {
    max-width: 600px;
  }
}

@media (max-width: 770px) {
  .hero-video-container {
    max-width: 500px;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .hero-inner {
    padding: var(--space-8) 0;
  }

  .hero-left {
    margin-top: var(--space-4);
  }

  .main-title {
    font-size: var(--text-xl);
    line-height: 1.25;
  }

  #rotating-title {
    font-size: 1.25rem;
    white-space: normal;
    line-height: 1.3;
  }

  .main-description {
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
  }

  .hero-sidebar {
    padding: var(--space-6) var(--space-4);
  }

  .sidebar-title {
    font-size: 1.1rem;
  }

  .research-link span {
    font-size: 0.95rem;
  }

  .video-caption-left {
    bottom: -40px;
    font-size: 13px;
  }

  .action-buttons {
    flex-direction: column;
    gap: var(--space-4);
  }

  .primary-button,
  .secondary-button {
    width: 100%;
    justify-content: center;
  }
}

/* Mobile padding fixes */
@media (max-width: 768px) {
  .hero-section,
  .hero-container {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
  }

  .hero-inner {
    width: 100%;
    padding: var(--space-8) var(--space-4);
  }

  #rotating-title {
    font-size: 1.35rem;
    line-height: 1.35;
  }

  .main-title {
    font-size: 1.6rem;
  }
}
