/* jinga.dev — the studio site set in the grammar of the EU energy label.
   One file, no build, no dependencies. The ramp hexes are the regulated ones,
   identical to app/extensions/energy-label/blocks/energy_label.liquid. */

:root {
  --class-a: #00a651;
  --class-b: #4cb847;
  --class-c: #bfd730;
  --class-d: #fff200;
  --class-e: #fcb814;
  --class-f: #f37021;
  --class-g: #ed1c24;
  /* Interactive green: the A-green darkened until white text clears WCAG AA
     (4.7:1). The seven scale hexes above stay exactly as regulated. */
  --action: #008542;
  --ink: #1a1a1a;
  --paper: #ffffff;
  --muted: #4d4d4d;
  --ground: #e9e8e4;
  --hairline: #c9c7c1;
  /* Verdana and Calibri are the two faces the delegated acts prescribe for the
     label (e.g. Reg. (EU) 2019/2014 Annex III). Carlito is Calibri's
     metric-compatible libre clone, common on Linux. */
  --face: Verdana, "DejaVu Sans", Geneva, sans-serif;
  --class-face: Calibri, Carlito, Verdana, "DejaVu Sans", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { color-scheme: light; }

body {
  font-family: var(--face);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--ground);
  padding: 28px 16px 48px;
  -webkit-text-size-adjust: 100%;
}

/* ---------- The sheet: the page is one label-like document ---------- */

.sheet {
  max-width: 920px;
  margin: 0 auto;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 16px;
  overflow: hidden;
}

.sheet > *, .sheet main > section { padding: 40px 48px; }
.sheet main { padding: 0; }
.sheet > * + *, .sheet main > section + section { border-top: 2px solid var(--ink); }

/* ---------- Masthead: the label's supplier / model row ---------- */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 24px;
  padding-top: 22px;
  padding-bottom: 22px;
}

.wordmark {
  font-weight: 700;
  font-size: 1.45rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.wordmark svg { display: block; }

.masthead nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  font-size: 0.9rem;
}

.masthead nav a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
}

.masthead nav a:hover { border-bottom-color: var(--ink); }
.masthead nav a[aria-current="page"] { border-bottom-color: var(--class-a); font-weight: 700; }

/* ---------- Type ---------- */

h1 {
  font-size: clamp(1.9rem, 4.6vw, 2.7rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
  max-width: 24ch;
}

h2 {
  font-size: 1.3rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

h3 { font-size: 1rem; }

p, li, dd { max-width: 62ch; }

.lede {
  margin-top: 20px;
  font-size: 1.05rem;
  max-width: 54ch;
}

.muted { color: var(--muted); }

a { color: var(--ink); }
a:hover { text-decoration-thickness: 2px; }

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

.skip {
  position: absolute;
  left: -9999px;
  background: var(--paper);
  padding: 8px 16px;
  border: 2px solid var(--ink);
}
.skip:focus { left: 16px; top: 16px; z-index: 10; }

/* ---------- The A–G scale ---------- */

.scale {
  list-style: none;
  display: grid;
  gap: 6px;
}

.scale .arrow {
  height: 42px;
  display: flex;
  align-items: center;
  padding-left: 16px;
  font-family: var(--class-face);
  font-weight: 700;
  font-size: 1.5rem;
  color: #fff;
  clip-path: polygon(0 0, calc(100% - 21px) 0, 100% 50%, calc(100% - 21px) 100%, 0 100%);
}

/* Ink letters on B–F: the mid-ramp hues cannot carry white text at WCAG AA,
   and the letters are the meaning. The hexes themselves stay regulated. */
.scale .arrow.a { width: 40%; background: var(--class-a); }
.scale .arrow.b { width: 50%; background: var(--class-b); color: var(--ink); }
.scale .arrow.c { width: 60%; background: var(--class-c); color: var(--ink); }
.scale .arrow.d { width: 70%; background: var(--class-d); color: var(--ink); }
.scale .arrow.e { width: 80%; background: var(--class-e); color: var(--ink); }
.scale .arrow.f { width: 90%; background: var(--class-f); color: var(--ink); }
.scale .arrow.g { width: 100%; background: var(--class-g); }

/* The one authored motion moment: the scale assembles once, left to right,
   like the ramp being printed. Everything else on the site holds still. */
@media (prefers-reduced-motion: no-preference) {
  .scale .arrow {
    animation: settle 0.55s cubic-bezier(0.16, 1, 0.3, 1) backwards;
  }
  .scale .arrow.b { animation-delay: 0.06s; }
  .scale .arrow.c { animation-delay: 0.12s; }
  .scale .arrow.d { animation-delay: 0.18s; }
  .scale .arrow.e { animation-delay: 0.24s; }
  .scale .arrow.f { animation-delay: 0.30s; }
  .scale .arrow.g { animation-delay: 0.36s; }
  @keyframes settle {
    from { transform: translateX(-28px); opacity: 0; }
  }
  .cta .cta-arrow { transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1); }
}

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 24px 48px;
  align-items: center;
  padding-top: 48px;
  padding-bottom: 48px;
}

.hero .scale { align-self: center; }

.hero figure figcaption {
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- Arrow-shaped call to action ---------- */

.cta {
  display: inline-block;
  text-decoration: none;
  margin-top: 28px;
}

.cta .cta-arrow {
  display: inline-flex;
  align-items: center;
  background: var(--action);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 44px 14px 22px;
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 50%, calc(100% - 22px) 100%, 0 100%);
}

