/* ============================================================
   style.css — Design system & components (sumber kebenaran gaya)
   Palet: Option A · sage green (#7D9B76) + terracotta (#C97B5A)
   Light default hangat; dark via [data-theme="dark"]. Tanpa #000/#FFF
   dominan; kombinasi teks/bg dibidik WCAG AA (≥4.5:1).
   ============================================================ */

/* ---------- Design tokens (light default) ---------- */
:root {
  color-scheme: light;
  --bg: #FAF8F5;
  --bg-alt: #F3EFE8;
  --surface: #FFFFFF;
  --surface-2: #FBF9F6;
  --border: #E8E4DC;
  --border-strong: #DCD5CA;

  --text: #2D2923;
  --muted: #6B665E;
  --muted-2: #6E675C;

  --sage: #7D9B76;
  --sage-600: #64865D;
  --sage-700: #4C6B48;
  --sage-800: #405D3D;
  --sage-bg: #EEF4EB;

  --terra: #C97B5A;
  --terra-600: #B4634A;
  --terra-700: #9A4C37;
  --terra-bg: #F9EEE8;

  --ok: #4E7A55; --ok-bg: #E9F1E8; --ok-text: #3F6B44;
  --err: #A64B3B; --err-bg: #F8E9E4; --err-text: #96402F;
  --warn: #B9882F; --warn-bg: #FAF2E0; --warn-text: #7E5E1C;

  --focus: #A8735C;
  --on-accent: #FDF6F0;
  --btn-bg: #9C5339;
  --btn-bg-hover: #8A4630;

  --shadow-sm: 0 1px 2px rgba(45,41,35,.05), 0 2px 6px rgba(45,41,35,.06);
  --shadow-md: 0 6px 24px rgba(45,41,35,.08), 0 2px 8px rgba(45,41,35,.06);

  --svg-soil:#D9C9AD; --svg-liner:#A98F6B; --svg-liner2:#8E7656;
  --svg-waste:#C6B08C; --svg-waste2:#B49A72; --svg-cover:#9A8460;
  --svg-gas:#8C9B77; --svg-pipe:#7E92A0; --svg-monitor:#9A8EA5; --svg-label:#5A554C;

  --radius: 14px;
  --radius-lg: 18px;
  --ease: cubic-bezier(.22,.61,.36,1);
  --header-h: 62px;
  --landing-pin-dot: #FDF6F0;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #16181D;
  --bg-alt: #121418;
  --surface: #1F2229;
  --surface-2: #242832;
  --border: #2E323B;
  --border-strong: #3B414C;

  --text: #E8E6E1;
  --muted: #9C988F;
  --muted-2: #7E7A71;

  --sage: #94AF8C;
  --sage-600: #7D9B76;
  --sage-700: #AEC6A7;
  --sage-800: #C2D4BC;
  --sage-bg: #232B26;

  --terra: #D99077;
  --terra-600: #C97B5A;
  --terra-700: #E0A58D;
  --terra-bg: #2B221E;

  --ok: #86BC8F; --ok-bg: #1E2A22; --ok-text: #A6D3AC;
  --err: #D08C78; --err-bg: #2C211E; --err-text: #E0A58D;
  --warn: #D9AF5E; --warn-bg: #2A2416; --warn-text: #E6C98F;

  --focus: #D99A7E;
  --on-accent: #F7E9DF;
  --btn-bg: #B4634A;
  --btn-bg-hover: #C97B5A;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.3), 0 2px 6px rgba(0,0,0,.25);
  --shadow-md: 0 8px 28px rgba(0,0,0,.35), 0 2px 8px rgba(0,0,0,.3);

  --svg-soil:#6C5F49; --svg-liner:#8E7A5C; --svg-liner2:#77674C;
  --svg-waste:#8F7D63; --svg-waste2:#7E6D55; --svg-cover:#6B5F49;
  --svg-gas:#7B8B6B; --svg-pipe:#6E8492; --svg-monitor:#837990; --svg-label:#C9C3B6;
  --landing-pin-dot: #2B221E;
}
/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .3s var(--ease), color .3s var(--ease);
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--sage-700); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
button { font-family: inherit; }
::selection { background: color-mix(in srgb, var(--sage) 28%, transparent); color: var(--text); }

/* ---------- Layout ---------- */
.wrap { max-width: 1100px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
.content { padding-top: var(--header-h); }

/* ---------- Typography ---------- */
h1, .h2, .h3 { font-family: "Fraunces", Georgia, "Times New Roman", serif; font-weight: 600; line-height: 1.14; color: var(--text); letter-spacing: -0.01em; text-wrap: balance; }
.eyebrow { font-family: "IBM Plex Mono", monospace; font-size: 0.78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--terra-600); margin: 0 0 10px; font-weight: 600; }
.tone { color: var(--terra-600); font-style: italic; }
.h2 { font-size: clamp(1.55rem, 3vw, 2.1rem); margin: 0 0 12px; }
.h3 { font-size: 1.16rem; margin: 0 0 8px; }
.lead { font-size: 1.12rem; color: var(--muted); line-height: 1.65; max-width: 60ch; text-wrap: pretty; }

