/* Flo LCA tokens: the shop's look. White ground, black type and accents, greys for everything else,
   square 2px corners, rules instead of shadows. One stage is ever black: the hotspot. */
:root {
  color-scheme: light;

  --paper: #FFFFFF;
  --paper-2: #F6F5F2;
  --rule: #E2E0DB;
  --rule-strong: #C9C6BF;
  --ink: #111111;
  --ink-2: #33322F;
  --ink-soft: #55534E;
  --ink-faint: #6F6D68;
  --focus: #111111;

  /* Stages in boundary order; the hotspot overrides its tone with --ink. */
  --st-kebun: #4A4844;
  --st-pascapanen: #6A6863;
  --st-hulling: #8A8781;
  --st-angkut: #A6A39C;
  --st-roasting: #BEBBB4;
  --st-kemasan: #D3D0C9;
  --st-gudang: #E4E1DA;

  --r: 2px;

  --f-head: 'Poppins', ui-sans-serif, system-ui, sans-serif;
  --f-body: 'Lato', ui-sans-serif, system-ui, sans-serif;
  --f-ui: 'Inter', ui-sans-serif, system-ui, sans-serif;

  --t-xs: 0.75rem;
  --t-sm: 0.875rem;
  --t-md: 1rem;
  --t-lg: 1.2rem;
  --t-xl: 1.44rem;
  --t-2xl: 1.728rem;
  --t-3xl: 2.074rem;
  --t-4xl: 2.488rem;
  --t-5xl: 3.583rem;

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;

  --d-hover: 160ms;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);

  --top-h: 64px;
  --gutter: 24px;
  --wide: 1180px;
  --narrow: 760px;
  --measure: 62ch;
}

@media (max-width: 899px) {
  :root { --top-h: 56px; --gutter: 16px; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-2);
  font: 400 var(--t-md)/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
h1, h2, h3 { color: var(--ink); font-family: var(--f-head); font-weight: 300; line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
p { margin: 0 0 var(--s-4); }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
img, svg { display: block; max-width: 100%; }
table { border-collapse: collapse; width: 100%; }
small { font-size: var(--t-xs); }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--s-4); top: -60px; z-index: 20; padding: var(--s-2) var(--s-3); background: var(--ink); color: var(--paper); font-family: var(--f-ui); }
.skip:focus { top: var(--s-2); }
.muted { color: var(--ink-faint); }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.wrap { width: 100%; max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }
.wrap--narrow > * { max-width: var(--narrow); }
.wrap--narrow > .table-wrap, .wrap--narrow > .mblock--wide { max-width: none; }
.main { min-height: 60vh; }

.top { position: sticky; top: 0; z-index: 10; background: rgb(255 255 255 / 0.96); border-bottom: 1px solid var(--rule); }
.top__in { display: flex; align-items: center; gap: var(--s-4); max-width: var(--wide); height: var(--top-h); margin: 0 auto; padding: 0 var(--gutter); }
.brand { display: flex; align-items: center; gap: var(--s-2); color: var(--ink); text-decoration: none; min-width: 0; }
.mark { flex: none; fill: var(--ink); }
.brand__name { font: 400 var(--t-md)/1 var(--f-head); }
.brand__sub { font: 400 var(--t-xs)/1 var(--f-ui); color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { font: 500 var(--t-xs)/1 var(--f-ui); padding: 5px 8px; border: 1px solid var(--ink); border-radius: var(--r); color: var(--ink); text-transform: uppercase; letter-spacing: 0.06em; }
.top__menu { margin-left: auto; display: none; font: 500 var(--t-sm)/1 var(--f-ui); background: none; border: 1px solid var(--rule-strong); border-radius: var(--r); padding: 8px 12px; color: var(--ink); }
.nav { margin-left: auto; display: flex; align-items: center; gap: var(--s-5); }
.nav__list { display: flex; gap: var(--s-5); list-style: none; margin: 0; padding: 0; }
.nav a { font: 400 var(--t-sm)/1 var(--f-ui); color: var(--ink-soft); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }
.nav__lang { border: 1px solid var(--rule-strong); border-radius: var(--r); padding: 6px 8px; }

@media (max-width: 899px) {
  .brand__sub { display: none; }
  .top__menu { display: inline-flex; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: var(--top-h); flex-direction: column; align-items: flex-start; gap: var(--s-4); padding: var(--s-5) var(--gutter); background: var(--paper); border-bottom: 1px solid var(--rule); }
  .nav.is-open { display: flex; }
  .nav__list { flex-direction: column; gap: var(--s-4); }
  .nav a { font-size: var(--t-md); }
}
.no-js .nav { display: flex; position: static; flex-direction: row; padding: 0; border: 0; }

.foot { margin-top: var(--s-9); border-top: 1px solid var(--rule); background: var(--paper-2); }
.foot__in { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--s-6); max-width: var(--wide); margin: 0 auto; padding: var(--s-7) var(--gutter); font-size: var(--t-sm); }
.foot__brand { display: flex; align-items: center; gap: var(--s-2); font: 400 var(--t-md)/1 var(--f-head); color: var(--ink); }
.foot__claim { color: var(--ink-faint); font-family: var(--f-ui); font-size: var(--t-xs); }
.foot__links { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); align-content: start; }
.foot__links a { color: var(--ink-soft); }
@media (max-width: 699px) { .foot__in { grid-template-columns: 1fr; gap: var(--s-5); } }

