/* ============================================================
   Cercand — Brand CSS  v1
   Tokens from the Brand Identity guide (warm paper palette)
   ============================================================ */

/* ---- TOKENS ---- */
:root {
  --paper:      #F4F0E8;
  --paper-2:    #FBF8F2;
  --paper-3:    #EFEADF;
  --ink:        #221F1A;
  --ink-2:      #46413A;
  --ink-3:      #847C70;
  --line:       #DED7C8;
  --line-2:     #CFC6B4;
  --clay:       oklch(0.585 0.115 45);
  --pine:       oklch(0.585 0.090 150);
  /* Chroma raised from 0.090 to 0.105 so it clears the 0.10 floor below which a
     hue reads as grey in a chart. Same lightness and hue as before, and it was
     unused anywhere in this file, so nothing else shifts.
     NOTE: --pine must never be a series colour — against --clay it is dE 4.9
     under deuteranopia, i.e. indistinguishable. It stays a status token, and
     anywhere it marks up/down it ships with a glyph, never colour alone. */
  --slate:      oklch(0.585 0.105 245);
  --clay-soft:  oklch(0.585 0.115 45 / 0.10);
  --pine-soft:  oklch(0.585 0.090 150 / 0.10);
  --slate-soft: oklch(0.585 0.105 245 / 0.10);

  /* ---- CHART SERIES ----
     Eight slots in a fixed order, handed out one per data source and never
     cycled. The order is the safety mechanism, not a preference: slots are
     assigned in sequence, so the earliest ones are the ones actually in use and
     the palette is built so that the first N are the best possible first N.
     That is the property that matters when sources arrive one at a time.

     Slots 1 and 2 ARE --clay and --slate, repeated here under series names so
     the two chains that already had them keep them. Never reorder this list:
     a source's colour is pinned by index in web/lab/sources.py, so moving a
     slot repaints a chain that had nothing to do with the change.

     Measured as OKLab dE x100 on --paper, with protanopia and deuteranopia
     simulated (Machado-Oliveira-Fernandes 2009, severity 1.0). Thresholds are
     dE >= 8 under CVD and >= 15 under normal vision:

       first 2      CVD 17.6   normal 21.7   pass
       first 3      CVD 14.3   normal 21.7   pass
       first 4      CVD  9.3   normal 19.7   pass   <- the four chains today
       first 5      CVD  7.7   normal 15.3   floor (>= 6, needs direct labels)
       all 8, adjacent pairs
                    CVD 10.8   normal 21.7   pass

     The first four clear the hard all-pairs test, which is the right one for a
     line chart whose lines cross. From the fifth on, identity is carried by the
     end-of-line labels charts.py already draws, not by colour alone. No palette
     separates eight simultaneous series; at that point the chart splits. */
  --series-1: oklch(0.584 0.115  45);   /* clay   — contrast 3.87:1 */
  --series-2: oklch(0.584 0.105 246);   /* slate  — contrast 3.67:1 */
  --series-3: oklch(0.440 0.170 315);   /* violet — contrast 7.48:1 */
  --series-4: oklch(0.440 0.104 120);   /* olive  — contrast 6.67:1 */
  --series-5: oklch(0.649 0.171 300);   /* lilac  — contrast 3.06:1 */
  --series-6: oklch(0.501 0.170   0);   /* wine   — contrast 5.79:1 */
  --series-7: oklch(0.619 0.122 170);   /* teal   — contrast 3.02:1 */
  --series-8: oklch(0.500 0.171 275);   /* indigo — contrast 5.57:1 */

  --maxw: 1080px;
  --pad:  clamp(20px, 4vw, 40px);
  --radius: 6px;
}

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  letter-spacing: -0.005em;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font: inherit; }
::selection { background: var(--clay); color: var(--paper-2); }

/* ---- LAYOUT ---- */
.wrap    { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }
.section { padding: 96px 0; }
.section + .section { border-top: 1px solid var(--line); }