.prose { max-width: 720px; }
.prose h3 { margin-top: 2rem; font-family: "Inter", sans-serif; font-weight: 700; font-size: 1.05rem; letter-spacing: 0; }
.prose p { margin: 0 0 1rem; text-wrap: pretty; }
.prose ul, .prose ol { margin: 0 0 1.2rem; padding-left: 1.2rem; }
.prose li { margin-bottom: .5rem; }
.prose strong { font-weight: 700; color: var(--text); }
.prose em { font-style: italic; }
.mt { margin-top: 1.5rem; }
.note { font-family: "IBM Plex Mono", monospace; font-size: 0.8rem; color: var(--muted-2); margin: .4rem 0 0; }

/* ---------- Buttons & icons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 600; font-size: .95rem; line-height: 1;
  padding: .72rem 1.15rem; border-radius: 12px;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background .2s var(--ease), transform .12s var(--ease), box-shadow .2s var(--ease), border-color .2s;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--btn-bg); color: var(--on-accent); box-shadow: var(--shadow-sm); }
.btn-primary:hover:not(:disabled) { background: var(--btn-bg-hover); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); border-color: var(--muted-2); text-decoration: none; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; flex: none;
  transition: background .2s, border-color .2s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.icon { display: inline-flex; }
.lucide { width: 1.15em; height: 1.15em; stroke: currentColor; stroke-width: 2; flex: none; }

/* ---------- Header / sticky TOC / progress ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 16px; height: 100%; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 600; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 22px; height: 22px; border-radius: 7px; flex: none;
  background: linear-gradient(135deg, var(--sage), var(--terra)); }
.brand-text { font-size: .92rem; }
.brand-text strong { color: var(--terra-600); }
.toc { display: flex; gap: 6px; overflow-x: auto; flex: 1; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 92%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 0, #000 92%, transparent 100%); }
.toc::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: .34rem .72rem; border-radius: 999px; border: 1px solid var(--border);
  background: transparent; color: var(--muted); font-size: .8rem; cursor: pointer;
  transition: color .2s, background .2s, border-color .2s; }
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip.active { background: var(--sage-bg); color: var(--sage-800); border-color: var(--sage-600); font-weight: 600; }
.chapter-nav { position: relative; flex: none; }
.chapter-btn { display: inline-flex; align-items: center; gap: .4rem; height: 38px; padding: 0 .7rem; border-radius: 11px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600; font-size: .86rem; cursor: pointer;
  transition: border-color .2s, background .2s, color .2s; }
.chapter-btn:hover { border-color: var(--sage-600); background: var(--sage-bg); color: var(--sage-800); }
.chapter-btn .chev { transition: transform .2s var(--ease); }
.chapter-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.chapter-menu { position: absolute; top: calc(100% + 6px); left: 0; width: 300px; background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: .4rem; z-index: 60; }
.chapter-menu[hidden] { display: none; }
.chapter-item { display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left; padding: .55rem .65rem;
  border-radius: 9px; border: none; background: transparent; color: var(--text); font-size: .87rem; line-height: 1.35; }
button.chapter-item { cursor: pointer; font-family: inherit; }
.chapter-item:hover:not(.locked) { background: var(--surface-2); }
.chapter-item.current { background: var(--sage-bg); color: var(--sage-800); font-weight: 600; }
.chapter-item.locked { opacity: .55; cursor: not-allowed; }
.chapter-num { flex: none; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center;
  background: var(--surface-2); font-family: "IBM Plex Mono", monospace; font-size: .72rem; font-weight: 600; color: var(--muted); }
.chapter-item.current .chapter-num { background: var(--sage); color: var(--on-accent); }
.chapter-item-txt { flex: 1; }
.chapter-soon { flex: none; font-family: "IBM Plex Mono", monospace; font-size: .64rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted-2); }
.chapter-item.current .chapter-soon { color: var(--sage-700); }
.header-inner .icon-btn { margin-left: auto; }

#progress-track { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 70; }
#progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--sage), var(--terra)); border-radius: 0 3px 3px 0; }

/* ---------- Sections ---------- */
.sec { padding: clamp(2.5rem, 6vw, 4.6rem) 0; }
.sec-deep { background-color: var(--bg-alt); border-block: 1px solid var(--border);
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 88'%3E%3Cpath d='M0 22 Q55 12 110 22 T220 22' fill='none' stroke='%237D9B76' stroke-width='1' stroke-opacity='.10'/%3E%3Cpath d='M0 44 Q55 36 110 46 T220 42' fill='none' stroke='%237D9B76' stroke-width='1' stroke-opacity='.10'/%3E%3Cpath d='M0 66 Q55 61 110 68 T220 64' fill='none' stroke='%237D9B76' stroke-width='1' stroke-opacity='.10'/%3E%3C/svg%3E");
  background-size: 220px 88px; background-repeat: repeat; }
