/* ==================================================================
   RABBI · LUBAVITCH.PRO — Profil rabína
   "TZFAT MEETS THE SINGULARITY"
   Mystická moudrost Chabadu & Safedu × AI / neon / blesky
   ================================================================== */

:root {
  /* ---- Cosmic dark base ---- */
  --bg:        #04050d;
  --bg-2:      #070914;
  --bg-3:      #0a0e1f;
  --surface:   rgba(18, 26, 54, 0.55);
  --surface-2: rgba(24, 34, 70, 0.66);
  --glass:     rgba(10, 16, 38, 0.5);

  /* ---- Tzfat electric blue (the painted-city azure, electrified) ---- */
  --cyan:        #34dffe;
  --cyan-bright: #8af3ff;
  --cyan-deep:   #1aa6d8;

  /* ---- Kabbalistic violet / magenta ---- */
  --violet:        #9d6bff;
  --violet-bright: #c4a3ff;
  --magenta:       #ff52c8;

  /* ---- Sacred gold spark (used sparingly) ---- */
  --gold: #ffce5a;

  /* ---- Ink ---- */
  --ink:     #e8f4ff;
  --ink-2:   #b6c7e6;
  --muted:   #7e8fb8;
  --muted-2: #51607f;

  --line:        rgba(120, 160, 230, 0.14);
  --line-bright: rgba(120, 200, 255, 0.34);

  --accent:        var(--cyan);
  --accent-bright: var(--cyan-bright);
  --accent-rgb:    52, 223, 254;
  --accent2:       var(--violet);
  --accent2-rgb:   157, 107, 255;

  /* ---- Neon glow knobs (Tweakable) ---- */
  --neon: 1;
  --glow-sm: 0 0 calc(8px * var(--neon)) rgba(var(--accent-rgb), 0.55);
  --glow-md: 0 0 calc(18px * var(--neon)) rgba(var(--accent-rgb), 0.5), 0 0 calc(42px * var(--neon)) rgba(var(--accent-rgb), 0.28);
  --glow-lg: 0 0 calc(28px * var(--neon)) rgba(var(--accent-rgb), 0.6), 0 0 calc(70px * var(--neon)) rgba(var(--accent-rgb), 0.35);
  --glow-v:  0 0 calc(20px * var(--neon)) rgba(var(--accent2-rgb), 0.5), 0 0 calc(50px * var(--neon)) rgba(var(--accent2-rgb), 0.3);

  /* ---- Type ---- */
  --serif: 'Frank Ruhl Libre', 'Times New Roman', serif;        /* mystical voice  */
  --tech:  'Space Grotesk', system-ui, sans-serif;             /* AI / HUD voice  */
  --sans:  'Heebo', system-ui, -apple-system, sans-serif;      /* body            */
  --mono:  'Space Mono', ui-monospace, monospace;

  --t-display: 74px;
  --t-h1:      46px;
  --t-h2:      32px;
  --t-h3:      21px;
  --t-body:    17px;
  --t-small:   14.5px;
  --t-micro:   12px;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 30px;
  --maxw: 1260px;
  --pad-x: 40px;

  /* Mobile/standalone safe-area (status bar / display cutout). Non-zero only
     inside an installed PWA/TWA with viewport-fit=cover; 0 in normal browsers
     and on desktop, so it never affects the desktop layout. */
  --safe-top: env(safe-area-inset-top, 0px);
}

/* ---- Light "daybreak" variant (geula / dawn) ---- */
[data-theme="dawn"] {
  --bg:        #e7eefc;
  --bg-2:      #dde7fb;
  --bg-3:      #eef3fe;
  --surface:   rgba(255, 255, 255, 0.7);
  --surface-2: rgba(255, 255, 255, 0.85);
  --glass:     rgba(255, 255, 255, 0.6);
  --cyan-deep: #0b86c2;
  --ink:     #0c1530;
  --ink-2:   #2c3a5e;
  --muted:   #5a6b88;
  --muted-2: #8593b3;
  --line:        rgba(20, 50, 110, 0.14);
  --line-bright: rgba(20, 120, 200, 0.34);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: var(--t-body);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Cosmic field: nebula glow + violet core + Tzfat azure rim */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -3; pointer-events: none;
  background:
    radial-gradient(1100px 720px at 82% -6%, rgba(157,107,255,0.20), transparent 60%),
    radial-gradient(900px 620px at 6% 8%, rgba(52,223,254,0.16), transparent 60%),
    radial-gradient(1400px 900px at 50% 120%, rgba(157,107,255,0.10), transparent 60%),
    var(--bg);
}
/* Faint star grain + scanlines */
body::after {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none; opacity: .5;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,.5), transparent),
    radial-gradient(1px 1px at 70% 65%, rgba(255,255,255,.4), transparent),
    radial-gradient(1px 1px at 40% 80%, rgba(255,255,255,.35), transparent),
    radial-gradient(1px 1px at 88% 20%, rgba(255,255,255,.4), transparent),
    radial-gradient(1px 1px at 55% 12%, rgba(255,255,255,.3), transparent),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.012) 0 1px, transparent 1px 3px);
  background-size: 100% 100%,100% 100%,100% 100%,100% 100%,100% 100%, 100% 3px;
}
[data-theme="dawn"] body::after { opacity: .12; }

::selection { background: var(--cyan); color: #021018; }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad-x); }

/* ---------- Type helpers ---------- */
.eyebrow {
  font-family: var(--tech);
  font-size: var(--t-micro); letter-spacing: 0.34em; text-transform: uppercase;
  font-weight: 600; color: var(--cyan);
  text-shadow: var(--glow-sm);
}
.neon { text-shadow: var(--glow-md); }
.hebrew { font-family: var(--serif); direction: rtl; font-weight: 500; }
.he-neon { font-family: var(--serif); direction: rtl; color: var(--cyan-bright); text-shadow: var(--glow-md); }

/* ==================================================================
   Top bar
   ================================================================== */
.topbar {
  position: sticky; top: 0; z-index: 60;
  /* Flush to the very top of the screen. In an installed app (PWA/TWA) with
     viewport-fit=cover the OS status bar overlays the top ~status-bar height;
     padding-top pushes the bar's CONTENT clear of it while the bar's own
     background fills that inset -- so the top bar reads as one solid bar that
     continues right up under the status bar (no ~13mm strip above it). */
  padding-top: var(--safe-top);
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 88%, transparent), color-mix(in srgb, var(--bg) 55%, transparent));
  backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