.kicker { font: 500 var(--t-xs)/1.4 var(--f-ui); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint); margin-bottom: var(--s-3); }
.h1 { font-size: clamp(var(--t-3xl), 5vw, var(--t-5xl)); margin-bottom: var(--s-4); }
.h2 { font-size: clamp(var(--t-xl), 3vw, var(--t-3xl)); margin-bottom: var(--s-3); }
.h3 { font-size: var(--t-xl); margin-bottom: var(--s-3); }
.section { padding: var(--s-8) 0 0; }
.section--rule > .wrap { border-top: 1px solid var(--rule); padding-top: var(--s-7); }
.section--rule { padding-top: var(--s-7); }
.section__lead { color: var(--ink-soft); max-width: var(--measure); margin-bottom: var(--s-6); }

.claim { display: flex; gap: var(--s-3); align-items: baseline; max-width: var(--measure); font: 400 var(--t-sm)/1.55 var(--f-ui); color: var(--ink-soft); }
.claim__dot { flex: none; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--ink); transform: translateY(-1px); }

.link-arrow { font: 500 var(--t-sm)/1.4 var(--f-ui); }
.link-arrow::after { content: " →"; }

.notice { font: 400 var(--t-sm)/1.5 var(--f-ui); border-left: 2px solid var(--ink); padding: var(--s-2) var(--s-3); background: var(--paper-2); }

.tag { display: inline-block; font: 500 11px/1 var(--f-ui); padding: 4px 6px; border-radius: var(--r); border: 1px solid var(--rule-strong); color: var(--ink-soft); white-space: nowrap; }
.tag--primer { border-color: var(--ink); color: var(--ink); }
.tag--mix { border-style: dashed; border-color: var(--ink-faint); }

.table-wrap { overflow-x: auto; }
.num { text-align: right; font-family: var(--f-ui); font-variant-numeric: tabular-nums; white-space: nowrap; }

.limits { padding-left: 1.1em; margin: 0 0 var(--s-5); max-width: var(--measure); }
.limits li { margin-bottom: var(--s-2); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-7); }
.two p { max-width: var(--measure); }
@media (max-width: 799px) { .two { grid-template-columns: 1fr; gap: var(--s-5); } }

.sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: var(--s-2); vertical-align: 0; background: var(--rule-strong); }
.sw--kebun { background: var(--st-kebun); }
.sw--pascapanen { background: var(--st-pascapanen); }
.sw--hulling { background: var(--st-hulling); }
.sw--angkut { background: var(--st-angkut); }
.sw--roasting { background: var(--st-roasting); }
.sw--kemasan { background: var(--st-kemasan); }
.sw--gudang { background: var(--st-gudang); }
.is-hot .sw { background: var(--ink); }

/* Hero: activity data in, kg CO2e out (src/assets/js/hero-flow.js draws the canvas). The canvas fills
   the hero behind the copy; until it is live (no JS) a plain halftone stands in. */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; min-height: min(780px, calc(100vh - var(--top-h))); }
