/* Energy Transition Partners — site styles
   Tokens first; everything else derives from them. */

:root {
  --haze: #f3f5f1;        /* page background */
  --paper: #ffffff;
  --ink: #14201c;         /* text */
  --pine: #0e3a36;        /* primary, headings, dark blocks */
  --pine-2: #17524c;
  --moss: #4e7d5f;        /* secondary accent */
  --solar: #e9a825;       /* accent: solar amber */
  --solar-deep: #c98a12;
  --line: #cdd6cf;
  --muted: #5b6b64;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 48px);
  --radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--haze);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--pine); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--pine-2); }
:focus-visible { outline: 3px solid var(--solar); outline-offset: 3px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.muted { color: var(--muted); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 50, "opsz" 72;
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  color: var(--pine);
  text-wrap: balance;
}
h2 { font-size: clamp(30px, 4vw, 44px); }
h3 { font-size: clamp(22px, 2.4vw, 27px); }
h4 { font-family: var(--font-body); font-size: 15px; font-weight: 700; margin: 1.6em 0 0.4em; color: var(--pine); }
p { margin: 0 0 1em; max-width: 68ch; }

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

/* ---------- Buttons ---------- */
.button {
  display: inline-block;
  background: var(--pine);
  color: #fff;
  font-weight: 600;
  padding: 14px 22px;
  border-radius: 999px;
  text-decoration: none;
  border: 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease;
}
.button:hover { background: var(--pine-2); color: #fff; }
.button--small { padding: 9px 16px; font-size: 15px; }
.link-arrow { font-weight: 600; text-decoration: none; }
.link-arrow::after { content: " \2193"; }

/* ---------- Header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--haze) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--pine); }
.brand__mark {
  width: 30px; height: 30px; border-radius: 50%;
  background: conic-gradient(var(--solar) 0 55%, var(--pine) 55% 100%);
  box-shadow: inset 0 0 0 6px var(--haze);
  border: 2px solid var(--pine);
  flex: none;
}
.brand__name { font-family: var(--font-display); font-size: 15px; line-height: 1.05; font-weight: 600; letter-spacing: -0.01em; }
.nav { display: flex; gap: 26px; align-items: center; }
.nav a { text-decoration: none; font-weight: 600; font-size: 15px; }
.nav a:not(.button):hover { text-decoration: underline; }
.menu-toggle {
  display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; padding: 10px;
  flex-direction: column; justify-content: center; gap: 6px;
}
.menu-toggle span { display: block; height: 2px; background: var(--pine); }
.mobile-nav[hidden] { display: none; }
.mobile-nav { display: flex; flex-direction: column; padding: 8px var(--gutter) 20px; gap: 14px; border-top: 1px solid var(--line); }
.mobile-nav a { font-weight: 600; text-decoration: none; font-size: 18px; }
@media (max-width: 860px) {
  .nav { display: none; }
  .menu-toggle { display: flex; }
}

/* ---------- Hero ---------- */
.hero { padding: clamp(40px, 7vw, 96px) 0 0; }
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}
.hero__title {
  font-size: clamp(38px, 5.2vw, 66px);
  font-weight: 400;
  font-variation-settings: "SOFT" 50, "opsz" 144;
  letter-spacing: -0.02em;
  margin-bottom: 0.55em;
}
.hero__lede { font-size: clamp(17px, 1.4vw, 20px); color: var(--ink); max-width: 56ch; }
.hero__actions { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; margin-top: 28px; }

.dispatch { margin: 0; }
.dispatch svg { width: 100%; height: auto; display: block; overflow: visible; }
.dispatch figcaption { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--muted); }
.legend { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 14px; height: 10px; border-radius: 2px; }
.legend__price { background: var(--pine); height: 3px !important; }
.legend__charge { background: var(--moss); }
.legend__discharge { background: var(--solar); }
.legend__soc { background: transparent; border-top: 2px dashed var(--pine); height: 0 !important; }
.dispatch__note { flex-basis: 100%; }

.facts {
  margin-top: clamp(40px, 6vw, 80px);
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.fact { padding: 22px 0; display: flex; flex-direction: column; gap: 4px; }
.fact + .fact { border-left: 1px solid var(--line); padding-left: 28px; }
.fact strong { font-family: var(--font-display); font-size: 22px; font-weight: 500; color: var(--pine); }
.fact span { font-size: 14px; color: var(--muted); }

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .fact + .fact { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); }
}

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 8vw, 112px) 0; }
.section-lede { color: var(--muted); font-size: 18px; margin-bottom: 2.5em; }

/* Why */
.why__head { max-width: 760px; margin-bottom: clamp(32px, 5vw, 64px); }
.why__body { font-size: 19px; max-width: 64ch; }
.why__cols { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 56px); }
.why__col { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(22px, 3vw, 36px); }
.why__col h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.who { font-family: var(--font-body); font-size: 14px; font-weight: 600; color: var(--muted); }
@media (max-width: 800px) { .why__cols { grid-template-columns: 1fr; } }