.topbar__inner { display: flex; align-items: center; flex-wrap: nowrap; gap: 26px; height: 70px; }
.brand { min-width: 0; }
.topbar__account { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand {
  display: flex; align-items: baseline; gap: 1px;
  font-family: var(--tech); font-weight: 700; font-size: 18px; letter-spacing: 0.02em; white-space: nowrap;
}
.brand .spark { color: var(--cyan); text-shadow: var(--glow-sm); }
.brand .tld { color: var(--muted); font-weight: 500; }

.mainnav { display: flex; align-items: center; gap: 2px; margin-left: 6px; }
.mainnav a {
  font-family: var(--tech); font-size: 13.5px; color: var(--ink-2);
  padding: 8px 12px; border-radius: 8px; transition: .18s; white-space: nowrap;
}
.mainnav a:hover { color: var(--cyan-bright); background: rgba(var(--accent-rgb),0.08); }
.mainnav a.active { color: var(--cyan); text-shadow: var(--glow-sm); }

.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 11px; }
.lang {
  display: flex; align-items: center; gap: 7px; font-family: var(--tech);
  font-size: 13px; color: var(--ink-2);
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: .18s;
}
.lang:hover { border-color: var(--line-bright); }
.lang b { color: var(--cyan); font-weight: 700; }
/* --- functional language switcher dropdown (native <details>) --------- */
.langwrap { position: relative; }
.langwrap > summary { list-style: none; }
.langwrap > summary::-webkit-details-marker { display: none; }
.langwrap > summary.lang { user-select: none; }
.langmenu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 60;
  min-width: 180px; display: flex; flex-direction: column;
  background: var(--panel, #0c1118); border: 1px solid var(--line);
  border-radius: 12px; padding: 6px; box-shadow: 0 16px 40px rgba(0,0,0,.5);
}
.langmenu a {
  display: flex; align-items: center; gap: 8px; padding: 8px 11px;
  border-radius: 8px; font-family: var(--tech); font-size: 13px;
  color: var(--ink-2); text-decoration: none; transition: .15s;
}
.langmenu a:hover { background: rgba(255,255,255,.05); color: var(--ink); }
.langmenu a.on { color: var(--cyan); }
.langmenu a b { color: var(--cyan); font-weight: 700; min-width: 22px; }
[dir="rtl"] .langmenu { right: auto; left: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--tech); font-size: 14px; font-weight: 600;
  padding: 10px 18px; border-radius: 11px; cursor: pointer; border: 1px solid transparent;
  transition: transform .12s, box-shadow .2s, background .2s, border-color .2s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--ghost { color: var(--ink-2); border-color: var(--line); }
.btn--ghost:hover { color: var(--ink); border-color: var(--line-bright); box-shadow: var(--glow-sm); }
.btn--neon {
  color: #021018; font-weight: 700;
  background: linear-gradient(180deg, var(--cyan-bright), var(--cyan));
  box-shadow: var(--glow-md);
}
.btn--neon:hover { box-shadow: var(--glow-lg); }
.btn--violet {
  color: var(--violet-bright); border-color: rgba(var(--accent2-rgb),0.4);
  background: rgba(var(--accent2-rgb),0.12);
}
.btn--violet:hover { box-shadow: var(--glow-v); border-color: var(--violet); }
.btn--outline {
  color: var(--cyan); border-color: var(--line-bright); background: rgba(var(--accent-rgb),0.06);
}
.btn--outline:hover { box-shadow: var(--glow-sm); }
.btn--lg { font-size: 16px; padding: 15px 26px; border-radius: 13px; }

/* ==================================================================
   Ribbon sub-nav
   ================================================================== */
.ribbon { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg-2) 50%, transparent); }
.ribbon__inner { display: flex; gap: 2px; height: 46px; align-items: center; overflow-x: auto; scrollbar-width: none; }
.ribbon__inner::-webkit-scrollbar { display: none; }
.ribbon a {
  font-family: var(--tech); font-size: 13px; color: var(--muted);
  padding: 7px 13px; border-radius: 8px; white-space: nowrap; transition: .16s;
}
.ribbon a:hover { color: var(--cyan-bright); background: rgba(var(--accent-rgb),0.07); }

/* Overflow "⋮" menu (JS-driven, static/js/rcd-ribbon-overflow.js): links that
   don't fit the row move into this dropdown instead of horizontal scrolling.
   .ribbon--js is set by the script — without JS the scroll fallback stays. */
.ribbon--js .ribbon__inner { overflow: visible; }
.ribbon__overflow { position: relative; flex: 0 0 auto; margin-inline-start: auto; }
.ribbon__more {
  font-family: var(--tech); font-size: 18px; line-height: 1; color: var(--muted);
  padding: 8px 12px; border: 0; border-radius: 8px; background: none;
  cursor: pointer; transition: .16s;
}
.ribbon__more:hover,
.ribbon__more[aria-expanded="true"] { color: var(--cyan-bright); background: rgba(var(--accent-rgb),0.07); }
.ribbon__dropdown[hidden] { display: none; } /* our display:flex would beat UA [hidden] */
.ribbon__dropdown {
  position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 80;
  display: flex; flex-direction: column; gap: 2px; min-width: 190px;
  padding: 6px; border: 1px solid var(--line-bright); border-radius: 12px;
  background: var(--bg-2);
  box-shadow: 0 14px 34px rgba(0,0,0,.45);
}
.ribbon__dropdown a { display: block; }

/* ==================================================================
   Hero — the Lightning Flash
   ================================================================== */
.hero { position: relative; padding: 76px 0 70px; overflow: hidden; }
.hero__bolt {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  width: 100%; height: 100%;
}
.hero__grid {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 430px 1fr; gap: 60px; align-items: center;
}

