@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600&family=Newsreader:ital,opsz,wght@1,6..72,500&display=swap');

:root {
  --ink: #e8f0e7;
  --muted: #9aa9a0;
  --dim: #63716a;
  --paper: #08100d;
  --panel: #0e1713;
  --line: rgba(197, 224, 205, 0.16);
  --lime: #c5ee71;
  --lime-dim: rgba(197, 238, 113, 0.16);
  --mono: 'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Manrope', Inter, system-ui, sans-serif;
  --serif: 'Newsreader', Georgia, serif;
}

* { box-sizing: border-box; }
html { background: var(--paper); color-scheme: dark; scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 70% -10%, rgba(74, 113, 85, 0.23), transparent 46%),
    linear-gradient(180deg, #09120e 0%, #07100c 65%, #050b08 100%);
  font-family: var(--sans);
  font-size: 14px;
  overflow-x: hidden;
}

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

a { color: inherit; }
main { width: min(1640px, 100%); margin: 0 auto; padding: 0 44px 28px; }

.topbar {
  height: 78px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line); font: 500 11px/1 var(--mono); letter-spacing: .13em;
}
.brand { display: inline-flex; gap: 12px; align-items: center; text-decoration: none; }
.brand:hover { color: var(--lime); }
.brand-mark { width: 27px; height: 17px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; align-items: end; }
.brand-mark i { display: block; border-radius: 1px; background: var(--lime); }
.brand-mark i:nth-child(1) { height: 45%; opacity: .48; }
.brand-mark i:nth-child(2) { height: 76%; opacity: .72; }
.brand-mark i:nth-child(3) { height: 100%; }
.live-block { display: flex; align-items: center; gap: 9px; color: var(--muted); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #dfd998; box-shadow: 0 0 0 0 rgba(197,238,113,.5); }
.live-block.is-live .live-dot { background: var(--lime); animation: ping 2.4s ease-out infinite; }
.live-block.is-stale .live-dot { background: #e99b70; animation: none; }
#live-time { color: var(--dim); }
@keyframes ping { 70% { box-shadow: 0 0 0 8px rgba(197,238,113,0); } 100% { box-shadow: 0 0 0 0 rgba(197,238,113,0); } }

.hero { padding: 82px 0 58px; }
.eyebrow { color: var(--lime); font: 500 10px/1 var(--mono); letter-spacing: .2em; margin-bottom: 23px; }
.hero-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; }
h1 { margin: 0; max-width: 1000px; font: 500 clamp(58px, 8.3vw, 134px)/.78 var(--sans); letter-spacing: -.067em; }
h1 em { color: var(--lime); font: 500 1.07em/.8 var(--serif); letter-spacing: -.055em; }
.hero-stat { flex: 0 0 auto; padding: 0 0 6px 20px; border-left: 1px solid var(--line); text-align: right; }
.hero-stat span { display: block; font: 500 clamp(36px, 4vw, 60px)/.8 var(--mono); letter-spacing: -.07em; }
.hero-stat small { display: block; color: var(--muted); font: 400 10px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; margin-top: 15px; }
.intro { max-width: 590px; margin: 38px 0 0 auto; padding-right: 6%; color: var(--muted); font-size: 14px; line-height: 1.65; }

.stage-section { padding: 0 0 46px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 15px; }
.section-head h2 { margin: 0; font-size: 14px; font-weight: 500; }
.legend { display: flex; gap: 18px; color: var(--dim); font: 400 9px/1 var(--mono); letter-spacing: .11em; }
.legend span { display: flex; gap: 7px; align-items: center; }
.legend i { width: 8px; height: 8px; display: inline-block; border: 1px solid var(--dim); }
.legend-scale { transform: rotate(45deg); }
.legend-motion { border-radius: 50%; border-right-color: var(--lime) !important; }
.legend-light { background: var(--lime); box-shadow: 0 0 8px var(--lime); border: 0 !important; }

.stage-shell {
  height: min(53vw, 660px); min-height: 510px; position: relative; overflow: hidden; border: 1px solid var(--line);
  background:
    linear-gradient(180deg, transparent 66%, rgba(197, 238, 113, .025) 66%),
    repeating-linear-gradient(90deg, transparent 0, transparent calc(12.5% - 1px), rgba(197,224,205,.055) calc(12.5% - 1px), rgba(197,224,205,.055) 12.5%),
    radial-gradient(ellipse at 50% 30%, rgba(47, 86, 65, .24), transparent 62%),
    #09130f;
}
#three-stage { position: absolute; inset: 0; z-index: 1; }
#three-stage canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.source-labels { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.source-label {
  position: absolute; left: 50%; top: 50%; width: 145px; transform: translate(-50%, -50%); text-align: center;
  transition: opacity .45s ease, transform .45s ease; text-shadow: 0 2px 8px #06100b, 0 0 14px #06100b;
}
.source-label .rank { color: var(--dim); font: 400 9px/1 var(--mono); letter-spacing: .1em; }
.source-label .name { display: block; margin: 5px 0 6px; color: var(--ink); font-size: 12px; font-weight: 600; letter-spacing: -.01em; }
.source-label .value { color: var(--lime); font: 500 18px/1 var(--mono); letter-spacing: -.06em; }
.source-label .mw { color: var(--dim); font: 400 8px/1 var(--mono); letter-spacing: .05em; margin-top: 5px; }
.source-label.charging .value { color: #81b9ee; }
.stage-axis { position: absolute; z-index: 0; left: 4%; right: 4%; top: 67%; height: 1px; background: var(--line); }
.stage-axis::before, .stage-axis::after { content: ''; position: absolute; top: -3px; width: 7px; height: 7px; border: 1px solid var(--line); border-radius: 50%; }
.stage-axis::before { left: 0; } .stage-axis::after { right: 0; }
.drag-hint { position: absolute; right: 17px; bottom: 14px; color: var(--dim); font: 400 8px/1 var(--mono); letter-spacing: .12em; z-index: 3; }
.loading-state { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; gap: 18px; align-items: center; justify-content: center; background: rgba(7,15,11,.87); color: var(--muted); font: 400 10px/1 var(--mono); letter-spacing: .13em; text-transform: uppercase; transition: opacity .5s, visibility .5s; }
.loading-state.done, .loading-state[hidden] { display: none; }
.loader { width: 36px; height: 36px; border: 1px solid var(--line); border-top-color: var(--lime); border-radius: 50%; animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.fact-card { min-height: 265px; padding: 24px 27px 27px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; }
.fact-card.renewables { background: var(--lime); color: #0a120d; }
.fact-top { display: flex; justify-content: space-between; align-items: center; font: 500 9px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.renewables .fact-top { color: rgba(10,18,13,.65); }
.fact-icon { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: 9px; }
.fact-card strong { display: block; margin-top: 35px; font-size: clamp(38px, 4.3vw, 68px); font-weight: 500; line-height: .9; letter-spacing: -.07em; }
.fact-card.leader strong, .fact-card.storage strong { font-size: clamp(27px, 3.2vw, 48px); text-transform: uppercase; }
.fact-bar { height: 4px; margin: 25px 0 0; background: rgba(10,18,13,.18); overflow: hidden; }
.fact-bar i { display: block; width: 0; height: 100%; background: #0a120d; transition: width 1s cubic-bezier(.2,.9,.2,1); }
.fact-card p { margin: auto 0 0; max-width: 360px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.renewables p { color: rgba(10,18,13,.63); }
.leader-metric { display: flex; align-items: baseline; gap: 9px; margin-top: 14px; font-family: var(--mono); }
.leader-metric b { color: var(--lime); font-size: 20px; letter-spacing: -.06em; }
.leader-metric span { color: var(--dim); font-size: 9px; letter-spacing: .08em; }

footer { display: grid; grid-template-columns: 1.8fr 1fr; gap: 60px; padding: 52px 0 32px; color: var(--muted); }
.method { display: grid; grid-template-columns: 45px 1fr; gap: 16px; }
.method-num { color: var(--lime); font: 500 9px/1 var(--mono); }
.method h2 { color: var(--ink); font-size: 13px; font-weight: 500; margin: 0 0 12px; }
.method p { margin: 0; max-width: 710px; font-size: 11px; line-height: 1.65; }
code { color: var(--ink); font: 400 10px var(--mono); }
.source-credit { border-left: 1px solid var(--line); padding-left: 28px; display: flex; flex-direction: column; align-items: flex-start; }
.source-credit span { color: var(--dim); font: 400 8px/1 var(--mono); letter-spacing: .14em; }
.source-credit a { margin: 12px 0 8px; color: var(--ink); text-decoration: none; font-size: 12px; }
.source-credit a:hover { color: var(--lime); }
.source-credit small { color: var(--dim); font-size: 9px; }

noscript { display: block; padding: 20px; background: #8b402f; color: white; text-align: center; }

@media (max-width: 880px) {
  main { padding: 0 20px 20px; }
  .hero { padding: 60px 0 45px; }
  .hero-row { align-items: flex-start; }
  h1 { font-size: clamp(53px, 14vw, 95px); }
  .intro { margin-left: 0; padding-right: 0; }
  .legend { display: none; }
  .stage-shell { min-height: 560px; height: 72vw; }
  .facts { grid-template-columns: 1fr; }
  .fact-card { min-height: 230px; }
  footer { grid-template-columns: 1fr; gap: 35px; }
  .source-credit { border-left: 0; border-top: 1px solid var(--line); padding: 25px 0 0; }
}

@media (max-width: 560px) {
  .topbar { height: 65px; }
  #live-state { font-size: 0; }
  #live-state::after { content: 'LIVE'; font-size: 10px; }
  #live-time { display: none; }
  .hero { padding-top: 52px; }
  .hero-row { display: block; }
  h1 { font-size: clamp(54px, 18vw, 88px); }
  .hero-stat { margin-top: 36px; display: inline-block; text-align: left; }
  .stage-shell { min-height: 560px; height: 142vw; max-height: 650px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-inline: contain; scrollbar-color: var(--lime) #102019; scrollbar-width: thin; }
  #three-stage, .source-labels { width: 1100px; right: auto; }
  .stage-axis { left: 44px; right: auto; width: 1012px; }
  .drag-hint { position: sticky; display: block; left: 0; bottom: 14px; width: calc(100vw - 40px); text-align: center; font-size: 0; }
  .drag-hint::after { content: 'SWIPE SOURCES · DRAG TO LOOK'; font-size: 8px; }
  .section-head h2 { font-size: 12px; }
  .source-label { width: 96px; }
  .source-label .name { font-size: 10px; }
  .source-label .value { font-size: 17px; }
  .fact-card { padding: 23px; }
  .method { grid-template-columns: 1fr; }
  .method-num { margin-bottom: -5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
