/* chocho.lol garden - ChoHog design tokens v2 "the mechanical garden"
   cream canvas, olive ink, sun accent + two flat chips (red/blue),
   thick ink borders, hard offset shadows, everything presses down.
   All fonts self-hosted - zero external requests. */

@font-face { font-family: 'Recoleta'; src: url('fonts/Recoleta-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Recoleta'; src: url('fonts/Recoleta-Black.woff2') format('woff2'); font-weight: 900; font-display: swap; }
@font-face { font-family: 'Open Sauce Sans'; src: url('fonts/OpenSauceSans-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Open Sauce Sans'; src: url('fonts/OpenSauceSans-Italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Open Sauce Sans'; src: url('fonts/OpenSauceSans-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Open Sauce Sans'; src: url('fonts/OpenSauceSans-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Open Sauce Sans'; src: url('fonts/OpenSauceSans-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Open Sauce Sans'; src: url('fonts/OpenSauceSans-Black.woff2') format('woff2'); font-weight: 900; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('fonts/IBMPlexMono-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('fonts/IBMPlexMono-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('fonts/IBMPlexMono-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Noto Sans Hebrew'; src: url('fonts/NotoSansHebrew-400.woff2') format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0590-05FF, U+FB1D-FB4F; }
@font-face { font-family: 'Noto Sans Hebrew'; src: url('fonts/NotoSansHebrew-700.woff2') format('woff2'); font-weight: 700; font-display: swap; unicode-range: U+0590-05FF, U+FB1D-FB4F; }
@font-face { font-family: 'Noto Sans Hebrew'; src: url('fonts/NotoSansHebrew-900.woff2') format('woff2'); font-weight: 900; font-display: swap; unicode-range: U+0590-05FF, U+FB1D-FB4F; }

:root {
  --paper: #EEEFE9;
  --surface: #FFFFFF;
  --ink: #23251D;
  --ink-2: rgba(35,37,29,.82);
  --dim: rgba(35,37,29,.60);
  --hair: rgba(35,37,29,.25);
  --wash: rgba(35,37,29,.07);
  --accent: #F7A501;
  --on-accent: #23251D;
  --chip-red: #F54E00;
  --chip-blue: #1D4AFF;
  --chip-green: #2E7D4F;
  --on-chip: #FFFFFF;
  --bw: 2.5px;                       /* the ink border */
  --shadow: 5px 5px 0 var(--ink);
  --shadow-big: 8px 8px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --r: 8px;
  --t: .13s cubic-bezier(.2,.9,.3,1.2);
  --sans: 'Open Sauce Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  --he: 'Noto Sans Hebrew', var(--sans);
  --title-en: 'Recoleta', Georgia, serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --sb-w: 232px;                     /* sidebar width (drag-resizable) */
  --beat-min: 150px;                 /* music tile size (pinch/slider) */
  --photo-col: 250px;                /* photo column width (pinch/slider) */
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1A1B16; --surface: #22231C; --ink: #F0EFE6;
    --ink-2: rgba(240,239,230,.82); --dim: rgba(240,239,230,.60);
    --hair: rgba(240,239,230,.25); --wash: rgba(240,239,230,.08);
    --on-accent: #23251D;
    --chip-red: #FF6B33; --chip-blue: #6B8CFF; --chip-green: #58B380; --on-chip: #1A1B16;
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink-2);
  background: var(--paper);
  line-height: 1.65;
  font-size: 16px;
  display: flex;
  min-height: 100vh;
}
:lang(he), [dir="rtl"] { font-family: var(--he); }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---- links: underline, invert on hover ---- */
a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { background: var(--ink); color: var(--paper); text-decoration: none; }
a.wiki { text-decoration-style: dotted; }
.broken { color: var(--dim); border-bottom: 1px dashed var(--dim); cursor: help; }

/* ---- titles: Recoleta 900, bigger, accent bar stamp ---- */
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; font-weight: 700; color: var(--ink); }
.lang-en, h1:lang(en), h2:lang(en), h3:lang(en) { font-family: var(--title-en); }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, .lang-he { font-family: var(--he); font-weight: 900; }
h1 { font-size: 2.6rem; font-weight: 900; letter-spacing: -.01em; }
main > h1::after {
  content: ''; display: block; width: 54px; height: 9px; margin-top: 12px;
  background: var(--accent); border: 2px solid var(--ink); border-radius: 3px;
  transform: rotate(-1.2deg); box-shadow: 2px 2px 0 var(--ink);
}
h2 { font-size: 1.4rem; margin-top: 1.6em; }
p, ul, ol { margin-bottom: 1em; }
article img { max-width: 100%; height: auto; border: var(--bw) solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.mono, .card-date, .np-bar-row .dim, .bc-dur { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* mono stamp label - the printed-tool look, used all over */
.stamp-label, .card-type, .micro-label span, .backlinks h2, .co-title, .size-ctl label {
  font-family: var(--mono); font-weight: 600; font-size: .68rem;
  text-transform: uppercase; letter-spacing: .12em;
}

/* ---- sidebar: a solid panel bolted to the page ---- */
.sidebar {
  width: var(--sb-w);
  flex-shrink: 0;
  border-inline-end: var(--bw) solid var(--ink);
  background: var(--paper);
  padding: 26px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 10;
}
.sb-handle {
  position: fixed; top: 0; bottom: 0; width: 10px;
  left: calc(var(--sb-w) - 5px);
  cursor: col-resize; z-index: 30;
}
.sb-handle:hover, .sb-handle.dragging { background: linear-gradient(90deg, transparent 3px, var(--accent) 3px 7px, transparent 7px); }
.site-name {
  font-family: var(--title-en);
  font-weight: 900;
  font-size: 1.7rem;
  text-decoration: none;
  margin-bottom: 18px;
  display: flex; align-items: baseline; gap: 8px;
}
.site-name::after {
  content: ''; width: 12px; height: 12px; flex-shrink: 0;
  background: var(--accent); border: 2px solid var(--ink); border-radius: 3px;
  transform: rotate(-8deg); box-shadow: 2px 2px 0 var(--ink);
  transition: transform .35s cubic-bezier(.2,.9,.3,1.4);
}
.site-name:hover { background: none; color: var(--ink); }
.site-name:hover::after { transform: rotate(172deg); }
.sidebar a {
  text-decoration: none; padding: 5px 10px; font-size: .95rem; font-weight: 500;
  border: var(--bw) solid transparent; border-radius: var(--r);
  transition: transform var(--t), box-shadow var(--t), background var(--t), color var(--t);
}
.sidebar a:hover {
  background: var(--surface); color: var(--ink);
  border-color: var(--ink); box-shadow: var(--shadow-sm);
  transform: translate(-1px,-1px);
}
.sidebar a:active { transform: translate(1px,1px); box-shadow: none; }
.sidebar a.active {
  font-weight: 700; background: var(--accent); color: var(--on-accent);
  border-color: var(--ink); box-shadow: var(--shadow-sm);
}
.sidebar details { margin: 0; }
.sidebar summary { list-style: none; cursor: pointer; display: flex; align-items: center; }
.sidebar summary::-webkit-details-marker { display: none; }
.sidebar summary::before { content: '▸'; font-size: .7em; margin-inline-end: 4px; color: var(--dim); transition: transform var(--t); }
.sidebar details[open] summary::before { content: '▾'; }
.sidebar .sub { display: block; margin-inline-start: 18px; font-size: .85rem; color: var(--dim); border-width: 1.5px; }
.sidebar .sub.empty { cursor: default; }

.menu-btn { display: none; }

.lang-toggle {
  margin-top: auto;
  align-self: flex-start;
  background: var(--surface);
  border: var(--bw) solid var(--ink);
  color: var(--ink);
  font-family: var(--he);
  font-weight: 700;
  font-size: .8rem;
  padding: 4px 16px;
  cursor: pointer;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t), box-shadow var(--t), background var(--t), color var(--t);
}
.lang-toggle:hover { background: var(--ink); color: var(--paper); transform: translate(-1px,-1px); box-shadow: var(--shadow); }
.lang-toggle:active { transform: translate(2px,2px); box-shadow: none; }

/* ---- home hero ---- */
.hero { margin: 6px 0 48px; max-width: 700px; }
.hero-title { font-family: var(--title-en); font-weight: 900; font-size: 3.2rem; line-height: 1.14; color: var(--ink); margin: 0; letter-spacing: -.015em; }
.hero-title::after { display: none; }
.hero-mark {
  background: var(--accent); color: var(--on-accent);
  padding: 0 12px 2px; border: var(--bw) solid var(--ink); border-radius: var(--r);
  box-shadow: 4px 4px 0 var(--ink); display: inline-block; transform: rotate(-1.4deg);
  transition: transform var(--t), box-shadow var(--t);
}
.hero-title:hover .hero-mark { transform: rotate(1deg) translate(-1px,-1px); box-shadow: 6px 6px 0 var(--ink); }
/* the mechanical rotating sign: chip presses in, word rolls, chip releases */
.hero-mark.ticking { transform: rotate(-1.4deg) translate(3px,3px); box-shadow: 0 0 0 var(--ink); }
.hm-win {
  display: inline-block; overflow: hidden; vertical-align: -0.155em;
  height: 1.16em; transition: width .26s cubic-bezier(.35,1.25,.4,1);
}
.hm-roll { display: block; transition: transform .3s cubic-bezier(.45,1.35,.4,1); }
/* max-content: each word keeps its own width, so the box can adapt per word */
.hm-word { display: block; width: max-content; height: 1.16em; line-height: 1.13; white-space: nowrap; }
.hero-sub { font-size: 1.1rem; color: var(--ink-2); margin: 18px 0 22px; max-width: 540px; }
.hero-cta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 22px; font-weight: 700; font-size: 1rem;
  background: var(--accent); color: var(--on-accent) !important;
  border: var(--bw) solid var(--ink); border-radius: 999px; text-decoration: none;
  box-shadow: var(--shadow); transition: transform var(--t), box-shadow var(--t);
}
.btn-primary:hover { background: var(--accent); color: var(--on-accent); transform: translate(-2px,-2px); box-shadow: var(--shadow-big); }
.btn-primary:active { transform: translate(3px,3px); box-shadow: none; }
.btn-ghost {
  display: inline-flex; align-items: center; height: 44px; padding: 0 18px;
  font-weight: 700; text-decoration: none;
  border: var(--bw) solid var(--ink); border-radius: 999px; background: var(--surface);
  box-shadow: var(--shadow-sm); transition: transform var(--t), box-shadow var(--t), background var(--t), color var(--t);
}
.btn-ghost:hover { background: var(--ink); color: var(--paper); transform: translate(-2px,-2px); box-shadow: var(--shadow); }
.btn-ghost:active { transform: translate(2px,2px); box-shadow: none; }
.micro-label { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; }
.micro-label span { color: var(--dim); white-space: nowrap; }
.micro-label::after { content: ''; flex: 1; height: 2px; background: var(--hair); border-radius: 2px; }

/* ---- main ---- */
main { flex: 1; padding: 48px min(5vw, 56px); min-width: 0; }
main > * { max-width: 1080px; margin-inline: auto; }
article p, article ul, article ol, article h2, article h3,
.project-toc, .index-list, .backlinks, .callout { max-width: 820px; }
.player, .yt, .sp-embed, .artist-block { max-width: 720px; }
.intro { font-size: 1.05rem; margin-bottom: 28px; }
.dim { color: var(--dim); font-size: .85rem; }

/* ---- cards (home feed): paper cutouts that press ---- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 20px;
}
.card {
  background: var(--surface);
  border: var(--bw) solid var(--ink);
  border-radius: var(--r);
  padding: 0 0 14px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 110px;
  box-shadow: var(--shadow);
  transition: transform var(--t), box-shadow var(--t);
}
.card:hover { background: var(--surface); color: inherit; transform: translate(-3px,-3px) rotate(-.35deg); box-shadow: var(--shadow-big); }
.card:active { transform: translate(3px,3px); box-shadow: none; }
.card-media {
  height: 92px; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px;
  background: var(--ink); border-bottom: var(--bw) solid var(--ink);
  border-radius: calc(var(--r) - 3px) calc(var(--r) - 3px) 0 0; overflow: hidden;
  margin-bottom: 8px;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s ease-out; }
.card:hover .card-media img { transform: scale(1.04); }
.card-media .tile-accent { display: flex; align-items: center; justify-content: center; background: var(--accent); color: var(--on-accent); }
.card-media .tile-accent svg { transform: scale(1.7); }
.card-media.hatch {
  display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(-45deg, transparent 0 7px, var(--hair) 7px 8px);
}
.card-media.hatch .stamp {
  width: 42px; height: 42px; border-radius: 999px;
  background: var(--surface); border: 2px solid var(--ink); color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  display: flex; align-items: center; justify-content: center; transition: all var(--t);
}
.card:hover .card-media.hatch .stamp { background: var(--accent); color: var(--on-accent); transform: rotate(-8deg); }
.card-type { color: var(--dim); display: flex; align-items: center; gap: 5px; padding: 0 16px; }
.card:hover .card-type { color: var(--dim); }
.card-title { font-size: 1.2rem; font-weight: 900; padding: 0 16px; line-height: 1.25; color: var(--ink); }
.card-title.lang-en { font-family: var(--title-en); }
.card-title.lang-he { font-family: var(--he); font-weight: 900; }
.card-sub { font-size: .85rem; color: var(--dim); padding: 0 16px; }
.card:hover .card-sub { color: var(--dim); }
.card-date { margin-top: auto; font-size: .7rem; color: var(--dim); padding: 10px 16px 0; border-top: 2px dashed var(--hair); margin-inline: 16px; padding-inline: 0; }
.card:hover .card-date { color: var(--dim); }

/* ---- index lists ---- */
.index-list { list-style: none; }
.index-list li { padding: 9px 2px; border-bottom: 2px solid var(--hair); display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }

/* ---- size control (tile size sliders) ---- */
.size-ctl { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; max-width: 340px; }
.size-ctl label { color: var(--dim); white-space: nowrap; }
.size-ctl input[type="range"] { flex: 1; accent-color: var(--ink); cursor: pointer; }
.size-ctl .hint { font-family: var(--mono); font-size: .62rem; color: var(--dim); white-space: nowrap; }

/* ---- music: the player is a device ---- */
.player {
  border: var(--bw) solid var(--ink); border-radius: calc(var(--r) + 4px);
  padding: 16px; position: sticky; top: 14px;
  background: var(--surface); z-index: 5;
  box-shadow: var(--shadow-big);
}
.player::before {
  content: 'CHOHOG · SND-01'; display: block;
  font-family: var(--mono); font-weight: 600; font-size: .6rem;
  letter-spacing: .18em; color: var(--dim); text-transform: uppercase;
  margin: -4px 0 8px;
}
.np { display: flex; gap: 14px; align-items: center; }
.np-cover {
  width: 64px; height: 64px; flex-shrink: 0;
  border: 2px solid var(--ink); border-radius: 6px;
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--dim); overflow: hidden; background: var(--paper);
}
.np-cover img { width: 100%; height: 100%; object-fit: cover; }
.np-info { flex: 1; min-width: 0; }
.np-title { font-weight: 900; font-family: var(--title-en); font-size: 1.2rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-bar-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: .78rem; }
.np-bar {
  flex: 1; height: 14px; background: var(--paper);
  border: 2px solid var(--ink); border-radius: 4px; cursor: pointer;
  padding: 2px; box-shadow: inset 2px 2px 0 var(--wash);
}
.np-fill {
  height: 100%; width: 0; border-radius: 2px;
  background: repeating-linear-gradient(-55deg, var(--accent) 0 6px, color-mix(in srgb, var(--accent) 78%, var(--ink)) 6px 9px);
  border-inline-end: 2px solid var(--ink);
  min-width: 0; transition: width .18s linear;
}
.np-controls { display: flex; align-items: center; gap: 7px; margin-top: 14px; }
.np-controls button, .np-controls a {
  background: var(--surface); border: 2px solid var(--ink); color: var(--ink); cursor: pointer;
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  padding: 0; text-decoration: none; border-radius: 7px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t), box-shadow var(--t), background var(--t), color var(--t);
}
.np-controls button:hover, .np-controls a:hover { background: var(--ink); color: var(--paper); transform: translate(-1px,-1px); box-shadow: var(--shadow); }
.np-controls button:active, .np-controls a:active { transform: translate(2px,2px); box-shadow: none; }
.np-controls .big {
  width: 50px; height: 50px; border-radius: 12px;
  background: var(--accent); color: var(--on-accent);
  border: var(--bw) solid var(--ink); box-shadow: var(--shadow);
}
.np-controls .big:hover { background: var(--accent); color: var(--on-accent); transform: translate(-2px,-2px); box-shadow: var(--shadow-big); }
.np-controls .big:active { transform: translate(3px,3px); box-shadow: none; }
.np-controls button.on { background: var(--ink); color: var(--paper); }
.np-spacer { flex: 1; }

/* floating "now playing" pill (visible off the music page while audio plays) */
.np-pill {
  position: fixed; bottom: 16px; inset-inline-end: 16px; z-index: 40;
  display: none; align-items: center; gap: 8px;
  background: var(--accent); color: var(--on-accent);
  border: var(--bw) solid var(--ink); border-radius: 999px;
  padding: 7px 16px; font-weight: 700; font-size: .85rem;
  box-shadow: var(--shadow); cursor: pointer; text-decoration: none;
  max-width: min(70vw, 340px);
}
.np-pill.show { display: flex; }
.np-pill:hover { background: var(--accent); color: var(--on-accent); transform: translate(-1px,-1px); box-shadow: var(--shadow-big); }
.np-pill:active { transform: translate(2px,2px); box-shadow: none; }
.np-pill .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-pill .eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; flex-shrink: 0; }
.np-pill .eq i { width: 3px; background: var(--on-accent); animation: eq 0.9s ease-in-out infinite; border-radius: 1px; }
.np-pill .eq i:nth-child(2) { animation-delay: .2s; } .np-pill .eq i:nth-child(3) { animation-delay: .45s; }
@keyframes eq { 0%,100% { height: 4px; } 50% { height: 12px; } }

/* ---- beat shapes (placeholder covers) ---- */
.beat-shape { display: flex; align-items: center; justify-content: center; position: relative; }
.beat-shape svg { display: block; overflow: visible; }
.beat-shape.glyph {
  font-family: var(--title-en); font-weight: 900; line-height: 1;
  color: var(--accent); -webkit-text-stroke: 2px var(--ink); font-size: 64px;
}
.np-cover .beat-shape.glyph { font-size: 34px; -webkit-text-stroke: 1.5px var(--ink); }
@keyframes chSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
body.is-playing .beat-card.active .beat-shape,
body.is-playing .np-cover .beat-shape { animation: chSpin 2.2s linear infinite; }

/* ---- beat tools: view toggle + sort + filter ---- */
.beat-tools { display: flex; align-items: center; gap: 10px; margin: 16px 0 2px; flex-wrap: wrap; }
.beat-tools .seg { display: inline-flex; border: 2px solid var(--ink); border-radius: 8px; overflow: hidden; box-shadow: var(--shadow-sm); background: var(--surface); }
.beat-tools .seg button {
  background: var(--surface); color: var(--ink); border: none; cursor: pointer;
  width: 36px; height: 32px; display: flex; align-items: center; justify-content: center;
  transition: background var(--t), color var(--t);
}
.beat-tools .seg button + button { border-inline-start: 2px solid var(--ink); }
.beat-tools .seg button.on { background: var(--accent); color: var(--on-accent); }
.beat-tools .seg button:not(.on):hover { background: var(--ink); color: var(--paper); }
.beat-tools select {
  appearance: none; -webkit-appearance: none;
  font-family: var(--mono); font-weight: 600; font-size: .74rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink); background: var(--surface);
  border: 2px solid var(--ink); border-radius: 999px; padding: 5px 30px 5px 14px;
  box-shadow: var(--shadow-sm); cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2323251D' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 10px;
}
.beat-tools select:hover { transform: translate(-1px,-1px); box-shadow: var(--shadow); }
.beat-tools select:active { transform: translate(1px,1px); box-shadow: none; }
body.beats-list-view .size-ctl { display: none; }

/* ---- beat list view ---- */
.beat-list { display: block; margin-top: 14px; border: 2px solid var(--ink); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; }
.beat-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: var(--surface); color: var(--ink); border: none; cursor: pointer; text-align: start;
  font-family: inherit; font-size: inherit;
  padding: 9px 14px; border-bottom: 2px solid var(--hair);
  transition: background var(--t);
}
.beat-list .beat-row:last-child { border-bottom: none; }
.beat-row:hover { background: var(--wash); }
.beat-row:active { background: var(--wash); transform: translate(1px,1px); }
.beat-row.active { background: var(--wash); box-shadow: inset 4px 0 0 var(--accent); }
.br-ico { width: 30px; height: 30px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--ink); border-radius: 6px; overflow: hidden; background: var(--paper); }
.br-ico img { width: 100%; height: 100%; object-fit: cover; }
.br-ico .beat-shape.glyph { font-size: 18px; -webkit-text-stroke: 1px var(--ink); }
.br-title { flex: 1; font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.br-meta { font-size: .68rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 34%; }
.br-dur { font-size: .75rem; flex-shrink: 0; }
body.is-playing .beat-row.active .beat-shape { animation: chSpin 2.2s linear infinite; }

/* ---- beat cards grid (resizable via --beat-min) ---- */
.beat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--beat-min), 1fr));
  gap: 16px; margin-top: 18px;
}
.beat-card {
  background: var(--surface); border: 2px solid var(--ink); color: var(--ink);
  border-radius: var(--r);
  padding: 0 0 10px; cursor: pointer; text-align: start;
  display: flex; flex-direction: column; gap: 6px;
  font-family: inherit; font-size: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t), box-shadow var(--t);
}
.beat-card:hover { transform: translate(-2px,-2px) rotate(-.4deg); box-shadow: var(--shadow); }
.beat-card:active { transform: translate(2px,2px); box-shadow: none; }
.beat-card.active { background: var(--paper); box-shadow: var(--shadow-sm), inset 0 0 0 2px var(--accent); }
.bc-cover {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-bottom: 2px solid var(--ink); color: var(--dim);
  border-radius: calc(var(--r) - 2px) calc(var(--r) - 2px) 0 0;
  position: relative; overflow: hidden;
}
.bc-cover img { width: 100%; height: 100%; object-fit: cover; }
.bc-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0); color: transparent; transition: all var(--t);
}
.beat-card:hover .bc-play { background: rgba(35,37,29,.55); color: #fff; }
.beat-card:hover .bc-cover .beat-shape ~ .bc-play,
.bc-cover .beat-shape + .bc-play { background: none; color: transparent; }
.bc-title { font-weight: 600; font-size: .9rem; padding: 0 10px; }
.bc-dur { font-size: .75rem; padding: 0 10px; }

/* ---- photos: flowing masonry (resizable via --photo-col) ---- */
.photo-stream {
  columns: var(--photo-col);
  column-gap: 14px;
}
.photo-stream a {
  display: block; line-height: 0; margin-bottom: 14px;
  border: 2px solid var(--ink); border-radius: var(--r); overflow: hidden;
  break-inside: avoid; box-shadow: var(--shadow-sm);
  transition: transform var(--t), box-shadow var(--t);
}
.photo-stream a:hover { background: none; transform: translate(-2px,-2px) rotate(-.3deg); box-shadow: var(--shadow); }
.photo-stream a:active { transform: translate(2px,2px); box-shadow: none; }
.photo-stream img { width: 100%; height: auto; }
.photo-tags { margin: 14px 0 22px; display: flex; gap: 8px; flex-wrap: wrap; }
.photo-tags a, .project-toc a {
  font-family: var(--mono); font-weight: 500; font-size: .78rem;
  text-decoration: none; border: 2px solid var(--ink); padding: 3px 14px; border-radius: 999px;
  background: var(--surface); box-shadow: 2px 2px 0 var(--ink);
  transition: transform var(--t), box-shadow var(--t), background var(--t), color var(--t);
}
.photo-tags a:hover, .project-toc a:hover { background: var(--ink); color: var(--paper); transform: translate(-1px,-1px); box-shadow: var(--shadow-sm); }
.photo-tags a:active, .project-toc a:active { transform: translate(1px,1px); box-shadow: none; }
.photo-tags a.on { background: var(--accent); color: var(--on-accent); }
figure.photo-full img { max-width: 100%; height: auto; border: 2px solid var(--ink); border-radius: var(--r); }
figure.photo-full figcaption { font-size: .85rem; color: var(--dim); margin-top: 8px; }

/* ---- projects single page ---- */
.project-toc { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 32px; }
.project-block { padding: 36px 0; border-top: 2px dashed var(--hair); }
.project-block:first-of-type { border-top: none; }
.project-block h2 { font-size: 1.6rem; margin-top: 0; scroll-margin-top: 20px; }

/* ---- backlinks: an obsidian-style panel ---- */
.backlinks {
  margin-top: 40px; padding: 14px 18px 8px;
  border: 2px solid var(--ink); border-radius: var(--r);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.backlinks h2 { color: var(--dim); margin: 0 0 8px; display: flex; align-items: center; gap: 6px; }
.backlinks h2::before { content: '⇄'; font-size: 1.1em; color: var(--chip-blue); }
.backlinks ul { list-style: none; margin: 0 0 8px; }
.backlinks li { padding: 2px 0; }

/* ---- callouts (obsidian style, from markdown) ---- */
.callout {
  border: 2px solid var(--ink); border-radius: var(--r);
  background: var(--surface); box-shadow: var(--shadow-sm);
  padding: 12px 16px; margin: 1.2em 0;
  border-inline-start-width: 8px;
}
.callout > :last-child { margin-bottom: 0; }
.co-title { display: flex; align-items: center; gap: 7px; color: var(--ink); margin-bottom: 6px; }
.co-title::before { font-size: 1rem; }
.callout-tip { border-inline-start-color: var(--accent); }
.callout-tip .co-title::before { content: '☀'; color: var(--accent); }
.callout-idea { border-inline-start-color: var(--chip-blue); }
.callout-idea .co-title::before { content: '✦'; color: var(--chip-blue); }
.callout-warning { border-inline-start-color: var(--chip-red); }
.callout-warning .co-title::before { content: '▲'; color: var(--chip-red); }
.callout-note { border-inline-start-color: var(--ink); }
.callout-note .co-title::before { content: '✎'; }

/* ---- hover preview popover ---- */
.peek {
  position: fixed; z-index: 60; width: 300px; max-width: 84vw;
  background: var(--surface); border: var(--bw) solid var(--ink);
  border-radius: var(--r); box-shadow: var(--shadow);
  padding: 12px 14px; pointer-events: none;
  opacity: 0; transform: translateY(4px) scale(.98);
  transition: opacity .12s ease-out, transform .12s ease-out;
}
.peek.show { opacity: 1; transform: none; }
.peek .pk-type { font-family: var(--mono); font-weight: 600; font-size: .62rem; text-transform: uppercase; letter-spacing: .12em; color: var(--dim); display: block; margin-bottom: 3px; }
.peek .pk-title { font-family: var(--title-en); font-weight: 900; font-size: 1.05rem; color: var(--ink); line-height: 1.25; display: block; }
.peek .pk-title[dir="rtl"] { font-family: var(--he); }
.peek .pk-ex { font-size: .82rem; color: var(--ink-2); line-height: 1.5; display: block; margin-top: 5px; }
.peek .pk-date { font-family: var(--mono); font-size: .68rem; color: var(--dim); display: block; margin-top: 6px; }

/* ---- garden map ---- */
.garden-wrap {
  border: var(--bw) solid var(--ink); border-radius: var(--r);
  background: var(--surface); box-shadow: var(--shadow);
  overflow: hidden; position: relative;
  height: min(72vh, 760px); max-width: 1080px;
  touch-action: none;
}
.garden-wrap canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.garden-wrap canvas.grabbing { cursor: grabbing; }
.garden-hint {
  position: absolute; bottom: 10px; inset-inline-start: 12px;
  font-family: var(--mono); font-size: .62rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--dim); pointer-events: none;
}
.garden-legend { display: flex; gap: 14px; flex-wrap: wrap; margin: 12px 2px 0; }
.garden-legend span { font-family: var(--mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); display: inline-flex; align-items: center; gap: 6px; }
.garden-legend i { width: 10px; height: 10px; border-radius: 999px; border: 1.5px solid var(--ink); display: inline-block; }

/* ---- video embeds ---- */
.yt { aspect-ratio: 16/9; max-width: 640px; margin: 1em 0; border: 2px solid var(--ink); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-sm); }
.yt iframe { width: 100%; height: 100%; display: block; border: 0; }