.grid-main { display: grid; grid-template-columns: 320px 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.sec-head { position: sticky; top: calc(var(--header-h) + 18px); align-self: start; }
.sec-head.center { position: static; text-align: center; max-width: 680px; margin: 0 auto 2.2rem; }
.sec-desc { color: var(--muted); line-height: 1.6; margin: 0; }

/* ---------- Hero ---------- */
.hero { padding: clamp(2.5rem, 6vw, 4.8rem) 0 1.2rem;
  background:
    radial-gradient(1100px 560px at 88% -12%, color-mix(in srgb, var(--sage) 16%, transparent), transparent 62%),
    radial-gradient(820px 460px at 6% -4%, color-mix(in srgb, var(--terra) 11%, transparent), transparent 56%); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.hero-copy h1 { font-size: clamp(2rem, 5vw, 3.1rem); font-weight: 700; line-height: 1.06; margin: .3rem 0 1rem; }
.meta-list { list-style: none; display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; padding: 0; margin: 0 0 1.6rem; color: var(--muted); font-size: .92rem; }
.meta-list li { display: inline-flex; align-items: center; gap: .45rem; }
.hero-cta { display: flex; gap: .8rem; flex-wrap: wrap; }
.hero-fig { margin: 0; }
.hero-fig svg { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-alt); box-shadow: var(--shadow-sm); }
.hero-fig figcaption { margin-top: .7rem; font-size: .85rem; color: var(--muted); line-height: 1.5; }
#hero-svg .flow { stroke-dasharray: 6 5; animation: flow 1.6s linear infinite; }
#hero-svg .flame { transform-box: fill-box; transform-origin: center; animation: flicker 2.6s ease-in-out infinite; }
@keyframes flow { to { stroke-dashoffset: -22; } }
@keyframes flicker { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

.stat-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 2.6rem; }
.stat { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.2rem 1.1rem 1.35rem; box-shadow: var(--shadow-sm); transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(var(--sage), var(--terra)); opacity: .75; }
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.stat-num { display: block; font-family: "IBM Plex Mono", monospace; font-size: 2.15rem; font-weight: 600; color: var(--terra-600); line-height: 1.1; }
.stat-lbl { display: block; color: var(--muted); font-size: .9rem; margin-top: .25rem; }
.stat-lbl em { font-style: italic; }

/* ---------- Panel & objectives ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: clamp(1.4rem, 3vw, 2.2rem); box-shadow: var(--shadow-sm); }
.objective-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .85rem; }
.objective-list li { display: flex; gap: .75rem; align-items: flex-start; }
.objective-list li:not(:has(.obj-ic)) { display: block; }
.obj-ic { color: var(--sage-600); margin-top: 2px; }
/* ---------- Glossary term & tooltip trigger ---------- */
.term { border-bottom: 2px dotted var(--terra-600); cursor: help; color: var(--text); font-style: normal; }
.term:hover { color: var(--terra-600); background: var(--terra-bg); border-radius: 4px; }
.term:focus-visible { color: var(--terra-600); }
.tooltip {
  position: fixed; z-index: 90; max-width: 300px; background: var(--surface-2);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: .8rem 1rem; pointer-events: none;
}
.tooltip .tt-term { font-family: "Fraunces", serif; font-weight: 600; font-size: .98rem; display: block; }
.tooltip .tt-en { font-size: .74rem; color: var(--terra-600); font-family: "IBM Plex Mono", monospace; display: inline-block; margin: .1rem 0 .35rem; }
.tooltip .tt-def { display: block; font-size: .88rem; line-height: 1.5; color: var(--text); }

/* ---------- Callout ---------- */
.callout { display: flex; gap: .8rem; align-items: flex-start; border-radius: var(--radius);
  padding: 1rem 1.1rem; border: 1px solid; margin: 1.2rem 0; }
.callout .icon { margin-top: 3px; flex: none; }
.callout p { margin: 0; }
.callout-ok { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 45%, transparent); color: var(--ok-text); }
.callout-ok .icon { color: var(--ok); }
.callout-warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 45%, transparent); color: var(--warn-text); }
.callout-warn .icon { color: var(--warn); }

/* ---------- Formula ---------- */
.formula { font-family: "IBM Plex Mono", monospace; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.15rem 1.3rem; text-align: center; margin: 1.2rem 0; box-shadow: var(--shadow-sm);
  color: var(--text); font-size: 1rem; }
.formula.small { font-size: .95rem; margin: .4rem 0 1.2rem; }

/* ---------- Table ---------- */
.tbl-title { font-family: "IBM Plex Mono", monospace; font-size: .78rem; font-weight: 600; color: var(--muted-2); margin: 1.2rem 0 .5rem; text-wrap: balance; }
.tbl-wrap { margin: 0 0 .5rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 520px; }
.tbl th { text-align: left; background: var(--surface-2); color: var(--text); font-weight: 600; padding: .6rem .8rem; border-bottom: 1px solid var(--border-strong); }
.tbl td { padding: .55rem .8rem; border-bottom: 1px solid var(--border); color: var(--text); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: var(--bg-alt); }

/* ---------- Fungsi (1.2) ---------- */
.fun-list { display: grid; gap: .8rem; margin: 1rem 0 1.4rem; }
.fun { display: flex; gap: .8rem; align-items: flex-start; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; box-shadow: var(--shadow-sm); }
.fun-ic { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--sage-bg); color: var(--sage-700); }
.fun p { margin: 0; color: var(--text); font-size: .95rem; }

/* ---------- Metode card (1.4) ---------- */
.meth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; box-shadow: var(--shadow-sm); margin: 0 0 .9rem; }
.meth-badge { display: inline-block; font-family: "IBM Plex Mono", monospace; font-size: .74rem; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; padding: .22rem .6rem; border-radius: 999px; margin-bottom: .5rem; }
.bad-open { background: var(--err-bg); color: var(--err-text); }
.bad-ctrl { background: var(--warn-bg); color: var(--warn-text); }
.bad-san { background: var(--ok-bg); color: var(--ok-text); }
.meth-card p { margin: 0; color: var(--text); font-size: .97rem; }

