/* ==========================================================================
   ME Makerspace — main.css
   Palette comes from the room itself: the slate wall paint, the oak worktops,
   the black stools and the yellow of the stickers on the walls.
   One typeface, Archivo, at three widths: expanded for headings (like the
   nameplates on the machines), normal for reading, condensed for small notes.
   ========================================================================== */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-var.woff2") format("woff2");
  font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Heebo";
  src: url("../fonts/heebo-hebrew-var.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}

:root {
  --wall: #cdd6d6;          /* page: the wall paint, a few steps lighter */
  --wall-hi: #dde4e3;
  --wall-lo: #b9c5c6;
  --ink: #141a1c;
  --ink-2: #47545a;
  --sheet: #f5f4ef;         /* cards */
  --sheet-2: #e9e8e1;
  --oak: #dcbd8d;
  --oak-ink: #3d2f14;
  --yellow: #ffc61a;
  --on-yellow: #17130a;
  --magenta: #e3256b;
  --rule: rgba(20, 26, 28, .2);
  --shadow: 0 24px 60px -24px rgba(22, 38, 42, .5), 0 2px 6px rgba(22, 38, 42, .08);

  --display: "Archivo", "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --text: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --he: "Heebo", "Arial Hebrew", "Noto Sans Hebrew", Arial, sans-serif;

  --pad: clamp(20px, 5vw, 72px);
  --nav-h: 64px;
  --seg: 92vh;              /* scroll distance per stop of the tour */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --wall: #162023; --wall-hi: #1e2b2f; --wall-lo: #0f1719;
    --ink: #e9efee; --ink-2: #a2b0b2;
    --sheet: #212c30; --sheet-2: #2a373b;
    --oak: #d9bd8c; --oak-ink: #2c2210;
    --rule: rgba(233, 239, 238, .2);
    --shadow: 0 24px 60px -24px rgba(0, 0, 0, .8), 0 2px 6px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --wall: #162023; --wall-hi: #1e2b2f; --wall-lo: #0f1719;
  --ink: #e9efee; --ink-2: #a2b0b2;
  --sheet: #212c30; --sheet-2: #2a373b;
  --oak: #d9bd8c; --oak-ink: #2c2210;
  --rule: rgba(233, 239, 238, .2);
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, .8), 0 2px 6px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }   /* in-page links are scrolled by main.js, so deep links land instantly */
body {
  margin: 0; background: var(--wall); color: var(--ink);
  font: 400 1.0625rem/1.5 var(--text); font-stretch: 100%;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--yellow); color: var(--on-yellow); }