/* ---- productions ---- */
.artist-block { padding: 10px 0 4px; border: none; }
.artist-block h3 { font-family: var(--he); font-weight: 900; margin-bottom: 10px; font-size: 1.15rem; }
.sp-embed { display: block; margin-bottom: 10px; border-radius: 12px; }

/* ---- bilingual toggle ---- */
html[data-lang="en"] .i18n-he { display: none; }
html[data-lang="he"] .i18n-en { display: none; }
html:not([data-lang]) .i18n-he { display: none; }

/* ---- mock image placeholders (about) ---- */
.mock-img {
  width: 280px; height: 280px; max-width: 100%;
  border: 2px dashed var(--dim); border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  color: var(--dim); font-size: .8rem;
  margin: 18px 0;
}
.mock-img.small { width: 190px; height: 190px; }
.mock-img::after { content: attr(data-label); }

/* ---- lightbox ---- */
.lb {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(20,21,16,.93);
  display: flex; align-items: center; justify-content: center;
}
.lb[hidden] { display: none; }
.lb figure { max-width: min(92vw, 1100px); max-height: 92vh; margin: 0; text-align: center; }
.lb img { max-width: 100%; max-height: 84vh; object-fit: contain; border: 3px solid #fff; border-radius: 6px; }
.lb figcaption { color: rgba(255,255,255,.65); font-size: .8rem; margin-top: 10px; letter-spacing: .02em; font-family: var(--mono); }
.lb button {
  position: absolute; background: none; border: none; color: rgba(255,255,255,.8);
  font-size: 34px; cursor: pointer; padding: 18px; line-height: 1;
}
.lb button:hover { color: #fff; }
.lb-close { top: 8px; inset-inline-end: 12px; }
.lb-prev { inset-inline-start: 6px; top: 50%; transform: translateY(-50%); }
.lb-next { inset-inline-end: 6px; top: 50%; transform: translateY(-50%); }

/* ---- building with AI cards ---- */
.ai-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px; margin-top: 22px;
}
.ai-card {
  border: var(--bw) solid var(--ink); border-radius: var(--r);
  background: var(--surface); box-shadow: var(--shadow);
  text-decoration: none; overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform var(--t), box-shadow var(--t);
}
.ai-card:hover { background: var(--surface); color: inherit; transform: translate(-3px,-3px) rotate(-.3deg); box-shadow: var(--shadow-big); }
.ai-card:active { transform: translate(3px,3px); box-shadow: none; }
.ai-shot { aspect-ratio: 16/10; overflow: hidden; border-bottom: var(--bw) solid var(--ink); display: block; }
.ai-shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; transition: transform .25s ease-out; }
.ai-card:hover .ai-shot img { transform: scale(1.03); }
.ai-noshot { display: flex; align-items: center; justify-content: center; height: 100%; font-family: var(--title-en); font-weight: 700; font-size: 1.4rem; color: var(--dim); background: repeating-linear-gradient(-45deg, transparent 0 7px, var(--hair) 7px 8px); }
.ai-body { display: flex; flex-direction: column; gap: 5px; padding: 13px 15px 15px; }
.ai-title { font-family: var(--title-en); font-weight: 900; font-size: 1.1rem; color: var(--ink); }
.ai-desc { font-size: .85rem; color: var(--dim); line-height: 1.45; }
.ai-body .card-date { margin-top: 6px; border-top: 2px dashed var(--hair); padding-top: 8px; }