/* ---------- Stepper ---------- */
.stepper { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-md);
  border-radius: var(--radius-lg); padding: clamp(1.4rem, 3vw, 2.4rem); }
.stepper-pos { font-family: "IBM Plex Mono", monospace; font-size: .8rem; color: var(--muted-2); margin-bottom: 1.2rem; }
.stepper-stage { min-height: 210px; display: grid; place-items: center; align-content: center; text-align: center; }
.step-ic { width: 58px; height: 58px; border-radius: 16px; display: inline-grid; place-items: center;
  background: var(--sage-bg); color: var(--sage-700); margin: 0 auto .9rem; }
.step-title { margin: 0 0 .5rem; }
.step-body { max-width: 560px; color: var(--text); margin: 0 auto 1rem; }
.step-note { font-family: "IBM Plex Mono", monospace; font-size: .82rem; color: var(--muted-2); max-width: 560px; margin: 0 auto; }
.stepper-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.8rem; }
.stepper-dots { position: relative; display: flex; align-items: center; gap: .45rem; }
.stepper-dots::before, .stepper-dots::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; transform: translateY(-50%); border-radius: 2px; pointer-events: none; }
.stepper-dots::before { background: var(--border-strong); }
.stepper-dots::after { background: linear-gradient(90deg, var(--sage), var(--terra)); width: var(--prog, 0%); transition: width .4s var(--ease); }
.dot { position: relative; z-index: 1; width: 12px; height: 12px; border-radius: 50%; border: none; background: var(--border-strong); box-shadow: 0 0 0 2px var(--surface); cursor: pointer; padding: 0; transition: background .2s, transform .2s, box-shadow .25s; }
.dot:hover { transform: scale(1.2); }
.dot.active { background: var(--terra-600); box-shadow: 0 0 0 2px var(--surface), 0 0 0 5px color-mix(in srgb, var(--terra) 22%, transparent); }

/* ---------- Simulator ---------- */
.sim { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(1.2rem, 3vw, 2.4rem); align-items: start; }
.sim-controls, .sim-readout { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: clamp(1.2rem, 2.5vw, 2rem); box-shadow: var(--shadow-sm); }
.sim-slider-row { display: grid; gap: 1.4rem; margin-bottom: 1.5rem; }
.sim-sl-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .4rem; }
.sim-sl-label { font-weight: 600; font-size: .92rem; color: var(--text); }
.sim-sl-val { font-family: "IBM Plex Mono", monospace; font-size: .95rem; color: var(--terra-600); font-weight: 600; }
.sim-sl-minmax { display: flex; justify-content: space-between; font-size: .74rem; color: var(--muted-2); font-family: "IBM Plex Mono", monospace; margin-top: .15rem; }
.range { width: 100%; accent-color: var(--terra-600); cursor: pointer; }
.sim-presets { display: flex; flex-wrap: wrap; gap: .5rem; }
.preset-btn { border: 1px solid var(--border-strong); background: transparent; color: var(--muted); border-radius: 999px;
  padding: .35rem .7rem; font-size: .8rem; cursor: pointer; transition: all .2s; }
.preset-btn:hover { color: var(--text); border-color: var(--terra-600); }
.preset-btn.active { background: var(--terra-bg); color: var(--terra-700); border-color: var(--terra); font-weight: 600; }
.sim-stats { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin: .4rem 0 1.1rem; }
.sim-stat.card { margin: 0; text-align: center; padding: .9rem .6rem; }
.sim-stat-lbl { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.sim-stat-val { display: block; font-family: "IBM Plex Mono", monospace; font-size: 1.5rem; font-weight: 600; color: var(--sage-800); line-height: 1.2; }
.sim-stat-unit { display: block; font-size: .72rem; color: var(--muted-2); }
.sim-stats .sim-stat:first-child {
  background: linear-gradient(135deg, color-mix(in srgb, var(--sage) 14%, var(--surface)), var(--surface));
  border-color: var(--sage-600);
}
.sim-stats .sim-stat:first-child .sim-stat-val { font-size: 2.3rem; color: var(--sage-700); }
.sim-stats .sim-stat:first-child .sim-stat-lbl { color: var(--sage-700); font-weight: 700; }
.bar-track { display: flex; height: 22px; border-radius: 999px; overflow: hidden; background: var(--bg-alt); border: 1px solid var(--border); }
.bar-seg { height: 100%; transition: width .35s var(--ease); }
.bar-diverted { background: var(--sage); opacity: .85; }
.bar-to-lpa { background: var(--terra); }
.bar-legend { display: flex; gap: 1.2rem; flex-wrap: wrap; margin-top: .6rem; font-size: .8rem; color: var(--muted); }
.legend { display: inline-flex; align-items: center; gap: .4rem; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw-d { background: var(--sage); }
.sw-l { background: var(--terra); }
.sim-hint { font-size: .9rem; color: var(--muted); margin: .9rem 0 0; }
/* ---------- Bento grid & cards ---------- */
.bento-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.bento-card { text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1.3rem 1.4rem; box-shadow: var(--shadow-sm); cursor: pointer; display: flex; flex-direction: column; gap: .55rem;
  transition: box-shadow .25s var(--ease), transform .25s var(--ease), border-color .25s; will-change: transform; }
.bento-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.bento-ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--sage-bg); color: var(--sage-700); }
.bento-tag { font-family: "IBM Plex Mono", monospace; font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; color: var(--terra-600); font-weight: 600; }
.bento-title { font-family: "Fraunces", serif; font-weight: 600; font-size: 1.22rem; color: var(--text); }
.bento-sum { color: var(--muted); font-size: .92rem; line-height: 1.55; }
.bento-link { display: inline-flex; align-items: center; gap: .35rem; color: var(--sage-700); font-size: .85rem; font-weight: 600; margin-top: auto; }
.bento-card:hover .bento-link { text-decoration: underline; }
.bento-card[data-i="0"] {  background: linear-gradient(135deg, var(--sage-bg), color-mix(in srgb, var(--terra) 8%, var(--surface)));
  border-color: color-mix(in srgb, var(--sage) 35%, var(--border)); }
