/* =========================================================
   PV & Heat Pump Guide (energyhub) — engineered-energy design system
   Palette: deep slate + phosphor-green signal + warm signal-amber
   Type: one system sans-serif stack throughout — no webfonts, kept minimal
   ========================================================= */

:root {
  /* core palette — cool engineered dark, not the generic cream-serif default */
  --ink:        #0e1826;   /* near-black slate for text on light */
  --slate-900:  #0b1420;
  --slate-800:  #13202f;
  --slate-700:  #1d2e40;
  --paper:      #f6f7f4;   /* faint warm-grey paper, not cream */
  --paper-2:    #eceee8;
  --line:       #d3d8cf;

  /* signals */
  --phosphor:   #1f7a5a;   /* deep photosynthetic green — the "generation" signal */
  --phosphor-lite:#e2efe8;
  --amber:      #c9761d;   /* warm signal amber — the "heat" signal */
  --amber-lite: #f6ead9;

  --accent:     var(--phosphor);

  --maxw: 74rem;
  --measure: 42rem;

  --f-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --f-display: var(--f-sans);
  --f-body: var(--f-sans);
  --f-mono: var(--f-sans);

  --r: 4px;              /* restrained radius — engineered, not pill-soft */
  --shadow: 0 1px 2px rgba(14,24,38,.06), 0 8px 30px rgba(14,24,38,.06);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--f-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(var(--maxw), 100% - 3rem); margin-inline: auto; }

a { color: inherit; text-decoration: none; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 100;
}
.skip:focus { left: 1rem; top: 1rem; }