/* ---- TYPE SCALE ---- */
.display {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 500;
  font-size: clamp(44px, 8vw, 80px);
  letter-spacing: -0.03em;
  line-height: 1.0;
}
h1, .h1 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 500;
  font-size: clamp(32px, 5vw, 52px);
  letter-spacing: -0.03em;
  line-height: 1.08;
}
h2, .h2 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 500;
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
h3, .h3 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 500;
  font-size: 20px;
  letter-spacing: -0.015em;
  line-height: 1.3;
}
.body-lead {
  font-size: 19px;
  color: var(--ink-2);
  line-height: 1.6;
  max-width: 52ch;
}
.mono {
  font-family: "Space Mono", monospace;
}
.eyebrow {
  font-family: "Space Mono", monospace;
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.sec-num {
  font-family: "Space Mono", monospace;
  font-size: 12px;
  color: var(--clay);
  letter-spacing: 0.05em;
}
em.accent { font-style: normal; color: var(--clay); }

/* ---- WORDMARK ---- */
.wordmark {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 0.9;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
}
.wordmark .dot { color: var(--clay); }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 500;
  font-size: 14.5px;
  letter-spacing: -0.01em;
  border-radius: var(--radius);
  padding: 10px 20px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-2);
}
.btn.ghost:hover { background: var(--paper-3); opacity: 1; }
.btn.clay {
  background: var(--clay);
  border-color: var(--clay);
  color: var(--paper-2);
}

/* ---- PILLS / BADGES ---- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: "Space Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
}
.pill.live    { background: var(--pine-soft); color: var(--pine); }
.pill.soon    { background: var(--clay-soft); color: var(--clay); }
.pill.live::before, .pill.soon::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}

/* ---- NAV ---- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.site-nav .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 24px;
}
.nav-wordmark { font-size: 22px; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}
.nav-links a {
  font-family: "Space Grotesk", sans-serif;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-2);
  letter-spacing: -0.01em;
  transition: color 0.15s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--ink); }
.nav-links a.active {
  position: relative;
}
.nav-links a.active::after {
  content: "";
  position: absolute;
  bottom: -3px; left: 0; right: 0;
  height: 1.5px;
  background: var(--clay);
  border-radius: 1px;
}

/* language switcher */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
}
.lang-btn {
  font-family: "Space Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  background: none;
  border: none;
  padding: 4px 6px;
  border-radius: 3px;
  transition: color 0.15s, background 0.15s;
}
.lang-btn:hover { color: var(--ink); background: var(--paper-3); }
.lang-btn.active { color: var(--clay); font-weight: 700; }

/* hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--ink);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* mobile nav drawer */
.nav-drawer {
  display: none;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--line);
  background: var(--paper);
}
.nav-drawer.open { display: flex; }
.nav-drawer a {
  font-family: "Space Grotesk", sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink-2);
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.nav-drawer a:hover { color: var(--ink); }
.nav-drawer .lang-row {
  display: flex;
  gap: 6px;
  padding: 14px 0;
}