.cta:hover .cta-arrow { transform: translateX(6px); }

.aside-link { margin-top: 14px; font-size: 0.9rem; }

/* ---------- Fiche: ruled information-sheet rows ---------- */

.fiche { width: 100%; border-collapse: collapse; margin-top: 26px; }

.fiche caption {
  text-align: left;
  font-size: 0.85rem;
  color: var(--muted);
  padding-bottom: 10px;
}

.fiche th, .fiche td {
  text-align: left;
  vertical-align: top;
  padding: 13px 0;
  border-top: 1px solid var(--hairline);
}

.fiche tr:last-child th, .fiche tr:last-child td { border-bottom: 1px solid var(--hairline); }

.fiche th {
  font-weight: 700;
  width: 34%;
  padding-right: 28px;
  font-size: 0.9rem;
}

.fiche td { font-size: 0.9rem; }

/* ---------- Pictogram strip: the label's bottom row ---------- */

.strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 2px solid var(--ink);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 30px;
}

.strip > div {
  padding: 22px 14px 18px;
  text-align: center;
  border-left: 2px solid var(--ink);
  min-width: 0;
}

.strip > div:nth-child(odd) { border-left: 0; }
.strip > div:nth-child(n + 3) { border-top: 2px solid var(--ink); }

.strip svg { display: inline-block; }

.strip .value {
  display: block;
  margin-top: 10px;
  font-weight: 700;
  font-size: 0.95rem;
}

.strip .unit {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 2px;
}

/* ---------- Numbered pipeline steps ---------- */

.steps { list-style: none; counter-reset: step; margin-top: 10px; }

.steps li {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 0 20px;
  padding: 24px 0;
  border-top: 1px solid var(--hairline);
  max-width: none;
}

.steps li:first-child { border-top: 0; }

.steps li::before {
  counter-increment: step;
  content: counter(step);
  font-family: var(--class-face);
  font-weight: 700;
  font-size: 2.1rem;
  line-height: 1;
}

.steps h3 { margin-bottom: 6px; }
.steps p { font-size: 0.92rem; }

/* ---------- Pricing rows ---------- */

.plans { width: 100%; border-collapse: collapse; margin-top: 26px; }

.plans th, .plans td {
  text-align: left;
  padding: 14px 0;
  border-top: 1px solid var(--hairline);
  font-size: 0.92rem;
  vertical-align: baseline;
}

.plans tr:last-child th, .plans tr:last-child td { border-bottom: 1px solid var(--hairline); }

.plans th { font-weight: 700; width: 34%; padding-right: 28px; }

.plans .price {
  text-align: right;
  font-weight: 700;
  white-space: nowrap;
  font-size: 1.05rem;
}

/* ---------- Storefront block demo ---------- */

.demo {
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 26px 28px;
  margin-top: 30px;
  max-width: 460px;
}

.demo .demo-product { font-size: 0.9rem; color: var(--muted); margin-bottom: 14px; }

.demo details summary {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.demo details summary::-webkit-details-marker { display: none; }

.demo .class-arrow {
  display: inline-flex;
  align-items: center;
  background: var(--class-b);
  color: var(--ink);
  font-family: var(--class-face);
  font-weight: 700;
  font-size: 1.3rem;
  padding: 6px 30px 6px 14px;
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%);
}

.demo details summary .hint {
  margin-left: 12px;
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: underline;
}

.demo details[open] summary .hint { text-decoration: none; }

.demo details > p {
  margin-top: 14px;
  font-size: 0.88rem;
  border-top: 1px solid var(--hairline);
  padding-top: 14px;
}

/* ---------- Prose sections (privacy policy) ---------- */

.doc-head .doc-meta {
  margin-top: 18px;
  font-size: 0.88rem;
  color: var(--muted);
}

.prose h2 { margin-top: 40px; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose ul { margin-top: 12px; }
.prose ul { padding-left: 22px; }
.prose li + li { margin-top: 8px; }

/* ---------- Footer ---------- */

footer.colophon {
  font-size: 0.8rem;
  color: var(--muted);
  padding-top: 26px;
  padding-bottom: 26px;
}

footer.colophon p { max-width: none; }
footer.colophon p + p { margin-top: 10px; }
footer.colophon a { color: inherit; }

.ramp-edge {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 22px;
}

/* ---------- Small screens ---------- */

@media (max-width: 720px) {
  .sheet > *, .sheet main > section { padding-left: 22px; padding-right: 22px; }
  .sheet main { padding: 0; }
  .hero { grid-template-columns: 1fr; padding-top: 34px; padding-bottom: 34px; }
  .hero figure { max-width: 420px; }
  .scale .arrow { height: 36px; font-size: 1.25rem; }
  .fiche th, .fiche td, .plans th, .plans td { display: block; width: auto; padding: 4px 0; }
  .fiche th, .plans th { border-top: 1px solid var(--hairline); padding-top: 14px; }
  .fiche td, .plans td { border-top: 0; padding-bottom: 14px; }
  .fiche tr:last-child th, .plans tr:last-child th { border-bottom: 0; }
  .plans .price { text-align: left; }
  .steps li { grid-template-columns: 44px minmax(0, 1fr); }
}
