@import url("./common.css");

:root {
  /* Page-specific dark-hero theme vars */
  --bg: #0a0a0f;
  --text: #ffffff;
}

html {
  background: var(--bg);
  overflow: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-optical-sizing: auto;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Canvas (fixed background) ── */
#canvas-container {
  position: fixed;
  inset: 0;
  z-index: 1;
  will-change: transform;
  transition: border-radius 0.3s ease;
}

/* ── Scroll content layer ── */
#smooth-wrapper {
  position: relative;
  z-index: 10;
  height: 100vh;
  overflow-y: auto;
}

#smooth-content {
  will-change: transform;
}



/* ── Loader ── */
#loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 200;
  font-size: 1.2rem;
  letter-spacing: 4px;
  color: rgba(255, 255, 255, 0.7);
  transition:
    opacity 0.8s ease,
    visibility 0.8s ease;
}

#loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#loader span {
  margin: 0 2px;
}

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

/* ── Custom cursor ── */


/* ── Text animation classes ── */
.split-title {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.split-title.visible {
  opacity: 1;
  transform: translateY(0);
}

.split-text {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.8s ease 0.2s,
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s;
}

.split-text.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Hero bottom gradient fade ── */
.section-hero {
  position: relative;
}

.section-hero::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 30vh;
  background: linear-gradient(to bottom, transparent, rgb(30 36 33));
  pointer-events: none;
  z-index: 1;
}

/* ── Section background color transition ── */
.section-background {
  transition: background-color 0.4s ease;
}

.cost-chart-container {
  width: 100%;
  background: var(--bg-light);
  border-radius: 16px;
  border: 1px solid rgba(100, 213, 179, 0.15);
  padding: 0.85rem 0.5rem 0.5rem;
  box-shadow:
    0 4px 32px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(100, 213, 179, 0.08);
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.reveal.visible .cost-chart-container {
  opacity: 1;
  transform: translateY(0);
}

.cost-chart-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0.5rem 0.55rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid rgba(64, 136, 91, 0.34);
  border-radius: 8px;
  color: #2b6f3d;
  background: rgba(100, 213, 179, 0.06);
  text-align: center;
}

.cost-summary-main,
.cost-summary-percent {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.05;
}

.cost-summary-main span,
.cost-summary-percent span {
  font-size: clamp(0.62rem, 1vw, 0.78rem);
  font-weight: 700;
}

.cost-summary-main strong {
  margin-top: 0.22rem;
  font-size: clamp(1.45rem, 2.6vw, 1.9rem);
  font-weight: 900;
}

.cost-summary-main em,
.cost-summary-percent em,
.cost-legend-card em {
  font-style: normal;
  font-weight: 500;
}

.cost-summary-percent strong {
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  font-weight: 900;
}

.cost-summary-divider {
  width: 1px;
  height: 2.3rem;
  background: rgba(64, 81, 77, 0.28);
}

.cost-chart-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 0 0.5rem 0.5rem;
}

