/* Our Energy Story — scrolly layout (loads after ../assets/css/site.css + tools.css). */

:root {
  --color-brand:       var(--ta-rust-500);
  --color-brand-dark:  var(--ta-rust-600);
  --color-text:        var(--ta-walnut-900);
  --color-text-muted:  var(--ta-walnut-500);
  --color-text-light:  var(--ta-walnut-400);
  --color-border:      rgba(42, 31, 21, 0.14);
  --color-border-input: rgba(42, 31, 21, 0.22);
  --color-surface:     var(--ta-cream-200);
  --color-highlight-bg: var(--ta-cream-100);
  --color-total:       var(--ta-rust-500);
  --color-total-area:  rgba(154, 68, 35, 0.18);
  --color-grid:        #5c6b78;
  --color-solar:       var(--ta-pine-600);
  --color-solar-area:  rgba(61, 74, 42, 0.22);
  --color-active-highlight: rgba(154, 68, 35, 0.12);
  --color-band:        rgba(107, 88, 71, 0.12);
  --color-marker:      rgba(42, 31, 21, 0.18);
  --max-width:         1100px;
}

.myenergy-card {
  margin-block: 1.5rem 2.5rem;
  padding: 0;
}

.myenergy-hero {
  text-align: center;
  padding: 2rem 1.5rem 1.75rem;
  background: linear-gradient(135deg, var(--ta-rust-500) 0%, var(--ta-rust-600) 100%);
  color: var(--fg-on-accent);
}

.myenergy-hero__title {
  color: var(--fg-on-accent) !important;
  margin-bottom: 0.5rem;
}

.myenergy-hero__lede {
  color: var(--ta-cream-200) !important;
  margin-inline: auto;
  max-width: 36rem;
}

.scroll-cue {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  margin-top: 1.5rem;
  color: rgba(250, 245, 233, 0.85);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; transform: translateY(0); }
  50%      { opacity: 1;   transform: translateY(4px); }
}

#scrolly {
  position: relative;
  padding: 0;
}

.scrolly-container {
  display: flex;
  gap: 1.5rem;
  padding: 0 1.25rem;
}

.sticky-chart {
  position: sticky;
  top: 5.5rem;
  flex: 1 1 58%;
  height: calc(100vh - 6rem);
  display: flex;
  flex-direction: column;
  align-self: flex-start;
  margin: 0;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
}

#chart {
  flex: 1;
  min-height: 0;
}

#chart svg {
  display: block;
  width: 100%;
  height: 100%;
}

.chart-legend {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  padding: 0.5rem 0 0;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.chart-legend .legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.chart-legend .swatch {
  width: 14px;
  height: 3px;
  border-radius: 1px;
}

.scroll-steps {
  flex: 0 0 38%;
  padding: 0 0 50vh;
}

.step-hero-image {
  padding-top: 1rem;
  margin-bottom: 2rem;
}

.step-hero-image img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  display: block;
}

.step-image {
  margin-top: 0.75rem;
}

.step-image img {
  width: 100%;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  display: block;
}

.step {
  min-height: 55vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1rem 0;
  margin-bottom: 0.5rem;
  opacity: 0.2;
  transition: opacity 0.4s ease;
}

.step.is-active { opacity: 1; }

.step-content {
  background: var(--color-highlight-bg);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.25rem;
  border-left: 3px solid var(--accent);
}

.step-content h3 {
  font-size: 1.05em;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.step-content p {
  font-size: 0.92em;
  line-height: 1.65;
  color: var(--fg-body);
}

.step-content .step-date {
  font-size: 0.75rem;
  color: var(--color-text-light);
  margin-top: 0.65rem;
}

.outro {
  background: var(--bg-tint);
  padding: 2.25rem 1.5rem;
  text-align: center;
  border-top: 1px solid var(--border);
}

.outro-inner { max-width: 56rem; margin: 0 auto; }

.outro h2 {
  font-size: 1.35rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: var(--bg-raised);
  border-radius: var(--radius-sm);
  padding: 1.1rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.stat-card .stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--accent);
  line-height: 1.1;
}

.stat-card .stat-label {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.35rem;
}

.colophon {
  font-size: 0.88rem;
  color: var(--fg-muted);
}

.myenergy-hero__subtitle {
  margin: 0.5rem auto 0;
  max-width: 36rem;
  font-size: 1rem;
  line-height: 1.5;
  color: rgba(250, 245, 233, 0.92);
}

.community {
  background: var(--bg-raised);
  padding: 2.25rem 1.5rem 2.5rem;
  border-top: 1px solid var(--border);
}

.community__inner {
  max-width: 40rem;
  margin: 0 auto;
  text-align: center;
}

.community h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 1rem;
}

.community__intro {
  margin: 0 0 1.25rem;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--fg-body);
}

.community__prompts {
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
  text-align: left;
  display: grid;
  gap: 0.65rem;
}

.community__prompts li {
  margin: 0;
  padding: 0.75rem 1rem;
  background: var(--bg-tint);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--fg-body);
}

.community__cta {
  margin: 0;
}

.axis text {
  font-family: var(--font-sans);
  font-size: 11px;
  fill: var(--color-text-muted);
}

.axis line,
.axis path {
  stroke: var(--color-border-input);
}

.zero-line {
  stroke: var(--ta-walnut-400);
  stroke-dasharray: 4 3;
}

.grid-line line {
  stroke: rgba(42, 31, 21, 0.06);
}

.event-marker line {
  stroke: var(--color-marker);
  stroke-dasharray: 3 2;
}

.highlight-band {
  fill: var(--color-band);
}

.active-highlight {
  fill: var(--color-active-highlight);
}

@media (max-width: 768px) {
  .myenergy-hero__title { font-size: 1.65rem !important; }

  .scrolly-container {
    flex-direction: column;
    padding: 0 1rem;
  }

  .sticky-chart {
    position: sticky;
    top: 0;
    height: 45vh;
    flex: none;
    z-index: 10;
    padding-top: 0.5rem;
  }

  .scroll-steps {
    flex: none;
    padding: 1rem 0 40vh;
  }

  .step {
    min-height: 40vh;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .stats {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-cue {
    animation: none;
  }
}
