/* Misha Graphics v2 — "Render": everything arrives rough and resolves sharp. See DESIGN.md. */

:root {
  --ground: #0b0b0c;
  --ink: #f2efe9;
  --muted: #a19d95;
  --line: rgba(242, 239, 233, 0.14);
  --accent: #ff3b2f;
  --curtain: #151517;
  --card: #141416;

  --f-display: "Karantina", "IBM Plex Sans Hebrew", system-ui, sans-serif;
  --f-text: "IBM Plex Sans Hebrew", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, monospace;

  --t-mega: clamp(3.9rem, 1.4rem + 10.4vw, 12.5rem);
  --t-xl: clamp(3rem, 1.4rem + 5.8vw, 7.5rem);
  --t-l: clamp(1.9rem, 1.3rem + 2.4vw, 3.5rem);
  --t-m: clamp(1.15rem, 1.02rem + 0.5vw, 1.5rem);
  --t-body: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --t-s: 0.875rem;
  --t-xs: 0.75rem;

  --gutter: clamp(16px, 2.2vw, 32px);
  --radius: 12px;
  --hdr: 84px;
  --hdr-offset: 0px;
  --page: min(100vw, max(1100px, 177.78svh));

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.87, 0, 0.13, 1);
  --ease-soft: cubic-bezier(0.215, 0.61, 0.355, 1);

  color-scheme: dark;
}
@media (max-width: 699px) {
  :root { --radius: 8px; --hdr: 64px; }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--ground); }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--f-text);
  font-size: var(--t-body);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, video, iframe { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
main, .ftr { display: block; outline: none; max-width: var(--page); margin-inline: auto; }

.skip {
  position: fixed; top: 10px; right: 10px; z-index: 200;
  background: var(--ink); color: var(--ground); padding: 10px 16px; border-radius: 99px; font-weight: 600;
  translate: 0 -200%; transition: translate 0.3s var(--ease-out);
}
.skip:focus-visible { translate: 0 0; }

.wrap { padding-inline: var(--gutter); }
.display {
  font-family: var(--f-display);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: normal;
  text-wrap: balance;
}

/* ---------- curtain (page transition: a render pass scanning down) ---------- */
.curtain {
  position: fixed; inset: 0; z-index: 150; pointer-events: none;
  background: var(--curtain);
  clip-path: inset(0 0 100% 0);
}
.curtain__scan {
  position: fixed; z-index: 151; pointer-events: none; inset-inline: 0; top: 0; height: 2px; opacity: 0; translate: 0 -50%;
  background: var(--accent);
  box-shadow: 0 0 18px 2px rgba(255, 59, 47, 0.55);
}
html.curtain-in .curtain { clip-path: inset(0 0 0 0); }

/* ---------- header ---------- */
.hdr {
  position: fixed; inset-inline: 0; top: 0; z-index: 60;
  height: var(--hdr);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-inline: max(var(--gutter), calc((100vw - var(--page)) / 2 + var(--gutter)));
  padding-top: env(safe-area-inset-top);
  transition: translate 0.6s var(--ease-out), background-color 0.4s;
}
.hdr::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to bottom, rgba(11, 11, 12, 0.7), rgba(11, 11, 12, 0));
  transition: opacity 0.4s;
}
.hdr.is-solid { background: rgba(11, 11, 12, 0.88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.hdr.is-solid::before { opacity: 0; }
html.hdr-away .hdr { translate: 0 -105%; }

.brand { display: inline-flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.brand__he { font-family: var(--f-display); font-weight: 700; font-size: 2.6rem; line-height: 1; }
.brand__en { font-family: var(--f-mono); font-size: 0.74rem; color: var(--muted); letter-spacing: 0.08em; }
@media (max-width: 699px) { .brand__he { font-size: 2.1rem; } }
@media (max-width: 420px) { .brand__en { display: none; } }

.nav { display: flex; align-items: center; gap: clamp(18px, 2.4vw, 40px); }
.nav__link { font-size: 1.12rem; font-weight: 500; padding-block: 8px; }

/* nav: underline draws from the right (RTL start) */
.draw {
  background: linear-gradient(currentColor 0 0) right bottom / 0% 1px no-repeat;
  transition: background-size 0.45s var(--ease-out);
}
@media (hover: hover) { .draw:hover { background-size: 100% 1px; } }
.draw:focus-visible, .draw[aria-current="page"] { background-size: 100% 1px; }
.draw[aria-current="page"] { background-image: linear-gradient(var(--accent) 0 0); }

/* primary button: a fill floods in from the pointer side */
.btn {
  position: relative; isolation: isolate; overflow: clip;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 22px; border-radius: 99px;
  border: 1px solid var(--ink);
  font-weight: 600; font-size: 0.95rem; white-space: nowrap;
  transition: color 0.35s var(--ease-soft);
}
.btn__fill { position: absolute; inset: 0; z-index: -1; background: var(--ink); clip-path: circle(0% at 50% 50%); }
.btn.is-filled, .btn:active { color: var(--ground); }
.btn:active .btn__fill { clip-path: circle(150% at 50% 50%); }
.btn--solid { background: var(--ink); color: var(--ground); }
.btn--solid .btn__fill { background: var(--accent); }
.btn--solid.is-filled { color: #fff; }
.btn__arrow { display: inline-block; transition: translate 0.4s var(--ease-out); }
@media (hover: hover) { .btn:hover .btn__arrow, a:hover > .arrow { translate: -5px 0; } }
.btn:focus-visible .btn__arrow { translate: -5px 0; }
.hdr .btn { min-height: 48px; padding: 0 24px; font-size: 1.05rem; }

.menu-btn { display: none; min-height: 48px; padding: 0 4px; font-weight: 600; font-size: 1.05rem; }
.menu-btn__lines { display: inline-grid; gap: 5px; margin-inline-start: 8px; vertical-align: middle; }
.menu-btn__lines i { display: block; width: 20px; height: 1.5px; background: currentColor; transition: rotate 0.4s var(--ease-out), translate 0.4s var(--ease-out); }
.menu-btn[aria-expanded="true"] .menu-btn__lines i:first-child { translate: 0 3.25px; rotate: 45deg; }
.menu-btn[aria-expanded="true"] .menu-btn__lines i:last-child { translate: 0 -3.25px; rotate: -45deg; }

@media (max-width: 860px) {
  .nav .nav__link, .nav .btn { display: none; }
  .menu-btn { display: inline-flex; align-items: center; }
}

/* mobile menu overlay */
.mmenu {
  position: fixed; inset: 0; z-index: 55;
  background: var(--ground);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: calc(var(--hdr) + 24px) var(--gutter) calc(32px + env(safe-area-inset-bottom));
  clip-path: inset(0 0 100% 0);
  visibility: hidden;
}
.mmenu.is-open { visibility: visible; }
.mmenu__list { display: grid; gap: 2px; }
.mmenu__link { display: block; overflow: clip; font-family: var(--f-display); font-weight: 700; font-size: clamp(3.4rem, 15vw, 6rem); line-height: 1.12; }
.mmenu__link > span { display: block; }
.mmenu__link[aria-current="page"] { color: var(--accent); }
.mmenu__foot { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 10px 20px; color: var(--muted); font-size: 0.95rem; }
.mmenu__foot a { min-height: 32px; display: inline-flex; align-items: center; }

/* ---------- hero: the reel, a 16:9 screen that fits the first view ---------- */
.hero {
  --hero-w: min(100%, calc((100svh - var(--hdr) - 200px) * 1.7778));
  padding: calc(var(--hdr) + clamp(16px, 2.4vw, 32px)) var(--gutter) 0;
}
.hero__top, .hero__frame { width: max(var(--hero-w), min(100%, 900px)); margin-inline: auto; }
.hero__top {
  container-type: inline-size;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 0.62fr); align-items: end; gap: 12px clamp(24px, 3vw, 48px);
  margin-bottom: clamp(16px, 2vw, 26px);
}
.hero__title { font-size: clamp(2.8rem, 6.2cqi, 7rem); line-height: 1.06; }
.hero__aside { padding-bottom: 0.5em; }
.hero__who { font-size: var(--t-s); color: var(--muted); margin-bottom: 6px; display: flex; align-items: center; gap: 10px; }
.rec { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.hero__sub { font-size: clamp(1rem, 0.9rem + 0.35vw, 1.2rem); line-height: 1.5; color: rgba(242, 239, 233, 0.86); font-weight: 300; }

.hero__frame {
  position: relative; overflow: clip; background: #000; aspect-ratio: 16 / 9;
  border-radius: var(--radius); isolation: isolate;
  container-type: inline-size; /* the reel controls scale with the screen they sit on */
}
.hero__frames, .hero__frames img, .hero__media, .hero__media video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000;
}
.hero__frames img { opacity: 0; }
.hero__frames img.is-on { opacity: 1; z-index: 1; }
.hero__frames img.is-next { opacity: 1; z-index: 2; }
.hero__media { opacity: 0; transition: opacity 1.2s var(--ease-soft); container-type: size; z-index: 3; }
.hero__media.is-playing { opacity: 1; }
.hero__media iframe {
  position: absolute; top: 50%; left: 50%; border: 0; pointer-events: none;
  width: calc(100cqw * 1.1); height: auto; aspect-ratio: 16 / 9;
  translate: -50% -50%;
}
.hero__scrim {
  position: absolute; inset: 0; pointer-events: none; z-index: 4;
  background: linear-gradient(to top, rgba(11, 11, 12, 0.55) 0%, rgba(11, 11, 12, 0) 26%);
}
.hero__scan {
  position: absolute; inset-inline: 0; top: 0; height: 2px; z-index: 5; pointer-events: none;
  background: var(--accent); box-shadow: 0 0 22px 3px rgba(255, 59, 47, 0.6);
  opacity: 0; translate: 0 -50%;
}
.hero__ui {
  position: absolute; z-index: 6; inset-inline: 0; bottom: clamp(16px, 3cqi, 72px);
  display: flex; align-items: center; justify-content: center; gap: clamp(10px, 1.2cqi, 24px);
  pointer-events: none;
}
.hero__ui > * { pointer-events: auto; }
.reel-btn { gap: clamp(12px, 1cqi, 22px); padding-inline: clamp(8px, 0.6cqi, 14px) clamp(26px, 2cqi, 44px); min-height: clamp(60px, 4.6cqi, 124px); font-size: clamp(1.05rem, 1.25cqi, 2.2rem); border-color: rgba(242, 239, 233, 0.5); background: rgba(11, 11, 12, 0.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.reel-btn__icon { width: clamp(42px, 3.4cqi, 96px); height: clamp(42px, 3.4cqi, 96px); border-radius: 50%; background: var(--accent); display: grid; place-items: center; flex: none; }
.reel-btn__icon svg { width: 34%; height: 34%; fill: #fff; margin-inline-start: -2px; }
.hero__ui .icon-btn { width: clamp(60px, 4.6cqi, 124px); height: clamp(60px, 4.6cqi, 124px); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.hero__ui .icon-btn svg { width: 30%; height: 30%; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid rgba(242, 239, 233, 0.35); background: rgba(11, 11, 12, 0.45);
  transition: border-color 0.3s, background-color 0.3s;
}
.icon-btn svg { width: 14px; height: 14px; fill: currentColor; }
@media (hover: hover) { .icon-btn:hover { border-color: var(--ink); background: rgba(242, 239, 233, 0.12); } }

@media (max-width: 699px) {
  .hero { padding-inline: 10px; }
  .hero__top { grid-template-columns: 1fr; padding-inline: 6px; }
  .hero__title { font-size: clamp(2.9rem, 14vw, 4.4rem); }
  .hero__ui { bottom: 10px; gap: 8px; }
  .reel-btn { min-height: 48px; padding-inline: 6px 16px; gap: 10px; font-size: 0.95rem; }
  .reel-btn__icon { width: 36px; height: 36px; }
  .hero__ui .icon-btn { width: 48px; height: 48px; }
}

/* ---------- works (gallery block) ---------- */
.works { position: relative; padding-top: clamp(56px, 9vw, 120px); padding-bottom: clamp(64px, 10vw, 140px); }
.works__head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px 32px;
  padding-inline: var(--gutter); margin-bottom: clamp(20px, 3vw, 36px);
}
.works__title { font-size: var(--t-xl); }
.works__count { font-size: var(--t-s); color: var(--muted); padding-bottom: 0.9em; white-space: nowrap; }
.works__count .mono { color: var(--ink); font-size: 1.3em; margin-inline-end: 4px; }
.works__intro { grid-column: 1 / -1; max-width: 46ch; color: var(--muted); font-size: var(--t-body); }

/* the prompt: filters read as a request */
.prompt {
  position: sticky; top: calc(var(--hdr-offset) + 10px); z-index: 20;
  margin: 0 var(--gutter) clamp(18px, 2.4vw, 28px);
  display: flex; align-items: center; gap: 12px;
  padding: 8px; padding-inline-start: 18px;
  border: 1px solid var(--line); border-radius: 99px;
  background: rgba(20, 20, 22, 0.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: top 0.6s var(--ease-out), border-color 0.3s;
}
.prompt__label { flex: none; font-size: 1rem; color: var(--muted); }
.prompt__tokens {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0;
  mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent);
  -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent);
  padding-inline-end: 24px; scroll-snap-type: x proximity;
}
.prompt__tokens::-webkit-scrollbar { display: none; }
.prompt__caret { flex: none; width: 2px; height: 20px; background: var(--accent); }
.prompt__fmt { flex: none; display: flex; gap: 4px; border-inline-start: 1px solid var(--line); padding-inline-start: 10px; }

.tok {
  flex: none; scroll-snap-align: start;
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 46px; padding: 0 20px; border-radius: 99px;
  font-size: 1.05rem; font-weight: 500; white-space: nowrap; color: var(--muted);
  transition: color 0.25s, background-color 0.25s;
}
.tok .mono { font-size: 0.72rem; opacity: 0.7; }
@media (hover: hover) { .tok:hover { color: var(--ink); background: rgba(242, 239, 233, 0.07); } }
.tok[aria-pressed="true"] { background: var(--ink); color: var(--ground); }
.tok--fmt { padding: 0 16px; justify-content: center; gap: 8px; }
.tok--fmt svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; flex: none; }

@media (max-width: 699px) {
  .prompt { margin-inline: 10px; padding-inline-start: 12px; gap: 8px; }
  .prompt__label, .prompt__caret { display: none; }
  .prompt { flex-wrap: wrap; border-radius: 22px; padding: 8px; }
  .prompt__tokens { flex-basis: 100%; }
  .prompt__fmt { border: 0; padding: 0; width: 100%; border-top: 1px solid var(--line); padding-top: 8px; }
  .tok { min-height: 42px; padding: 0 16px; font-size: 0.98rem; }
  .tok--fmt { flex: 1; padding: 0 8px; }
}

/* masonry grid (positions set by JS; flows as a plain grid without JS) */
.grid { position: relative; margin-inline: var(--gutter); }
html:not(.js) .grid, .grid:not(.is-packed) {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px;
}
.grid.is-packed .card { position: absolute; top: 0; right: 0; }
.grid__empty { padding: 60px 0; text-align: center; color: var(--muted); }
.grid__sentinel { height: 1px; }
@media (max-width: 699px) { .grid { margin-inline: 10px; } }

.card { display: block; color: inherit; }
html.motion .card { opacity: 0; translate: 0 34px; transition: opacity 0.7s var(--ease-soft), translate 1s var(--ease-out); }
html.motion .card.is-in { opacity: 1; translate: 0 0; }
.card__frame {
  position: relative; overflow: clip; border-radius: var(--radius); background: var(--card);
  isolation: isolate;
}
.card__frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card__lo { image-rendering: pixelated; opacity: 0.9; }
.card__img { opacity: 0; transition: scale 0.9s var(--ease-out); }
.card.is-loaded .card__img { opacity: 1; animation: resolve 0.9s var(--ease-out) both; }
.card__scrub { opacity: 0; pointer-events: none; }
.card.is-scrubbing .card__scrub { opacity: 1; }
.card__scan {
  position: absolute; inset-inline: 0; top: 0; height: 2px; z-index: 3; pointer-events: none;
  background: var(--accent); box-shadow: 0 0 14px 2px rgba(255, 59, 47, 0.55); opacity: 0;
}
.card.is-loaded .card__scan { animation: scan 0.9s var(--ease-out) both; }
.card__bar { position: absolute; inset-inline: 0; bottom: 0; height: 3px; z-index: 3; background: rgba(0, 0, 0, 0.35); opacity: 0; transition: opacity 0.25s; }
.card__bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--accent); }
.card.is-scrubbing .card__bar { opacity: 1; }
.card__play {
  position: absolute; z-index: 2; left: 12px; bottom: 12px;
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(11, 11, 12, 0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: grid; place-items: center;
  transition: background-color 0.3s, scale 0.45s var(--ease-out);
}
.card__play svg { width: 11px; height: 11px; fill: #fff; margin-left: 2px; }
.card__meta { padding: 10px 2px 0; height: var(--meta-h, 64px); overflow: hidden; }
.card__title {
  font-size: 0.95rem; font-weight: 500; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  text-align: right;
}
.card__sub { font-size: 0.78rem; color: var(--muted); margin-top: 2px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card--image .card__meta { height: var(--meta-h-img, 40px); }
@media (hover: hover) {
  .card:hover .card__img, .card:hover .card__scrub { scale: 1.035; }
  .card:hover .card__play { background: var(--accent); scale: 1.1; }
}
.card:focus-visible { outline: none; }
.card:focus-visible .card__frame { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 699px) {
  .card__play { width: 32px; height: 32px; left: 8px; bottom: 8px; }
  .card__play svg { width: 9px; height: 9px; }
  .card__title { font-size: 0.84rem; }
  .card__meta { padding-top: 8px; }
}

.more-btn { display: flex; justify-content: center; margin-top: 36px; }

/* ---------- footer finale ---------- */
.ftr { position: relative; border-top: 1px solid var(--line); padding: clamp(72px, 11vw, 160px) var(--gutter) calc(28px + env(safe-area-inset-bottom)); overflow: clip; }
.ftr__cta { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); grid-template-rows: auto auto; gap: 24px clamp(32px, 5vw, 80px); align-items: end; }
.ftr__title { grid-row: 1 / span 2; font-family: var(--f-display); font-weight: 700; font-size: var(--t-xl); line-height: 1.06; }
.ftr__cta > .ftr__btns { align-self: start; }
@media (max-width: 899px) { .ftr__cta { grid-template-columns: 1fr; } .ftr__title { grid-row: auto; } }
.ftr__text { color: var(--muted); max-width: 44ch; font-size: var(--t-m); font-weight: 300; }
.ftr__btns { display: flex; flex-wrap: wrap; gap: 12px; }
.ftr__btns .btn { min-height: 54px; padding-inline: 28px; font-size: 1rem; }
.ftr__bottom {
  margin-top: clamp(64px, 9vw, 120px); padding-top: 22px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 28px; font-size: var(--t-s); color: var(--muted);
}
.ftr--slim { padding-top: 0; border-top: 0; }
.ftr--slim .ftr__bottom { margin-top: 0; padding-block: 22px 0; }
.ftr__social { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.ftr__social a { min-height: 32px; display: inline-flex; align-items: center; transition: color 0.25s; }
@media (hover: hover) { .ftr__social a:hover { color: var(--ink); } }

/* ---------- lightbox ---------- */
.lb { position: fixed; inset: 0; z-index: 120; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.lb[hidden] { display: none; }
.lb__bg { position: absolute; inset: 0; background: rgba(6, 6, 7, 0.97); }
.lb__top { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: calc(10px + env(safe-area-inset-top)) var(--gutter) 10px; }
.lb__count { font-size: var(--t-xs); color: var(--muted); }
.lb__stage { position: relative; display: grid; place-items: center; padding: 0 clamp(8px, 6vw, 96px); min-height: 0; touch-action: pan-y; }
.lb__media {
  position: relative; max-width: 100%; max-height: 100%;
  aspect-ratio: var(--r, 16 / 9); height: min(100%, calc((100vw - 2 * clamp(8px, 6vw, 96px)) / (var(--rn, 1.7778))));
  background: #000; border-radius: var(--radius); overflow: clip;
}
.lb__media iframe, .lb__media img, .lb__media video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: contain; }
.lb__media .lb__poster { object-fit: cover; }
.lb__bar { position: relative; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 32px; padding: 14px var(--gutter) calc(18px + env(safe-area-inset-bottom)); }
.lb__title { font-size: var(--t-m); font-weight: 500; line-height: 1.35; }
.lb__sub { font-size: var(--t-s); color: var(--muted); margin-top: 2px; }
.lb__nav { display: flex; gap: 8px; flex: none; }
.lb .icon-btn { width: 48px; height: 48px; }
.lb .icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.lb__open { font-size: var(--t-s); color: var(--muted); text-decoration: underline; text-underline-offset: 0.25em; }
@media (max-width: 699px) {
  .lb__stage { padding: 0; }
  .lb__media { border-radius: 0; height: min(100%, calc(100vw / var(--rn, 1.7778))); }
  .lb__bar { flex-direction: column; align-items: stretch; }
  .lb__nav { justify-content: space-between; }
  .lb__title { font-size: 1.05rem; }
}

/* ---------- about (home, below the gallery) ---------- */
.about-hero { padding-top: clamp(72px, 10vw, 150px); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 32px var(--gutter); padding-inline: var(--gutter); align-items: end; }
.about-hero__text { grid-column: 1 / span 7; padding-bottom: clamp(8px, 2vw, 24px); }
.about-hero__title { font-size: var(--t-mega); }
.about-hero__lead { margin-top: 24px; font-size: var(--t-m); font-weight: 300; max-width: 36ch; }
.about-hero__media { grid-column: 9 / -1; }
.frame-media { position: relative; overflow: clip; border-radius: var(--radius); background: var(--card); }
.frame-media img { width: 100%; height: 100%; object-fit: cover; }
.about-hero__media .frame-media { aspect-ratio: 4 / 5; }
@media (max-width: 899px) {
  .about-hero__text, .about-hero__media { grid-column: 1 / -1; }
  .about-hero__media { order: -1; max-width: 420px; }
}
/* about: every section is a chapter with its label in the same column, one line to read down */
.chap {
  display: grid; grid-template-columns: minmax(150px, 0.24fr) minmax(0, 1fr); gap: 20px clamp(28px, 4vw, 72px);
  margin-inline: var(--gutter); padding-block: clamp(48px, 6vw, 88px); border-top: 1px solid var(--line); scroll-margin-top: 40px;
}
.chap__label {
  font-family: var(--f-text); font-size: 1rem; font-weight: 600; color: var(--muted);
  display: flex; align-items: center; gap: 10px; align-self: start; position: sticky; top: calc(var(--hdr) + 28px);
}
.chap__label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.chap__body { min-width: 0; }
@media (max-width: 899px) { .chap { grid-template-columns: 1fr; } .chap__label { position: static; } }
.bio { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px clamp(28px, 4vw, 64px); }
.bio__text { display: grid; gap: 1.1em; font-size: var(--t-m); font-weight: 300; line-height: 1.6; max-width: 40ch; }
.facts { display: grid; gap: 0; align-self: start; border-top: 1px solid var(--line); }
.fact { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.fact__num { font-family: var(--f-display); font-weight: 700; font-size: var(--t-xl); line-height: 1; direction: ltr; }
.fact__label { color: var(--muted); }
@media (max-width: 899px) { .bio { grid-template-columns: 1fr; } }

.svc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 40px clamp(28px, 4vw, 64px); }
.svc__side { min-width: 0; }
.svc__sticky { position: sticky; top: calc(var(--hdr) + 24px); }
.svc__title { font-size: clamp(2.4rem, 1.4rem + 3vw, 5rem); direction: ltr; text-align: right; }
.svc__title:lang(he) { direction: rtl; }
.svc__lead { margin-top: 16px; font-size: var(--t-m); max-width: 30ch; }
.svc__img { margin-top: 28px; aspect-ratio: 4 / 3; }
.svc__main { display: grid; gap: clamp(36px, 5vw, 56px); align-content: start; }
.svc__intro { font-size: var(--t-m); font-weight: 300; max-width: 40ch; }
.svc h3 { font-size: var(--t-s); font-weight: 600; color: var(--muted); margin-bottom: 14px; letter-spacing: 0.02em; }
.svc__problems li { padding: 14px 0; border-bottom: 1px solid var(--line); display: flex; gap: 14px; }
.svc__problems li::before { content: ""; flex: none; width: 7px; height: 7px; margin-top: 0.62em; border-radius: 50%; background: var(--accent); }
.svc__includes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.svc__includes li { padding: 14px 0; border-top: 1px solid var(--line); }
.svc__includes b { display: block; font-weight: 600; }
.svc__includes span { color: var(--muted); font-size: 0.95rem; }
.svc__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.svc__tags li { border: 1px solid var(--line); border-radius: 99px; padding: 6px 14px; font-size: 0.9rem; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 0; font-weight: 500; min-height: 44px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--f-mono); font-size: 1.2rem; transition: rotate 0.35s var(--ease-out); flex: none; }
.faq details[open] summary::after { rotate: 45deg; }
.faq p { padding-bottom: 18px; color: var(--muted); max-width: 60ch; }
@media (max-width: 899px) {
  .svc { grid-template-columns: 1fr; }
  .svc__sticky { position: static; }
  .svc__includes { grid-template-columns: 1fr; }
}


.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 var(--gutter); counter-reset: step; }
.step { border-top: 1px solid var(--ink); padding-top: 18px; counter-increment: step; }
.step::before { content: counter(step, decimal-leading-zero); font-family: var(--f-mono); font-size: var(--t-xs); color: var(--accent); display: block; margin-bottom: 30px; }
.step h3 { font-family: var(--f-display); font-weight: 700; font-size: var(--t-l); line-height: 1.1; margin-bottom: 10px; }
.step p { color: var(--muted); }
@media (max-width: 899px) { .steps { grid-template-columns: 1fr 1fr; gap: 40px var(--gutter); } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } .step::before { margin-bottom: 14px; } }


.credits__title { font-size: var(--t-s); color: var(--muted); margin-bottom: 30px; font-weight: 500; }
.credits__list { display: flex; flex-wrap: wrap; gap: 6px 0; }
.credits__list li { font-family: var(--f-display); font-weight: 700; font-size: var(--t-l); line-height: 1.2; }
.credits__list li:not(:last-child)::after { content: "/"; color: var(--accent); margin-inline: 0.45em; font-weight: 400; }

/* contact */
.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 40px clamp(28px, 4vw, 64px); }
.contact__side { min-width: 0; }
.contact__title { font-size: var(--t-xl); }
.contact__intro { margin-top: 16px; color: var(--muted); max-width: 36ch; font-size: var(--t-m); font-weight: 300; }
.contact__direct { margin-top: 28px; display: grid; gap: 8px; }
.contact__direct a { display: inline-flex; gap: 10px; align-items: center; min-height: 36px; }
.form { position: relative; display: grid; gap: 22px; }
.field { display: grid; gap: 8px; }
.field label, .field legend { font-size: var(--t-s); color: var(--muted); padding: 0; }
.field input:not([type=radio]):not([type=checkbox]), .field textarea {
  width: 100%; background: transparent; color: var(--ink); font: inherit; font-size: 1.05rem;
  border: 0; border-bottom: 1px solid var(--line); padding: 10px 0; border-radius: 0;
  transition: border-color 0.3s;
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--accent); }
.field input:focus-visible, .field textarea:focus-visible { outline: none; }
fieldset.field { border: 0; margin: 0; padding: 0; min-inline-size: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border: 1px solid var(--line); border-radius: 99px; cursor: pointer; transition: background-color 0.25s, color 0.25s, border-color 0.25s; font-size: 0.92rem; }
.chip input:checked + span { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) { .chip span:hover { border-color: var(--ink); } }
.form__hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); opacity: 0; }
.form__status { min-height: 1.6em; font-size: 0.95rem; }
.form__status.is-error { color: #ff8a80; }
.form__status.is-ok { color: var(--ink); }
.form .btn { justify-self: start; min-height: 54px; padding-inline: 30px; }
@media (max-width: 899px) { .contact { grid-template-columns: 1fr; } }

/* ---------- gallery tabs (home) ---------- */
.works { scroll-margin-top: 0; }
.works__tabs { padding-inline: var(--gutter); }
.works .gal-body { padding-bottom: 0; }
.tabs {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-top: clamp(18px, 3vw, 32px);
  padding-bottom: 2px; border-bottom: 1px solid var(--line);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; flex: none; padding: 14px 8px 18px; margin-inline-end: clamp(14px, 2.6vw, 40px);
  font-family: var(--f-display); font-weight: 700; font-size: clamp(2.2rem, 1.4rem + 2.4vw, 3.8rem); line-height: 1.1;
  color: var(--muted); transition: color 0.3s;
}
.tab .mono { font-family: var(--f-mono); font-weight: 400; font-size: 0.75rem; vertical-align: super; margin-inline-start: 4px; }
.tab::after { content: ""; position: absolute; inset-inline: 0; bottom: -3px; height: 2px; background: var(--accent); scale: 0 1; transform-origin: 100% 50%; transition: scale 0.5s var(--ease-out); }
.tab[aria-selected="true"] { color: var(--ink); }
.tab[aria-selected="true"]::after { scale: 1 1; }
@media (hover: hover) { .tab:hover { color: var(--ink); } }
.gal-body { padding-top: clamp(24px, 3vw, 40px); padding-bottom: clamp(64px, 10vw, 140px); }
.gal-intro { padding-inline: var(--gutter); color: var(--muted); max-width: 52ch; margin-bottom: 20px; }

/* ---------- project page (a branding case study) ---------- */
.proj { padding: calc(var(--hdr) + clamp(28px, 5vw, 72px)) var(--gutter) 0; }
.proj__head { max-width: 1100px; margin-inline: auto; margin-bottom: clamp(28px, 4vw, 56px); }
.proj__back { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--muted); font-weight: 500; transition: color 0.25s; }
.proj__back .arrow { display: inline-block; transition: translate 0.45s var(--ease-out); }
@media (hover: hover) { .proj__back:hover { color: var(--ink); } .proj__back:hover .arrow { translate: 5px 0; } }
.proj__title { font-size: var(--t-mega); margin-top: clamp(8px, 1.4vw, 20px); text-align: right; }
.proj__next-title { text-align: right; }
.proj__meta { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--muted); font-size: var(--t-m); font-weight: 300; margin-top: 10px; }
.proj__meta .mono { color: var(--ink); }
/* the story column, block by block, as it was built in the old editor */
.pb { display: flex; flex-direction: column; gap: 26px; max-width: var(--sw, 1100px); margin-inline: auto; }
.pb--grid { max-width: 1600px; }
.pb-h { font-family: var(--f-display); font-weight: 700; font-size: clamp(1.7rem, 1.2rem + 1.4vw, 2.6rem); line-height: 1.1; color: var(--ink); margin: 6px 0 0; }
.pb-text { margin: 6px 0; }
.pb-text .pb-h { margin-bottom: 10px; }
.pb-text p { font-size: 1rem; color: rgba(242, 239, 233, 0.72); line-height: 1.7; }
.pb-text a { color: var(--ink); text-decoration: underline; text-underline-offset: 0.2em; }
.pb-text b, .pb-text strong { color: var(--ink); font-weight: 600; }
.pb-fig { margin: 0; }
.pb-img { display: block; width: 100%; aspect-ratio: var(--r, 1.333); overflow: clip; border-radius: var(--radius); background: var(--card); cursor: zoom-in; }
.pb-img img { width: 100%; height: 100%; object-fit: cover; }
/* "wide" and "full" images step out of the column, centred on the page */
.pb-fig--wide, .pb-fig--full { align-self: center; } /* a column item wider than the column overflows evenly on both sides */
.pb-fig--wide { width: min(calc(100vw - 2 * var(--gutter)), 1400px); }
.pb-fig--full { width: min(calc(100vw - 2 * var(--gutter)), 1800px); }
/* like the old page: shown at their own size at most, never taller than the screen */
.pb-fig--wide .pb-img, .pb-fig--full .pb-img { aspect-ratio: auto; width: auto; max-width: 100%; margin-inline: auto; background: transparent; border-radius: 0; }
.pb-fig--wide .pb-img img, .pb-fig--full .pb-img img { width: auto; height: auto; max-width: 100%; max-height: 85vh; object-fit: contain; }
.pb-fig figcaption { margin-top: 8px; font-size: var(--t-s); color: var(--muted); text-align: center; }
.pb-video { width: 100%; border-radius: var(--radius); overflow: clip; background: #000; }
.pb-video iframe, .pb-video video, .pb-cell iframe, .pb-cell video { width: 100%; height: 100%; border: 0; display: block; }
/* galleries keep their designed order, left to right, whatever the page direction */
.pb-gal { width: 100%; direction: ltr; }
.pb-gal--masonry { position: relative; }
.pb-gal--uniform { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: var(--gap, 8px); }
.pb-cell { display: block; width: 100%; overflow: clip; border-radius: var(--radius); background: var(--card); cursor: zoom-in; }
.pb-gal--uniform .pb-cell { aspect-ratio: var(--ar, 1 / 1); }
.pb-cell img { width: 100%; height: 100%; object-fit: cover; }
.pb-cell--vid { cursor: auto; }
.pb-span { direction: rtl; }
@media (max-width: 699px) {
  .pb { gap: 18px; }
  .pb-gal--uniform { grid-template-columns: repeat(min(var(--cols, 3), 2), minmax(0, 1fr)); }
  .pb-text p { font-size: 1rem; }
}
.proj__next {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px clamp(20px, 3vw, 48px);
  max-width: 1600px; margin: clamp(56px, 8vw, 120px) auto 0; padding: clamp(24px, 3vw, 40px) 0; border-top: 1px solid var(--line);
}
.proj__next-label { grid-column: 1 / -1; color: var(--muted); font-size: var(--t-s); font-weight: 600; }
.proj__next-title { font-size: var(--t-xl); }
.proj__next-img { width: clamp(90px, 10vw, 180px); aspect-ratio: 4 / 3; border-radius: 8px; overflow: clip; background: var(--card); }
.proj__next-img img { width: 100%; height: 100%; object-fit: cover; transition: scale 0.7s var(--ease-out); }
.proj__next .arrow { font-size: 2rem; display: inline-block; transition: translate 0.45s var(--ease-out); }
@media (hover: hover) { .proj__next:hover .arrow { translate: -8px 0; } .proj__next:hover img { scale: 1.06; } }

/* ---------- 404 ---------- */
.nf { min-height: 100svh; display: grid; place-items: center; text-align: center; padding: calc(var(--hdr) + 20px) var(--gutter) 40px; }
.nf__frame { width: min(560px, 86vw); aspect-ratio: 16 / 9; margin: 0 auto 36px; border-radius: var(--radius); overflow: clip; position: relative; background: var(--card); }
.nf__frame canvas { width: 100%; height: 100%; image-rendering: pixelated; }
.nf__frame .card__scan { opacity: 1; }
.nf__title { font-size: var(--t-xl); }
.nf p { color: var(--muted); margin: 14px auto 28px; max-width: 36ch; }

/* ---------- reveals ---------- */
html.motion [data-reveal] { opacity: 0; translate: 0 28px; }
html.motion [data-reveal].is-in { opacity: 1; translate: 0 0; transition: opacity 0.9s var(--ease-soft), translate 1.1s var(--ease-out); transition-delay: var(--d, 0s); }
html.motion .frame-media[data-reveal] { opacity: 1; translate: none; }
html.motion .frame-media[data-reveal] img { clip-path: inset(0 0 100% 0); scale: 1.12; }
html.motion .frame-media[data-reveal].is-in img { clip-path: inset(0 0 0 0); scale: 1; transition: clip-path 1.3s var(--ease-out), scale 1.8s var(--ease-out); }
.split-line { display: block; overflow: clip; padding-bottom: 0.06em; margin-bottom: -0.06em; }

/* ---------- keyframes ---------- */
@keyframes resolve { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes scan { 0% { top: 0; opacity: 1; } 85% { opacity: 1; } 100% { top: 100%; opacity: 0; } }
@keyframes caret { 50% { opacity: 0; } }
@keyframes rec { 50% { opacity: 0.25; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .card__scan, .hero__scan { display: none; }
}

/* ---------- all works: the lens grid (home, above the contact form) ---------- */
.lens-block { padding-top: clamp(72px, 10vw, 150px); border-top: 1px solid var(--line); }
.lens-block__head { padding: 0 var(--gutter) clamp(20px, 2.4vw, 36px); display: grid; gap: 10px; }
.lens-block__title { font-size: var(--t-xl); }
.lens-block__lead { color: var(--muted); font-size: var(--t-m); font-weight: 300; }
.lens-block .ln { position: relative; height: min(100svh, 1400px); min-height: 520px; overflow: hidden; background: #000; }
.lens-block .ln__view { position: absolute; inset: 0; }
.ln3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: pan-y; }
.ln3d.is-dragging { cursor: grabbing; }
.lens-block .ln__chips {
  position: absolute; z-index: 3; top: 26px; left: 50%; translate: -50% 0; padding: 10px; border-radius: 99px;
  background: rgba(20, 20, 22, 0.85); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  max-width: calc(100% - 2 * var(--gutter)); overflow-x: auto; scrollbar-width: none;
}
.lens-block .gl-chips { display: flex; flex-wrap: nowrap; gap: 8px; }
.lens-block .gl-chip {
  white-space: nowrap; border-radius: 99px; border: 1px solid transparent; color: var(--muted); transition: color 0.25s, background-color 0.25s;
  min-height: clamp(44px, 1.6vw + 24px, 84px); padding: 0 clamp(16px, 1vw + 8px, 40px); font-size: clamp(1rem, 0.4vw + 0.8rem, 1.9rem);
}
.lens-block .gl-chip .mono { font-size: 0.75em; margin-inline-start: 8px; opacity: 0.7; }
.lens-block .gl-chip[aria-pressed="true"] { background: var(--ink); color: var(--ground); }
@media (hover: hover) { .lens-block .gl-chip:hover { color: var(--ink); } .lens-block .gl-chip[aria-pressed="true"]:hover { color: var(--ground); } }

/* contact form: more air around the subject chips */
.form { gap: clamp(28px, 2.6vw, 40px); }
fieldset.field legend { margin-bottom: 14px; }
.chips { gap: 12px 12px; }
.chip span { min-height: 46px; padding: 0 22px; font-size: 0.98rem; }

/* the contact form sits in its own frame */
.form { padding: clamp(24px, 3vw, 48px); border: 1px solid var(--line); border-radius: calc(var(--radius) + 6px); background: rgba(242, 239, 233, 0.02); }

/* about intro, after the owner's sketch: portrait on the right, title and lead beside it, centred as a pair */
.about-hero {
  grid-template-columns: minmax(0, 560px) minmax(0, 620px); justify-content: center; align-items: center;
  gap: 32px clamp(32px, 3.4vw, 64px);
}
.about-hero__media { grid-column: auto; order: -1; }
.about-hero__text { grid-column: auto; padding-bottom: 0; }
.about-hero__title { font-size: var(--t-xl); }
.about-hero__lead { margin-top: 18px; max-width: 34ch; }
@media (max-width: 899px) {
  .about-hero { grid-template-columns: minmax(0, 1fr); justify-items: start; }
  .about-hero__media { max-width: 420px; width: 100%; }
}
/* the sketch's proportions: the portrait about a fifth of the screen width, type that grows with it */
.about-hero { grid-template-columns: minmax(0, clamp(300px, 22vw, 1200px)) minmax(0, clamp(300px, 19vw, 1000px)); column-gap: clamp(32px, 2.6vw, 150px); }
.about-hero__title { font-size: max(var(--t-xl), 4.2vw); }
.about-hero__lead { font-size: max(var(--t-m), 0.64vw); margin-top: 0.9em; }
@media (max-width: 899px) { .about-hero { grid-template-columns: minmax(0, 1fr); } }
.about-hero { grid-template-columns: minmax(0, clamp(300px, 22vw, 1200px)) minmax(0, clamp(300px, 24vw, 1300px)); }
@media (min-width: 900px) { .about-hero__title { white-space: nowrap; } }
@media (max-width: 899px) { .about-hero { grid-template-columns: minmax(0, 1fr); } }
/* centred between the line above and the line below: the same space under it as over it */
.about-hero { padding-bottom: clamp(72px, 10vw, 150px); }

/* ---------- reading size ----------
   Body text was fixed while headings grow with the screen, so on wide screens it read tiny.
   The base size now grows past ~1500px wide (16px at 1440, ~18 at 1920, ~21 at 2560, up to 28),
   and the smallest steps are a notch larger everywhere. */
html { font-size: clamp(100%, 0.45vw + 9px, 175%); }
:root { --t-s: 0.95rem; --t-xs: 0.82rem; }
.card__title { font-size: 1rem; }
.card__sub { font-size: 0.86rem; }
.hero__who, .chap__label, .field label, .field legend, .svc h3, .svc__tags li, .ftr__bottom, .ftr__social a { font-size: var(--t-s); }
.svc__includes span, .faq p, .step p, .fact__label, .gal-intro, .tok, .chip span { font-size: 1rem; }
.svc__problems li, .svc__includes b, .faq summary { font-size: 1.08rem; }
.nav__link { font-size: 1.15rem; }

/* facts: a smaller number sitting right beside a larger label, instead of the two at opposite ends */
.fact { justify-content: flex-start; align-items: baseline; gap: 0.5em; }
.fact__num { font-size: clamp(2.6rem, 1.6rem + 3.2vw, 5rem); }
.fact__label { font-size: var(--t-l); font-weight: 400; color: var(--ink); line-height: 1.1; }
/* facts, second pass: the number leads, the label follows it a size step below, quieter */
.fact { gap: clamp(12px, 0.9vw, 26px); padding-block: clamp(14px, 1.2vw, 26px); }
.fact__num { order: -1; font-size: clamp(2.3rem, 1.2rem + 2.2vw, 3.8rem); }
.fact__label { font-size: var(--t-m); font-weight: 300; color: var(--muted); line-height: 1.3; }
/* in a right-to-left line the plus trails on the left: +10 */
.fact__num { direction: rtl; unicode-bidi: isolate; }
.bio__text a { color: var(--ink); background-size: 100% 1px; }

/* the YouTube channel in the bio: a small play badge that lights up red on hover */
.bio__text a.yt-link {
  display: inline-flex; align-items: center; gap: 0.4em; padding: 0.06em 0.5em 0.06em 0.6em; margin-inline: 0.1em;
  border-radius: 99px; border: 1px solid rgba(255, 59, 47, 0.45); background: rgba(255, 59, 47, 0.1);
  color: var(--ink); font-weight: 500; line-height: 1.35; white-space: nowrap; vertical-align: baseline;
  transition: background-color 0.3s var(--ease-soft), border-color 0.3s, color 0.3s;
}
.yt-link__icon { display: inline-grid; place-items: center; width: 1.25em; height: 0.9em; border-radius: 0.22em; background: var(--accent); flex: none; }
.yt-link__icon svg { width: 0.38em; height: 0.46em; fill: #fff; margin-inline-start: 0.06em; }
.yt-link__arrow { font-size: 0.8em; opacity: 0.6; transition: translate 0.35s var(--ease-out), opacity 0.3s; }
@media (hover: hover) {
  .bio__text a.yt-link:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
  .bio__text a.yt-link:hover .yt-link__icon { background: #fff; }
  .bio__text a.yt-link:hover .yt-link__icon svg { fill: var(--accent); }
  .bio__text a.yt-link:hover .yt-link__arrow { opacity: 1; translate: -2px -2px; }
}
.bio__text a.yt-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- blog (blog.html) and a post (post.html) ---------- */
.blog, .post { padding: calc(var(--hdr) + clamp(28px, 5vw, 72px)) var(--gutter) clamp(64px, 8vw, 120px); }
.blog-head { max-width: 1600px; margin: 0 auto clamp(28px, 4vw, 56px); display: grid; gap: 14px; }
.blog-head__title { font-size: var(--t-mega); }
.blog-head__lead { color: var(--muted); font-size: var(--t-m); font-weight: 300; max-width: 52ch; }
.blog-head__lead .mono { color: var(--ink); }
.blog-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; margin-top: 10px; }
.blog-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.blog-search input {
  min-height: 46px; min-width: min(320px, 80vw); padding: 0 18px; border-radius: 99px; border: 1px solid var(--line);
  background: transparent; color: var(--ink); font: inherit; font-size: 1rem; transition: border-color 0.25s;
}
.blog-search input:focus { outline: none; border-color: var(--accent); }
.blog-grid { max-width: 1600px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: clamp(28px, 3vw, 48px) clamp(16px, 2vw, 32px); }
.post-card { display: grid; gap: 10px; align-content: start; }
.post-card__cover { display: block; aspect-ratio: 16 / 10; overflow: clip; border-radius: var(--radius); background: var(--card); }
.post-card__cover img { width: 100%; height: 100%; object-fit: cover; transition: scale 0.8s var(--ease-out); }
@media (hover: hover) { .post-card:hover .post-card__cover img { scale: 1.04; } .post-card:hover .post-card__title { color: #fff; } }
.post-card__meta, .post-head__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; color: var(--muted); font-size: var(--t-s); }
.post-card__tag { color: var(--accent); font-weight: 600; }
.post-card__title { font-size: var(--t-m); font-weight: 600; line-height: 1.3; }
.post-card__excerpt { color: var(--muted); font-size: 1rem; line-height: 1.55; }
.blog-empty { text-align: center; color: var(--muted); padding: 60px 0; }

.post-head, .post-body, .post-cover, .post-next { max-width: 820px; margin-inline: auto; }
.post-head { display: grid; gap: 14px; margin-bottom: clamp(24px, 3vw, 44px); }
.post-head__back { color: var(--muted); font-weight: 500; min-height: 44px; display: inline-flex; align-items: center; gap: 8px; justify-self: start; }
@media (hover: hover) { .post-head__back:hover { color: var(--ink); } }
.post-head__title { font-size: var(--t-xl); line-height: 1.05; }
.post-head__lead { color: var(--muted); font-size: var(--t-m); font-weight: 300; }
.post-cover { margin-bottom: clamp(28px, 3vw, 48px); border-radius: var(--radius); overflow: clip; }
.post-cover img { width: 100%; }
.post-body { display: grid; gap: 1.1em; font-size: 1.12rem; line-height: 1.8; }
.post-body h2 { font-family: var(--f-display); font-weight: 700; font-size: var(--t-l); line-height: 1.1; margin-top: 0.8em; }
.post-body p { color: rgba(242, 239, 233, 0.86); }
.post-body a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 0.2em; }
.post-body b, .post-body strong { color: var(--ink); font-weight: 600; }
.post-body figure { margin: 0.6em 0; }
.post-body figure img { width: 100%; border-radius: var(--radius); }
.post-body blockquote { margin: 0.4em 0; padding-inline-start: 18px; border-inline-start: 3px solid var(--accent); font-size: var(--t-m); }
.post-video { aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: clip; background: #000; }
.post-video iframe, .post-video video { width: 100%; height: 100%; border: 0; }
.post-file .btn { min-height: 50px; }
.post-next { margin-top: clamp(56px, 7vw, 100px); }

/* lightbox arrows on the sides, large: previous on the right, next on the left (the page reads from the right) */
.lb .lb__prev, .lb .lb__next {
  position: absolute; z-index: 5; top: 50%; translate: 0 -50%;
  width: clamp(56px, 3vw + 24px, 96px); height: clamp(56px, 3vw + 24px, 96px);
  background: rgba(11, 11, 12, 0.55); border-color: rgba(242, 239, 233, 0.3);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.lb .lb__prev { right: clamp(10px, 1.6vw, 40px); }
.lb .lb__next { left: clamp(10px, 1.6vw, 40px); }
.lb .lb__prev svg, .lb .lb__next svg { width: 36%; height: 36%; }
@media (max-width: 699px) {
  .lb .lb__prev, .lb .lb__next { top: auto; bottom: calc(18px + env(safe-area-inset-bottom)); translate: none; width: 52px; height: 52px; }
}
