/* ============================================================
   אוריגמי — מחקר עומק ביקורתי
   Static site stylesheet (RTL, Hebrew-first)
   ============================================================ */

:root {
  --paper: #f7f4ee;
  --paper-2: #efeae0;
  --ink: #1b1a17;
  --ink-soft: #4a463e;
  --ink-faint: #7b746a;
  --line: #ddd5c7;
  --accent: #c0392b;      /* valley / crimson crane */
  --accent-2: #1f6f6b;    /* mountain / deep teal */
  --accent-3: #b8860b;    /* gold leaf */
  --card: #fffdf8;
  --shadow: 0 1px 2px rgba(27, 26, 23, .05), 0 8px 28px rgba(27, 26, 23, .07);
  --shadow-lg: 0 2px 6px rgba(27, 26, 23, .07), 0 24px 60px rgba(27, 26, 23, .14);
  --radius: 14px;
  --maxw: 1180px;
  --font: "Assistant", "Heebo", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Courier New", monospace;
}

html[data-theme="dark"] {
  --paper: #14151a;
  --paper-2: #1b1d24;
  --ink: #ece7dd;
  --ink-soft: #b9b2a5;
  --ink-faint: #8a8275;
  --line: #2e3139;
  --accent: #ff6f5e;
  --accent-2: #4ecdc4;
  --accent-3: #e2b23c;
  --card: #1b1d24;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .35);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .4), 0 24px 60px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 86px;
}

body {
  margin: 0;
  direction: rtl;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  transition: background .35s ease, color .35s ease;
}

body.no-scroll { overflow: hidden; }

/* ---------- paper texture backdrop ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .5;
  background-image:
    repeating-linear-gradient(115deg, transparent 0 38px, rgba(0,0,0,.012) 38px 39px),
    repeating-linear-gradient(-115deg, transparent 0 54px, rgba(0,0,0,.012) 54px 55px);
}

h1, h2, h3, h4 {
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -.015em;
  margin: 0 0 .5em;
}

a { color: var(--accent-2); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

p { margin: 0 0 1em; }

code, .mono { font-family: var(--mono); font-size: .92em; }

/* ============================================================
   Layout helpers
   ============================================================ */