.bento-card[data-i="0"] .bento-ic { background: var(--surface); color: var(--sage-700); box-shadow: var(--shadow-sm); }
.bento-card[data-i="0"] .bento-title { font-size: 1.42rem; }
.bento-card[data-i="0"] .bento-sum { font-size: 1rem; max-width: 56ch; }

/* ---------- Timeline ---------- */
.timeline { position: relative; margin: 1.6rem 0; padding-left: 1.4rem; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--border-strong); }
.tl-item { position: relative; padding: 0 0 1.3rem 1.25rem; }
.tl-item::before { content: ""; position: absolute; left: -1.4rem; top: .35rem; width: 12px; height: 12px; border-radius: 50%; background: var(--terra-600); border: 3px solid var(--bg); }
.tl-year { font-family: "IBM Plex Mono", monospace; font-weight: 600; color: var(--terra-600); font-size: .86rem; }
.tl-title { font-weight: 600; color: var(--text); margin: .15rem 0 .25rem; }
.tl-text { color: var(--muted); font-size: .92rem; line-height: 1.6; }

/* ---------- Quiz ---------- */
.quiz { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-md); border-radius: var(--radius-lg); padding: clamp(1.4rem, 3vw, 2.4rem); }
.q { max-width: 640px; margin: 0 auto; }
.q-meta { font-family: "IBM Plex Mono", monospace; font-size: .8rem; color: var(--muted-2); margin-bottom: .6rem; }
.q-text { font-family: "Fraunces", serif; font-size: 1.18rem; font-weight: 600; color: var(--text); margin: 0 0 1.2rem; line-height: 1.4; }
.q-opts { display: grid; gap: .7rem; }
.q-opt { display: flex; gap: .8rem; align-items: flex-start; text-align: left; width: 100%; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem 1rem; cursor: pointer; color: var(--text); font-size: .95rem; transition: border-color .2s, background .2s; }
.q-opt:hover:not(:disabled) { border-color: var(--sage-600); }
.q-opt:disabled { cursor: default; }
.q-letter { flex: none; width: 27px; height: 27px; border-radius: 8px; display: grid; place-items: center; font-family: "IBM Plex Mono", monospace;
  font-size: .8rem; font-weight: 600; background: var(--surface); border: 1px solid var(--border-strong); color: var(--muted); }
.q-opt.ok { border-color: var(--ok); background: var(--ok-bg); color: var(--ok-text); }
.q-opt.ok .q-letter { background: var(--ok); color: #F4FAF4; border-color: var(--ok); }
.q-opt.no { border-color: var(--err); background: var(--err-bg); color: var(--err-text); }
.q-opt.no .q-letter { background: var(--err); color: #FBF1EC; border-color: var(--err); }
.q-feedback { margin-top: 1rem; border-radius: var(--radius); padding: .9rem 1.05rem; background: var(--surface-2); border: 1px solid var(--border-strong); }
.q-feedback[hidden] { display: none; }
.fb-head { font-family: "IBM Plex Mono", monospace; font-weight: 600; font-size: .8rem; letter-spacing: .05em; text-transform: uppercase; }
.fb-head.ok { color: var(--ok-text); }
.fb-head.no { color: var(--err-text); }
.fb-text { margin: .35rem 0 0; font-size: .92rem; color: var(--text); }
.q-nav { margin-top: 1.5rem; display: flex; justify-content: flex-end; }
.q-result { text-align: center; padding: .5rem 0; }
.q-result-ic { width: 60px; height: 60px; border-radius: 18px; display: inline-grid; place-items: center; background: var(--sage-bg); color: var(--sage-700); margin: 0 auto 1rem; }
.q-score { font-family: "IBM Plex Mono", monospace; font-size: 2.1rem; font-weight: 600; color: var(--text); line-height: 1.1; }
.q-score-pct { display: block; font-size: 1rem; color: var(--muted); }
.q-msg { color: var(--muted); margin: .6rem 0 1.5rem; }
/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(19, 17, 22, .52); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.modal-dialog { position: relative; z-index: 2; width: min(560px, 100%); max-height: 82vh; overflow: auto; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 2rem 1.8rem; }
.modal-close { position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; }
.modal-close:hover { border-color: var(--border-strong); }
.modal-body p { color: var(--text); margin: 0 0 .8rem; }

/* ---------- Code ---------- */
code { font-family: "IBM Plex Mono", monospace; font-size: .85em; background: var(--surface-2); border: 1px solid var(--border);
  padding: .05em .35em; border-radius: 6px; color: var(--terra-600); }

/* ---------- Kata kunci ---------- */
.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; }
.sec-kw { padding: 1.2rem 0 2.6rem; }
.center-eyebrow { text-align: center; margin-bottom: 1rem; }
.kw-cloud { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; max-width: 820px; margin: 0 auto; }
.kw-chip { border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted); border-radius: 999px;
  padding: .45rem .95rem; font-size: .88rem; cursor: pointer; transition: color .2s, border-color .2s, background .2s, transform .12s; }