:focus-visible { outline: 2px solid var(--phosphor); outline-offset: 3px; }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246,247,244,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.head-inner { display: flex; align-items: center; gap: 2rem; height: 66px; }
.brand { display: flex; align-items: center; gap: .55rem; color: var(--ink); }
.brand-mark { color: var(--phosphor); display: grid; place-items: center; }
.brand-name {
  font-family: var(--f-display);
  font-weight: 600; font-size: 1.28rem; letter-spacing: -.01em;
}
.site-nav { display: flex; gap: 1.6rem; margin-left: auto; }
.site-nav a {
  font-size: .92rem; font-weight: 500; color: var(--slate-700);
  padding-block: .3rem; border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a.active { color: var(--phosphor); border-color: var(--phosphor); }
.head-right { display: flex; align-items: center; }
.lang-toggle {
  font-family: var(--f-mono); font-size: .78rem; letter-spacing: .02em;
  border: 1px solid var(--line); border-radius: var(--r);
  padding: .35rem .7rem; color: var(--slate-700);
  transition: border-color .15s, color .15s;
}
.lang-toggle:hover { border-color: var(--phosphor); color: var(--phosphor); }

@media (max-width: 780px) {
  .head-inner { gap: 1rem; flex-wrap: wrap; height: auto; padding-block: .7rem; }
  .site-nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; gap: 1.1rem; padding-bottom: .3rem; }
}

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--slate-900);
  color: #eef2ee;
  padding-block: 5.5rem 6rem;
}
.hero .wrap { position: relative; z-index: 2; }
.hero-grid {
  position: absolute; inset: 0; z-index: 1;
  background-image:
    linear-gradient(transparent 31px, rgba(255,255,255,.035) 32px),
    linear-gradient(90deg, transparent 31px, rgba(255,255,255,.035) 32px);
  background-size: 32px 32px;
  mask-image: radial-gradient(120% 90% at 80% 0%, #000 30%, transparent 75%);
}
.hero .eyebrow { color: #8fb8a6; }
.hero-title {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 6vw, 4.3rem);
  line-height: 1.03; letter-spacing: -.02em;
  margin: .4rem 0 1.1rem;
}
.hero-title .accent { color: #4bd6a0; }
.hero-lead {
  max-width: var(--measure); font-size: 1.12rem; color: #c2ccc6;
}
.hero-actions { display: flex; gap: .9rem; margin-top: 2rem; flex-wrap: wrap; }

.eyebrow {
  font-family: var(--f-mono); font-size: .78rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--slate-700); margin: 0;
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  font-weight: 600; font-size: .95rem;
  padding: .7rem 1.15rem; border-radius: var(--r);
  border: 1px solid transparent; transition: transform .12s, background .15s, border-color .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--phosphor); color: #fff; }
.btn-primary:hover { background: #196349; }
.btn-ghost { border-color: rgba(255,255,255,.28); color: #eef2ee; }
.btn-ghost:hover { border-color: #4bd6a0; color: #4bd6a0; }

/* ---------- section overview grid ---------- */
.sections-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem; padding-block: 4rem;
}
@media (max-width: 720px) { .sections-grid { grid-template-columns: 1fr; } }
.section-card {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  padding: 1.5rem 1.6rem; transition: border-color .15s, box-shadow .15s, transform .12s;
}
.section-card:hover { border-color: var(--phosphor); box-shadow: var(--shadow); transform: translateY(-2px); }
.section-card-head { display: flex; align-items: baseline; gap: .8rem; margin-bottom: .9rem; }
.section-index {
  font-family: var(--f-mono); font-size: .85rem; color: var(--phosphor);
  border: 1px solid var(--phosphor-lite); background: var(--phosphor-lite);
  border-radius: var(--r); padding: .1rem .45rem;
}
.section-card h2 { font-family: var(--f-display); font-weight: 600; font-size: 1.4rem; margin: 0; letter-spacing: -.01em; }
.section-card-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .35rem; }
.section-card-list li {
  font-size: .93rem; color: var(--slate-700); padding-left: 1rem; position: relative;
}
.section-card-list li::before {
  content: ""; position: absolute; left: 0; top: .6em;
  width: 5px; height: 5px; border-radius: 50%; background: var(--amber);
}
.section-card-count {
  margin-top: auto; font-family: var(--f-mono); font-size: .76rem;
  color: var(--slate-700); letter-spacing: .04em;
}

/* ---------- page head ---------- */
.page-head { padding-block: 3rem 1rem; }
.crumb { font-family: var(--f-mono); font-size: .82rem; color: var(--phosphor); }
.page-head h1, .article-head h1 {
  font-family: var(--f-display); font-weight: 600;
  font-size: clamp(2rem, 4.5vw, 3rem); letter-spacing: -.02em; line-height: 1.08;
  margin: .5rem 0 0;
}

/* ---------- article list ---------- */
.article-list { padding-block: 1.5rem 5rem; display: grid; gap: .1rem; }
.article-row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1.2rem;
  padding: 1.3rem .4rem; border-top: 1px solid var(--line);
  transition: background .12s, padding-left .12s;
}
.article-row:last-child { border-bottom: 1px solid var(--line); }
.article-row:hover { background: #fff; padding-left: 1rem; }
.article-num { font-family: var(--f-mono); font-size: .9rem; color: var(--phosphor); }
.article-title { display: block; font-family: var(--f-display); font-weight: 600; font-size: 1.28rem; letter-spacing: -.01em; }
.article-summary { display: block; color: var(--slate-700); font-size: .95rem; margin-top: .15rem; }
.article-arrow { color: var(--phosphor); font-size: 1.2rem; opacity: 0; transition: opacity .12s, transform .12s; }
.article-row:hover .article-arrow { opacity: 1; transform: translateX(3px); }

/* ---------- article page ---------- */
.article-head { padding-block: 3rem 1.5rem; }
.article-lead { max-width: var(--measure); font-size: 1.18rem; color: var(--slate-700); margin-top: 1rem; }
.article-meta { font-family: var(--f-mono); font-size: .78rem; color: var(--slate-700); margin-top: .8rem; }

.article-layout {
  display: grid; grid-template-columns: 15rem 1fr; gap: 3rem; align-items: start;
  padding-bottom: 4rem;
}
@media (max-width: 900px) { .article-layout { grid-template-columns: 1fr; } .article-toc { display: none; } }

.article-toc { position: sticky; top: 88px; }
.toc-label { font-family: var(--f-mono); font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--slate-700); }
.article-toc ul { list-style: none; margin: .5rem 0 0; padding: 0; border-left: 2px solid var(--line); }
.article-toc li { margin: 0; }
.article-toc a {
  display: block; padding: .3rem .9rem; font-size: .88rem; color: var(--slate-700);
  border-left: 2px solid transparent; margin-left: -2px; transition: color .12s, border-color .12s;
}
.article-toc a:hover { color: var(--phosphor); border-color: var(--phosphor); }

/* prose */
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1.15rem; }
.prose h2 {
  font-family: var(--f-display); font-weight: 600; font-size: 1.6rem; letter-spacing: -.01em;
  margin-top: 2.6rem; padding-top: 1.4rem; border-top: 1px solid var(--line); line-height: 1.2;
}
.prose h3 { font-family: var(--f-display); font-weight: 600; font-size: 1.24rem; margin-top: 1.8rem; }
.prose p, .prose li { font-size: 1.05rem; }
.prose a { color: var(--phosphor); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover { color: #196349; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-top: .4rem; }
.prose strong { font-weight: 600; }
.prose code {
  font-family: var(--f-mono); font-size: .88em;
  background: var(--paper-2); padding: .12em .4em; border-radius: 3px;
}
.prose pre {
  background: var(--slate-900); color: #dfe7e2; padding: 1.1rem 1.2rem;
  border-radius: var(--r); overflow-x: auto; font-size: .88rem;
}
.prose pre code { background: none; padding: 0; color: inherit; }
.prose blockquote {
  border-left: 3px solid var(--amber); background: var(--amber-lite);
  padding: .9rem 1.2rem; border-radius: 0 var(--r) var(--r) 0; color: #6b4a1e;
}
.prose blockquote p { margin: 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: .55rem .7rem; text-align: left; }
.prose th { background: var(--paper-2); font-weight: 600; }
.prose img { max-width: 100%; border-radius: var(--r); }

/* "more in section" */
.article-more { padding-block: 2.5rem 4rem; border-top: 1px solid var(--line); }
.more-label { font-family: var(--f-mono); font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; color: var(--slate-700); }
.more-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem,1fr)); gap: 1rem; margin-top: 1rem; }
.more-card {
  display: flex; flex-direction: column; gap: .3rem;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 1rem 1.1rem;
  transition: border-color .15s, transform .12s;
}
.more-card:hover { border-color: var(--phosphor); transform: translateY(-2px); }
.more-title { font-family: var(--f-display); font-weight: 600; font-size: 1.05rem; }
.more-summary { font-size: .88rem; color: var(--slate-700); }