.hero__in { position: relative; z-index: 1; flex: 1; display: flex; align-items: center; padding-top: var(--s-8); padding-bottom: var(--s-8); pointer-events: none; }
.hero__copy { max-width: min(560px, 46vw); pointer-events: auto; }
.hero__h { font-size: clamp(var(--t-3xl), 4.6vw, 3.9rem); max-width: 15ch; margin-bottom: var(--s-5); }
.hero__lead { font-size: var(--t-lg); max-width: 46ch; color: var(--ink-soft); margin-bottom: var(--s-6); }
.hero__flow { position: absolute; inset: 0; z-index: 0; }
.hero__flow canvas { display: block; width: 100%; height: 100%; }
.hero__flow:not(.is-live) {
  background-image: radial-gradient(circle, var(--ink) 1.3px, transparent 1.6px);
  background-size: 14px 14px;
  -webkit-mask-image: radial-gradient(120% 120% at 100% 100%, #000 0%, rgb(0 0 0 / 0.55) 30%, transparent 65%);
  mask-image: radial-gradient(120% 120% at 100% 100%, #000 0%, rgb(0 0 0 / 0.55) 30%, transparent 65%);
  opacity: 0.4;
}
.hero__foot { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3) var(--s-5); padding-bottom: var(--s-5); }
.hero__source { margin: 0; font: 400 var(--t-xs)/1.4 var(--f-ui); color: var(--ink-faint); }
.legend { list-style: none; margin: 0; padding: var(--s-2) var(--s-4); display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); border: 1px solid var(--rule); border-radius: var(--r); background: var(--paper); font: 500 var(--t-xs)/1.2 var(--f-ui); color: var(--ink-soft); }
.legend li { display: inline-flex; align-items: center; gap: var(--s-2); }
.legend__dots { width: 18px; height: 8px; background-image: radial-gradient(circle, var(--ink) 1.4px, transparent 1.7px); background-size: 6px 8px; opacity: 0.6; }
.legend__gate { width: 1px; height: 14px; background: var(--ink); }
.legend__lane { width: 18px; height: 7px; background-image: linear-gradient(90deg, var(--ink) 1px, transparent 1px); background-size: 4px 7px; opacity: 0.7; }

/* Narrow screens: the copy first, then the picture as its own band under it. */
@media (max-width: 799px) {
  .hero { min-height: 0; }
  .hero__in { padding-top: var(--s-7); padding-bottom: 0; }
  .hero__copy { max-width: none; }
  .hero__flow { position: relative; inset: auto; height: 380px; margin-top: var(--s-5); }
  .hero__foot { padding-top: var(--s-3); }
  .hero__h { font-size: clamp(var(--t-3xl), 9vw, var(--t-4xl)); }
}

.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s-4); }
.card__link { display: grid; gap: var(--s-2); height: 100%; padding: var(--s-5); border: 1px solid var(--rule); border-radius: var(--r); text-decoration: none; color: var(--ink-2); transition: border-color var(--d-hover) var(--ease); }
.card__link:hover { border-color: var(--ink); }
.card__label { font: 500 var(--t-xs)/1.3 var(--f-ui); color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.06em; }
.card__name { font: 300 var(--t-xl)/1.25 var(--f-head); color: var(--ink); }
.card__origin { font-size: var(--t-sm); color: var(--ink-soft); }
.card__fig { margin-top: var(--s-3); font: 400 var(--t-sm)/1.2 var(--f-ui); color: var(--ink-soft); }
.card__big { font: 300 var(--t-4xl)/1 var(--f-head); color: var(--ink); font-variant-numeric: tabular-nums; }
.card__meta { font: 400 var(--t-xs)/1.4 var(--f-ui); color: var(--ink-faint); }
.card__go { margin-top: var(--s-2); font: 500 var(--t-sm)/1 var(--f-ui); color: var(--ink); }
.card__go::after { content: " →"; }

.steps { list-style: none; margin: var(--s-5) 0 var(--s-6); padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-5); }
.step { border-top: 1px solid var(--ink); padding-top: var(--s-4); }
.step__n { font: 500 var(--t-xs)/1 var(--f-ui); color: var(--ink-faint); }
.step__t { font-size: var(--t-lg); margin: var(--s-3) 0 var(--s-2); }
.step p { font-size: var(--t-sm); color: var(--ink-soft); }
@media (max-width: 999px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 599px) { .steps { grid-template-columns: 1fr; } }