.kw-chip:hover { color: var(--sage-700); border-color: var(--sage-600); background: var(--sage-bg); transform: translateY(-1px); }

/* ---------- Diagram & grafik ---------- */
.viz { margin: 1.4rem 0; }
.mermaid-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.2rem; overflow-x: auto; }
.mermaid-box svg { max-width: 100%; height: auto; }
.viz figcaption, .chart-card figcaption { font-size: .82rem; color: var(--muted); line-height: 1.5; margin-top: .6rem; }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin: 1.4rem 0; }
.chart-card { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.chart-wrap { position: relative; height: 260px; }

/* ---------- Accordion diskusi ---------- */
.acc { display: grid; gap: .7rem; max-width: 760px; margin: 0 auto; }
.acc-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.acc-item summary { display: flex; align-items: flex-start; gap: .8rem; padding: 1rem 1.1rem; cursor: pointer; list-style: none; }
.acc-item summary::-webkit-details-marker { display: none; }
.acc-num { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--sage-bg);
  color: var(--sage-700); font-family: "IBM Plex Mono", monospace; font-size: .82rem; font-weight: 600; }
.acc-q { flex: 1; color: var(--text); font-weight: 600; font-size: .97rem; line-height: 1.55; }
.acc-chev { flex: none; color: var(--muted-2); margin-top: 4px; transition: transform .25s var(--ease); }
.acc-item[open] .acc-chev { transform: rotate(180deg); }
.acc-body { display: flex; gap: .7rem; padding: 0 1.1rem 1.15rem 3.8rem; color: var(--muted); }
.acc-body .icon { color: var(--warn); flex: none; margin-top: 2px; }
.acc-body p { margin: 0; font-size: .92rem; line-height: 1.6; }

/* ---------- Latihan ---------- */
.lat-progress { display: flex; align-items: center; gap: 1rem; max-width: 560px; margin: 0 auto 1.4rem; }
.lat-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); overflow: hidden; }
.lat-bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--sage), var(--terra)); transition: width .4s var(--ease); }
.lat-count { font-family: "IBM Plex Mono", monospace; font-size: .82rem; color: var(--muted); flex: none; }
.lat-list { list-style: none; padding: 0; margin: 0 auto; max-width: 760px; display: grid; gap: .7rem; }
.lat-item { display: flex; gap: .9rem; align-items: flex-start; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.1rem; transition: border-color .2s, background .2s; }
.lat-item.done { border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); background: var(--ok-bg); }
.lat-check { flex: none; width: 28px; height: 28px; border-radius: 9px; border: 1.5px solid var(--border-strong); background: var(--surface);
  color: transparent; cursor: pointer; display: grid; place-items: center; transition: background .2s, border-color .2s, color .2s; }
.lat-item.done .lat-check { background: var(--ok); border-color: var(--ok); color: #F4FAF4; }
.lat-body { flex: 1; }
.lat-tag { display: inline-block; font-family: "IBM Plex Mono", monospace; font-size: .7rem; letter-spacing: .05em; text-transform: uppercase;
  color: var(--terra-600); font-weight: 600; margin-bottom: .3rem; }
.lat-body p { margin: 0; color: var(--text); font-size: .95rem; line-height: 1.6; }
.lat-item.done .lat-body p { color: var(--muted); }

/* ---------- Pustaka ---------- */
.pustaka-group { font-family: "IBM Plex Mono", monospace; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--terra-600); margin: 1.6rem 0 .6rem; }
.pustaka-list { list-style: none; padding: 0; margin: 0; }
.pustaka-list li { padding: .3rem 0 .3rem 1.4rem; position: relative; color: var(--muted); font-size: .92rem; line-height: 1.6; }
.pustaka-list li::before { content: "—"; position: absolute; left: 0; color: var(--muted-2); }

/* ---------- Landing page ---------- */
.landing-page { background: var(--bg); }
.landing-nav { display: flex; align-items: center; gap: 1.2rem; margin-left: auto; }
.landing-nav a { color: var(--muted); font-size: .86rem; font-weight: 600; }
.landing-nav a:hover { color: var(--text); text-decoration: none; }
.landing-main { padding-top: var(--header-h); }
.landing-hero { padding: clamp(3rem, 8vw, 7rem) 0 clamp(3rem, 7vw, 5.6rem); background:
  radial-gradient(900px 500px at 90% 0%, color-mix(in srgb, var(--sage) 15%, transparent), transparent 62%),
  radial-gradient(700px 440px at 8% 0%, color-mix(in srgb, var(--terra) 10%, transparent), transparent 60%); }
