/* QUIXOTIC · שלב 0 — דף ניסוי. מובייל אנכי קודם. שחור ולבן בלבד. */
:root {
  --black: #000;
  --ink: #1a1a1a;
  --white: #fff;
  --grey: #888;
  --pale: #e7e4e4;
  --display: "Barlow Condensed", "Bahnschrift", "DIN Condensed", "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", sans-serif-condensed, sans-serif;
  /* לטקסט בקו-מתאר: בלי Bahnschrift, שבו קו המתאר חושף קווים פנימיים של האות (גופן משתנה עם קווי מתאר חופפים) */
  --outline: "Barlow Condensed", "DIN Condensed", "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", sans-serif-condensed, "Impact", sans-serif;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --vh: 100vh;
}
@supports (height: 100svh) { :root { --vh: 100svh; } }

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--black); color: var(--white); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; font-family: var(--text); background: var(--black); overflow-x: clip; -webkit-tap-highlight-color: transparent; }
img, video, canvas { display: block; }

/* ---------- כותרת קבועה ---------- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  height: calc(52px + var(--sat));
  padding: var(--sat) calc(16px + var(--sar)) 0 calc(16px + var(--sal));
  pointer-events: none;
}
.bar-logo { width: 100px; height: auto; filter: brightness(0) invert(1); opacity: 0; transition: opacity .35s ease; }
.bar.is-compact .bar-logo { opacity: 1; }
.bar-cart {
  font-family: var(--display); font-stretch: condensed; font-weight: 600; font-size: 17px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--white); text-shadow: 0 0 12px rgba(0, 0, 0, .8);
}
.bar-cart.is-bump { animation: bump .45s ease; }
@keyframes bump { 30% { transform: scale(1.18); } }

/* ---------- א+ב: במה דביקה בתוך מקטע גבוה ---------- */
.scrub { position: relative; height: calc(var(--vh) * 4.6); background: var(--black); }
.stage { position: sticky; top: 0; height: var(--vh); overflow: hidden; background: var(--black); }
.stage-frame {
  position: relative; height: 100%;
  width: min(100vw, calc(var(--vh) * 9 / 16));   /* בדסקטופ: 9:16 ממורכז על שחור */
  margin: 0 auto; overflow: hidden; background: var(--ink);
  container-type: inline-size; contain: layout paint;
}
.poster, .entrance, .layers, .layers > * { position: absolute; inset: 0; width: 100%; height: 100%; }
.poster, .entrance, .layers > video, .layers > canvas, .layers > img { object-fit: cover; }
.layers { visibility: hidden; }
.layers.is-live { visibility: visible; }
.entrance { transition: opacity .28s ease; pointer-events: none; background: transparent; }
.entrance.is-out { opacity: 0; }
video::-webkit-media-controls, video::-webkit-media-controls-start-playback-button { display: none !important; -webkit-appearance: none; }
.layers > .flip-base { will-change: clip-path; }
.layers > .flip-line {
  inset: 0 auto 0 0; width: 2px; margin-left: -1px; background: var(--white);
  box-shadow: 0 0 14px 2px rgba(255, 255, 255, .55); will-change: transform; visibility: hidden;
}

.hero-logo {
  position: absolute; left: 50%; top: calc(11% + var(--sat)); width: min(62%, 300px); height: auto;
  transform: translateX(-50%); filter: brightness(0) invert(1) drop-shadow(0 0 18px rgba(255, 255, 255, .35));
  opacity: 0; animation: lamp 1.5s .15s linear forwards; transition: opacity .35s ease; pointer-events: none;
}
.hero-logo.is-gone { animation: none; opacity: 0; }
@keyframes lamp { /* הלוגו "נדלק" כמו פנס סטודיו. opacity בלבד */
  0% { opacity: 0; } 8% { opacity: .85; } 12% { opacity: .1; } 20% { opacity: .9; } 26% { opacity: .25; }
  34% { opacity: 1; } 42% { opacity: .6; } 55%, 100% { opacity: 1; }
}