/* ---- FOOTER ---- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 64px 0 80px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 24px;
}
.footer-wordmark { font-size: 30px; }
.footer-meta {
  font-family: "Space Mono", monospace;
  font-size: 11.5px;
  color: var(--ink-3);
  text-align: right;
  line-height: 1.9;
}
.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
  margin-top: 16px;
}
.footer-links a {
  font-size: 13.5px;
  color: var(--ink-3);
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--ink); }

/* ---- HOME: HERO ---- */
.hero {
  min-height: calc(100svh - 60px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  padding: 80px 0;
}
.hero-content { display: flex; flex-direction: column; gap: 32px; }
.hero-content .display { max-width: 14ch; }
.hero-content .body-lead { max-width: 44ch; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* Thermometer card: the one market-wide figure the front page publishes. */
.hero-solo { grid-template-columns: 1fr; }
.hero-visual { position: relative; }
.thermo-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 24px 48px -32px rgba(34,31,26,.35);
}
.thermo-head {
  padding: 12px 20px;
  background: var(--paper-3);
  border-bottom: 1px solid var(--line);
  font-family: "Space Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.thermo-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}
.thermo-month { font-size: 16px; color: var(--ink-2); }
.thermo-partial {
  display: block;
  font-family: "Space Mono", monospace;
  font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 4px;
}
.thermo-pct {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: clamp(28px, 3vw, 40px);
  letter-spacing: -0.03em;
  color: var(--ink);
  white-space: nowrap;
}
.thermo-note { padding: 16px 20px 0; font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.thermo-foot {
  padding: 12px 20px 16px;
  font-family: "Space Mono", monospace;
  font-size: 10.5px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}

/* "Aquest mes al súper" and the pharmacy gaps: same card language as the
   thermometer, so the page reads as one instrument. */
.sec-lead { color: var(--ink-2); max-width: 60ch; margin-top: 8px; line-height: 1.6; }
.moves-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden;
}
.moves-col { background: var(--paper-2); }
.moves-head {
  padding: 12px 20px; background: var(--paper-3); border-bottom: 1px solid var(--line);
  font-family: "Space Mono", monospace; font-size: 10.5px;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.moves-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 16px 20px; border-bottom: 1px solid var(--line); color: var(--ink-2);
}
.moves-row:last-child { border-bottom: none; }
.moves-pct {
  font-family: "Space Grotesk", sans-serif; font-size: 22px;
  letter-spacing: -0.02em; white-space: nowrap;
}
.moves-none { color: var(--ink-3); font-size: 14px; }
.gap-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.gap-card {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0;
}
.gap-group {
  font-family: "Space Mono", monospace; font-size: 10px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--clay);
}
.gap-name { font-size: 15px; color: var(--ink); line-height: 1.4; flex: 1; overflow-wrap: anywhere; }
.gap-price {
  display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 13.5px; color: var(--ink-2); transition: border-color 0.15s;
}
.gap-price:hover { border-color: var(--ink-3); }
.gap-price .num { font-family: "Space Mono", monospace; color: var(--ink); white-space: nowrap; }
/* Cheapest marked by position, weight and a border, never by colour alone. */
.gap-cheapest { border-color: var(--pine); font-weight: 600; }
.gap-diff { font-family: "Space Mono", monospace; font-size: 11.5px; color: var(--ink-3); }

/* ---- OPEN DATA: the home cards and /dades/ ----
   The total is the point of the card: it is what says "there is a lot more
   than the sample", so it gets the display size. */
.api-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.api-card {
  display: flex; flex-direction: column; gap: 6px; padding: 28px;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px;
  text-decoration: none; color: inherit; transition: border-color 0.15s;
}
.api-card:hover { border-color: var(--clay); }
.api-kind {
  font-family: "Space Mono", monospace; font-size: 10px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--clay);
}
.api-total {
  font-family: 'Space Grotesk', sans-serif; font-weight: 600;
  font-size: clamp(36px, 5vw, 56px); letter-spacing: -0.03em; line-height: 1.05;
  color: var(--ink); overflow-wrap: anywhere;
}
.api-lbl { color: var(--ink-2); font-size: 15px; }
.api-go { margin-top: 14px; font-weight: 500; color: var(--clay); }

.shop-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; padding: 0; }
.shop-chips li {
  display: flex; gap: 10px; padding: 6px 12px; font-size: 13.5px; color: var(--ink-2);
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-2);
}
.shop-chips .num { font-family: "Space Mono", monospace; color: var(--ink); }

.sample-callout {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  flex-wrap: wrap; padding: 20px 24px; margin-bottom: 16px;
  background: var(--clay-soft); border: 1px solid var(--clay); border-radius: 10px;
  color: var(--ink-2); line-height: 1.6;
}
.sample-callout strong { color: var(--ink); font-weight: 600; }
.sample-date { display: block; font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.sample-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* A <details>, so one click shows the table with JS off and under the CSP. */
.sample-table { margin-bottom: 24px; }
.sample-table summary {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 12px 20px; border: 1px solid var(--ink); border-radius: var(--radius);
  background: var(--ink); color: var(--paper-2); font-weight: 500; list-style: none;
}
.sample-table summary::-webkit-details-marker { display: none; }
.sample-table summary:hover { opacity: 0.85; }
.sample-table[open] summary svg { transform: rotate(180deg); }
.sample-table[open] summary { margin-bottom: 16px; }
.sample-brand { color: var(--ink-3); font-weight: 400; font-size: 13px; }

.dev-block {
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--paper-2);
}
.dev-head {
  padding: 10px 20px; background: var(--paper-3); border-bottom: 1px solid var(--line);
  font-family: "Space Mono", monospace; font-size: 10px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-3);
}
.dev-block pre {
  margin: 0; padding: 20px; overflow-x: auto;
  font-family: "Space Mono", monospace; font-size: 12.5px; line-height: 1.7; color: var(--ink);
}
.dev-comment { color: var(--ink-3); }
.dev-note { padding: 0 20px 18px; font-size: 13px; color: var(--ink-2); line-height: 1.6; }