/* Portrait inside a neon "reliquary" frame */
.portrait-wrap { position: relative; }
.portrait {
  /* SQUARE reliquary frame REMOVED (2026-06-04 PROFILE-UX): no border, no
     filled square background, no clipping box -- only the circular avatar +
     the neon/ion ring read. aspect-ratio keeps child positions intact. */
  position: relative; aspect-ratio: 5/6; border-radius: 0; overflow: visible;
  border: 0; background: none; box-shadow: none;
}
.portrait__mono { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-size: 150px; font-weight: 700; color: var(--cyan); opacity: .10; text-shadow: var(--glow-md); z-index: 0; overflow: hidden; }
/* centered glowing avatar (for small / transparent-corner source photos) */
.portrait__avatar {
  position: absolute; z-index: 2; left: 50%; top: 46%; transform: translate(-50%, -50%);
  width: 62%; aspect-ratio: 1 / 1; border-radius: 50%; overflow: hidden;
  border: 1px solid var(--line-bright);
  background: linear-gradient(160deg, var(--surface-2), var(--bg-3));
  box-shadow: var(--glow-md), 0 24px 50px -22px #000;
}
.portrait__avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center top; filter: saturate(1.06) contrast(1.04); }
.portrait__avatar::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 30px rgba(4,7,18,0.55); pointer-events: none; }
.portrait__caption {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: 58px; text-align: center;
  font-family: var(--serif); direction: rtl; font-size: 20px; color: var(--cyan-bright); text-shadow: var(--glow-sm);
}
/* .portrait::after square vignette REMOVED (PROFILE-UX): the frame is gone. */
/* ===================================================================== */
/* CIRCULAR NEON / ION RING around the round photo (PROFILE-UX 2026-06-04). */
/* Two stacked circular layers centered on .portrait__avatar geometry        */
/* (width 62%, square, centered left:50% top:46%):                            */
/*  - ::before = slow-rotating conic-gradient neon halo (electric azure/      */
/*    violet/magenta), softly blurred.                                        */
/*  - ::after  = a thin crisp ion ring + a gentle pulsing ion glow.           */
/* Both are circular (border-radius:50%), subtle, behind the avatar (z-1).    */
.portrait-wrap::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  left: 50%; top: 46%; transform: translate(-50%, -50%);
  width: calc(62% + 26px); aspect-ratio: 1 / 1; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--cyan), var(--violet), var(--magenta), var(--violet), var(--cyan));
  filter: blur(14px); opacity: .5; animation: ionSpin 12s linear infinite;
}
.portrait-wrap::after {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  left: 50%; top: 46%; transform: translate(-50%, -50%);
  width: calc(62% + 10px); aspect-ratio: 1 / 1; border-radius: 50%;
  border: 1px solid rgba(var(--accent-rgb), .65);
  box-shadow:
    0 0 18px 2px rgba(var(--accent-rgb), .5),
    0 0 42px 8px rgba(157, 107, 255, .28),
    inset 0 0 14px 1px rgba(var(--accent-rgb), .35);
  animation: ionPulse 4.2s ease-in-out infinite;
}
@keyframes ionSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes ionPulse {
  0%,100% { opacity: .75; box-shadow: 0 0 18px 2px rgba(var(--accent-rgb), .5), 0 0 42px 8px rgba(157,107,255,.28), inset 0 0 14px 1px rgba(var(--accent-rgb), .35); }
  50%     { opacity: 1;   box-shadow: 0 0 26px 5px rgba(var(--accent-rgb), .62), 0 0 60px 14px rgba(157,107,255,.36), inset 0 0 18px 2px rgba(var(--accent-rgb), .45); }
}

.portrait__badge {
  position: absolute; left: 16px; bottom: 16px; z-index: 3;
  display: flex; align-items: center; gap: 9px; padding: 8px 14px; border-radius: 100px;
  background: rgba(4,7,18,0.7); backdrop-filter: blur(8px); border: 1px solid var(--line-bright);
  font-family: var(--tech); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--cyan-bright);
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 0 rgba(var(--accent-rgb),0.7), var(--glow-sm); animation: pulse 2.2s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(var(--accent-rgb),.6);} 70%{box-shadow:0 0 0 10px rgba(var(--accent-rgb),0);} 100%{box-shadow:0 0 0 0 rgba(var(--accent-rgb),0);} }

/* little Sefirot-node chips floating on portrait corner */
.sefirot-tag {
  position: absolute; right: -16px; top: 30px; z-index: 4;
  display: flex; flex-direction: column; gap: 10px;
}
.sefirot-tag span,
.sefirot-tag .sefirot-chip {
  font-family: var(--tech); font-size: 11px; letter-spacing: .1em; color: var(--ink-2);
  background: var(--glass); backdrop-filter: blur(8px); border: 1px solid var(--line-bright);
  padding: 7px 12px; border-radius: 100px; box-shadow: var(--glow-sm); white-space: nowrap;
}
.sefirot-tag span b,
.sefirot-tag .sefirot-chip b { color: var(--cyan-bright); }
/* Topic chips are live controls -> reset button chrome, add affordances. */
.sefirot-tag .sefirot-chip {
  cursor: pointer; font: inherit; text-align: inherit; line-height: 1.2;
  -webkit-appearance: none; appearance: none;
  font-family: var(--tech); font-size: 11px; letter-spacing: .1em;
  transition: border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .12s ease;
}
.sefirot-tag .sefirot-chip:hover,
.sefirot-tag .sefirot-chip:focus-visible {
  color: var(--ink); border-color: var(--cyan-bright);
  box-shadow: var(--glow-sm), 0 0 0 1px rgba(var(--accent-rgb), .35);
  outline: none;
}
.sefirot-tag .sefirot-chip:active { transform: translateY(1px); }
/* TOPIC SWITCH selected state: subtle accent glow + filled chip. The button
   STAYS in place (fixed row) -- selection is purely a visual mark. */
.sefirot-tag .topic-btn.is-active {
  color: #021018; font-weight: 700;
  background: linear-gradient(180deg, var(--cyan-bright), var(--cyan));
  border-color: var(--cyan-bright);
  box-shadow: var(--glow-md), 0 0 0 1px rgba(var(--accent-rgb), .55);
}
.sefirot-tag .topic-btn.is-active b { color: #021018; }

/* Hero text */
.hero__eyebrow { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.hero__eyebrow .rule { height: 1px; width: 56px; background: linear-gradient(90deg, var(--cyan), transparent); box-shadow: var(--glow-sm); }
.hero h1 { font-family: var(--serif); font-size: var(--t-display); line-height: .98; font-weight: 700; letter-spacing: -.01em; }
.hero h1 .l1 { display: block; color: var(--ink); }
.hero h1 .l2 { display: block; color: var(--cyan-bright); text-shadow: var(--glow-lg); }
.hero h1 .he { display: block; font-size: .42em; color: var(--violet-bright); direction: rtl; font-weight: 500; margin-top: 16px; text-shadow: var(--glow-v); }
.hero__role { font-family: var(--tech); font-size: 19px; color: var(--ink-2); max-width: 34ch; margin: 20px 0 26px; }
.hero__role b { color: var(--cyan); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 34px; }
.tag {
  font-family: var(--tech); font-size: 13px; color: var(--ink-2);
  padding: 6px 13px; border-radius: 100px; border: 1px solid var(--line);
  background: var(--surface); display: inline-flex; align-items: center; gap: 7px;
}
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: var(--glow-sm); }
.tag.v .dot { background: var(--violet); }
.tag.g .dot { background: var(--gold); }

.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }

.hero__stats { display: flex; gap: 38px; margin-top: 42px; padding-top: 30px; border-top: 1px solid var(--line); }
.stat .num { font-family: var(--tech); font-size: 34px; font-weight: 700; color: var(--cyan-bright); line-height: 1; text-shadow: var(--glow-sm); }
.stat .lab { font-family: var(--tech); font-size: 12.5px; color: var(--muted); margin-top: 7px; letter-spacing: .04em; }