.landing-hero-grid { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(360px, .98fr); gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.landing-copy h1 { max-width: 760px; margin: .4rem 0 1rem; font: 700 clamp(2.8rem, 6vw, 5.2rem)/.98 "Fraunces", Georgia, serif; letter-spacing: -.035em; color: var(--text); text-wrap: balance; }
.landing-audience { margin: 0 0 1.2rem; color: var(--terra-700); font: 600 1.05rem "IBM Plex Mono", monospace; }
.landing-description { max-width: 58ch; margin: 0; color: var(--muted); font-size: 1.08rem; line-height: 1.75; text-wrap: pretty; }
.landing-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.8rem; }
.landing-visual { margin: 0; }
.landing-visual svg { width: 100%; border: 1px solid var(--border); border-radius: var(--radius-lg); background: color-mix(in srgb, var(--surface) 70%, var(--bg-alt)); box-shadow: var(--shadow-md); }
.landing-visual figcaption { margin-top: .7rem; color: var(--muted); font-size: .84rem; line-height: 1.5; }
.contour { fill: none; stroke: var(--sage); stroke-width: 2; opacity: .38; }
.contour-a { opacity: .68; }
.contour-d { opacity: .22; }
.route { fill: none; stroke: var(--terra); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 2 10; opacity: .75; }
.site { stroke: var(--surface); stroke-width: 4; }
.site-risk { fill: var(--terra); }
.site-safe { fill: var(--sage); }
.site-future { fill: var(--muted-2); }
.pin { fill: color-mix(in srgb, var(--sage) 78%, var(--surface)); stroke: var(--sage-700); stroke-width: 3; }
.landing-labels { fill: var(--muted); font-size: 12px; }
.landing-chapters { padding: clamp(3rem, 7vw, 5.5rem) 0; background: var(--bg-alt); border-block: 1px solid var(--border); }
.chapter-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.chapter-card { position: relative; min-height: 245px; display: flex; flex-direction: column; align-items: flex-start; padding: 1.35rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); text-decoration: none; overflow: hidden; }
.chapter-card:hover { text-decoration: none; }
.chapter-ready { transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s; }
.chapter-ready:hover { transform: translateY(-4px); border-color: var(--sage-600); box-shadow: var(--shadow-md); }
.chapter-ready:first-child { background: linear-gradient(145deg, var(--sage-bg), var(--surface)); }
.chapter-ready:nth-child(2) { background: linear-gradient(145deg, var(--terra-bg), var(--surface)); }
.chapter-locked { background: color-mix(in srgb, var(--surface) 72%, var(--bg-alt)); opacity: .72; }
.chapter-card-no { color: var(--terra-600); font: 600 1.25rem "IBM Plex Mono", monospace; letter-spacing: -.04em; }
.chapter-card-status { margin-top: .35rem; color: var(--muted-2); font: 600 .68rem "IBM Plex Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
.chapter-ready .chapter-card-status { color: var(--sage-700); }
.chapter-card h3 { max-width: 16ch; margin: 1rem 0 .5rem; font: 600 1.2rem/1.15 "Fraunces", Georgia, serif; }
.chapter-card p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.55; }
.chapter-card-link { display: inline-flex; align-items: center; gap: .35rem; margin-top: auto; padding-top: 1.2rem; color: var(--sage-700); font-size: .83rem; font-weight: 700; }
.chapter-card-link .lucide { width: 1em; height: 1em; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--border); padding: 1.7rem 0 2.2rem; }
.foot-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.foot-copy, .foot-modified { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.foot-copy { font-weight: 600; }
.foot-copy a { color: var(--sage-700); }
.foot-copy a:hover { color: var(--terra-700); }
.foot-modified { color: var(--muted-2); font: .75rem "IBM Plex Mono", monospace; }

/* ---------- Bab 2: scoring & AHP tools ---------- */
.b2-explain-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; max-width: 900px; margin: 0 auto 1.4rem; }
.b2-tool-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: clamp(1.2rem, 3vw, 2rem); margin: 1.4rem auto; max-width: 1000px; }
.b2-tool-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }
.b2-tool-head .eyebrow { margin-bottom: .35rem; }
.b2-tool-head .h3 { margin-bottom: .35rem; }
.b2-formula-mini { flex: none; font-family: "IBM Plex Mono", monospace; color: var(--terra-700); background: var(--terra-bg); border: 1px solid color-mix(in srgb, var(--terra) 35%, var(--border)); border-radius: 10px; padding: .65rem .8rem; font-size: .85rem; }
.b2-tool-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.2rem, 3vw, 2.2rem); align-items: start; }
.b2-tool-controls { display: grid; gap: .9rem; }
.b2-tool-output { min-width: 0; }
.b2-location-tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .25rem; }
.b2-loc-btn { border: 1px solid var(--border-strong); background: transparent; color: var(--muted); border-radius: 999px; padding: .4rem .8rem; font: 600 .82rem "IBM Plex Mono", monospace; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.b2-loc-btn:hover { color: var(--text); border-color: var(--sage-600); }
.b2-loc-btn.active { background: var(--sage-bg); color: var(--sage-800); border-color: var(--sage-600); }
.b2-range-row { display: grid; gap: .3rem; }
.b2-range-head { display: flex; justify-content: space-between; gap: .8rem; align-items: baseline; }
.b2-range-head label { color: var(--text); font-size: .88rem; font-weight: 600; }
.b2-range-value { color: var(--terra-600); font: 600 .9rem "IBM Plex Mono", monospace; }
.b2-range-meta { display: flex; justify-content: space-between; color: var(--muted-2); font: .7rem "IBM Plex Mono", monospace; }
.b2-output-hero { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: .2rem 1rem; padding: 1rem; border-radius: var(--radius); background: var(--sage-bg); border: 1px solid color-mix(in srgb, var(--sage) 35%, var(--border)); margin-bottom: .9rem; }
.b2-output-label { grid-column: 1 / -1; color: var(--sage-700); font: 600 .72rem "IBM Plex Mono", monospace; letter-spacing: .06em; text-transform: uppercase; }
.b2-output-hero strong { color: var(--sage-800); font: 600 2.4rem/1.05 "IBM Plex Mono", monospace; }
.b2-output-hero span:last-child { color: var(--sage-700); font-size: .82rem; }
.b2-ranking { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.b2-rank { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--border); border-radius: 999px; padding: .35rem .6rem; color: var(--muted); font-size: .78rem; }
.b2-rank strong { color: var(--terra-600); font-family: "IBM Plex Mono", monospace; }
.b2-rank b { color: var(--text); font-family: "IBM Plex Mono", monospace; }
.b2-rank.selected { background: var(--terra-bg); border-color: var(--terra); color: var(--terra-700); }
.b2-chart-wrap { position: relative; height: 245px; margin-top: 1rem; }
.b2-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-bottom: .8rem; }
.b2-metrics > div { display: grid; gap: .2rem; text-align: center; padding: .7rem .4rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.b2-metrics span { color: var(--muted); font: .72rem "IBM Plex Mono", monospace; }
.b2-metrics strong { color: var(--text); font: 600 1.2rem "IBM Plex Mono", monospace; }
.b2-verdict { border-radius: var(--radius); padding: .75rem .9rem; text-align: center; font-weight: 700; margin-bottom: .9rem; }
.b2-verdict.ok { background: var(--ok-bg); color: var(--ok-text); border: 1px solid color-mix(in srgb, var(--ok) 45%, var(--border)); }
.b2-verdict.warn { background: var(--warn-bg); color: var(--warn-text); border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--border)); }
.b2-weight-list { display: grid; gap: .45rem; }
.b2-weight { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .85rem; }
.b2-weight strong { color: var(--sage-700); font-family: "IBM Plex Mono", monospace; }
.b2-details { max-width: 100%; margin-top: 1.2rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.b2-details summary { color: var(--sage-700); cursor: pointer; font-weight: 600; }
.b2-matrix { margin: .8rem 0 0; min-width: 420px; }
.b2-method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; max-width: 1000px; margin: 1.4rem auto 0; }
.b2-method-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow-sm); }
.b2-method-card .h3 { margin: .3rem 0 .45rem; font-size: 1.05rem; }
.b2-method-card p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.6; }