/* ---- SERVICES: the six-card grid (home) and /serveis/ ----
   Hairline gaps on a --line background, like .lab-stats, so a 3x2 grid has
   no doubled borders where the rows meet. */
.svc-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.svc-card {
  display: flex; flex-direction: column; gap: 14px; padding: 30px 28px;
  background: var(--paper-2); color: inherit; text-decoration: none;
  transition: background 0.15s;
}
.svc-card:hover { background: var(--paper); }
.svc-card h3 { font-size: 18px; }
.svc-card p { color: var(--ink-2); font-size: 15px; line-height: 1.6; }
.svc-more { margin-top: 20px; }
.svc-more a { color: var(--clay); font-weight: 500; }

.svc-index { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 0; padding: 0; }
.svc-index a {
  display: inline-block; padding: 6px 12px; font-size: 13.5px; color: var(--ink-2);
  border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--paper-2);
}
.svc-index a:hover { color: var(--clay); border-color: var(--clay); }

.svc-detail { scroll-margin-top: 72px; }
.svc-detail-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 56px; align-items: start; }
.svc-detail h2 { margin: 16px 0 4px; }
.tech-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 20px 0 0; padding: 0; }
.tech-tags li {
  font-family: "Space Mono", monospace; font-size: 11.5px; color: var(--ink-2);
  padding: 4px 9px; border-radius: var(--radius); background: var(--paper-3);
}
.svc-facts { display: flex; flex-direction: column; gap: 12px; }
.svc-fact {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px;
}
.svc-fact .k, .ref-pieces .k, .contact-guide .k {
  font-family: "Space Mono", monospace; font-size: 10px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--clay);
}
.svc-fact ul { margin: 10px 0 0; padding-left: 18px; color: var(--ink-2); line-height: 1.7; font-size: 15px; }
.svc-fact p { margin-top: 8px; color: var(--ink-2); font-size: 15px; line-height: 1.6; }
.process-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
/* The hairline gaps draw the dividers; the borders .service-card adds between
   siblings (and swaps to border-top on narrow screens) would double them. */
.process-grid .service-card + .service-card { border: none; }

/* ---- ABOUT: the reference project ---- */
.about-stats { margin: 6px 0 18px; --tiles: 2; }
.ref-pieces { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.ref-pieces li {
  display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: baseline;
  padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: 15px;
}
.ref-pieces a { color: var(--clay); }

/* ---- CONTACT: what helps a first email ---- */
.contact-guide {
  margin-top: 28px; padding: 20px 22px; max-width: 44ch;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
}
.contact-guide ol { margin: 10px 0 0; padding-left: 20px; color: var(--ink-2); line-height: 1.7; }

/* ---- HOME: SERVICES ---- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 48px;
}
.service-card {
  background: var(--paper-2);
  padding: 36px 30px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.service-card + .service-card { border-left: 1px solid var(--line); }
.service-icon {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: var(--clay-soft);
  border-radius: var(--radius);
  color: var(--clay);
}
.service-card h3 { font-size: 18px; }
.step-num {
  font-family: "Space Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--clay);
}
.service-card p { color: var(--ink-2); font-size: 15px; line-height: 1.6; }

/* Up and down, anywhere on the site. These used to be scoped inside .uc-row,
   which meant the lab marked its percentages with class="higher" and got no
   colour at all — a +60% and a -12% printed identically. Colour is always an
   extra here, never the signal: --clay and --pine are dE 4.9 apart under
   deuteranopia, so every use ships with a glyph and a sign as well. */
.higher { color: var(--clay); font-weight: 600; }
.lower  { color: var(--pine); font-weight: 600; }
.sec-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 48px;
}

/* ---- HOME: CTA STRIP ---- */
.cta-strip {
  background: var(--ink);
  border-radius: 10px;
  padding: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}