/* ---- view transition cross-fade (instant nav) ---- */
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) { animation: vtOut .09s ease-in both; }
  ::view-transition-new(root) { animation: vtIn .12s ease-out both; }
  @keyframes vtOut { to { opacity: 0; } }
  @keyframes vtIn { from { opacity: 0; transform: translateY(3px); } }
}

/* ---- mobile ---- */
@media (max-width: 720px) {
  html, body { overflow-x: clip; }
  body { display: block; }
  .menu-btn {
    display: block;
    position: fixed;
    top: 12px;
    inset-inline-end: 12px;
    z-index: 20;
    background: var(--surface);
    color: var(--ink);
    border: 2px solid var(--ink);
    border-radius: 7px;
    font-size: 18px;
    padding: 4px 11px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
  }
  .menu-btn:active { transform: translate(2px,2px); box-shadow: none; }
  .sidebar {
    display: none;
    width: 100% !important;
    height: auto;
    position: static;
    border-inline-end: none;
    border-bottom: var(--bw) solid var(--ink);
  }
  body.nav-open .sidebar { display: flex; }
  .sb-handle { display: none; }
  main { padding: 26px 16px; }
  h1 { font-size: 2.1rem; }
  .hero { margin-bottom: 34px; }
  .hero-title { font-size: clamp(1.7rem, 8.5vw, 2.3rem); }

  /* cards become compact rows: media left, facts right */
  .cards { grid-template-columns: 1fr; gap: 12px; }
  .card {
    display: grid; grid-template-columns: 100px 1fr;
    grid-auto-rows: min-content; column-gap: 14px; align-content: start;
    padding: 0 12px 0 0; min-height: 104px;
    box-shadow: var(--shadow-sm);
  }
  .card:hover { transform: none; box-shadow: var(--shadow-sm); }
  .card:active { transform: translate(2px,2px); box-shadow: none; }
  .card-media {
    grid-row: 1 / span 4; width: 100px; height: 100%; min-height: 104px;
    display: block; margin: 0;
    border-bottom: none; border-inline-end: var(--bw) solid var(--ink);
    border-radius: calc(var(--r) - 3px) 0 0 calc(var(--r) - 3px);
  }
  .card-media img { height: 100%; }
  .card-media img:not(:first-child), .card-media .tile-accent { display: none; }
  .card-media.hatch { display: flex; }
  .card-type { padding: 10px 0 0; }
  .card-title { padding: 0; font-size: 1.08rem; }
  .card-sub { padding: 0; }
  .card-date { margin: 2px 0 10px; padding: 0; border-top: none; }

  /* the player: tighter hardware, everything fits */
  .player { padding: 12px; top: 8px; box-shadow: var(--shadow); }
  .np { gap: 11px; }
  .np-cover { width: 52px; height: 52px; }
  .np-title { font-size: 1.05rem; }
  .np-controls { gap: 5px; margin-top: 11px; }
  .np-controls button, .np-controls a { width: 34px; height: 34px; border-radius: 6px; }
  .np-controls .big { width: 44px; height: 44px; border-radius: 10px; }
  .size-ctl { max-width: none; }
  .size-ctl .hint { display: none; }
  .beat-grid { grid-template-columns: repeat(auto-fill, minmax(min(var(--beat-min), 43vw), 1fr)); gap: 12px; }
  .photo-stream { columns: min(var(--photo-col), 86vw); }

  .np-pill { bottom: 12px; inset-inline-end: 12px; }
  .garden-wrap { height: 68vh; }
  .backlinks, .callout { box-shadow: var(--shadow-sm); }
}