/* ==================================================================
   Section scaffolding
   ================================================================== */
section.block { padding: 66px 0; position: relative; }
.sechead { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 36px; }
.sechead .htxt h2 { font-family: var(--serif); font-size: var(--t-h1); font-weight: 700; line-height: 1.04; }
.sechead .htxt .kick { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.sechead .htxt .kick .idx { font-family: var(--tech); font-size: 13px; color: var(--cyan); letter-spacing: .12em; }
.sechead .htxt .kick .bar { height: 1px; width: 40px; background: linear-gradient(90deg,var(--cyan),transparent); }
.sechead p { color: var(--muted); max-width: 44ch; margin-top: 10px; }

/* ==================================================================
   Study strip — "Daily transmissions"
   ================================================================== */
.studybar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.modeswitch { display: inline-flex; padding: 4px; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.modeswitch button {
  font-family: var(--tech); font-size: 13.5px; font-weight: 600; color: var(--muted);
  padding: 8px 16px; border: none; background: transparent; border-radius: 9px; cursor: pointer;
  display: flex; align-items: center; gap: 8px; transition: .16s;
}
.modeswitch button.on { background: rgba(var(--accent-rgb),0.12); color: var(--cyan-bright); box-shadow: var(--glow-sm); }

.study-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.studycard {
  position: relative; display: flex; flex-direction: column; gap: 12px;
  padding: 24px; border-radius: var(--r-lg);
  background: linear-gradient(165deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); cursor: pointer; overflow: hidden;
  transition: transform .18s, border-color .2s, box-shadow .25s;
}
.studycard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: linear-gradient(var(--cyan), var(--violet)); opacity: 0; transition: .2s; box-shadow: var(--glow-sm); }
.studycard:hover { transform: translateY(-5px); border-color: var(--line-bright); box-shadow: var(--glow-md); }
.studycard:hover::before { opacity: 1; }
.studycard__he { font-family: var(--serif); direction: rtl; font-size: 30px; color: var(--cyan); line-height: 1; font-weight: 700; text-shadow: var(--glow-sm); }
.studycard h3 { font-family: var(--serif); font-size: var(--t-h3); font-weight: 700; }
.studycard p { font-size: var(--t-small); color: var(--muted); flex: 1; }
.studycard__foot { display: flex; align-items: center; justify-content: space-between; font-family: var(--tech); font-size: 12.5px; color: var(--ink-2); }
.studycard__play { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(var(--accent-rgb),0.12); color: var(--cyan-bright); border: 1px solid var(--line-bright); transition: .16s; }
.studycard:hover .studycard__play { background: var(--cyan); color: #021018; box-shadow: var(--glow-sm); }

/* --- LIVE study-card expand (open today's portion + rabbi explanation) --- */
.studycard__open { all: unset; display: flex; flex-direction: column; gap: 12px; cursor: pointer; width: 100%; box-sizing: border-box; }
.studycard__open:focus-visible { outline: 1px solid var(--line-bright); outline-offset: 4px; border-radius: var(--r-lg); }
.studycard__open[aria-expanded="true"] .studycard__play { background: var(--cyan); color: #021018; box-shadow: var(--glow-sm); }
.studycard__panel { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--line); }
.studycard__loading, .studycard__err { font-family: var(--tech); font-size: 12.5px; color: var(--ink-2); }
.studycard__orig { font-family: var(--serif); font-size: 15px; line-height: 1.6; color: var(--ink); }
/* B11 daily-rule: bilingual ORIGINAL-first block (Hebrew original +
   client-language translation, chabad.org/dailystudy style). The original
   leads the panel; the rabbi explanation follows under .studycard__explainh. */
.studycard__bi { display: flex; flex-direction: column; gap: 6px; }
.studycard__bilabel { font-family: var(--tech); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.studycard__he-orig { font-family: var(--serif); direction: rtl; text-align: right; font-size: 18px; line-height: 1.9; color: var(--ink); }
.studycard__trans { font-family: var(--serif); font-size: 15px; line-height: 1.65; color: var(--ink); }
.studycard__trans[dir="rtl"] { text-align: right; }
.studycard__src { font-family: var(--tech); font-size: 11.5px; color: var(--ink-2); }
.studycard__explainh { font-family: var(--tech); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--cyan-bright); }
.studycard__explain { font-size: 14px; line-height: 1.65; color: var(--ink-2); }
.studycard__listen { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 4px; }
.studycard__listen .ask-audio, .ask-rav__audio .ask-audio, .ask-audio { width: 100%; max-width: 320px; margin-top: 6px; }
/* library link cards behave like the article cards (no underline) */
a.lesson--link { text-decoration: none; color: inherit; display: flex; flex-direction: column; }

/* ==================================================================
   Ask the rabbi — AI core
   ================================================================== */
.ask__panel {
  position: relative;
  display: grid; grid-template-columns: 1.02fr 1fr; gap: 0;
  border-radius: var(--r-xl); overflow: hidden; border: 1px solid var(--line-bright);
  background: linear-gradient(150deg, var(--surface-2), var(--glass));
  box-shadow: var(--glow-md), 0 50px 100px -50px #000;
}
.ask__left { padding: 52px 46px; display: flex; flex-direction: column; position: relative; z-index: 2; }
.ask__left h2 { font-family: var(--serif); font-size: 40px; font-weight: 700; line-height: 1.05; margin: 16px 0 14px; }
.ask__left h2 em { font-style: normal; color: var(--cyan-bright); text-shadow: var(--glow-md); }
.ask__left p { color: var(--ink-2); max-width: 40ch; }
.ask__feat { margin: 30px 0 34px; display: flex; flex-direction: column; gap: 15px; }
.ask__feat li { display: flex; gap: 14px; align-items: flex-start; list-style: none; font-size: var(--t-small); color: var(--ink-2); }
.ask__feat .ic { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(var(--accent-rgb),0.12); color: var(--cyan-bright); border: 1px solid var(--line-bright); box-shadow: var(--glow-sm); }
.ask__feat b { color: var(--ink); }

/* chat mock */
.chat {
  position: relative;
  background: radial-gradient(560px 300px at 80% 0%, rgba(var(--accent2-rgb),0.16), transparent 60%), var(--bg-2);
  padding: 32px; display: flex; flex-direction: column; gap: 15px; justify-content: flex-end; border-left: 1px solid var(--line);
}
.chat__hud { position: absolute; top: 16px; left: 24px; right: 24px; display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--muted-2); }
.chat__hud .live { color: var(--cyan); display: flex; align-items: center; gap: 6px; }
.bubble { max-width: 86%; padding: 14px 18px; border-radius: 18px; font-size: var(--t-small); line-height: 1.55; }
.bubble--user { align-self: flex-end; background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); border-bottom-right-radius: 5px; }
.bubble--rav {
  align-self: flex-start; border-bottom-left-radius: 5px;
  background: linear-gradient(165deg, rgba(var(--accent-rgb),0.14), var(--surface-2));
  color: var(--ink); border: 1px solid var(--line-bright);
  box-shadow: var(--glow-sm);
}
.bubble--rav .who { font-family: var(--tech); font-weight: 700; font-size: 11.5px; color: var(--cyan-bright); letter-spacing: .04em; margin-bottom: 6px; display: flex; align-items: center; gap: 7px; }
.bubble--rav .src { margin-top: 11px; font-family: var(--mono); font-size: 10.5px; color: var(--muted); display: flex; gap: 7px; flex-wrap: wrap; }
.bubble--rav .src span { padding: 3px 8px; border-radius: 6px; background: rgba(var(--accent-rgb),0.08); border: 1px solid var(--line); color: var(--cyan-bright); }
.typing { display: flex; gap: 5px; align-self: flex-start; padding: 14px 18px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: var(--glow-sm); animation: blink 1.2s infinite; }
.typing i:nth-child(2){animation-delay:.2s;} .typing i:nth-child(3){animation-delay:.4s;}
@keyframes blink { 0%,60%,100%{opacity:.25;} 30%{opacity:1;} }