.cta-strip h2 { color: var(--paper); }
.cta-strip p { color: var(--ink-3); margin-top: 8px; font-size: 16px; }
.cta-strip .btn.ghost {
  border-color: #4a443c;
  color: var(--paper-2);
}
.cta-strip .btn.ghost:hover { background: #2c2822; }

/* ---- PAGE HERO (about, contact) ---- */
.page-hero {
  padding: 72px 0 64px;
  border-bottom: 1px solid var(--line);
}
.page-hero .eyebrow { margin-bottom: 14px; }
.page-hero p { color: var(--ink-2); margin-top: 16px; max-width: 52ch; font-size: 17px; }

/* ---- ABOUT ---- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 80px;
  align-items: start;
}
.about-aside {
  position: sticky;
  top: 84px;
}
.avatar-block {
  width: 100%;
  aspect-ratio: 1;
  max-width: 260px;
  border-radius: 10px;
  background: var(--paper-3);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.avatar-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--ink-3);
}
.avatar-placeholder svg { opacity: 0.4; }
.avatar-placeholder span {
  font-family: "Space Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.about-name-block { margin-top: 22px; }
.about-name-block .name {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.about-name-block .role {
  font-family: "Space Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--clay);
  margin-top: 5px;
}
.about-contact-links { margin-top: 20px; display: flex; flex-direction: column; gap: 8px; }
.contact-link {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  color: var(--ink-2);
  transition: color 0.15s;
}
.contact-link:hover { color: var(--ink); }
.contact-link svg { flex-shrink: 0; color: var(--ink-3); }

.about-main { display: flex; flex-direction: column; gap: 40px; }
.about-block h2 { font-size: 22px; margin-bottom: 14px; }
.about-block p { color: var(--ink-2); margin-bottom: 14px; line-height: 1.75; }
.values-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}
.value-item {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.value-item .k {
  font-family: "Space Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--clay);
}
.value-item p { font-size: 14px; color: var(--ink-2); margin-top: 5px; margin-bottom: 0; }

/* ---- CONTACT ---- */
.contact-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 80px;
  align-items: start;
  margin-top: 64px;
}
.contact-intro h1 { margin-bottom: 20px; }
.contact-intro p { color: var(--ink-2); font-size: 17px; line-height: 1.7; max-width: 44ch; }
.contact-cards { display: flex; flex-direction: column; gap: 14px; }
.contact-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
}
.contact-card:hover {
  box-shadow: 0 8px 24px -12px rgba(34,31,26,.18);
}
.contact-card-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  background: var(--clay-soft);
  display: flex; align-items: center; justify-content: center;
  color: var(--clay);
  flex-shrink: 0;
}
.contact-card .label {
  font-family: "Space Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.contact-card .value {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 500;
  font-size: 16px;
  color: var(--ink);
  margin-top: 3px;
}
.contact-card .arrow {
  margin-left: auto;
  color: var(--ink-3);
  flex-shrink: 0;
}

/* ---- EMPTY STATE ---- */
.empty-state {
  padding: 80px 40px;
  text-align: center;
  border: 1px dashed var(--line-2);
  border-radius: 10px;
  color: var(--ink-3);
}
.empty-state p { margin-top: 10px; font-size: 14px; }