.marquee {
  position: absolute; left: 0; right: 0; top: 66%; overflow: hidden; pointer-events: none;
  opacity: 0; transition: opacity .4s ease;
}
.marquee.is-on { opacity: 1; }
.marquee-track { display: flex; width: max-content; will-change: transform; animation: run 16s linear infinite; animation-play-state: paused; }
.marquee.is-on .marquee-track { animation-play-state: running; }
.marquee span {
  flex: none; white-space: pre; font-family: var(--outline); font-stretch: condensed; font-weight: 700;
  font-size: 64px; font-size: clamp(48px, 17cqw, 110px); line-height: 1.05; letter-spacing: .03em; text-transform: uppercase;
  color: transparent; -webkit-text-stroke: 1.25px var(--white);
}
@keyframes run { to { transform: translate3d(-50%, 0, 0); } }

.scroll-hint {
  position: absolute; left: 0; right: 0; bottom: calc(22px + var(--sab));
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-family: var(--display); font-stretch: condensed; font-weight: 600; font-size: 13px; letter-spacing: .42em; text-indent: .42em;
  color: var(--white); opacity: 0; transition: opacity .5s ease; pointer-events: none;
}
.scroll-hint.is-on { opacity: .9; }
.scroll-hint i { display: block; width: 1px; height: 34px; background: var(--white); transform-origin: top; animation: drip 1.6s ease-in-out infinite; animation-play-state: paused; }
.scroll-hint.is-on i { animation-play-state: running; }
@keyframes drip { 0% { transform: scaleY(0); opacity: 1; } 60% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------- ג: דף מוצר ---------- */
.product { position: relative; background: var(--black); padding-bottom: calc(96px + var(--sab)); }
.spin {
  position: relative; margin: 0 auto; overflow: hidden; background: var(--ink);
  width: 100%; height: min(calc(100vw * 16 / 9), calc(var(--vh) * .76));
  touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  outline: none; contain: layout paint;
}
.spin.is-dragging { cursor: grabbing; }
.spin:focus-visible { box-shadow: inset 0 0 0 2px var(--white); }
.spin-pending {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: var(--grey); font-family: var(--text); font-size: 15px; letter-spacing: .08em;
  background: repeating-linear-gradient(135deg, #1a1a1a 0 14px, #161616 14px 28px);
}
.spin-pending b { font-family: var(--display); font-stretch: condensed; font-size: 64px; font-weight: 700; color: var(--pale); letter-spacing: .04em; }
.spin-pending[hidden], .drag-hint[hidden] { display: none; }
.drag-hint {
  position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; pointer-events: none;
  font-family: var(--display); font-stretch: condensed; font-weight: 600; font-size: 13px; letter-spacing: .36em; text-indent: .36em;
  color: var(--white); text-shadow: 0 0 10px rgba(0, 0, 0, .9); transition: opacity .4s ease;
}
.drag-hint.is-gone { opacity: 0; }

.panel { padding: 26px calc(20px + var(--sar)) 0 calc(20px + var(--sal)); max-width: 560px; margin: 0 auto; }
.eyebrow { margin: 0 0 10px; font-family: var(--display); font-stretch: condensed; font-size: 14px; font-weight: 600; letter-spacing: .32em; color: var(--grey); }
.title { margin: 0; font-family: var(--display); font-stretch: condensed; font-weight: 700; font-size: clamp(34px, 9.6vw, 52px); line-height: .98; letter-spacing: .02em; text-transform: uppercase; }
.price { margin: 14px 0 22px; font-family: var(--display); font-stretch: condensed; font-size: 26px; font-weight: 500; letter-spacing: .08em; color: var(--pale); }
.sizes { border: 0; margin: 0 0 22px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sizes legend { padding: 0; margin-bottom: 10px; font-family: var(--display); font-stretch: condensed; font-size: 13px; font-weight: 600; letter-spacing: .32em; color: var(--grey); }
.sizes label { position: relative; display: block; }
.sizes input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.sizes span {
  display: flex; align-items: center; justify-content: center; height: 52px; border: 1px solid #444;
  font-family: var(--display); font-stretch: condensed; font-size: 20px; font-weight: 600; letter-spacing: .1em;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.sizes input:checked + span { background: var(--white); color: var(--black); border-color: var(--white); }
.sizes input:focus-visible + span { outline: 2px solid var(--white); outline-offset: 2px; }
.add {
  display: block; width: 100%; height: 60px; border: 1px solid var(--white); border-radius: 0; background: var(--white); color: var(--black);
  font-family: var(--display); font-stretch: condensed; font-size: 21px; font-weight: 700; letter-spacing: .26em; text-indent: .26em;
  cursor: pointer; touch-action: manipulation; transition: background-color .15s ease, color .15s ease;
}
.add:active, .add.is-added { background: var(--black); color: var(--white); }
.add:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; }
.fine { margin: 16px 0 0; font-size: 12px; color: var(--grey); }

@media (min-width: 900px) {
  .product { display: grid; grid-template-columns: auto minmax(320px, 480px); justify-content: center; align-items: center; gap: 56px; min-height: var(--vh); padding: 0 40px; }
  .spin { height: min(calc(var(--vh) * .92), 960px); width: auto; aspect-ratio: 9 / 16; margin: 0; }
  .panel { margin: 0; padding: 0; }
  .title { font-size: 56px; }
}

/* ---------- לוח המדידה (HUD), בעברית ---------- */
.hud {
  position: fixed; z-index: 40; left: calc(8px + var(--sal)); bottom: calc(8px + var(--sab));
  font: 11px/1.45 var(--mono); color: var(--white); direction: rtl; text-align: right;
  pointer-events: none; max-width: calc(100vw - 16px);
}
.hud[hidden] { display: none; }
.hud > * { pointer-events: auto; }
.hud-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border: 1px solid #444; border-radius: 16px;
  background: rgba(0, 0, 0, .72); color: var(--white); font: inherit; cursor: pointer; touch-action: manipulation; direction: rtl;
}
.hud-pill b { font-weight: 700; }
.hud-body {
  display: none; flex-direction: column; width: min(340px, calc(100vw - 16px)); max-height: calc(var(--vh) * .7);
  margin-bottom: 6px; padding: 10px 10px 4px; border: 1px solid #444; background: rgba(0, 0, 0, .78);
}
.hud.is-open .hud-body { display: flex; }
.hud-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.hud-row { display: flex; flex: none; align-items: center; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.hud-row > span:first-child { flex: none; width: 42px; color: var(--grey); }
.hud button, .hud select {
  font: inherit; color: var(--white); background: #1a1a1a; border: 1px solid #555; border-radius: 0; height: 30px; padding: 0 9px;
  cursor: pointer; touch-action: manipulation;
}
.hud button[aria-pressed="true"] { background: var(--white); color: var(--black); border-color: var(--white); }
.hud button:disabled, .hud select:disabled { color: #666; border-color: #333; cursor: not-allowed; }
/* הדף נטען מחדש בלי להיסגר כרגיל (כנראה נסגר בגלל זיכרון): ההודעה הבולטת ביותר בלוח */
.hud-alert { margin: 0 0 8px; padding: 8px 10px; background: var(--white); color: var(--black); font-weight: 600; white-space: pre-wrap; }
.hud-alert[hidden] { display: none; }
.hud-actions { display: grid; flex: none; grid-template-columns: 1fr 1fr; gap: 6px; margin: 8px 0; }
.hud-note { color: var(--pale); margin: 6px 0 0; padding-top: 6px; border-top: 1px solid #333; white-space: pre-wrap; }
.hud-note:empty { display: none; }
.hud-stats { white-space: pre-wrap; margin: 0; }
.hud-copy { display: none; width: 100%; height: 110px; margin-bottom: 8px; font: inherit; color: var(--white); background: #111; border: 1px solid #555; direction: rtl; }
.hud-copy.is-on { display: block; }

@media (prefers-reduced-motion: reduce) {
  .hero-logo { animation: none; opacity: 1; }
}