.composer { display: flex; align-items: center; gap: 11px; margin-top: 6px; padding: 8px 8px 8px 18px; background: var(--surface); border: 1px solid var(--line-bright); border-radius: 14px; }
.composer input { flex: 1; background: transparent; border: none; outline: none; color: var(--ink); font-family: var(--sans); font-size: var(--t-small); }
.composer input::placeholder { color: var(--muted-2); }
.mic { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: rgba(var(--accent-rgb),0.12); color: var(--cyan-bright); border: 1px solid var(--line-bright); cursor: pointer; transition: .16s; }
.mic:hover { background: var(--cyan); color: #021018; box-shadow: var(--glow-sm); }
/* listening state: pulsing red dot while voice capture is active */
.mic.is-listening { background: #e53935; color: #fff; border-color: #ff6f60; animation: micpulse 1.1s ease-in-out infinite; }
.mic.is-listening:hover { background: #ff5a4d; color: #fff; }
@keyframes micpulse { 0%,100% { box-shadow: 0 0 0 0 rgba(229,57,53,0.55); } 50% { box-shadow: 0 0 0 8px rgba(229,57,53,0); } }

/* PORTRAIT-CLICK MIC: clicking the rabbi's portrait starts voice input. While
   listening, the portrait shows an unmistakable pulsing ring + a floating
   "Слушаю…/poslouchám" cue. Cursor hints the photo is tappable. */
.portrait__avatar { cursor: pointer; }
.portrait-wrap.is-listening .portrait__avatar {
  box-shadow: 0 0 0 3px #e53935, var(--glow-md), 0 24px 50px -22px #000;
  animation: portraitlisten 1.15s ease-in-out infinite;
}
@keyframes portraitlisten {
  0%,100% { box-shadow: 0 0 0 0 rgba(229,57,53,0.55); }
  50%     { box-shadow: 0 0 0 14px rgba(229,57,53,0); }
}
.portrait-listen-cue {
  position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%) translateY(6px);
  background: #e53935; color: #fff; font-weight: 600; font-size: 13px;
  padding: 5px 14px; border-radius: 999px; white-space: nowrap;
  box-shadow: 0 6px 18px rgba(229,57,53,0.45);
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; z-index: 5;
  display: flex; align-items: center; gap: 7px;
}
.portrait-listen-cue::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff;
  animation: micpulse 1.1s ease-in-out infinite;
}
.portrait-listen-cue.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===================================================================== */
/* PORTRAIT = THE SINGLE HANDS-FREE CONVERSATION CONTROL (in-place).      */
/* The whole portrait is the button. An overlay anchored ON it shows the  */
/* state machine: idle -> listening -> thinking -> speaking (-> loop), or */
/* paused. Pulsing ring per-state + a state label + a live caption of     */
/* what was heard / answered. The page never scrolls when it is tapped.   */
/* ===================================================================== */
.portrait { -webkit-tap-highlight-color: transparent; }
.portrait-convo {
  position: absolute; inset: 0; z-index: 6;
  pointer-events: none;            /* clicks fall through to .portrait */
  border-radius: var(--r-xl);
}
/* the pulsing state ring drawn around the CIRCULAR avatar edge */
.portrait-convo .pc-ring {
  position: absolute; z-index: 7;
  /* match .portrait__avatar geometry: width 62%, square, centered at top:46% */
  left: 50%; top: 46%; transform: translate(-50%, -50%);
  width: calc(62% + 6px); aspect-ratio: 1 / 1; border-radius: 50%;
  pointer-events: none; opacity: 0; transition: opacity .2s;
}
.portrait-wrap.pc-active .portrait-convo .pc-ring { opacity: 1; }
.portrait-wrap.pc-listening .portrait-convo .pc-ring {
  box-shadow: 0 0 0 3px #e53935, 0 0 26px 6px rgba(229,57,53,.55);
  animation: pcPulse 1.15s ease-in-out infinite;
}
.portrait-wrap.pc-thinking .portrait-convo .pc-ring {
  box-shadow: 0 0 0 3px #e0c04c, 0 0 22px 5px rgba(224,192,76,.5);
  animation: pcSpin 1.2s linear infinite;
}
.portrait-wrap.pc-speaking .portrait-convo .pc-ring {
  box-shadow: 0 0 0 3px var(--cyan-bright), 0 0 30px 8px rgba(var(--accent-rgb),.6);
  animation: pcPulse 1.5s ease-in-out infinite;
}
.portrait-wrap.pc-paused .portrait-convo .pc-ring {
  box-shadow: 0 0 0 3px #7a8aa0, 0 0 16px 3px rgba(122,138,160,.4);
}
@keyframes pcPulse {
  0%,100% { box-shadow: 0 0 0 3px currentColor, 0 0 14px 2px rgba(255,255,255,.0); transform: translate(-50%, -50%) scale(1); }
  50%     { transform: translate(-50%, -50%) scale(1.012); }
}
@keyframes pcSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }
/* dim the portrait a touch while active so the overlay reads clearly */
.portrait-wrap.pc-active .portrait::after { opacity: 1; }