/* ---- DIVIDER ---- */
.divider {
  height: 1px;
  background: var(--line);
  margin: 0;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding: 56px 0; }
  .hero-content .display { font-size: clamp(38px, 10vw, 56px); }
  .services-grid { grid-template-columns: 1fr; }
  .svc-grid { grid-template-columns: 1fr 1fr; }
  .process-grid { grid-template-columns: 1fr 1fr; }
  .svc-detail-grid { grid-template-columns: 1fr; gap: 28px; }
  .gap-grid { grid-template-columns: 1fr 1fr; }
  .service-card + .service-card { border-left: none; border-top: 1px solid var(--line); }
  .cta-strip { padding: 40px 28px; flex-direction: column; align-items: flex-start; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-aside { position: static; display: flex; gap: 24px; align-items: flex-start; }
  .avatar-block { max-width: 120px; flex-shrink: 0; }
  .contact-layout { grid-template-columns: 1fr; gap: 48px; }
  .values-list { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .section { padding: 64px 0; }
  .moves-grid, .gap-grid, .api-grid, .svc-grid, .process-grid { grid-template-columns: 1fr; }
  .ref-pieces li { grid-template-columns: 1fr; gap: 4px; }
  .nav-links, .lang-switcher { display: none; }
  .nav-toggle { display: flex; }
  .page-hero { padding: 48px 0 40px; }
  .about-aside { flex-direction: column; }
}

/* ============================================================
   LAB — price insights (/laboratori/)
   Charts are inline SVG rendered server-side: the production CSP
   is `script-src 'self'`, so no CDN chart library would load, and
   these read fine with JS off.
   ============================================================ */

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- thermometer ----
   Tiles in normal flow. The home page's counters reuse them as they are. */
.lab-stats {
  /* --tiles lets a page with fewer tiles avoid an empty cell; the narrow
     breakpoints below still override it. */
  display: grid; grid-template-columns: repeat(var(--tiles, 4), 1fr);
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.lab-stat { background: var(--paper-2); padding: 22px 20px; min-width: 0; }
.lab-stat .num {
  font-family: 'Space Grotesk', sans-serif; font-weight: 600;
  font-size: clamp(22px, 2.4vw, 32px); letter-spacing: -0.03em;
  line-height: 1.1; color: var(--ink);
  /* Long values (a date, a 6-digit count) must wrap inside the tile rather
     than widen the grid track and force a horizontal page scroll. */
  overflow-wrap: anywhere;
}
.lab-stat .lbl {
  font-family: 'Space Mono', monospace; font-size: 10px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3); margin-top: 8px; line-height: 1.5;
}

.lab-subhead { margin: 32px 0 8px; }
.lab-empty {
  color: var(--ink-3); padding: 24px 0; border-top: 1px solid var(--line);
}
.lab-caveat {
  font-size: 11.5px; color: var(--ink-3); line-height: 1.6;
  margin-top: 12px; max-width: 60ch;
}
.lab-swatch {
  display: inline-block; width: 12px; height: 12px; border-radius: 3px;
  margin-right: 8px; vertical-align: baseline;
}
.lab-method { margin-top: 20px; font-size: 14px; color: var(--ink-2); }
.lab-method summary {
  cursor: pointer; font-family: 'Space Mono', monospace; font-size: 11.5px;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3);
}
.lab-method summary:hover { color: var(--clay); }
.lab-method > *:not(summary) { margin-top: 12px; }
.lab-method ul { padding-left: 18px; }

/* ---- lab controls: granularity + period ---- */
.lab-controls {
  display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0 4px;
}
.lab-toggle { display: flex; border: 1px solid var(--line-2); }
.lab-toggle-btn {
  font-family: 'Space Mono', monospace; font-size: 11.5px;
  letter-spacing: 0.04em; padding: 7px 13px; color: var(--ink-2);
  text-decoration: none; white-space: nowrap;
  border-right: 1px solid var(--line-2);
}
.lab-toggle-btn:last-child { border-right: 0; }
.lab-toggle-btn:hover { color: var(--clay); background: var(--paper-3); }
/* The active state is carried by aria-pressed, so the styling and the thing a
   screen reader announces can never drift apart. */
.lab-toggle-btn[aria-pressed="true"] {
  background: var(--ink); color: var(--paper);
}
.lab-toggle-btn[aria-pressed="true"]:hover { color: var(--paper); background: var(--ink); }

/* Which date the line is measured against — stated, never implied. */
.lab-basis {
  display: flex; flex-wrap: wrap; gap: 4px 20px;
  font-size: 11.5px; color: var(--ink-3); margin-top: 10px;
}
.lab-basis-item { display: inline-flex; align-items: center; }

/* ---- the annual table ---- */
.year-table-wrap { margin-top: 8px; }
.year-table { max-width: 640px; }
.year-table tbody th { font-family: 'Space Mono', monospace; }
.year-open {
  font-family: 'Space Mono', monospace; font-size: 10.5px; color: var(--ink-3);
  margin-left: 8px; text-transform: uppercase; letter-spacing: 0.06em;
}
.year-note { color: var(--ink-3); }
.year-yoy {
  display: block; font-size: 10.5px; color: var(--ink-3);
  font-family: 'Space Mono', monospace; margin-top: 2px;
}