.crumb { margin: var(--s-5) 0 var(--s-4); font: 400 var(--t-sm)/1 var(--f-ui); }
.crumb a { color: var(--ink-soft); text-decoration: none; }
.crumb a:hover { color: var(--ink); text-decoration: underline; }

.prod__head { border-bottom: 1px solid var(--rule); padding-bottom: var(--s-7); }
.prod__name { font-size: clamp(var(--t-3xl), 5vw, var(--t-5xl)); margin-bottom: var(--s-2); }
.prod__origin { color: var(--ink-soft); margin-bottom: var(--s-6); }
.figure { margin-bottom: var(--s-6); }
.figure__big { margin: 0; font: 300 clamp(3.4rem, 11vw, 6.5rem)/1 var(--f-head); color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.figure__unit { font: 400 var(--t-lg)/1 var(--f-ui); margin-left: var(--s-3); letter-spacing: 0; color: var(--ink-soft); }
.figure__sub { margin: var(--s-3) 0 var(--s-1); font: 500 var(--t-sm)/1.4 var(--f-ui); color: var(--ink); }
.figure__range { font: 400 var(--t-sm)/1.4 var(--f-ui); color: var(--ink-faint); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, max-content)); gap: var(--s-6); margin: 0 0 var(--s-6); }
.facts dt { font: 400 var(--t-xs)/1.3 var(--f-ui); color: var(--ink-faint); margin-bottom: var(--s-1); }
.facts dd { margin: 0; font: 300 var(--t-2xl)/1.1 var(--f-head); color: var(--ink); font-variant-numeric: tabular-nums; }
@media (max-width: 599px) { .facts { grid-template-columns: 1fr 1fr; gap: var(--s-4); } }

.waffle { display: grid; grid-template-columns: repeat(20, 1fr); gap: 6px; max-width: 560px; margin: 0 0 var(--s-4); }
.dot { aspect-ratio: 1; border-radius: 50%; background: var(--rule); }
.dot--kebun { background: var(--st-kebun); }
.dot--pascapanen { background: var(--st-pascapanen); }
.dot--hulling { background: var(--st-hulling); }
.dot--angkut { background: var(--st-angkut); }
.dot--roasting { background: var(--st-roasting); }
.dot--kemasan { background: var(--st-kemasan); }
.dot--gudang { background: var(--st-gudang); }
.dot.is-hot { background: var(--ink); }
@media (max-width: 599px) { .waffle { grid-template-columns: repeat(10, 1fr); gap: 5px; max-width: 280px; } }
.hotspot { font: 400 var(--t-md)/1.5 var(--f-ui); margin-bottom: var(--s-6); }

.stages { font-size: var(--t-sm); max-width: 820px; }
.stages th, .stages td { padding: var(--s-3) var(--s-3) var(--s-3) 0; border-bottom: 1px solid var(--rule); text-align: left; font-weight: 400; vertical-align: middle; }
.stages thead th { font: 500 var(--t-xs)/1 var(--f-ui); color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.06em; }
.stages .num { text-align: right; }
.stage-row th { color: var(--ink); font-family: var(--f-ui); font-weight: 500; }
.stage-row.is-hot th, .stage-row.is-hot td { font-weight: 600; color: var(--ink); }
.item-row th, .item-row td { padding-top: var(--s-1); padding-bottom: var(--s-2); border-bottom-color: transparent; color: var(--ink-faint); font-size: var(--t-xs); }
.item-row th { padding-left: calc(10px + var(--s-2)); font-family: var(--f-ui); font-weight: 400; }
.bar { display: inline-block; width: 64px; height: 6px; margin-right: var(--s-2); background: linear-gradient(90deg, var(--ink) var(--w, 0%), var(--rule) var(--w, 0%)); vertical-align: 1px; }
.notes { margin-top: var(--s-6); max-width: var(--measure); }
.notes ul { padding-left: 1.1em; margin: 0; font-size: var(--t-sm); color: var(--ink-soft); }
.notes li { margin-bottom: var(--s-2); }