.ticks { list-style: none; padding: 0; margin: 0; }
.ticks li { position: relative; padding-left: 26px; margin-bottom: 10px; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 0.62em; width: 14px; height: 2px; background: var(--solar);
}
.ticks--compact li { font-size: 15px; margin-bottom: 6px; }

/* Services */
.services { background: var(--pine); color: #e6ede9; }
.services h2 { color: #fff; margin-bottom: 1em; }
.services__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.14); }
.service { background: var(--pine); padding: clamp(22px, 3vw, 34px); }
.service h3 { color: var(--solar); font-size: 22px; }
.service p { color: #d5e0da; font-size: 16px; margin: 0; }
@media (max-width: 960px) { .services__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .services__grid { grid-template-columns: 1fr; } }

/* Work */
.case {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(24px, 5vw, 72px);
  padding: clamp(32px, 5vw, 56px) 0; border-top: 1px solid var(--line);
}
.case:last-child { border-bottom: 1px solid var(--line); }
.case__client { font-family: var(--font-display); font-size: 21px; line-height: 1.3; color: var(--pine); margin-bottom: 14px; }
.tags { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-size: 12.5px; font-weight: 600; color: var(--pine); border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 3px 10px; }
.case__summary { font-size: 18px; }
/* Case-study gallery: 16:9 slide images, click to enlarge */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 28px; }
.gallery__item { margin: 0; }
.gallery__item img {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  cursor: zoom-in; transition: transform .15s ease;
}
.gallery__item img:hover { transform: translateY(-2px); }
.gallery__item figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }
.lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(14, 32, 28, .86);
  display: grid; place-items: center; padding: 24px; cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: min(1400px, 96vw); max-height: 90vh; border-radius: var(--radius); background: #fff; }
.lightbox figcaption { color: #e6ede9; font-size: 14px; margin-top: 10px; text-align: center; }
@media (max-width: 800px) { .case { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .gallery { grid-template-columns: 1fr; } }

/* Process */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(20px, 3vw, 40px); counter-reset: step; }
.step { counter-increment: step; position: relative; padding-top: 18px; border-top: 2px solid var(--pine); }
.step::before {
  content: counter(step);
  position: absolute; top: -18px; left: 0;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--haze); border: 2px solid var(--pine);
  font-family: var(--font-display); font-size: 16px; font-weight: 600; color: var(--pine);
  display: grid; place-items: center;
}
.step h3 { margin-top: 22px; font-size: 22px; }
.step p { font-size: 16px; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }

/* Partners */
.partners { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.partners__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); }
.partner { display: grid; grid-template-columns: 140px 1fr; gap: 24px; align-items: start; }
.partner__photo { width: 140px; height: 140px; object-fit: cover; border-radius: 50%; border: 3px solid var(--haze); box-shadow: 0 0 0 1px var(--line); }
.partner__role { color: var(--muted); font-size: 15px; margin-bottom: 1.2em; }
.partner__links { display: flex; gap: 18px; margin-top: 1.2em; font-weight: 600; }
@media (max-width: 960px) { .partners__grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .partner { grid-template-columns: 1fr; } }

/* Contact */
.contact__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.contact__body { font-size: 18px; }
.contact__direct { color: var(--muted); }
.form { display: grid; gap: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 3vw, 32px); }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: 15px; }
.form input, .form textarea {
  font: inherit; font-weight: 400; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--haze); color: var(--ink); width: 100%;
}
.form input:focus, .form textarea:focus { outline: 2px solid var(--solar); outline-offset: 0; border-color: var(--solar); }
.form textarea { resize: vertical; }
.form .button { justify-self: start; }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.notice { padding: 12px 14px; border-radius: var(--radius); font-weight: 600; margin: 0; }
.notice--ok { background: #e4f0e8; color: #1f4d33; }
.notice--err { background: #fbe9e4; color: #7a2a17; }
@media (max-width: 800px) { .contact__grid { grid-template-columns: 1fr; } }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 32px 0 40px; font-size: 14px; }
.footer__inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.footer__links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer a { text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* Dispatch chart pieces (SVG built in site.js) */
.dc-axis { stroke: var(--line); stroke-width: 1; }
.dc-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; }
.dc-label { font-family: var(--font-body); font-size: 11px; fill: var(--muted); }
.dc-price { fill: none; stroke: var(--pine); stroke-width: 2.5; stroke-linejoin: round; }
.dc-price-area { fill: var(--pine); opacity: .06; }
.dc-charge { fill: var(--moss); }
.dc-discharge { fill: var(--solar); }
.dc-soc { fill: none; stroke: var(--pine); stroke-width: 1.5; stroke-dasharray: 4 4; }
.dc-reserve { fill: var(--solar); opacity: .18; }
.dc-reveal { transition: width 2.2s cubic-bezier(.2,.7,.2,1); }
@media (prefers-reduced-motion: reduce) { .dc-reveal { transition: none; } }