/* ---- charts ---- */
.chart { margin: 24px 0 0; }
/* Wide charts scroll inside their own box; the page body never scrolls sideways. */
.chart-scroll, .table-scroll { overflow-x: auto; }
.chart-grid line { stroke: var(--line); stroke-width: 1; }
.chart-baseline { stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-axis text {
  font-family: 'Space Mono', monospace; font-size: 10.5px; fill: var(--ink-3);
}
.chart-end-label {
  font-family: 'Space Grotesk', sans-serif; font-size: 12px; font-weight: 500;
}
.chart-dot { transition: r 0.12s ease; }
.chart-dot:hover { r: 6; }
.chart-legend {
  display: flex; flex-wrap: wrap; gap: 20px; align-items: center;
  margin-bottom: 8px;
}
.chart-legend-item {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink-2);
}
.chart-swatch {
  width: 10px; height: 10px; border-radius: 2px; display: inline-block;
}
.chart-note { color: var(--ink-3); font-size: 11.5px; }
.chart-table { margin-top: 12px; }
.chart-table summary {
  cursor: pointer; font-family: 'Space Mono', monospace; font-size: 11.5px;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3);
}
.chart-table summary:hover { color: var(--clay); }

.dbar-label { font-size: 12px; fill: var(--ink-2); }
.dbar-value {
  font-family: 'Space Mono', monospace; font-size: 11px; fill: var(--ink-3);
}

.sparkline { flex-shrink: 0; }

/* ---- data table ---- */
.data-table {
  width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px;
}
.data-table th, .data-table td {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.data-table thead th {
  font-family: 'Space Mono', monospace; font-size: 10.5px; font-weight: 400;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3);
  border-bottom-color: var(--line-2);
}
.data-table tbody th { font-weight: 500; color: var(--ink); }
/* nowrap: otherwise the € and % break onto their own line in these narrow columns. */
.data-table .num {
  text-align: right; font-family: 'Space Mono', monospace; white-space: nowrap;
}
.data-table tbody tr:hover { background: var(--paper-3); }
.data-table a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--line-2); }
.data-table a:hover { color: var(--clay); border-bottom-color: var(--clay); }

.movers { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.movers-col { min-width: 0; }
.movers-cat {
  display: block; font-family: 'Space Mono', monospace; font-size: 10.5px;
  color: var(--ink-3); margin-top: 3px;
}

/* ---- movers: five a side, the percentage loudest ---- */
.mover-list { list-style: none; }
.mover {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line);
}
.mover:last-child { border-bottom: none; }
.mover-main { min-width: 0; }
.mover-name { display: block; font-size: 15px; line-height: 1.35; }
.mover-name a { border-bottom: 1px solid var(--line-2); }
.mover-name a:hover { color: var(--clay); border-bottom-color: var(--clay); }
.mover-meta { display: block; font-size: 10.5px; color: var(--ink-3); margin-top: 4px; }
.mover-figure { flex-shrink: 0; text-align: right; }
/* The number is the point of the row, so it is the biggest thing in it. */
.mover-pct {
  display: block; font-family: 'Space Mono', monospace; font-size: 17px;
  white-space: nowrap;
}
.mover-bar { display: block; margin-top: 5px; margin-left: auto; }
.mover-bar rect { fill: var(--line-2); }
.mover-pct.higher + .mover-bar rect { fill: var(--clay); }
.mover-pct.lower  + .mover-bar rect { fill: var(--pine); }
/* The glyph, not the colour, carries direction: --clay and --pine are
   indistinguishable under deuteranopia (dE 4.9). */
.dir { font-size: 13px; }
.dir.up   { color: var(--clay); }
.dir.down { color: var(--pine); }

/* ---- search ---- */
.lab-search { display: flex; gap: 12px; margin: 24px 0 8px; max-width: 520px; }
.lab-search input[type="search"] {
  flex: 1; min-width: 0; padding: 12px 14px; font: inherit; font-size: 15px;
  color: var(--ink); background: var(--paper-2);
  border: 1px solid var(--line-2); border-radius: var(--radius);
}
.lab-search input[type="search"]:focus {
  outline: none; border-color: var(--clay);
  box-shadow: 0 0 0 3px var(--clay-soft);
}
.lab-search input[type="search"]::placeholder { color: var(--ink-3); }