.sens { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); }
.sens__row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 4.5em; gap: var(--s-3); align-items: center; font-size: var(--t-sm); }
.sens__track { position: relative; height: 10px; background: linear-gradient(90deg, transparent calc(50% - 0.5px), var(--rule-strong) calc(50% - 0.5px), var(--rule-strong) calc(50% + 0.5px), transparent calc(50% + 0.5px)); }
.sens__bar { position: absolute; top: 0; bottom: 0; width: var(--w, 0%); }
.sens__bar.is-up { left: 50%; background: var(--ink); }
.sens__bar.is-down { right: 50%; background: var(--ink-faint); }
.sens__val { text-align: right; font-family: var(--f-ui); font-variant-numeric: tabular-nums; color: var(--ink); }
@media (max-width: 599px) { .sens__row { grid-template-columns: 1fr 4em; } .sens__track { grid-column: 1 / -1; grid-row: 2; } }

.cup { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); margin-bottom: var(--s-5); max-width: 900px; }
.cup__f { display: grid; gap: var(--s-1); font: 400 var(--t-xs)/1.3 var(--f-ui); color: var(--ink-faint); }
.cup__f select { font: 400 var(--t-sm)/1.2 var(--f-ui); color: var(--ink); padding: 10px 12px; border: 1px solid var(--rule-strong); border-radius: var(--r); background: var(--paper); width: 100%; }
@media (max-width: 699px) { .cup { grid-template-columns: 1fr; } }
.cupbar { display: flex; height: 14px; max-width: 900px; margin-bottom: var(--s-4); background: var(--rule); }
.cupbar__seg { width: var(--w, 0%); }
.cupbar__seg--core { background: var(--ink); }
.cupbar__seg--kirim { background: var(--st-pascapanen); }
.cupbar__seg--seduh { background: var(--st-angkut); }
.cupbar__seg--limbah { background: var(--st-kemasan); }
.sw--core { background: var(--ink); }
.sw--kirim { background: var(--st-pascapanen); }
.sw--seduh { background: var(--st-angkut); }
.sw--limbah { background: var(--st-kemasan); }
.cup__dl { display: grid; grid-template-columns: repeat(5, minmax(0, max-content)); gap: var(--s-6); margin: 0; }
.cup__dl dt { font: 400 var(--t-xs)/1.3 var(--f-ui); color: var(--ink-faint); margin-bottom: var(--s-1); }
.cup__dl dd { margin: 0; font: 400 var(--t-lg)/1.2 var(--f-ui); color: var(--ink); font-variant-numeric: tabular-nums; }
.cup__total dd { font: 300 var(--t-2xl)/1.1 var(--f-head); }
.cup__total small { display: block; font: 400 var(--t-xs)/1.4 var(--f-ui); color: var(--ink-faint); margin-top: var(--s-1); }
@media (max-width: 899px) { .cup__dl { grid-template-columns: 1fr 1fr; gap: var(--s-4); } .cup__total { grid-column: 1 / -1; } }

.history { list-style: none; margin: 0 0 var(--s-5); padding: 0; font-size: var(--t-sm); }
.history li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-2); padding: var(--s-3) 0; border-bottom: 1px solid var(--rule); }
.history span { color: var(--ink-faint); font-family: var(--f-ui); font-size: var(--t-xs); }
.history .is-current a { font-weight: 700; text-decoration: none; }

.method { padding-top: var(--s-8); }
.mblock { border-top: 1px solid var(--rule); padding-top: var(--s-5); margin-top: var(--s-6); }
.mblock p, .mblock li { max-width: var(--measure); }
.mstages { padding-left: 1.3em; }
.mstages li { margin-bottom: var(--s-2); }
.mblock--wide { max-width: none; }
.factors { font-size: var(--t-sm); min-width: 640px; }
.factors th, .factors td { padding: var(--s-2) var(--s-3) var(--s-2) 0; border-bottom: 1px solid var(--rule); text-align: left; font-weight: 400; vertical-align: top; }
.factors thead th { font: 500 var(--t-xs)/1 var(--f-ui); color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.06em; }
.factors tbody th { color: var(--ink); }
.factors tbody th small { display: block; color: var(--ink-faint); margin-top: 2px; }
.factors td:nth-child(4) { font-family: var(--f-ui); font-size: var(--t-xs); color: var(--ink-soft); }
.sources { padding-left: 1.6em; font-size: var(--t-sm); }
.sources li { margin-bottom: var(--s-3); }
.unchecked { color: var(--ink-faint); font-family: var(--f-ui); font-size: var(--t-xs); }
.nf { padding-top: var(--s-9); }