/* state badge (icon + label) pinned top-center on the portrait */
.portrait-convo .pc-badge {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%) translateY(-6px);
  display: none; align-items: center; gap: 8px;
  padding: 7px 15px; border-radius: 999px;
  background: rgba(4,7,18,0.82); backdrop-filter: blur(8px);
  border: 1px solid var(--line-bright); color: var(--cyan-bright);
  font-family: var(--tech); font-size: 12px; font-weight: 600; letter-spacing: .04em;
  white-space: nowrap; box-shadow: var(--glow-sm);
  opacity: 0; transition: opacity .2s, transform .2s;
}
.portrait-wrap.pc-active .portrait-convo .pc-badge { display: flex; opacity: 1; transform: translateX(-50%) translateY(0); }
.portrait-wrap.pc-listening .portrait-convo .pc-badge { color: #ff8a80; border-color: #ff6f60; }
.portrait-wrap.pc-thinking  .portrait-convo .pc-badge { color: #f4dd7a; border-color: #e0c04c; }
.portrait-wrap.pc-speaking  .portrait-convo .pc-badge { color: var(--cyan-bright); }
.portrait-convo .pc-ico { font-size: 14px; line-height: 1; }

/* live caption (what was heard / the answer) anchored UNDER the portrait */
.portrait-convo .pc-cap {
  position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%) translateY(8px);
  max-width: 112%; width: max-content; max-height: 92px; overflow: hidden;
  padding: 9px 15px; border-radius: 14px;
  background: rgba(4,7,18,0.88); backdrop-filter: blur(10px);
  border: 1px solid var(--line-bright); color: var(--ink);
  font-size: 13.5px; line-height: 1.4; text-align: center;
  box-shadow: 0 10px 30px -10px #000;
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; z-index: 7;
}
.portrait-convo .pc-cap.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* idle affordance: a subtle hint the portrait is tappable */
.portrait-wrap:not(.pc-active) .portrait::before {
  content: ""; position: absolute; inset: 0; z-index: 3; border-radius: var(--r-xl);
  box-shadow: inset 0 0 0 0 rgba(var(--accent-rgb),0); transition: box-shadow .25s; pointer-events: none;
}
.portrait-wrap:not(.pc-active) .portrait:hover::before {
  box-shadow: inset 0 0 0 2px rgba(var(--accent-rgb),.5);
}

/* mobile: bigger caption + room under the portrait for it */
@media (max-width: 760px){
  .portrait-convo .pc-cap { font-size: 14.5px; max-width: 120%; }
  .portrait-convo .pc-badge { font-size: 12.5px; top: 10px; }
}

.composer .send { width: 42px; height: 42px; border-radius: 11px; background: linear-gradient(180deg,var(--cyan-bright),var(--cyan)); color: #021018; display: grid; place-items: center; cursor: pointer; border: none; box-shadow: var(--glow-sm); }

/* ---- LIVE "Ask the rabbi" chat (wired to the twin) ---------------- */
/* Scrollable conversation log: the seed demo + every real Q&A turn live
   here so the panel grows downward without breaking the cosmic layout. */
.chat__log {
  display: flex; flex-direction: column; gap: 15px;
  max-height: 360px; overflow-y: auto; padding-right: 4px;
  scrollbar-width: thin;
}
.chat__log::-webkit-scrollbar { width: 6px; }
.chat__log::-webkit-scrollbar-thumb { background: var(--line-bright); border-radius: 6px; }
.ask-seed { display: contents; }
.ask-rav__body { display: block; }
.ask-rav__text { white-space: pre-wrap; }
.ask-rav__audio { margin-top: 11px; }
.ask-rav__audio .ask-audio { width: 100%; height: 34px; border-radius: 9px; }
.bubble--rav .src span { cursor: help; }

/* ---- Answer-box actions: copy / download / share -------------------- */
.ask-rav__actions {
  position: relative;
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ask-rav__act {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  min-height: 34px;
  font-family: var(--tech);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--cyan-bright);
  background: rgba(var(--accent-rgb), 0.06);
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .08s ease;
  -webkit-tap-highlight-color: transparent;
}
.ask-rav__act svg { flex: none; opacity: .9; }
.ask-rav__act:hover {
  background: rgba(var(--accent-rgb), 0.12);
  border-color: var(--line-bright);
  box-shadow: var(--glow-sm);
}
.ask-rav__act:active { transform: translateY(1px); }
.ask-rav__act-lbl { white-space: nowrap; }
.ask-rav__toast {
  position: absolute;
  top: -8px;
  left: 0;
  transform: translateY(-100%);
  padding: 6px 11px;
  font-family: var(--tech);
  font-size: 12px;
  font-weight: 600;
  color: #07121f;
  background: var(--cyan-bright);
  border-radius: 8px;
  box-shadow: var(--glow-sm);
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
  z-index: 4;
}
.ask-rav__toast.is-on { opacity: 1; transform: translateY(-100%) translateY(-2px); }
[dir="rtl"] .ask-rav__toast { left: auto; right: 0; }
@media (max-width: 640px) {
  .ask-rav__act { flex: 1 1 auto; justify-content: center; min-height: 42px; font-size: 13px; }
}
.composer .send.is-busy { opacity: .55; cursor: progress; }
.composer .send:disabled { cursor: progress; }
/* RTL (he): user bubbles flip side; citation chips wrap naturally. */
[dir="rtl"] .bubble--user { align-self: flex-start; border-bottom-right-radius: 18px; border-bottom-left-radius: 5px; }
[dir="rtl"] .bubble--rav { align-self: flex-end; border-bottom-left-radius: 18px; border-bottom-right-radius: 5px; }

/* ==================================================================
   Split: bio + channels
   ================================================================== */
.split { display: grid; grid-template-columns: 1.5fr 1fr; gap: 42px; align-items: start; }
.prose p { color: var(--ink-2); margin-bottom: 18px; max-width: 60ch; }
.prose p.lead { font-family: var(--serif); font-size: 24px; line-height: 1.5; color: var(--ink); }
.pullquote {
  margin: 32px 0; padding: 26px 30px; border-radius: var(--r-md);
  background: linear-gradient(150deg, rgba(var(--accent-rgb),0.10), rgba(var(--accent2-rgb),0.07));
  border: 1px solid var(--line-bright); box-shadow: var(--glow-sm);
  font-family: var(--serif); font-size: 22px; line-height: 1.5; color: var(--ink);
}
.pullquote .he { display: block; direction: rtl; color: var(--cyan-bright); font-size: 19px; margin-top: 12px; text-shadow: var(--glow-sm); }

.sidecard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; backdrop-filter: blur(8px); }
.sidecard + .sidecard { margin-top: 20px; }
.sidecard h3 { font-family: var(--tech); font-size: 15px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; }
.channel { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.channel:last-child { border-bottom: none; }
.channel .ic { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--surface-2); border: 1px solid var(--line-bright); color: var(--cyan); }
.channel .meta { flex: 1; }
.channel .meta b { display: block; font-size: var(--t-small); color: var(--ink); font-weight: 600; }
.channel .meta span { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.channel .arw { color: var(--muted); transition: .16s; }
.channel:hover .arw { color: var(--cyan); transform: translateX(3px); }
.channel:hover .ic { box-shadow: var(--glow-sm); }

.factrow { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: var(--t-small); }
.factrow:last-child { border: none; }
.factrow span { color: var(--muted); }
.factrow b { color: var(--ink); font-weight: 600; }

/* ==================================================================
   Library
   ================================================================== */
.libtools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.chip { font-family: var(--tech); font-size: 13px; color: var(--ink-2); padding: 8px 15px; border-radius: 100px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: .16s; }
.chip:hover { border-color: var(--line-bright); color: var(--ink); }
.chip.on { background: rgba(var(--accent-rgb),0.12); color: var(--cyan-bright); border-color: var(--line-bright); box-shadow: var(--glow-sm); }

.lib-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.lesson { display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); cursor: pointer; transition: transform .16s, border-color .2s, box-shadow .25s; }
.lesson:hover { transform: translateY(-4px); border-color: var(--line-bright); box-shadow: var(--glow-md); }
.lesson__thumb { aspect-ratio: 16/10; border-radius: var(--r-sm); position: relative; overflow: hidden; background: radial-gradient(120px 80px at 70% 30%, rgba(var(--accent-rgb),0.2), transparent), linear-gradient(150deg, var(--surface-2), var(--bg-3)); display: grid; place-items: center; border: 1px solid var(--line); }
.lesson__thumb .play { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: rgba(4,7,18,0.5); backdrop-filter: blur(4px); border: 1px solid var(--line-bright); color: var(--cyan-bright); box-shadow: var(--glow-sm); }
.lesson__thumb .dur { position: absolute; right: 8px; bottom: 8px; font-family: var(--mono); font-size: 11px; background: rgba(0,0,0,0.6); padding: 3px 7px; border-radius: 6px; color: #fff; }
.lesson__cat { font-family: var(--tech); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--cyan); font-weight: 600; }
.lesson h3 { font-family: var(--serif); font-size: var(--t-h3); font-weight: 700; line-height: 1.2; }
.lesson__meta { font-family: var(--mono); font-size: 11px; color: var(--muted); display: flex; gap: 10px; }

/* ==================================================================
   Sponsor band
   ================================================================== */
.sponsor {
  position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 58px;
  background: radial-gradient(700px 360px at 100% 0%, rgba(var(--accent2-rgb),0.22), transparent 60%), linear-gradient(150deg, var(--surface-2), var(--bg-2));
  border: 1px solid var(--line-bright); box-shadow: var(--glow-md);
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 42px; align-items: center;
}
.sponsor h2 { font-family: var(--serif); font-size: 38px; font-weight: 700; line-height: 1.08; margin-bottom: 14px; }
.sponsor h2 em { font-style: normal; color: var(--cyan-bright); text-shadow: var(--glow-md); }
.sponsor p { color: var(--ink-2); max-width: 48ch; }
.sponsor__he { position: absolute; right: 34px; bottom: -18px; font-family: var(--serif); direction: rtl; font-size: 130px; color: var(--cyan); opacity: .08; line-height: 1; pointer-events: none; }
.tiers { display: flex; flex-direction: column; gap: 12px; position: relative; z-index: 2; }
.tier { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-radius: var(--r-md); background: var(--glass); border: 1px solid var(--line); transition: .16s; cursor: pointer; }
.tier:hover { border-color: var(--line-bright); box-shadow: var(--glow-sm); }
.tier b { font-family: var(--serif); font-size: 20px; font-weight: 700; }
.tier span { font-family: var(--tech); font-size: 13px; color: var(--muted); }
.tier .amt { font-family: var(--tech); color: var(--cyan-bright); font-weight: 700; }

/* ==================================================================
   Footer
   ================================================================== */
.foot { border-top: 1px solid var(--line); margin-top: 44px; padding: 56px 0 40px; }
.foot__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 36px; }
.foot h4 { font-family: var(--tech); font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }
.foot a { display: block; font-size: var(--t-small); color: var(--ink-2); padding: 5px 0; transition: .15s; }
.foot a:hover { color: var(--cyan); }
.foot__brand p { color: var(--muted); font-size: var(--t-small); max-width: 34ch; margin-top: 14px; }
.foot__bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 46px; padding-top: 24px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 11.5px; color: var(--muted-2); }

