/* Green Methanol Power-to-X — site styles */
:root {
  color-scheme: light;
  --bg: #f4f6f4;
  --bg-alt: #ebefec;
  --surface: #ffffff;
  --surface-2: #f0f3f1;
  --border: #dbe2dd;
  --text: #16201b;
  --text-2: #55625b;
  --text-3: #7c8982;
  --accent: #0d7a5f;
  --accent-ink: #ffffff;
  --accent-soft: #dff1ea;
  --grid: #e4e9e6;
  --shadow: 0 1px 2px rgba(16, 32, 26, .05), 0 6px 20px rgba(16, 32, 26, .05);

  /* data colours */
  --c-solar: #f2a600;
  --c-wind: #257de0;
  --c-el: #6a4ce2;
  --c-meoh: #ee7fac;
  --c-surplus: #00b894;
  --c-deficit: #ec4647;
  --c-neutral: #efefef;
  --c-aqua: #00b894;
  --c-orange: #f47230;
  --seq-0: #cce3fd; --seq-1: #84b9f3; --seq-2: #338ced; --seq-3: #1b64be; --seq-4: #0e3d7e;
  --map-land: #f1f4f2; --map-land-dk: #dfe7e2; --map-line: #cdd6d0; --map-sea: #f0f3f1;

  --radius: 14px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1312;
  --bg-alt: #121917;
  --surface: #171e1c;
  --surface-2: #1e2725;
  --border: #2a3532;
  --text: #e8eeeb;
  --text-2: #a3b0aa;
  --text-3: #7d8a84;
  --accent: #3ccaa2;
  --accent-ink: #06231b;
  --accent-soft: #16332b;
  --grid: #26302d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);

  --c-solar: #d28e05;
  --c-wind: #338ced;
  --c-el: #9887ef;
  --c-meoh: #e24d8b;
  --c-surplus: #00a888;
  --c-deficit: #eb6263;
  --c-neutral: #383838;
  --c-aqua: #00a888;
  --c-orange: #e76624;
  --seq-0: #0e3d7e; --seq-1: #1757ac; --seq-2: #257de0; --seq-3: #6aabf1; --seq-4: #b6d5f8;
  --map-land: #1b2422; --map-land-dk: #2a3633; --map-line: #44524d; --map-sea: #131a18;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 var(--font); -webkit-font-smoothing: antialiased;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -.01em; text-wrap: balance; }
p { margin: 0; }
code { font: .88em var(--mono); background: var(--surface-2); padding: .1em .35em; border-radius: 5px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.wrap { width: min(1240px, 100% - 40px); margin-inline: auto; }
@media (max-width: 600px) { .wrap { width: calc(100% - 32px); } }

.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { width: min(1240px, 100% - 40px); margin-inline: auto; display: flex; align-items: center; gap: 18px; height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; white-space: nowrap; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 17px; height: 17px; fill: var(--accent-ink); }
.brand-sub { color: var(--text-2); font-weight: 500; }
.nav { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--text-2); text-decoration: none; font-size: 14px; font-weight: 500; padding: 7px 11px; border-radius: 8px; white-space: nowrap; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active { color: var(--accent); background: var(--accent-soft); }
.icon-btn { flex: none; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { border-color: var(--text-3); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
:root[data-theme="dark"] .i-moon, :root:not([data-theme="dark"]) .i-sun { display: none; }
@media (max-width: 900px) {
  .topbar-inner { width: calc(100% - 32px); flex-wrap: wrap; height: auto; padding: 8px 0 0; row-gap: 2px; }
  .brand { margin-right: auto; }
  .nav { order: 3; width: 100%; margin: 0 -16px; padding: 4px 16px 8px; width: calc(100% + 32px); }
  html { scroll-padding-top: 104px; }
}

/* ---------- hero */
.hero { padding: 64px 0 48px; background:
  radial-gradient(900px 380px at 85% -10%, color-mix(in srgb, var(--c-solar) 16%, transparent), transparent 70%),
  radial-gradient(800px 360px at 5% 0%, color-mix(in srgb, var(--c-wind) 13%, transparent), transparent 70%); }
.eyebrow { color: var(--accent); font-weight: 600; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 14px; }
h1 { font-size: clamp(30px, 4.4vw, 50px); max-width: 21ch; letter-spacing: -.025em; }
.lead { margin-top: 18px; max-width: 68ch; font-size: clamp(16px, 1.5vw, 18.5px); color: var(--text-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 36px; }
.fineprint { margin-top: 16px; font-size: 13.5px; color: var(--text-2); max-width: 90ch; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 15px var(--font); padding: 10px 18px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--text-3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { font-size: 13px; padding: 6px 11px; border-radius: 8px; }

/* ---------- KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpis.compact { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 16px; }
.sim-main > .grid { margin-top: 0; }
.sim-main > .grid + .chart-card { margin-top: 16px; }
@media (max-width: 600px) { .kpis, .kpis.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi-value, .kpis.compact .kpi-value { font-size: 20px; } }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); min-width: 0; }
.kpi-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.kpi-value { font-size: 25px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.25; }
.kpi-value small { font-size: .55em; font-weight: 600; color: var(--text-2); letter-spacing: 0; margin-left: 3px; }
.kpis.compact .kpi-value { font-size: 21px; }
.kpi-note { font-size: 12.5px; color: var(--text-3); }
.dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; flex: none; }
.c-solar { background: var(--c-solar); } .c-wind { background: var(--c-wind); }
.c-surplus { background: var(--c-surplus); } .c-deficit { background: var(--c-deficit); }

/* ---------- sections */
.section { padding: 64px 0; }
.section.alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section-head { margin-bottom: 26px; max-width: 78ch; }
.section-head h2 { font-size: clamp(24px, 3vw, 33px); letter-spacing: -.02em; }
.section-head p { margin-top: 10px; color: var(--text-2); }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
figure { margin: 0; }
.grid { display: grid; gap: 16px; margin-top: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.sidebar { grid-template-columns: 320px minmax(0, 1fr); margin-top: 0; }
.wrap > .chart-card { margin-top: 16px; }
@media (max-width: 1000px) { .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.three > :last-child { grid-column: 1 / -1; } }
@media (max-width: 820px) { .grid.two, .grid.three, .grid.sidebar { grid-template-columns: minmax(0, 1fr); } .grid.three > :last-child { grid-column: auto; } }

.chart-card figcaption, .figcap { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 18px; flex-wrap: wrap; margin-bottom: 10px; }
.chart-card h3 { font-size: 16px; }
.chart-card figcaption p, .figcap p { font-size: 13.5px; color: var(--text-2); margin-top: 3px; max-width: 70ch; }
.chart { width: 100%; height: 340px; }
.chart.tall { height: 520px; }
.chart.short { height: 300px; }
.chart.map { height: 560px; }
.chart.rank { height: 620px; }
#ch-heat { height: 360px; }
@media (max-width: 600px) { .chart { height: 300px; } .chart.tall { height: 480px; } .chart.map { height: 400px; } .panel { padding: 14px; } }
.map-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); margin-top: 0; align-items: start; }
@media (max-width: 900px) { .map-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- segmented control */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: block; padding: 6px 12px; border-radius: 7px; font-size: 13.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.seg.small span { padding: 4px 10px; font-size: 12.5px; }
.seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- simulator layout */
.sim { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.controls { position: sticky; top: 74px; display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - 90px); overflow-y: auto; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.panel-head h3 { font-size: 16px; }
@media (max-width: 980px) { .sim { grid-template-columns: minmax(0, 1fr); } .controls { position: static; max-height: none; } }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-size: 13.5px; font-weight: 600; padding: 0; margin-bottom: 6px; }
.seg-field .seg { display: flex; }
.seg-field .seg label { flex: 1; text-align: center; }
.hint { font-size: 12.5px; color: var(--text-3); line-height: 1.45; margin-top: 6px; }
.ctl { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: baseline; }
.ctl label { font-size: 13.5px; font-weight: 600; }
.ctl label small { font-weight: 500; color: var(--text-3); }
.ctl output { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ctl input[type=range] { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); height: 22px; margin: 0; cursor: pointer; }

.form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form .group { grid-column: 1 / -1; font-size: 11.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }
.form label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 600; color: var(--text-2); min-width: 0; }
.form input { width: 100%; font: 600 14px var(--font); font-variant-numeric: tabular-nums; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; min-width: 0; }
.form input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }

/* ---------- process flow */
.flow { display: grid; grid-template-columns: minmax(0, 1fr) 104px minmax(0, 1.05fr) 104px minmax(0, 1.05fr) 104px minmax(0, 1fr); align-items: center; }
.flow-col { display: flex; flex-direction: column; gap: 12px; }
.node { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); border-top: 3px solid var(--node, var(--border)); }
.node h3 { font-size: 14px; display: flex; align-items: center; gap: 8px; color: var(--text-2); font-weight: 600; }
.node h3 svg { width: 19px; height: 19px; fill: none; stroke: var(--node, currentColor); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.node-val { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 6px; }
.node-val small { font-size: .6em; color: var(--text-2); font-weight: 600; margin-left: 3px; letter-spacing: 0; }
.node-sub { font-size: 12.5px; color: var(--text-3); }
.io { list-style: none; margin: 10px 0 0; padding: 8px 0 0; border-top: 1px dashed var(--border); font-size: 13px; display: grid; gap: 3px; }
.io li { display: flex; justify-content: space-between; gap: 10px; color: var(--text-2); }
.io b { color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.eq { font: 12.5px var(--mono); color: var(--text-2); background: var(--surface-2); border-radius: 7px; padding: 5px 8px; margin-top: 10px; text-align: center; }
.n-solar { --node: var(--c-solar); } .n-wind { --node: var(--c-wind); } .n-grid { --node: var(--text-3); }
.n-el { --node: var(--c-el); } .n-syn { --node: var(--c-meoh); } .n-prod { --node: var(--accent); }
.flow-arrow { position: relative; height: 2px; background: var(--text-3); margin: 0 10px 0 8px; }
.flow-arrow::after { content: ""; position: absolute; right: -2px; top: -5px; border: 6px solid transparent; border-left: 9px solid var(--text-3); border-right: 0; }
.flow-arrow span { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); font-size: 11px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
@media (max-width: 1080px) {
  .flow { grid-template-columns: minmax(0, 1fr); justify-items: stretch; }
  .flow-col { flex-direction: row; flex-wrap: wrap; }
  .flow-col > .node { flex: 1 1 200px; }
  .flow-arrow { width: 2px; height: 34px; margin: 6px auto; }
  .flow-arrow::after { right: auto; left: -5px; top: auto; bottom: -2px; border: 6px solid transparent; border-top: 9px solid var(--text-3); border-bottom: 0; }
  .flow-arrow span { left: 14px; bottom: 9px; transform: none; }
}

.cards { display: grid; gap: 16px; margin-top: 24px; }
.cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 820px) { .cards.three, .cards.two { grid-template-columns: minmax(0, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.card h3 { font-size: 16px; margin-bottom: 8px; }
.card p, .card li { color: var(--text-2); font-size: 14.5px; }
.card ul { margin: 0; padding-left: 18px; display: grid; gap: 7px; }
.card strong { color: var(--text); }

/* ---------- spec list */
.spec h3 { font-size: 16px; margin-bottom: 10px; }
.spec dl { margin: 0; font-size: 13.5px; }
.spec dl > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--grid); }
.spec dl > div:last-child { border-bottom: 0; padding-bottom: 0; }
.spec dt { color: var(--text-2); }
.spec dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.grid.sidebar > .chart-card { display: flex; flex-direction: column; }
.grid.sidebar > .chart-card .chart { flex: 1 1 auto; min-height: 340px; height: auto; }

/* ---------- tables */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; min-width: 760px; }
table.data th, table.data td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--grid); white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data thead th { font-size: 12px; color: var(--text-2); font-weight: 600; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
table.data tfoot td { font-weight: 700; border-top: 1px solid var(--border); border-bottom: 0; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--pc); }
.pill.excess { --pc: var(--c-surplus); } .pill.deficit { --pc: var(--c-deficit); }

/* ---------- method */
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .steps { grid-template-columns: minmax(0, 1fr); } }
.steps li { counter-increment: s; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13.5px; margin-bottom: 10px; }
.steps h3 { font-size: 15.5px; margin-bottom: 6px; }
.steps p { font-size: 14px; color: var(--text-2); }

/* ---------- footer */
.footer { border-top: 1px solid var(--border); padding: 28px 0 40px; font-size: 14px; color: var(--text-2); }
.footer-inner { display: flex; justify-content: space-between; gap: 18px 40px; flex-wrap: wrap; }
.footer strong { color: var(--text); }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.noscript { text-align: center; padding: 20px; background: var(--accent-soft); }