.search-results { list-style: none; margin-top: 20px; }
.search-result {
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.sr-main { min-width: 0; }
.sr-name { display: block; font-size: 15px; }
.sr-name a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--line-2); }
.sr-name a:hover { color: var(--clay); border-bottom-color: var(--clay); }
.sr-meta { display: block; font-size: 11px; color: var(--ink-3); margin-top: 4px; }
.sr-figures { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.sr-price { font-size: 15px; }
.sr-change { font-size: 12px; min-width: 84px; text-align: right; }
.sr-flat { color: var(--ink-3); }

/* ---- basket: search on the left, what you picked on the right ---- */
.basket-search {
  display: flex; gap: 12px; margin: 24px 0 8px; flex-wrap: wrap;
}
.basket-search input[type="search"] {
  flex: 1; min-width: 200px; padding: 12px 14px; font: inherit; font-size: 15px;
  color: var(--ink); background: var(--paper-2);
  border: 1px solid var(--line-2); border-radius: var(--radius);
}
.basket-search input[type="search"]:focus,
.basket-select:focus {
  outline: none; border-color: var(--clay);
  box-shadow: 0 0 0 3px var(--clay-soft);
}
.basket-search input[type="search"]::placeholder { color: var(--ink-3); }
.basket-select {
  padding: 12px 14px; font: inherit; font-size: 14px; max-width: 240px;
  color: var(--ink); background: var(--paper-2);
  border: 1px solid var(--line-2); border-radius: var(--radius);
}

.basket-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 8px; }
.basket-results, .basket-panel { min-width: 0; }
.basket-panel { border-left: 1px solid var(--line); padding-left: 32px; }
.basket-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
}
.basket-clear {
  font-family: 'Space Mono', monospace; font-size: 10.5px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3);
  background: none; border: 0; cursor: pointer; padding: 4px;
}
.basket-clear:hover { color: var(--clay); }

.basket-found, .basket-list { list-style: none; margin-top: 12px; }
.basket-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line);
}
.basket-item:last-child { border-bottom: none; }
.basket-item-main { min-width: 0; }
.basket-item-name { display: block; font-size: 15px; line-height: 1.35; }
.basket-item-meta { display: block; font-size: 10.5px; color: var(--ink-3); margin-top: 4px; }

.basket-add {
  flex-shrink: 0; font-family: 'Space Mono', monospace; font-size: 11px;
  letter-spacing: 0.04em; padding: 6px 12px; cursor: pointer;
  color: var(--ink-2); background: none; border: 1px solid var(--line-2);
}
.basket-add:hover { color: var(--clay); border-color: var(--clay); }
.basket-add[disabled] { color: var(--ink-3); border-color: var(--line); cursor: default; }
.basket-add[disabled]:hover { color: var(--ink-3); border-color: var(--line); }
.basket-remove {
  flex-shrink: 0; font-size: 18px; line-height: 1; padding: 4px 8px;
  color: var(--ink-3); background: none; border: 0; cursor: pointer;
}
.basket-remove:hover { color: var(--clay); }

/* The two figures the block exists to show: what it costs now, and how far
   that is from the first month everything in it had a price. */
.basket-figures { display: flex; flex-wrap: wrap; gap: 32px; margin-top: 16px; }
.basket-total-num, .basket-change-num {
  display: block; font-family: 'Space Mono', monospace; font-size: 26px;
  line-height: 1.1; white-space: nowrap;
}
.basket-total-lbl {
  display: block; font-family: 'Space Mono', monospace; font-size: 10px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3); margin-top: 8px;
}
.basket-line { display: block; margin-top: 20px; max-width: 100%; }

@media (max-width: 900px) {
  .lab-stats { grid-template-columns: repeat(2, 1fr); }
  .movers { grid-template-columns: 1fr; gap: 8px; }
  .basket-cols { grid-template-columns: 1fr; gap: 24px; }
  .basket-panel { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 24px; }
}

@media (max-width: 680px) {
  .lab-stats { grid-template-columns: 1fr; }
  
  .lab-search { flex-direction: column; }
  .basket-search { flex-direction: column; }
  .basket-select { max-width: none; width: 100%; }
  .basket-figures { gap: 20px; }
  .search-result { flex-direction: column; align-items: flex-start; gap: 10px; }
  .sr-figures { width: 100%; justify-content: flex-start; }
  .sr-change { text-align: left; min-width: 0; }
}