.cost-legend-card {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  padding: 9px 11px;
  border: 1.5px solid var(--bg-tab-bar);
  border-radius: 8px;
  background: transparent;
  font-family: var(--font);
  font-size: clamp(0.72rem, 1vw, 0.82rem);
  font-weight: 600;
  color: var(--bg-teal);
  cursor: pointer;
  text-align: left;
  opacity: 0.45;
  transition:
    opacity 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.cost-legend-card.active {
  opacity: 1;
}

.cost-legend-card:hover {
  transform: translateY(-1px);
}

.cost-legend-card:focus-visible {
  outline: 2px solid var(--cta-green);
  outline-offset: 2px;
}

.cost-legend-card b {
  width: 100%;
  padding-left: 14px;
  font-size: clamp(0.86rem, 1.25vw, 1rem);
  font-weight: 900;
  line-height: 1.1;
}

.cost-legend-value-row {
  width: 100%;
  padding-left: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cost-legend-value-row b {
  width: auto;
  padding-left: 0;
  flex: 0 1 auto;
}

.cost-legend-card--trad {
  border-color: var(--bg-teal);
  background: rgba(52, 59, 56, 0.07);
}

.cost-legend-card--intel {
  border-color: var(--cta-green);
  background: rgba(100, 213, 179, 0.1);
}

.cost-toggle-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cost-savings {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--bg-dark);
  background: rgba(100, 213, 179, 0.18);
  padding: 1px 5px;
  border-radius: 4px;
  line-height: 1.15;
  flex-shrink: 0;
}

.cost-chart-svg {
  width: 100%;
  max-height: 420px;
  height: auto;
  display: block;
}

.cost-chart-footnote {
  font-size: 0.65rem;
  color: #40514d;
  text-align: center;
  padding: 4px 0 2px;
  margin-bottom: 10px;
}



/* ============================================================
   Scroll Reveal Animations
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(60px);
  transition:
    opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger.visible> :nth-child(1) {
  transition-delay: 0s;
}

.reveal-stagger.visible> :nth-child(2) {
  transition-delay: 0.12s;
}

.reveal-stagger.visible> :nth-child(3) {
  transition-delay: 0.24s;
}

.reveal-stagger.visible> :nth-child(4) {
  transition-delay: 0.36s;
}

.reveal-left {
  opacity: 0;
  transform: translateX(-60px);
  transition:
    opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(60px);
  transition:
    opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.88);
  transition:
    opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

[data-parallax] {
  will-change: transform;
}

.section-video .reveal.visible .video-placeholder {
  animation: scaleIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes scaleIn {
  from {
    transform: scale(0.92);
    opacity: 0.5;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ============================================================
   Sequential Char Glow (light-bg variant)
   ============================================================ */
.word-glow-target {
  /* Preserve layout; text replaced by .glow-item spans via JS */
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
}

.glow-item {
  display: inline-block;
  white-space: pre-wrap;
  color: rgba(13, 5, 14, 0.05);
  animation: none;
}

.glow-active .glow-item {
  animation: sequential-glow-light 1s forwards;
}

@keyframes sequential-glow-light {

  0% {
    color: rgba(13, 5, 14, 0.15);
    text-shadow: none;
  }

  5% {
    color: var(--bg-black, #0d050e);
    text-shadow: 0 0 12px rgba(100, 213, 179, 0.5);
  }

  10% {
    color: var(--cta-green, #64d5b3);
    text-shadow: 0 0 18px rgba(100, 213, 179, 0.7);
  }

  20%,
  100% {
    color: rgb(13 5 14 / var(--tw-text-opacity, 1));
    text-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .glow-active .glow-item {
    animation: none;
    color: var(--bg-black, #0d050e);
  }
}

/* Sequential Char Glow — dark-bg variant */
.glow-item--dark {
  color: rgba(248, 253, 251, 0.15);
}

.glow-active .glow-item--dark {
  animation: sequential-glow-dark 1s forwards;
}

@keyframes sequential-glow-dark {

  0% {
    color: rgba(248, 253, 251, 0.15);
    text-shadow: none;
  }

  5% {
    color: var(--bg-light, #f8fdfb);
    text-shadow: 0 0 12px rgba(100, 213, 179, 0.5);
  }

  10% {
    color: var(--cta-green, #64d5b3);
    text-shadow: 0 0 18px rgba(100, 213, 179, 0.7);
  }

  20%,
  100% {
    color: var(--bg-light, #f8fdfb);
    text-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .glow-active .glow-item--dark {
    animation: none;
    color: var(--bg-light, #f8fdfb);
  }
}

.stat-number.counted {
  animation: statPulse 0.4s ease-out;
}

@keyframes statPulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {

  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-scale {
    transition: none;
    opacity: 1;
    transform: none;
  }

  .cost-chart-container {
    transition: none;
    opacity: 1;
    transform: none;
  }

  .stat-number.counted {
    animation: none;
  }

  .section-video .reveal.visible .video-placeholder {
    animation: none;
  }

  [data-parallax] {
    transform: none !important;
  }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .section-video {
    min-height: auto !important;
    justify-content: flex-start !important;
    padding-top: clamp(6rem, 18vh, 8rem) !important;
    padding-bottom: clamp(2.5rem, 8vh, 4rem) !important;
  }

  .cost-chart-summary {
    align-items: stretch;
    gap: 0.6rem;
  }

  .cost-chart-legend {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}
