/* ============================================================================
   TOMORROW SECTION
   The mirror. Same 3 operations, but WORKING. White bg + blue accents
   invert the dark navy + red of today-pain. The emotional payoff.
   ============================================================================ */

.tomorrow {
  background: var(--color-bg);
  padding: var(--space-3xl) 0;
  width: 100%;
  position: relative;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   GRID CANVAS — Testament lattice in blue. Orderly waves, full-width.
   Same grid as today-pain but calm and controlled.
   -------------------------------------------------------------------------- */

#tomorrow-grid-canvas {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 0;
}

/* Blue ambient glow — success radiating from top */
.tomorrow::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(59, 130, 246, 0.06) 0%, transparent 100%);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   SCAN LINE — Single blue sweep revealing the section. GPU-composited.
   --tomorrow-h is set from JS to the section's actual pixel height.
   -------------------------------------------------------------------------- */

.tomorrow--visible::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(59, 130, 246, 0.2) 15%,
    rgba(59, 130, 246, 0.6) 50%,
    rgba(59, 130, 246, 0.2) 85%,
    transparent 100%);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.3), 0 0 4px rgba(59, 130, 246, 0.5);
  will-change: transform, opacity;
  animation: tomorrow-scan 3s linear 1 forwards;
  pointer-events: none;
  z-index: 1;
}

@keyframes tomorrow-scan {
  0% { transform: translateY(0); opacity: 0; }
  5% { opacity: 1; }
  95% { opacity: 1; }
  100% { transform: translateY(var(--tomorrow-h, 100vh)); opacity: 0; }
}

.tomorrow__content {
  max-width: var(--max-width-full);
  margin: 0 auto;
  padding: 0 var(--space-md);
  position: relative;
  z-index: 2;
}

/* --------------------------------------------------------------------------
   HEADLINE — "TOMORROW."
   -------------------------------------------------------------------------- */

.tomorrow__headline {
  font-family: 'NewPanamSkyline', var(--font-sans);
  font-size: var(--text-5xl);
  font-weight: var(--weight-black);
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: var(--tracking-tighter);
  line-height: var(--leading-none);
  margin: 0;
  opacity: 0;
  transform: translateY(16px);
}

.tomorrow--visible .tomorrow__headline {
  animation: tomorrow-reveal 0.6s var(--ease-snappy) forwards;
}