.wrap {
  width: min(var(--maxw), calc(100% - 2.5rem));
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

section.band { padding: 5.5rem 0; position: relative; }
section.band.alt { background: var(--paper-2); }

.section-head { margin-bottom: 2.75rem; max-width: 62ch; }
.section-kicker {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .6rem;
}
.section-kicker::before {
  content: "";
  width: 28px; height: 2px;
  background: var(--accent);
  display: inline-block;
}
.section-head h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
.section-head p { color: var(--ink-soft); font-size: 1.05rem; margin-bottom: 0; }

.lead { font-size: 1.12rem; color: var(--ink-soft); }

/* ============================================================
   Header / nav
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(14px);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 68px;
}
.brand {
  display: flex; align-items: center; gap: .6rem;
  font-weight: 800; font-size: 1.05rem;
  color: var(--ink); text-decoration: none;
  white-space: nowrap;
}
.brand svg { width: 28px; height: 28px; flex: none; }
.brand small { font-weight: 500; color: var(--ink-faint); font-size: .76rem; display: block; line-height: 1; }

.nav { display: flex; gap: .15rem; margin-inline-start: auto; flex-wrap: wrap; }
.nav a {
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  padding: .45rem .7rem;
  border-radius: 999px;
  transition: background .2s, color .2s;
}
.nav a:hover, .nav a.active { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }

.icon-btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid; place-items: center;
  cursor: pointer;
  flex: none;
  transition: transform .15s, border-color .2s;
}
.icon-btn:hover { transform: translateY(-1px); border-color: var(--accent); }
.nav-toggle { display: none; }

.progress {
  position: absolute;
  bottom: -1px; right: 0;
  height: 2px; width: 0;
  background: linear-gradient(90deg, var(--accent-3), var(--accent));
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  padding: 6rem 0 5rem;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
#creaseCanvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: .5;
  z-index: 0;
}
.hero .wrap { position: relative; z-index: 2; }
.hero h1 {
  font-size: clamp(2.3rem, 6vw, 4.2rem);
  max-width: 17ch;
  margin-bottom: .4em;
}
.hero h1 .grad { color: var(--accent); }
.hero-sub { font-size: clamp(1.02rem, 2vw, 1.22rem); color: var(--ink-soft); max-width: 60ch; }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 2rem; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .78rem 1.5rem;
  border-radius: 999px;
  font-weight: 700; font-size: .96rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s, box-shadow .2s, background .2s;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { transform: translateY(-2px); color: #fff; box-shadow: var(--shadow-lg); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 3.5rem;
  max-width: 820px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
}
.stat b { display: block; font-size: 1.75rem; line-height: 1.1; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat span { font-size: .85rem; color: var(--ink-faint); }

/* ============================================================
   Evidence tiers
   ============================================================ */
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.tier {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  padding: 1.3rem;
  box-shadow: var(--shadow);
}
.tier h4 { font-size: 1.05rem; color: var(--t); margin-bottom: .35rem; display: flex; align-items: center; gap: .5rem; }
.tier h4::before { content: ""; width: 9px; height: 9px; border-radius: 2px; background: var(--t); transform: rotate(45deg); flex: none; }
.tier p { font-size: .92rem; color: var(--ink-soft); margin: 0; }

.badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  white-space: nowrap;
  vertical-align: middle;
}
.b-fact { color: #2e7d32; }
.b-evidence { color: #1565c0; }
.b-interp { color: #ad6a00; }
.b-hypo { color: #8e44ad; }
html[data-theme="dark"] .b-fact { color: #7fd38a; }
html[data-theme="dark"] .b-evidence { color: #7bb6f5; }
html[data-theme="dark"] .b-interp { color: #ebb757; }
html[data-theme="dark"] .b-hypo { color: #c79af0; }

/* ============================================================
   Generic cards & grids
   ============================================================ */
.grid { display: grid; gap: 1.1rem; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .25s, border-color .2s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.card h3 { font-size: 1.08rem; margin-bottom: .35rem; }
.card .en { font-family: var(--mono); font-size: .78rem; color: var(--accent-2); display: block; margin-bottom: .5rem; letter-spacing: .02em; }
.card p { font-size: .93rem; color: var(--ink-soft); margin: 0; }

/* ============================================================
   Tables
   ============================================================ */
.table-scroll { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; min-width: 640px; }
thead th {
  background: color-mix(in srgb, var(--accent-2) 12%, var(--card));
  text-align: right;
  font-weight: 800;
  padding: .85rem 1rem;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
  font-size: .88rem;
}
tbody td { padding: .8rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-soft); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--accent-3) 7%, transparent); }
tbody td:first-child { color: var(--ink); font-weight: 700; }

/* quality pills */
.q { font-size: .78rem; font-weight: 700; padding: .18rem .55rem; border-radius: 999px; white-space: nowrap; display: inline-block; }
.q-high { background: #d8f0d9; color: #1e5e23; }
.q-mid  { background: #fdf0d2; color: #85601a; }
.q-low  { background: #fadbd8; color: #8e2a20; }
html[data-theme="dark"] .q-high { background: #1d3a22; color: #8fdc98; }
html[data-theme="dark"] .q-mid  { background: #3c3119; color: #f0c969; }
html[data-theme="dark"] .q-low  { background: #3d201c; color: #f29b90; }

/* ============================================================
   Timeline
   ============================================================ */
.timeline { position: relative; padding-inline-start: 0; margin: 0; list-style: none; }
.timeline::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; right: 13px;
  width: 2px;
  background: linear-gradient(var(--accent-3), var(--accent), var(--accent-2));
  opacity: .45;
}
.tl-item { position: relative; padding-inline-start: 0; padding-inline-end: 2.6rem; margin-bottom: 1.6rem; }
.tl-item::before {
  content: "";
  position: absolute;
  right: 7px; top: .55rem;
  width: 14px; height: 14px;
  border-radius: 3px;
  background: var(--card);
  border: 2px solid var(--accent);
  transform: rotate(45deg);
  transition: background .2s, transform .3s;
}
.tl-item:hover::before { background: var(--accent); transform: rotate(135deg); }
.tl-era { font-family: var(--mono); font-size: .82rem; font-weight: 700; color: var(--accent); letter-spacing: .03em; }
.tl-item h4 { font-size: 1.02rem; margin: .1rem 0 .25rem; }
.tl-item p { font-size: .9rem; color: var(--ink-soft); margin: 0; }

/* ============================================================
   Myth flip cards
   ============================================================ */
.myths { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.1rem; }
.myth {
  perspective: 1200px;
  height: 196px;
  cursor: pointer;
  outline: none;
}
.myth-inner {
  position: relative;
  width: 100%; height: 100%;
  transition: transform .62s cubic-bezier(.4,.2,.2,1);
  transform-style: preserve-3d;
}
.myth.flipped .myth-inner { transform: rotateY(180deg); }
.myth-face {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 1.2rem;
  display: flex; flex-direction: column; justify-content: center;
  box-shadow: var(--shadow);
}
.myth-front { background: var(--card); }
.myth-back {
  transform: rotateY(180deg);
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent-2) 14%, var(--card)), var(--card));
  border-color: color-mix(in srgb, var(--accent-2) 45%, var(--line));
}
.myth-tag { font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; margin-bottom: .5rem; }
.myth-front .myth-tag { color: var(--accent); }
.myth-back .myth-tag { color: var(--accent-2); }
.myth-face p { font-size: .96rem; margin: 0; color: var(--ink); font-weight: 600; }
.myth-back p { font-weight: 500; color: var(--ink-soft); font-size: .92rem; }
.myth-hint { font-size: .74rem; color: var(--ink-faint); margin-top: auto; padding-top: .7rem; }

/* ============================================================
   Interactive panels
   ============================================================ */
.lab {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(260px, .85fr);
  gap: 1.5rem;
  align-items: stretch;
}
.lab-stage {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  display: grid;
  place-items: center;
  min-height: 340px;
}
.lab-stage svg, .lab-stage canvas { width: 100%; height: auto; max-height: 420px; display: block; }
.lab-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem;
}
.lab-panel h3 { font-size: 1.1rem; }
.lab-panel p { font-size: .93rem; color: var(--ink-soft); }

.ctl { margin: 1.1rem 0; }
.ctl label { display: flex; justify-content: space-between; font-size: .85rem; font-weight: 700; margin-bottom: .35rem; }
.ctl label span { font-family: var(--mono); color: var(--accent); font-variant-numeric: tabular-nums; }
input[type="range"] {
  width: 100%; height: 5px; border-radius: 999px; appearance: none;
  background: var(--line); outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none; width: 19px; height: 19px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--card);
  box-shadow: 0 2px 8px rgba(0,0,0,.25); cursor: grab;
}
input[type="range"]::-moz-range-thumb {
  width: 19px; height: 19px; border-radius: 50%; border: 3px solid var(--card);
  background: var(--accent); cursor: grab;
}

.readout {
  font-family: var(--mono);
  font-size: .86rem;
  background: var(--paper-2);
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: .85rem 1rem;
  margin-top: 1rem;
  direction: ltr;
  text-align: left;
}
.readout .ok { color: #2e7d32; font-weight: 700; }
.readout .bad { color: var(--accent); font-weight: 700; }
html[data-theme="dark"] .readout .ok { color: #7fd38a; }

.verdict {
  margin-top: 1rem;
  padding: .8rem 1rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: .95rem;
  text-align: center;
  transition: background .3s, color .3s;
}
.verdict.good { background: #d8f0d9; color: #1e5e23; }
.verdict.bad { background: #fadbd8; color: #8e2a20; }
html[data-theme="dark"] .verdict.good { background: #1d3a22; color: #8fdc98; }
html[data-theme="dark"] .verdict.bad { background: #3d201c; color: #f29b90; }

.legend { display: flex; gap: 1.2rem; flex-wrap: wrap; font-size: .82rem; color: var(--ink-faint); margin-top: .9rem; }
.legend i { display: inline-block; width: 22px; height: 0; border-top: 3px solid; margin-inline-end: .4rem; vertical-align: middle; }
.l-mountain i { color: var(--accent-2); }
.l-valley i { color: var(--accent); border-top-style: dashed; }

/* ============================================================
   Practical guide — accordion & path
   ============================================================ */
.path { counter-reset: step; display: grid; gap: .7rem; }
.path-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .85rem 1.1rem;
  box-shadow: var(--shadow);
  transition: transform .18s, border-color .2s;
}
.path-item:hover { transform: translateX(-5px); border-color: var(--accent); }
.path-num {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  border-radius: 9px;
  font-weight: 800; font-size: .95rem;
  font-variant-numeric: tabular-nums;
}
.path-item h4 { margin: 0; font-size: 1rem; }
.path-item p { margin: 0; font-size: .86rem; color: var(--ink-faint); }
.diff { font-size: .74rem; font-weight: 700; letter-spacing: .06em; color: var(--ink-faint); white-space: nowrap; }
.diff b { color: var(--accent-3); letter-spacing: 0; }

details.fold {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: .8rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}
details.fold > summary {
  cursor: pointer;
  padding: 1rem 1.2rem;
  font-weight: 700;
  font-size: 1.02rem;
  list-style: none;
  display: flex; align-items: center; gap: .7rem;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before {
  content: "◀";
  font-size: .7rem;
  color: var(--accent);
  transition: transform .25s;
}
details.fold[open] > summary::before { transform: rotate(-90deg); }
details.fold[open] > summary { border-bottom: 1px solid var(--line); }
.fold-body { padding: 1.1rem 1.2rem 1.3rem; }
.fold-body ol { margin: 0; padding-inline-start: 1.3rem; }
.fold-body ol li { margin-bottom: .55rem; font-size: .95rem; color: var(--ink-soft); }
.fold-body .takeaway {
  margin-top: 1rem;
  padding: .7rem .95rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: .9rem;
}

/* ============================================================
   People
   ============================================================ */
.person {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: .9rem;
  align-items: start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .25s;
}
.person:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.avatar {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(140deg, var(--accent), var(--accent-3));
  color: #fff; font-weight: 800; font-size: .95rem;
  font-family: var(--mono);
}
.person h4 { margin: 0 0 .15rem; font-size: 1rem; direction: ltr; text-align: right; }
.person p { margin: 0; font-size: .88rem; color: var(--ink-soft); }

/* ============================================================
   Fact list
   ============================================================ */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: .9rem; counter-reset: f; }
.fact {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.05rem 1.1rem 1.05rem 1.1rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.fact::after {
  counter-increment: f;
  content: counter(f, decimal-leading-zero);
  position: absolute;
  left: .7rem; bottom: -.35rem;
  font-size: 2.6rem; font-weight: 800;
  color: color-mix(in srgb, var(--accent) 12%, transparent);
  font-family: var(--mono);
}
.fact b { display: block; font-size: .97rem; margin-bottom: .3rem; }
.fact span { font-size: .87rem; color: var(--ink-faint); }

/* ============================================================
   Future tiers
   ============================================================ */
.future { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1.1rem; }
.future-col {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.future-col header {
  padding: 1rem 1.2rem;
  color: #fff;
  font-weight: 800;
}
.f-now header { background: linear-gradient(120deg, #1f6f6b, #2e9e96); }
.f-likely header { background: linear-gradient(120deg, #b8860b, #d9a521); }
.f-spec header { background: linear-gradient(120deg, #8e44ad, #b56cd6); }
.future-col ul { margin: 0; padding: 1.1rem 2rem 1.3rem 1.2rem; }
.future-col li { font-size: .92rem; color: var(--ink-soft); margin-bottom: .5rem; }

/* ============================================================
   Callouts
   ============================================================ */
.callout {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  box-shadow: var(--shadow);
  margin: 1.5rem 0;
}
.callout h4 { margin-bottom: .3rem; font-size: 1.05rem; color: var(--accent); }
.callout.teal h4 { color: var(--accent-2); }
.callout.gold h4 { color: var(--accent-3); }
.callout p:last-child { margin-bottom: 0; }

.pull {
  font-size: clamp(1.15rem, 2.4vw, 1.6rem);
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  max-width: 48ch;
  margin: 3rem auto;
  color: var(--ink);
  position: relative;
  padding: 0 2rem;
}
.pull::before, .pull::after {
  content: "„";
  font-size: 3rem;
  color: color-mix(in srgb, var(--accent) 35%, transparent);
  position: absolute; top: -.4em;
}
.pull::before { right: 0; }
.pull::after { left: 0; content: "”"; }

/* ============================================================
   Sources
   ============================================================ */
.sources { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: .55rem; }
.src {
  display: flex; gap: .7rem; align-items: baseline;
  padding: .6rem .8rem;
  border-radius: 9px;
  border: 1px solid transparent;
  transition: background .2s, border-color .2s;
  font-size: .9rem;
}
.src:hover { background: var(--card); border-color: var(--line); }
.src .n { font-family: var(--mono); font-size: .76rem; color: var(--accent); font-weight: 700; flex: none; }
.src a { color: var(--ink); text-decoration: none; font-weight: 600; }
.src a:hover { color: var(--accent-2); text-decoration: underline; }
.src em { display: block; font-style: normal; font-size: .76rem; color: var(--ink-faint); direction: ltr; text-align: right; word-break: break-all; }

/* ============================================================
   Footer
   ============================================================ */
footer.site {
  background: var(--paper-2);
  border-top: 1px solid var(--line);
  padding: 3rem 0 2.2rem;
  font-size: .9rem;
  color: var(--ink-faint);
}
footer.site .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 2rem; margin-bottom: 2rem; }
footer.site h5 { color: var(--ink); font-size: .95rem; margin: 0 0 .6rem; }
footer.site ul { list-style: none; margin: 0; padding: 0; }
footer.site li { margin-bottom: .35rem; }
footer.site a { color: var(--ink-faint); text-decoration: none; }
footer.site a:hover { color: var(--accent); }
.foot-bottom { border-top: 1px solid var(--line); padding-top: 1.3rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ============================================================
   Reveal animation
   ============================================================ */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.3,1); }
.reveal.in { opacity: 1; transform: none; }

/* back to top */
#toTop {
  position: fixed;
  inset-inline-start: 1.5rem;
  bottom: 1.5rem;
  z-index: 40;
  opacity: 0; pointer-events: none;
  transition: opacity .3s, transform .3s;
  transform: translateY(10px);
}
#toTop.show { opacity: 1; pointer-events: auto; transform: none; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .lab { grid-template-columns: 1fr; }
  .nav-toggle { display: grid; }
  .nav {
    position: fixed;
    inset: 68px 0 auto 0;
    flex-direction: column;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 1rem 1.25rem 1.5rem;
    gap: .2rem;
    display: none;
    box-shadow: var(--shadow-lg);
    max-height: calc(100vh - 68px);
    overflow-y: auto;
  }
  .nav.open { display: flex; }
  .nav a { padding: .6rem .8rem; font-size: 1rem; }
  section.band { padding: 3.5rem 0; }
  .hero { padding: 3.5rem 0 3rem; }
  .brand small { display: none; }
}

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

@media print {
  .topbar, #toTop, .lab-panel .ctl, #creaseCanvas { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .table-scroll { box-shadow: none; }
}