/* utility */
.muted { color: var(--slate-700); }
.muted.big { font-size: 1.1rem; padding-block: 2rem; }

/* ---------- footer ---------- */
.site-foot { background: var(--slate-900); color: #b9c4bd; margin-top: 2rem; }
.foot-inner { display: grid; grid-template-columns: 1.5fr 1fr; gap: 2rem; padding-block: 3rem 2rem; }
.foot-brand .brand-name { color: #fff; font-size: 1.3rem; }
.foot-brand p { max-width: 26rem; margin: .5rem 0 0; font-size: .92rem; }
.foot-nav { display: flex; flex-direction: column; gap: .5rem; }
.foot-nav a { color: #b9c4bd; font-size: .92rem; }
.foot-nav a:hover { color: #4bd6a0; }
.foot-legal {
  grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.1); padding-top: 1.4rem;
  font-family: var(--f-mono); font-size: .76rem; color: #7f8d85; letter-spacing: .03em;
}
@media (max-width: 640px) { .foot-inner { grid-template-columns: 1fr; } }

/* ---------- learning path (the staircase) ---------- */
.lp { padding-block: 1.5rem 5rem; }
.lp-stage {
  font-family: var(--f-mono); font-size: .82rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--phosphor); margin: 2.4rem 0 .8rem; padding-bottom: .5rem;
  border-bottom: 1px solid var(--line);
}
.lp-stage:first-child { margin-top: 0; }
.lp-step {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem;
  padding: .95rem .9rem; border: 1px solid var(--line); border-radius: var(--r);
  margin-bottom: .5rem; background: #fff;
  transition: border-color .12s, transform .12s;
}
.lp-step.done:hover { border-color: var(--phosphor); transform: translateX(3px); }
.lp-step.todo { background: transparent; border-style: dashed; opacity: .7; }
.lp-num {
  font-family: var(--f-mono); font-size: .9rem; color: var(--phosphor);
  min-width: 2ch; text-align: right;
}
.lp-step.todo .lp-num { color: var(--slate-700); }
.lp-title { font-family: var(--f-display); font-weight: 600; font-size: 1.1rem; letter-spacing: -.01em; }
.lp-arrow { color: var(--phosphor); opacity: 0; transition: opacity .12s; }
.lp-step.done:hover .lp-arrow { opacity: 1; }
.lp-soon {
  font-family: var(--f-mono); font-size: .72rem; letter-spacing: .04em;
  color: var(--amber); border: 1px solid var(--amber-lite); background: var(--amber-lite);
  padding: .12rem .5rem; border-radius: 999px;
}