/* Blue pulsing period — operational LED */
.tomorrow__dot {
  display: inline-block;
  color: #3b82f6;
  text-shadow: 0 0 20px rgba(59, 130, 246, 0.6), 0 0 40px rgba(59, 130, 246, 0.3);
  animation: tomorrow-dot-pulse 2s ease-in-out infinite;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.tomorrow__dot--hit {
  transform: scale(1.8);
}

@keyframes tomorrow-dot-pulse {
  0%, 100% { text-shadow: 0 0 20px rgba(59, 130, 246, 0.6), 0 0 40px rgba(59, 130, 246, 0.3); }
  50% { text-shadow: 0 0 30px rgba(59, 130, 246, 0.9), 0 0 60px rgba(59, 130, 246, 0.5), 0 0 80px rgba(59, 130, 246, 0.2); }
}

/* --------------------------------------------------------------------------
   SUBHEAD
   -------------------------------------------------------------------------- */

.tomorrow__subhead {
  font-size: var(--text-lg);
  font-weight: var(--weight-light);
  color: var(--color-text-secondary);
  margin: var(--space-sm) 0 var(--space-2xl);
  opacity: 0;
  transform: translateY(12px);
}

.tomorrow--visible .tomorrow__subhead {
  animation: tomorrow-reveal 0.5s var(--ease-snappy) 0.2s forwards;
}

/* --------------------------------------------------------------------------
   CARDS — Same ops dashboard rows, now resolved
   -------------------------------------------------------------------------- */

.tomorrow__cards {
  display: flex;
  flex-direction: column;
}

.tomorrow__card {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: var(--space-xl);
  padding: var(--space-xl) 0;
  border-bottom: 1px solid var(--color-border);
  opacity: 0;
  transform: translateY(12px);
}

.tomorrow__card:first-child {
  border-top: 1px solid var(--color-border);
}

.tomorrow__card:last-child {
  border-bottom: none;
}

.tomorrow__card--active {
  animation: tomorrow-reveal 0.5s var(--ease-snappy) forwards;
}

/* Borders shift to blue after cards are revealed */
.tomorrow--resolved .tomorrow__card {
  border-color: rgba(59, 130, 246, 0.2);
  transition: border-color 0.8s var(--ease-default);
}

@keyframes tomorrow-reveal {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   ICON COLUMN — Pictogram + system code badge
   -------------------------------------------------------------------------- */

.tomorrow__icon-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  flex-shrink: 0;
  width: 5rem;
}

.tomorrow__icon {
  width: 3rem;
  height: 3rem;
  position: relative;
  /* Blue tint via CSS filter */
  filter: invert(35%) sepia(85%) saturate(1500%) hue-rotate(200deg) brightness(95%);
}

.tomorrow__icon svg {
  width: 100%;
  height: 100%;
}

/* STATUS RING — spinning arc showing "processing" */
.tomorrow__icon::before {
  content: '';
  position: absolute;
  inset: -6px;
  border: 2px solid transparent;
  border-top-color: rgba(59, 130, 246, 0.5);
  border-radius: 50%;
  opacity: 0;
}

.tomorrow__card--active .tomorrow__icon::before {
  opacity: 1;
  animation: tomorrow-status-ring 1.8s linear infinite;
}

/* PULSE RING — expanding circle showing "alive" */
.tomorrow__icon::after {
  content: '';
  position: absolute;
  inset: -4px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 50%;
  opacity: 0;
}

.tomorrow__card--active .tomorrow__icon::after {
  animation: tomorrow-pulse-ring 3s ease-out infinite;
}

/* Icon breathe — subtle scale pulse */
.tomorrow__card--active .tomorrow__icon svg {
  animation: tomorrow-icon-breathe 3s ease-in-out infinite;
}

@keyframes tomorrow-status-ring {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes tomorrow-pulse-ring {
  0% { transform: scale(1); opacity: 0.4; }
  100% { transform: scale(1.6); opacity: 0; }
}

@keyframes tomorrow-icon-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Badge */
.tomorrow__badge {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: rgba(59, 130, 246, 0.7);
  border: 1px solid rgba(59, 130, 246, 0.25);
  padding: 0.1em 0.5em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Pulsing blue dot on badge — operational indicator */
.tomorrow__badge::after {
  content: '';
  width: 4px;
  height: 4px;
  background: #3b82f6;
  border-radius: 50%;
  position: absolute;
  top: -2px;
  right: -2px;
  opacity: 0;
}

.tomorrow__card--active .tomorrow__badge::after {
  animation: tomorrow-badge-dot 2s ease-in-out infinite;
}

.tomorrow__badge--auto {
  color: rgba(16, 185, 129, 0.7);
  border-color: rgba(16, 185, 129, 0.25);
}

.tomorrow__badge--auto::after {
  background: #10b981;
}

@keyframes tomorrow-badge-dot {
  0%, 100% { opacity: 0.3; box-shadow: none; }
  50% { opacity: 1; box-shadow: 0 0 6px rgba(59, 130, 246, 0.5); }
}

/* --------------------------------------------------------------------------
   TEXT — Quote + resolution
   -------------------------------------------------------------------------- */

.tomorrow__text {
  flex: 1;
  min-width: 0;
}

.tomorrow__quote {
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  color: var(--color-text);
  line-height: var(--leading-snug);
  margin: 0;
}

.tomorrow__resolution {
  font-size: var(--text-base);
  font-weight: var(--weight-light);
  color: var(--color-text-secondary);
  line-height: var(--leading-normal);
  margin: var(--space-xs) 0 0;
  opacity: 0;
  transition: opacity 0.4s var(--ease-default);
}

.tomorrow__resolution--visible {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   BRIDGE — "Same operations. Different system."
   -------------------------------------------------------------------------- */

.tomorrow__bridge {
  font-size: var(--text-xl);
  font-weight: var(--weight-light);
  color: var(--color-text);
  text-align: center;
  margin: var(--space-2xl) auto 0;
  max-width: var(--max-width-prose);
  line-height: var(--leading-snug);
  opacity: 0;
  transform: translateY(12px);
}

.tomorrow__bridge--visible {
  animation: tomorrow-reveal 0.8s var(--ease-snappy) forwards;
}

/* Blue beam underline */
.tomorrow__bridge::after {
  content: '';
  display: block;
  height: 2px;
  margin: var(--space-md) auto 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(59, 130, 246, 0.2) 15%,
    rgba(59, 130, 246, 0.6) 50%,
    rgba(59, 130, 246, 0.2) 85%,
    transparent 100%);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.3), 0 0 4px rgba(59, 130, 246, 0.5);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.tomorrow__bridge--beam::after {
  transform: scaleX(1);
}

/* --------------------------------------------------------------------------
   MOBILE — 768px
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
  .tomorrow {
    padding: var(--space-3xl) 0;
  }

  #tomorrow-grid-canvas {
    display: none;
  }

  .tomorrow__headline {
    font-size: var(--text-4xl);
  }

  .tomorrow__subhead {
    font-size: var(--text-base);
    margin-bottom: var(--space-2xl);
  }

  .tomorrow__card {
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-lg) 0;
  }

  .tomorrow__icon-col {
    flex-direction: row;
    width: auto;
    gap: var(--space-sm);
  }

  .tomorrow__icon {
    width: 2rem;
    height: 2rem;
  }

  .tomorrow__icon::before,
  .tomorrow__icon::after {
    display: none;
  }

  .tomorrow__quote {
    font-size: var(--text-base);
  }

  .tomorrow__resolution {
    font-size: var(--text-sm);
  }

  .tomorrow__bridge {
    font-size: var(--text-lg);
    margin-top: var(--space-2xl);
  }

  .tomorrow__bridge::after {
    height: 1px;
    margin-top: var(--space-sm);
  }
}