.to-top { position: fixed; right: 20px; bottom: 20px; z-index: 60; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); box-shadow: var(--shadow-md);
  cursor: pointer; display: grid; place-items: center; transition: transform .2s var(--ease), opacity .2s, border-color .2s, color .2s; }
.to-top:hover { border-color: var(--terra-600); color: var(--terra-600); transform: translateY(-2px); }
.to-top[hidden] { display: none; }

/* ---------- Responsive & motion ---------- */
@media (max-width: 960px) {
  .grid-main { grid-template-columns: 1fr; gap: 1.4rem; }
  .sec-head { position: static; }
  .hero-grid, .sim { grid-template-columns: 1fr; }
  .bento-grid { grid-template-columns: repeat(2, 1fr); }
  .b2-method-grid { grid-template-columns: 1fr 1fr; }
  .landing-hero-grid { grid-template-columns: 1fr; }
  .landing-visual { max-width: 680px; margin: 0 auto; }
  .chapter-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .bento-grid { grid-template-columns: 1fr; }
  .stat-strip, .sim-stats { grid-template-columns: 1fr; }
  .header-inner { gap: 10px; }
  .brand-text { font-size: .82rem; }
  .stepper-nav { flex-wrap: wrap; justify-content: center; }
  .to-top { right: 14px; bottom: 14px; width: 42px; height: 42px; }
  .chart-grid { grid-template-columns: 1fr; }
  .acc-body { padding-left: 1.1rem; }
  .b2-explain-grid, .b2-tool-grid, .b2-method-grid { grid-template-columns: 1fr; }
  .b2-tool-head { flex-direction: column; }
  .b2-formula-mini { align-self: stretch; text-align: center; }
  .b2-output-hero strong { font-size: 2rem; }
  .landing-nav { display: none; }
  .landing-copy h1 { font-size: clamp(2.5rem, 13vw, 4rem); }
  .landing-description { font-size: 1rem; }
  .chapter-grid { grid-template-columns: 1fr; }
  .foot-inner { display: block; }
  .foot-modified { margin-top: .35rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .bar-seg { transition: none; }
}