.skip {
  position: fixed; left: 12px; top: -80px; z-index: 100; padding: 10px 16px; border-radius: 10px;
  background: var(--yellow); color: var(--on-yellow); font-weight: 650; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  min-height: 52px; padding: 0 22px; border: 0; border-radius: 14px; cursor: pointer;
  font: 650 1rem/1 var(--text); font-stretch: 108%; text-decoration: none; white-space: nowrap;
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:active { transform: scale(.98); }
.btn--go { background: var(--yellow); color: var(--on-yellow); box-shadow: 0 10px 24px -12px rgba(160, 110, 0, .9); }
.btn--go:hover { background: #ffd447; }
.btn--quiet { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn--quiet:hover { background: var(--ink); color: var(--wall); }
.i-pause { display: none; }
.is-flying .i-play { display: none; }
.is-flying .i-pause { display: block; }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; flex: none;
  border: 0; border-radius: 12px; background: transparent; color: var(--ink); cursor: pointer;
  transition: background-color .15s ease;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { background: color-mix(in srgb, var(--ink) 12%, transparent); }
.icon-btn--go { background: var(--yellow); color: var(--on-yellow); }
.icon-btn--go:hover { background: #ffd447; }
.icon-btn[disabled] { opacity: .35; cursor: default; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 60; height: calc(var(--nav-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) var(--pad) 0; display: flex; align-items: center; gap: 12px;
  transition: background-color .25s ease, box-shadow .25s ease;
}
.nav.is-solid {
  background: color-mix(in srgb, var(--wall) 84%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 1px 0 var(--rule);
}
.brand { display: inline-flex; align-items: center; gap: 12px; margin-inline-end: auto; text-decoration: none; }
.brand__mark { width: 38px; height: 20px; }
.brand__name { font: 800 1.02rem/1 var(--display); font-stretch: 125%; letter-spacing: -.01em; white-space: nowrap; }
.nav__links { display: flex; gap: clamp(16px, 2.4vw, 34px); margin-inline-end: 10px; }
.nav__links a {
  font-weight: 550; font-size: .96rem; text-decoration: none; padding: 8px 0;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat; transition: background-size .2s ease;
}
.nav__links a:hover { background-size: 100% 2px; }
.nav__menu { display: none; }

/* ---------- the tour: a pinned stage plus the scroll that drives it ---------- */
.tour { position: relative; }
.stage {
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden;
  background: radial-gradient(120% 95% at 62% 38%, var(--wall-hi) 0%, var(--wall) 55%, var(--wall-lo) 100%);
}
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage__photo { display: none; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.no-webgl #scene { display: none; }
.no-webgl .stage__photo { display: block; }
.stage__scrim {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top right, color-mix(in srgb, var(--wall) 92%, transparent) 0%, color-mix(in srgb, var(--wall) 40%, transparent) 30%, transparent 56%);
  transition: opacity .5s ease;
}
.is-touring .stage__scrim { opacity: 0; }
.no-webgl .stage__scrim { opacity: 1; background: linear-gradient(to top right, color-mix(in srgb, var(--wall) 95%, transparent) 0%, color-mix(in srgb, var(--wall) 58%, transparent) 42%, color-mix(in srgb, var(--wall) 10%, transparent) 100%); }
.tour__track { height: calc(var(--seg) * 11); }
.tour__mark { position: absolute; left: 0; top: calc(var(--seg) * var(--i)); width: 1px; height: 1px; pointer-events: none; }

/* hero */
.hero {
  position: absolute; left: var(--pad); right: var(--pad); bottom: clamp(36px, 9vh, 92px);
  max-width: 760px; transition: opacity .45s ease, transform .6s cubic-bezier(.2, .7, .2, 1);
}
.hero h1 {
  font: 800 clamp(2.5rem, 6.1vw, 5.6rem)/.93 var(--display); font-stretch: 118%; letter-spacing: -.035em;
  max-width: 10.5em; text-wrap: balance;
}
.hero__lede { margin-top: clamp(16px, 2.4vh, 26px); max-width: 33em; font-size: clamp(1rem, 1.25vw, 1.16rem); line-height: 1.5; text-wrap: pretty; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(20px, 3.2vh, 32px); }
.is-touring .hero { opacity: 0; transform: translateY(-16px); pointer-events: none; }
/* one opening sequence: the drawing appears first, then the words, as the room rises */
.js .hero > * { opacity: 0; transform: translateY(14px); }
.js.is-rising .hero > * { opacity: 1; transform: none; transition: opacity .7s ease, transform .9s cubic-bezier(.2, .7, .2, 1); }
.js.is-rising .hero > *:nth-child(2) { transition-delay: .22s; }
.js.is-rising .hero > *:nth-child(3) { transition-delay: .44s; }
.js.is-quick .hero > * { transition-delay: 0s !important; }

.cue {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: .8rem; font-stretch: 84%; font-weight: 550; letter-spacing: .02em; color: var(--ink-2);
  opacity: 0; transition: opacity .5s ease;
}
.is-live .cue { opacity: 1; }
.is-touring .cue { opacity: 0; }
.cue span { width: 1.5px; height: 30px; background: linear-gradient(var(--ink-2), var(--ink-2)) 0 0 / 100% 40% no-repeat; animation: cue 1.8s cubic-bezier(.6, 0, .3, 1) infinite; }
@keyframes cue { 0% { background-position: 0 -14px; } 100% { background-position: 0 34px; } }

/* stops */
.stop {
  position: absolute; left: var(--pad); top: calc(50% + 22px); width: min(430px, 36vw);
  transform: translateY(calc(-50% + 20px)); opacity: 0; pointer-events: none;
  transition: opacity .32s ease, transform .5s cubic-bezier(.2, .7, .2, 1);
}
.stop.is-past { transform: translateY(calc(-50% - 20px)); }
.stop.is-on { opacity: 1; transform: translateY(-50%); pointer-events: auto; }
.card { background: var(--sheet); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; }
.card__photos { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; height: clamp(130px, 25vh, 220px); background: var(--sheet); }
.card__photos:has(.shot:nth-child(2)) { grid-template-columns: 1.55fr 1fr; grid-auto-flow: row; }
.shot { display: block; padding: 0; border: 0; background: var(--sheet-2); cursor: zoom-in; overflow: hidden; min-width: 0; min-height: 0; }
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.shot:hover img { transform: scale(1.04); }
.shot:focus-visible { outline-offset: -3px; }
.card__body { padding: clamp(16px, 2.4vh, 24px) clamp(18px, 1.8vw, 26px) clamp(18px, 2.6vh, 26px); }
.card__no { display: flex; align-items: baseline; gap: 8px; color: var(--ink-2); font-size: .82rem; font-stretch: 84%; font-weight: 550; }
.card__no b { font: 800 2.5rem/.85 var(--display); font-stretch: 125%; letter-spacing: -.04em; color: var(--ink); font-variant-numeric: tabular-nums; }
.card__title { margin-top: 12px; font: 750 1.5rem/1.08 var(--display); font-stretch: 116%; letter-spacing: -.02em; }
.card__text { margin-top: 9px; font-size: .98rem; line-height: 1.5; text-wrap: pretty; }
.card__list { margin-top: 13px; display: grid; gap: 5px; font-size: .9rem; font-stretch: 94%; font-weight: 500; }
.card__list li { position: relative; padding-left: 17px; }
.card__list li::before { content: ""; position: absolute; left: 0; top: .5em; width: 8px; height: 8px; border-radius: 2px; background: var(--yellow); box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 55%, transparent); }
.card__link {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; font-weight: 650; font-size: .95rem;
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; text-decoration-color: var(--yellow);
}
.card__link::before { content: ""; width: 16px; height: 16px; background: currentColor; -webkit-mask: var(--i-down) center / contain no-repeat; mask: var(--i-down) center / contain no-repeat; }
.card__link--to::before { -webkit-mask-image: var(--i-user); mask-image: var(--i-user); }
.card__link:hover { text-decoration-color: currentColor; }
:root {
  --i-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 4v11m0 0l-4.5-4.5M12 15l4.5-4.5M5 19.5h14' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --i-user: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='8' r='4' fill='none' stroke='%23000' stroke-width='2.4'/%3E%3Cpath d='M4.5 20.5c1-4 4-5.5 7.5-5.5s6.5 1.5 7.5 5.5' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* HUD: the plan with a live camera marker, and the transport */
.hud {
  position: absolute; right: var(--pad); bottom: clamp(18px, 4.5vh, 44px); display: grid; justify-items: end; gap: 10px;
  opacity: 0; transition: opacity .5s ease;
}
.is-live .hud { opacity: 1; }
.map {
  position: relative; width: clamp(84px, 13.5vh, 112px); aspect-ratio: 384 / 918; border-radius: 14px;
  background: color-mix(in srgb, var(--sheet) 82%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); transition: opacity .4s ease, transform .5s cubic-bezier(.2, .7, .2, 1); pointer-events: none;
}
.is-touring .map { opacity: 1; transform: none; pointer-events: auto; }
.map__plan { position: absolute; inset: 7px; background: var(--ink); opacity: .5; -webkit-mask: url("../img/plan-room.webp") center / 100% 100% no-repeat; mask: url("../img/plan-room.webp") center / 100% 100% no-repeat; }
.map__dot {
  position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%;
}
.map__dot::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 2px var(--sheet); transition: inset .2s ease, background-color .2s ease; }
.map__dot:hover::after { inset: 5px; }
.map__dot.is-on::after { inset: 4px; background: var(--yellow); box-shadow: 0 0 0 2px var(--on-yellow); }
.map__cam { position: absolute; left: 0; top: 0; width: 40px; height: 40px; margin: -20px 0 0 -20px; pointer-events: none; opacity: 0; transition: opacity .3s ease; will-change: transform; }
.map__cam.is-on { opacity: 1; }
.transport {
  display: flex; align-items: center; gap: 2px; padding: 5px; border-radius: 17px;
  background: color-mix(in srgb, var(--sheet) 86%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: var(--shadow);
}
.transport__no { min-width: 5.6em; text-align: center; font: 700 .9rem/1 var(--display); font-stretch: 112%; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.transport .icon-btn--go { margin-left: 4px; }

/* ---------- sections below the tour ---------- */
.words { padding: clamp(56px, 10vh, 120px) 0 clamp(20px, 4vh, 40px); overflow: hidden; }
.words__strip { display: flex; gap: .42em; width: max-content; padding-left: var(--pad); font: 900 clamp(3.4rem, 11vw, 10rem)/1 var(--display); font-stretch: 125%; letter-spacing: -.04em; will-change: transform; }
.w { display: inline-block; transform: skewX(-9deg); paint-order: stroke fill; -webkit-text-stroke: .075em var(--ink); padding: .08em .06em; }
.w--a { color: var(--yellow); }
.w--b { color: var(--ink); -webkit-text-stroke-width: 0; }
.w--c { color: var(--magenta); }
.w--d { color: var(--wall); }
.words__note { margin: clamp(22px, 4vh, 44px) var(--pad) 0; max-width: 36em; font-size: clamp(1.1rem, 1.6vw, 1.4rem); line-height: 1.42; font-weight: 450; text-wrap: pretty; }

.block { padding: clamp(64px, 11vh, 132px) var(--pad) 0; max-width: 1320px; margin-inline: auto; scroll-margin-top: 0; }
.block__head { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(20px, 5vw, 80px); align-items: end; margin-bottom: clamp(28px, 5vh, 56px); }
.block h2 { font: 800 clamp(2.1rem, 4.6vw, 4.1rem)/.96 var(--display); font-stretch: 116%; letter-spacing: -.035em; text-wrap: balance; }
.block__head p { max-width: 30em; font-size: 1.08rem; color: var(--ink-2); text-wrap: pretty; padding-bottom: .35em; }

/* machines and safety: a schedule, like the one on an architect's sheet */
.index { border-bottom: 1.5px solid var(--ink); }
.row {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(170px, .7fr) minmax(0, auto); gap: 14px clamp(16px, 3vw, 40px); align-items: center;
  padding: 20px 0; border-top: 1.5px solid var(--ink); scroll-margin-top: calc(var(--nav-h) + 24px);
}
.row:target, .row.is-target { background: linear-gradient(90deg, color-mix(in srgb, var(--yellow) 42%, transparent), transparent 72%); }
.row h3 { font: 720 clamp(1.2rem, 1.9vw, 1.55rem)/1.1 var(--display); font-stretch: 112%; letter-spacing: -.02em; }
.row__what p { margin-top: 4px; color: var(--ink-2); font-size: .96rem; }
.row__where { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: .93rem; text-decoration: none; justify-self: start; padding: 6px 0; }
.row__where b { display: inline-grid; place-items: center; min-width: 2.3em; height: 2.3em; border-radius: 50%; background: var(--ink); color: var(--wall); font: 750 .82rem/1 var(--display); font-stretch: 110%; font-variant-numeric: tabular-nums; transition: background-color .15s ease, color .15s ease; }
a.row__where:hover b { background: var(--yellow); color: var(--on-yellow); }
a.row__where:hover { text-decoration: underline; text-underline-offset: 4px; }
.row__where--none { color: var(--ink-2); font-weight: 500; }
.row__docs { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.doc {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 12px; border-radius: 12px;
  background: var(--sheet); font-weight: 620; font-size: .93rem; text-decoration: none; white-space: nowrap;
  box-shadow: 0 1px 0 var(--rule); transition: background-color .15s ease, color .15s ease;
}
.doc svg { width: 18px; height: 18px; flex: none; }
.doc small { font-size: .7rem; font-weight: 700; font-stretch: 80%; letter-spacing: .04em; padding: 2px 5px; border-radius: 5px; background: color-mix(in srgb, var(--ink) 12%, transparent); }
.doc:hover { background: var(--yellow); color: var(--on-yellow); }

/* workshops */
.sessions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 2vw, 26px); margin-bottom: clamp(26px, 4vh, 40px); }
.session { background: var(--sheet); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; }
.session img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.session__body { padding: 20px 22px 24px; }
.session__when { display: inline-block; padding: 4px 9px; border-radius: 7px; background: var(--oak); color: var(--oak-ink); font-size: .8rem; font-weight: 650; font-stretch: 90%; }
.session h3 { margin-top: 12px; font: 720 1.28rem/1.14 var(--display); font-stretch: 110%; letter-spacing: -.02em; text-wrap: balance; }
.session__body > p:last-child { margin-top: 8px; color: var(--ink-2); font-size: .97rem; }

/* Nitai */
.person { display: grid; grid-template-columns: minmax(180px, 300px) minmax(0, 1fr); gap: clamp(24px, 6vw, 90px); align-items: center; }
.person__tile { aspect-ratio: 1; border-radius: 28px; background: var(--oak); color: var(--oak-ink); display: grid; place-items: center; font: 850 clamp(4rem, 10vw, 8rem)/1 var(--display); font-stretch: 125%; letter-spacing: -.06em; }
.person__text p { margin: clamp(16px, 2.6vh, 26px) 0 clamp(22px, 3.4vh, 34px); max-width: 30em; font-size: clamp(1.08rem, 1.5vw, 1.3rem); line-height: 1.45; text-wrap: pretty; }

/* footer */
.foot { margin-top: clamp(80px, 14vh, 170px); padding: 0 var(--pad) calc(28px + env(safe-area-inset-bottom, 0px)); overflow: hidden; }
.foot__mark { font: 850 clamp(2rem, 8.9vw, 10.5rem)/.86 var(--display); font-stretch: 125%; letter-spacing: -.055em; white-space: nowrap; margin-left: -.04em; }
.foot__cols { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 28px 60px; margin-top: clamp(28px, 5vh, 56px); padding-top: 24px; border-top: 1.5px solid var(--ink); font-size: .98rem; }
.foot__cols nav { display: grid; grid-template-columns: repeat(2, auto); gap: 8px 36px; align-content: start; }
.foot__cols nav a { font-weight: 550; text-decoration: none; }
.foot__cols nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.he { font-family: var(--he); font-weight: 600; font-size: 1.08rem; margin-top: 12px; text-align: start; }
.foot__hours { margin-top: 12px; font-weight: 650; }
.foot__small { margin-top: 36px; font-size: .84rem; color: var(--ink-2); }

/* lightbox and toast */
.lightbox { border: 0; padding: 0; background: transparent; max-width: none; max-height: none; width: 100vw; height: 100vh; height: 100dvh; color: #f2f5f4; overflow: hidden; }
.lightbox::backdrop { background: rgba(10, 15, 17, .9); }
.lightbox[open] { display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px; align-items: center; justify-items: center; }
.lightbox figure { display: grid; justify-items: center; gap: 12px; max-width: 100%; grid-column: 2; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 120px); max-height: calc(100dvh - 120px); border-radius: 14px; object-fit: contain; }
.lightbox figcaption { font-size: .93rem; text-align: center; max-width: 46em; color: #c9d2d2; padding: 0 12px; }
.lightbox .icon-btn { color: #f2f5f4; background: rgba(255, 255, 255, .1); }
.lightbox .icon-btn:hover { background: rgba(255, 255, 255, .22); }
.lightbox__x { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: 14px; z-index: 2; }
.lightbox__nav--prev { grid-column: 1; grid-row: 1; }
.lightbox__nav--next { grid-column: 3; grid-row: 1; }
.lightbox__nav[hidden] { display: none; }

.toast {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); z-index: 90; transform: translate(-50%, 20px);
  max-width: min(92vw, 460px); padding: 13px 18px; border-radius: 14px; background: var(--ink); color: var(--wall);
  font-weight: 560; font-size: .95rem; text-align: center; box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .35s cubic-bezier(.2, .7, .2, 1);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- language switch ---------- */
.lang {
  display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border-radius: 10px; text-decoration: none;
  font-weight: 650; font-size: .92rem; box-shadow: inset 0 0 0 1.5px var(--ink); transition: background-color .15s ease, color .15s ease;
}
.lang:hover { background: var(--ink); color: var(--wall); }
.lang[lang="he"] { font-family: var(--he); font-size: 1rem; }

/* ---------- RIGHT-TO-LEFT (Hebrew) ----------
   Hebrew is set in Heebo; Latin names and numbers inside it fall through to Archivo.
   The tour mirrors: cards on the right, plan and transport on the left. */
html[lang="he"] {
  --display: "Heebo", "Archivo", "Arial Hebrew", Arial, sans-serif;
  --text: "Heebo", "Archivo", "Arial Hebrew", system-ui, Arial, sans-serif;
}
html[lang="he"] body { line-height: 1.55; }
html[lang="he"] h1, html[lang="he"] h2, html[lang="he"] h3, html[lang="he"] .card__title { letter-spacing: -.01em; }
html[lang="he"] .hero h1 { line-height: 1.02; font-weight: 900; }
html[lang="he"] .block h2 { line-height: 1.05; font-weight: 900; }
html[lang="he"] .brand__name, html[lang="he"] .foot__mark { font-family: "Archivo", sans-serif; direction: ltr; }
html[lang="he"] .foot__mark { text-align: right; margin-left: 0; }
html[lang="he"] .he { font-family: "Archivo", sans-serif; font-weight: 500; font-size: .98rem; direction: ltr; text-align: right; }
html[dir="rtl"] .skip { left: auto; right: 12px; }
html[dir="rtl"] .nav__links a { background-position: 100% 100%; }
html[dir="rtl"] .stage__scrim { background: linear-gradient(to top left, color-mix(in srgb, var(--wall) 92%, transparent) 0%, color-mix(in srgb, var(--wall) 40%, transparent) 30%, transparent 56%); }
html[dir="rtl"].no-webgl .stage__scrim { background: linear-gradient(to top left, color-mix(in srgb, var(--wall) 95%, transparent) 0%, color-mix(in srgb, var(--wall) 58%, transparent) 42%, color-mix(in srgb, var(--wall) 10%, transparent) 100%); }
html[dir="rtl"] .stop { left: auto; right: var(--pad); }
html[dir="rtl"] .card__list li { padding-left: 0; padding-right: 17px; }
html[dir="rtl"] .card__list li::before { left: auto; right: 0; }
html[dir="rtl"] .hud { right: auto; left: var(--pad); }
html[dir="rtl"] .transport, html[dir="rtl"] .lightbox { direction: ltr; }
html[dir="rtl"] .lightbox figcaption { direction: rtl; }
html[dir="rtl"] .words { direction: ltr; }
html[dir="rtl"] .words__note { direction: rtl; margin-left: auto; }
html[dir="rtl"] .row:target, html[dir="rtl"] .row.is-target { background: linear-gradient(270deg, color-mix(in srgb, var(--yellow) 42%, transparent), transparent 72%); }
html[dir="rtl"] .doc { padding: 0 12px 0 14px; }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  :root { --nav-h: 56px; --seg: 86vh; }
  .nav__menu { display: inline-grid; }
  .nav__links {
    position: absolute; top: 100%; left: 12px; right: 12px; margin: 0; padding: 8px; display: none; flex-direction: column; gap: 0;
    background: var(--sheet); border-radius: 16px; box-shadow: var(--shadow);
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: 13px 12px; font-size: 1.05rem; background: none; border-radius: 10px; }
  .nav__links a:hover { background: var(--sheet-2); }

  .stage__scrim { background: linear-gradient(to top, color-mix(in srgb, var(--wall) 96%, transparent) 0%, color-mix(in srgb, var(--wall) 60%, transparent) 34%, transparent 62%); }
  .hero { bottom: calc(26px + env(safe-area-inset-bottom, 0px)); }
  .hero h1 { font-size: clamp(2.25rem, 11vw, 3.6rem); font-stretch: 112%; }
  .hero__cta .btn { flex: 1 1 auto; }
  .cue { display: none; }

  .stop {
    left: 10px; right: 10px; width: auto; top: auto; bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    transform: translateY(22px);
  }
  .stop.is-past { transform: translateY(-14px); }
  .stop.is-on { transform: none; }
  .card { border-radius: 18px; position: relative; }
  .card__photos, .card__photos:has(.shot:nth-child(2)) { position: absolute; top: 14px; right: 14px; width: 84px; height: 84px; display: block; border-radius: 12px; overflow: hidden; }
  .card__photos .shot { width: 100%; height: 100%; }
  .card__photos .shot + .shot { display: none; }
  .card__body { padding: 16px 16px 16px; }
  .card:has(.card__photos) .card__no, .card:has(.card__photos) .card__title { margin-right: 96px; }
  .card__no b { font-size: 1.9rem; }
  .card__title { font-size: 1.28rem; margin-top: 8px; min-height: 1.4em; }
  .card__text { font-size: .93rem; line-height: 1.42; margin-top: 12px; }
  .card__list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; font-size: .8rem; }
  .card__list li { padding: 3px 8px; border-radius: 7px; background: var(--sheet-2); }
  .card__list li::before { display: none; }
  .card__link { margin-top: 12px; font-size: .9rem; }

  .hud { right: 10px; top: calc(var(--nav-h) + env(safe-area-inset-top, 0px) + 6px); bottom: auto; }
  .map { display: none; }
  .transport { opacity: 0; transition: opacity .3s ease; }
  .is-touring .transport { opacity: 1; }

  .block__head { grid-template-columns: 1fr; gap: 14px; }
  .row { grid-template-columns: minmax(0, 1fr) auto; }
  .row__docs { grid-column: 1 / -1; justify-content: flex-start; }
  .sessions { grid-template-columns: 1fr; }
  .session { flex-direction: row; }
  .session img { width: 34%; height: auto; aspect-ratio: auto; align-self: stretch; }
  .session__body { padding: 16px 18px 18px; }
  .person { grid-template-columns: 1fr; }
  .person__tile { width: 132px; border-radius: 22px; font-size: 3.4rem; }
  .lightbox[open] { grid-template-columns: 52px minmax(0, 1fr) 52px; }
}
@media (max-width: 860px) and (max-height: 640px) { .card__list { display: none; } }
@media (max-width: 860px) {
  html[dir="rtl"] .stage__scrim { background: linear-gradient(to top, color-mix(in srgb, var(--wall) 96%, transparent) 0%, color-mix(in srgb, var(--wall) 60%, transparent) 34%, transparent 62%); }
  html[dir="rtl"] .stop { left: 10px; right: 10px; }
  html[dir="rtl"] .card__photos, html[dir="rtl"] .card__photos:has(.shot:nth-child(2)) { right: auto; left: 14px; }
  html[dir="rtl"] .card:has(.card__photos) .card__no, html[dir="rtl"] .card:has(.card__photos) .card__title { margin-right: 0; margin-left: 96px; }
  html[dir="rtl"] .card__list li { padding: 3px 8px; }
  html[dir="rtl"] .hud { left: 10px; right: auto; }
  .lang { height: 34px; padding: 0 10px; }
}
@media (max-width: 480px) { .nav { gap: 4px; } .brand { gap: 8px; } .brand__mark { width: 30px; } .brand__name { font-size: .82rem; } .lang { padding: 0 8px; font-size: .84rem; } .row__where { font-size: .86rem; } }
@media (min-width: 861px) and (max-height: 700px) { .card__list { display: none; } .card__photos { height: 120px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}