/* ==================================================================
   Reveal
   ================================================================== */
.reveal { opacity: 1; transform: none; }
html.js-anim .reveal {
  opacity: 0; transform: translateY(22px);
  transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1);
}
html.js-anim .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html.js-anim .reveal { opacity: 1; transform: none; transition: none; }
  .portrait-wrap::before { animation: none; }
}

/* ==================================================================
   Responsive
   ================================================================== */
@media (max-width: 1080px) {
  :root { --t-display: 54px; --t-h1: 38px; }
  .hero__grid { grid-template-columns: 320px 1fr; gap: 44px; }
  /* Topic chips become a static, centered, tappable row below the portrait. */
  .sefirot-tag {
    position: static; right: auto; top: auto;
    flex-direction: row; flex-wrap: wrap; justify-content: center;
    gap: 8px; margin: 16px auto 0; max-width: 100%;
  }
  .sefirot-tag .sefirot-chip {
    min-height: 40px; display: inline-flex; align-items: center;
    padding: 9px 16px; font-size: 12px; white-space: normal;
  }
  .study-grid, .lib-grid { grid-template-columns: repeat(2, 1fr); }
  .ask__panel { grid-template-columns: 1fr; }
  .chat { border-left: none; border-top: 1px solid var(--line); }
  .split, .sponsor { grid-template-columns: 1fr; }
  .foot__grid { grid-template-columns: 1fr 1fr; }
  .mainnav { display: none; }
}
@media (max-width: 720px) {
  :root { --pad-x: 20px; --t-display: 42px; --t-h1: 30px; }
  .hero { padding: 40px 0; }
  .hero__grid { grid-template-columns: 1fr; gap: 36px; }
  .portrait { max-width: 300px; }
  .study-grid, .lib-grid { grid-template-columns: 1fr; }
  .ask__left, .sponsor { padding: 32px 24px; }
  .foot__grid { grid-template-columns: 1fr 1fr; }
}

/* ==================================================================
   MOBILE (phones) - full-width vertical stack, content first.
   2026-06-02 live-demo hotfix: the whole layout stacks, decoration
   is scaled/clipped (never hides content), and #ask is reachable in
   one screen with large tap targets + an always-on play voice button.
   ================================================================== */
@media (max-width: 560px) {
  :root {
    --pad-x: 16px;
    --t-display: 34px; --t-h1: 26px; --t-h2: 24px; --t-body: 16px; --t-small: 15px;
  }
  /* No horizontal overflow, ever. */
  html, body { max-width: 100%; overflow-x: hidden; }
  .wrap { padding: 0 var(--pad-x); }

  /* --- Top bar: brand + auth buttons only, never overflow.  ONE row,
         never wrap to a 2nd line (a wrapped auth row looked like a
         duplicated bar on phones). --- */
  .topbar__inner { gap: 10px; height: 60px; flex-wrap: nowrap; }
  .brand { font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar__right { flex-wrap: nowrap; flex-shrink: 0; }
  .topbar__account { max-width: 38vw; }
  .brand .tld { display: none; }              /* keep "RABBI." compact */
  .topbar__right { gap: 7px; }
  .lang { display: none; }                    /* language stays in footer / menu */
  .btn { padding: 9px 13px; font-size: 13px; }

  /* --- Ribbon: KEEP it (it is the jump-to-#ask path). Sticky,
         finger-friendly. The .topbar exists ONLY for anonymous visitors
         (Jinja-gated), so by DEFAULT the ribbon sticks flush to the very
         top (own padding fills the notch inset, same trick as .topbar);
         only when a .topbar directly precedes it does it sit 60px lower. --- */
  .ribbon {
    display: block;
    position: sticky; top: 0; z-index: 50;
    padding-top: var(--safe-top);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(12px);
    -webkit-overflow-scrolling: touch;
  }
  .topbar + .ribbon { top: calc(60px + var(--safe-top)); padding-top: 0; }
  .ribbon__inner { height: 46px; gap: 4px; }
  .ribbon a { font-size: 13px; padding: 9px 12px; white-space: nowrap; }
  /* Make the "Zeptat se rabina" jump stand out as the primary mobile action. */
  .ribbon a[href="#ask"] {
    color: #021018; font-weight: 700;
    background: linear-gradient(180deg, var(--cyan-bright), var(--cyan));
    border-radius: 9px; box-shadow: var(--glow-sm);
  }

  /* --- Hero: single column, content centered & visible --- */
  .hero { padding: 26px 0 30px; }
  .hero__grid { gap: 26px; }
  .portrait-wrap { max-width: 240px; margin: 0 auto; }
  .portrait { max-width: 240px; }
  .portrait__mono { font-size: 130px; }       /* clipped by overflow:hidden anyway */
  /* keep topic chips visible + tappable on phones (do NOT hide) */
  .sefirot-tag .sefirot-chip { font-size: 11px; padding: 9px 14px; }
  .hero__bolt { opacity: .5; }                /* keep decoration subtle, never covering */
  .hero__text { text-align: left; }
  .hero h1 .he { font-size: .5em; margin-top: 10px; }
  .hero__role { font-size: 16px; max-width: 100%; margin: 16px 0 20px; }
  .tags { gap: 8px; }
  .hero__cta { flex-direction: column; align-items: stretch; gap: 10px; }
  .hero__cta .btn { width: 100%; }
  .btn--lg { font-size: 16px; padding: 15px 20px; }
  .hero__stats { gap: 22px; margin-top: 28px; padding-top: 22px; flex-wrap: wrap; }

  /* --- Sections: tighter vertical rhythm --- */
  .block { padding: 40px 0; }
  .sechead { flex-direction: column; align-items: flex-start; gap: 12px; }
  .modeswitch { align-self: flex-start; }

  /* --- ASK: one screen, composer prominent + immediately usable --- */
  .ask__panel { grid-template-columns: 1fr; border-radius: var(--r-lg); }
  .ask__left { padding: 26px 18px 8px; }
  .ask__left h2 { font-size: 26px; }
  .ask__left p { max-width: 100%; }
  /* Trim the long marketing list on phones so the composer is reachable
     without a big scroll; the chat itself carries the real interaction. */
  .ask__feat { display: none; }
  .ask__left .hero__cta { margin-top: 4px; }
  .ask__left .hero__cta .btn { width: 100%; }

  .chat {
    padding: 18px 16px 20px;
    /* Put the live composer FIRST so the input + mic + send are the first
       thing the visitor sees in the #ask card on a phone. */
    display: flex; flex-direction: column; gap: 14px; justify-content: flex-start;
  }
  .chat__hud { position: static; margin-bottom: 4px; }
  .composer {
    order: -1;                                 /* composer on top, in reach */
    margin-top: 0; gap: 9px; padding: 7px 7px 7px 14px; border-radius: 13px;
    position: sticky; top: calc(110px + var(--safe-top)); z-index: 5;  /* stays put as the log scrolls */
    background: var(--surface-2);
  }
  /* 16px input prevents iOS auto-zoom; bigger tap targets. */
  .composer input { font-size: 16px; padding: 6px 0; }
  .mic, .composer .send { width: 46px; height: 46px; border-radius: 12px; }
  .chat__log { max-height: 300px; }
  .bubble { max-width: 92%; font-size: 15px; padding: 13px 15px; }

  /* The voice play button must be big + tappable (autoplay is blocked). */
  .ask-rav__speak.btn { width: 100%; font-size: 16px; padding: 14px 18px; margin-top: 4px; }
  .studycard__listen .btn { width: 100%; font-size: 16px; padding: 13px 18px; }
  .ask-audio, .ask-rav__audio .ask-audio, .studycard__listen .ask-audio { max-width: 100%; height: 40px; }

  /* --- Cards / library / bio / sponsor stack full width --- */
  .study-grid, .lib-grid { grid-template-columns: 1fr; }
  .split, .sponsor { grid-template-columns: 1fr; }
  .sponsor { padding: 28px 18px; }
  .sponsor__he { display: none; }
  .sidecard { padding: 20px 16px; }
  .libtools { gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .foot__grid { grid-template-columns: 1fr 1fr; gap: 22px; }
  .foot__bottom { flex-direction: column; gap: 8px; text-align: center; }
}

/* Extra-small phones (<=400px: iPhone SE / 360-wide Androids) */
@media (max-width: 400px) {
  :root { --t-display: 30px; --t-h1: 23px; }
  .portrait-wrap, .portrait { max-width: 210px; }
  .ask__left h2, .hero h1 .l1, .hero h1 .l2 { word-break: break-word; }
  .foot__grid { grid-template-columns: 1fr; }
  .hero__stats { gap: 16px; }
  .stat .num { font-size: 26px; }
}
