/* ============================================================
   Workshop Portal — Warm Luxury
   Palette derived from the ui-ux-pro-max "E-commerce Luxury"
   tokens (warm stone neutrals + restrained gold accent).
   Typography: Heebo (Hebrew, all weights). Layout is RTL (dir="rtl");
   only the media controls stay LTR so the timeline reads left→right.
   ============================================================ */

:root {
  /* warm stone neutrals */
  --bg:            #FAFAF9;
  --bg-elev:       #F5F5F4;
  --fg:            #1C1917;
  --fg-soft:       #57534E;
  --muted:         #78716C;
  --card:          #FFFFFF;
  --border:        #E7E5E4;
  --border-strong: #D6D3D1;

  /* restrained gold accent */
  --accent:        #A16207;
  --accent-hover:  #854D0E;
  --accent-soft:   #FDF6EC;
  --on-accent:     #FFFFFF;

  --stage:         #100E0C;      /* video letterbox */
  --focus:         #A16207;

  --shadow-sm: 0 1px 2px rgba(28,25,23,.06), 0 1px 3px rgba(28,25,23,.05);
  --shadow-md: 0 4px 14px rgba(28,25,23,.08), 0 2px 6px rgba(28,25,23,.05);
  --shadow-lg: 0 24px 60px -20px rgba(28,25,23,.28), 0 8px 24px rgba(28,25,23,.10);

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;

  --sans: "Heebo", system-ui, -apple-system, "Segoe UI", "Arial Hebrew", sans-serif;
  --serif: "Heebo", system-ui, sans-serif; /* Hebrew: use Heebo heavy weights for display */

  --maxw: 1280px;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

:root[data-theme="dark"] {
  --bg:            #1C1917;
  --bg-elev:       #232020;
  --fg:            #FAFAF9;
  --fg-soft:       #D6D3D1;
  --muted:         #A8A29E;
  --card:          #292524;
  --border:        #3B3633;
  --border-strong: #44403C;

  --accent:        #D9A441;
  --accent-hover:  #E8B95A;
  --accent-soft:   #2A2318;
  --on-accent:     #1C1917;

  --stage:         #000000;
  --focus:         #D9A441;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 6px 18px rgba(0,0,0,.45);
  --shadow-lg: 0 28px 64px -18px rgba(0,0,0,.7), 0 8px 24px rgba(0,0,0,.5);
}

* { box-sizing: border-box; }

/* the `hidden` attribute must win over any element's own display value */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  transition: background .3s var(--ease), color .3s var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand__mark {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 11px;
  color: var(--on-accent);
  background: linear-gradient(145deg, var(--accent), var(--accent-hover));
  font-size: 15px; box-shadow: var(--shadow-sm);
}
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__title { font-weight: 600; letter-spacing: -.01em; }
.brand__sub { font-size: 12px; color: var(--muted); }

.topbar__actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--card); color: var(--fg);
  cursor: pointer; transition: background .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease);
}
.icon-btn:hover { background: var(--bg-elev); border-color: var(--border-strong); }
.icon-btn:active { transform: scale(.94); }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }

/* ---------- Layout ---------- */
.layout {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(20px, 4vw, 40px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: clamp(20px, 3vw, 36px);
  align-items: start;
}
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { order: 2; }
}

/* ---------- Player ---------- */
.stage { min-width: 0; }
.player {
  position: relative;
  aspect-ratio: 1470 / 956;
  background: var(--stage);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.player video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  background: var(--stage);
  display: block;
}

.player.is-paused .controls,
.player:hover .controls,
.player.is-scrubbing .controls { opacity: 1; transform: translateY(0); }
.player.is-playing:not(:hover) .controls { opacity: 0; transform: translateY(8px); }
.player.is-playing.hide-cursor { cursor: none; }

/* big center play */
.bigplay {
  position: absolute; inset: 0; margin: auto;
  width: 84px; height: 84px; border-radius: 999px;
  display: grid; place-items: center;
  border: none; cursor: pointer;
  color: var(--on-accent);
  background: linear-gradient(145deg, var(--accent), var(--accent-hover));
  box-shadow: 0 12px 40px rgba(0,0,0,.45);
  transition: transform .25s var(--ease), opacity .25s var(--ease);
  padding-left: 4px;
}
.bigplay:hover { transform: scale(1.06); }
.player.is-playing .bigplay,
.player.is-started.is-paused .bigplay { opacity: 0; pointer-events: none; transform: scale(.8); }
.player.is-started.is-paused:not(.is-playing) .bigplay { opacity: 1; pointer-events: auto; transform: scale(1); }

/* spinner */
.spinner { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.spinner span {
  width: 46px; height: 46px; border-radius: 999px;
  border: 3px solid rgba(255,255,255,.25);
  border-top-color: #fff;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* controls */
.controls {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 40px 14px 12px;
  background: linear-gradient(to top, rgba(0,0,0,.78) 0%, rgba(0,0,0,.35) 55%, transparent 100%);
  opacity: 0; transform: translateY(8px);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
  color: #fff;
}

/* scrub bar */
.scrub { position: relative; padding: 10px 4px; cursor: pointer; }
.scrub__track {
  position: relative; height: 5px; border-radius: 999px;
  background: rgba(255,255,255,.28);
  transition: height .15s var(--ease);
}
.scrub:hover .scrub__track { height: 8px; }
.scrub__buffer, .scrub__played {
  position: absolute; left: 0; top: 0; height: 100%; border-radius: 999px;
}
.scrub__buffer { background: rgba(255,255,255,.35); width: 0; }
.scrub__played { background: var(--accent); width: 0; }
.scrub__thumb {
  position: absolute; top: 50%; left: 0;
  width: 14px; height: 14px; border-radius: 999px; background: #fff;
  transform: translate(-50%, -50%) scale(0);
  box-shadow: 0 2px 6px rgba(0,0,0,.5);
  transition: transform .15s var(--ease);
}
.scrub:hover .scrub__thumb, .player.is-scrubbing .scrub__thumb { transform: translate(-50%, -50%) scale(1); }
.scrub__tip {
  position: absolute; bottom: 100%; transform: translateX(-50%);
  background: rgba(0,0,0,.9); color: #fff; font-size: 12px; font-variant-numeric: tabular-nums;
  padding: 3px 7px; border-radius: 6px; pointer-events: none;
  opacity: 0; transition: opacity .12s var(--ease); white-space: nowrap;
}
.scrub:hover .scrub__tip, .player.is-scrubbing .scrub__tip { opacity: 1; }

.controls__row { display: flex; align-items: center; gap: 4px; }
.ctrl {
  display: grid; place-items: center;
  min-width: 38px; height: 38px; padding: 0 8px;
  border: none; background: transparent; color: #fff; cursor: pointer;
  border-radius: 9px; transition: background .18s var(--ease), transform .12s var(--ease);
}
.ctrl:hover { background: rgba(255,255,255,.16); }
.ctrl:active { transform: scale(.9); }
.ctrl--text { font-family: var(--sans); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }

.i-pause, .i-mute, .i-fsexit { display: none; }
.player.is-playing .i-play { display: none; }
.player.is-playing .i-pause { display: block; }
.player.is-muted .i-vol { display: none; }
.player.is-muted .i-mute { display: block; }
.player.is-fullscreen .i-fs { display: none; }
.player.is-fullscreen .i-fsexit { display: block; }

.time { font-size: 13px; font-variant-numeric: tabular-nums; padding: 0 8px; white-space: nowrap; }
.time__sep { opacity: .5; margin: 0 2px; }
.spacer { flex: 1; }

/* volume */
.vol { display: flex; align-items: center; }
.vol__range {
  width: 0; opacity: 0; transition: width .22s var(--ease), opacity .22s var(--ease);
  -webkit-appearance: none; appearance: none; height: 4px; border-radius: 999px;
  background: rgba(255,255,255,.3); cursor: pointer; margin: 0;
}
.vol:hover .vol__range, .vol:focus-within .vol__range { width: 84px; opacity: 1; margin-left: 6px; margin-right: 4px; }
.vol__range::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.5); }
.vol__range::-moz-range-thumb { width: 13px; height: 13px; border: none; border-radius: 999px; background: #fff; }

/* speed menu */
.menu { position: relative; }
.menu__list {
  position: absolute; bottom: calc(100% + 10px); right: 0;
  background: rgba(20,18,16,.97); border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px; padding: 6px; min-width: 108px;
  box-shadow: 0 16px 40px rgba(0,0,0,.5);
  display: none; flex-direction: column; gap: 2px;
}
.menu.open .menu__list { display: flex; }
.menu__item {
  display: flex; align-items: center; justify-content: space-between;
  border: none; background: transparent; color: #fff; cursor: pointer;
  font-size: 13px; font-weight: 500; padding: 8px 10px; border-radius: 8px; text-align: left;
}
.menu__item:hover { background: rgba(255,255,255,.14); }
.menu__item.active { color: var(--accent); }
.menu__item.active::after { content: "✓"; }

/* ---------- Info panel ---------- */
.info { margin-top: 24px; }
.info__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.info__eyebrow { margin: 0 0 6px; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.info__title { margin: 0; font-family: var(--serif); font-weight: 800; font-size: clamp(23px, 3.2vw, 34px); letter-spacing: -.02em; line-height: 1.15; }
.info__desc { margin: 16px 0 0; max-width: 62ch; color: var(--fg-soft); font-size: 15.5px; }

.info__downloads { display: flex; gap: 10px; flex-shrink: 0; }
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 18px; border-radius: 12px; font-weight: 600; font-size: 14px;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform .14s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: linear-gradient(145deg, var(--accent), var(--accent-hover)); color: var(--on-accent); box-shadow: var(--shadow-sm); }
.btn--primary:hover { box-shadow: var(--shadow-md); }
.btn--ghost { background: var(--card); color: var(--fg); border-color: var(--border-strong); }
.btn--ghost:hover { background: var(--bg-elev); }

/* chapters */
.chapters { margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--border); }
.chapters__title { margin: 0 0 12px; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.chapters__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.chapter {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 11px 12px; border-radius: var(--r-sm); border: 1px solid transparent;
  background: transparent; color: var(--fg); cursor: pointer; text-align: left;
  font: inherit; transition: background .16s var(--ease), border-color .16s var(--ease);
}
.chapter:hover { background: var(--bg-elev); }
.chapter.active { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.chapter__time { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; color: var(--accent); min-width: 52px; }
.chapter__label { font-size: 14.5px; color: var(--fg-soft); }
.chapter.active .chapter__label { color: var(--fg); }

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky; top: 88px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow-sm);
}
@media (max-width: 960px) { .sidebar { position: static; } }
.sidebar__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; padding: 0 4px; }
.sidebar__title { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); }
.sidebar__count { font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 2px 9px; border-radius: 999px; }

.playlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pl-item {
  display: grid; grid-template-columns: 108px 1fr; gap: 12px; align-items: center;
  padding: 8px; border-radius: var(--r-md); border: 1px solid transparent;
  background: transparent; cursor: pointer; text-align: left; font: inherit; color: var(--fg);
  transition: background .18s var(--ease), border-color .18s var(--ease), transform .14s var(--ease);
}
.pl-item:hover { background: var(--bg-elev); }
.pl-item:hover .pl-item__thumb { transform: scale(1.03); }
.pl-item.active { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.pl-item__thumbwrap {
  position: relative; aspect-ratio: 16/10; border-radius: 10px; overflow: hidden;
  background: linear-gradient(135deg, #2a2521, #100e0c); box-shadow: var(--shadow-sm);
}
.pl-item__thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .3s var(--ease); }
.pl-item__badge {
  position: absolute; right: 5px; bottom: 5px;
  background: rgba(0,0,0,.8); color: #fff; font-size: 11px; font-weight: 600;
  padding: 2px 6px; border-radius: 5px; font-variant-numeric: tabular-nums;
}
.pl-item__play {
  position: absolute; inset: 0; display: grid; place-items: center; color: #fff;
  opacity: 0; background: rgba(0,0,0,.35); transition: opacity .18s var(--ease);
}
.pl-item:hover .pl-item__play, .pl-item.active .pl-item__play { opacity: 1; }
.pl-item__meta { min-width: 0; }
.pl-item__title { font-weight: 600; font-size: 14px; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pl-item__sub { margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.pl-item.active .pl-item__sub { color: var(--accent); }

/* focus visibility */
:where(button, a, input, [tabindex]):focus-visible {
  outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px;
}
.controls :focus-visible { outline-color: #fff; }

/* ============================================================
   RTL + Hebrew adjustments
   ============================================================ */
:root { --display: "Heebo", system-ui, sans-serif; }

/* Back link (player header) */
.backlink {
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none; color: var(--fg-soft); font-weight: 600; font-size: 14px;
  padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--card); transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
}
.backlink:hover { background: var(--bg-elev); color: var(--fg); border-color: var(--border-strong); }
/* the chevron points right; in RTL that reads as "back" naturally */
.brand__divider { width: 1px; height: 26px; background: var(--border); margin: 0 4px; }

/* Media controls stay LTR (dir="ltr" on .controls) — nothing to flip there.
   Restore visual order for RTL context where needed. */
.time { direction: ltr; }

/* Eyebrow with a middot separator works in both directions; keep tidy */
.info__eyebrow { unicode-bidi: plaintext; }

/* ============================================================
   Hub / landing (workshop selector)
   ============================================================ */
.hub { max-width: var(--maxw); margin: 0 auto; padding: clamp(20px, 4vw, 44px); }

.hero { margin: clamp(8px, 3vw, 28px) 2px clamp(24px, 4vw, 40px); }
.hero__eyebrow {
  margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .06em;
  color: var(--accent); text-transform: uppercase;
}
.hero__title {
  margin: 0; font-family: var(--display); font-weight: 800;
  font-size: clamp(30px, 5vw, 48px); letter-spacing: -.02em; line-height: 1.1;
}
.hero__sub { margin: 14px 0 0; color: var(--fg-soft); font-size: clamp(15px, 2vw, 17px); max-width: 56ch; }

.cards {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: clamp(16px, 2.4vw, 26px);
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.cards__empty { color: var(--muted); padding: 40px; text-align: center; }

.card { min-width: 0; }
.card__inner {
  display: flex; flex-direction: column; height: 100%;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden; text-decoration: none; color: var(--fg);
  box-shadow: var(--shadow-sm);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
}
a.card__inner:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.card--soon .card__inner { cursor: default; }

.card__thumb {
  position: relative; aspect-ratio: 16/9;
  background: linear-gradient(135deg, #2a2521, #100e0c);
  display: grid; place-items: center; overflow: hidden;
}
.card__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card__fallback { color: rgba(255,255,255,.35); }
.card--soon .card__thumb { filter: grayscale(.4); }
.card--soon .card__thumb::after { content: ""; position: absolute; inset: 0; background: rgba(16,14,12,.55); }

.card__badge {
  position: absolute; top: 12px; inset-inline-start: 12px; z-index: 2;
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700; padding: 6px 11px; border-radius: 999px;
  backdrop-filter: blur(6px);
}
.card__badge--ok { background: rgba(255,255,255,.92); color: #15803d; }
.card__badge--soon { background: rgba(20,18,16,.72); color: #fff; }
.card__badge--soon .dot { width: 7px; height: 7px; border-radius: 999px; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: pulse 1.8s var(--ease) infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.card__play {
  position: absolute; z-index: 2; inset: 0; margin: auto;
  width: 62px; height: 62px; border-radius: 999px; display: grid; place-items: center;
  color: var(--on-accent); background: linear-gradient(145deg, var(--accent), var(--accent-hover));
  box-shadow: 0 10px 30px rgba(0,0,0,.4); padding-inline-start: 4px;
  opacity: 0; transform: scale(.8); transition: opacity .22s var(--ease), transform .22s var(--ease);
}
a.card__inner:hover .card__play { opacity: 1; transform: scale(1); }

.card__body { padding: 18px 18px 20px; display: flex; flex-direction: column; flex: 1; }
.card__meta { margin: 0 0 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); unicode-bidi: plaintext; }
.card__title { margin: 0; font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: -.015em; line-height: 1.25; }
.card__desc {
  margin: 10px 0 0; color: var(--fg-soft); font-size: 14.5px; line-height: 1.55;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
}
.card__cta {
  margin-top: 16px; align-self: flex-start;
  display: inline-flex; align-items: center; gap: 7px;
  font-weight: 700; font-size: 14.5px; color: var(--accent);
}
a.card__inner:hover .card__cta svg { transform: translateX(-3px); }
.card__cta svg { transition: transform .2s var(--ease); }
.card__cta--soon {
  color: var(--muted); background: var(--bg-elev); border: 1px solid var(--border);
  padding: 8px 14px; border-radius: 10px; font-size: 13.5px;
}

/* ============================================================
   Player: coming-soon overlay
   ============================================================ */
.soon {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  text-align: center; color: #fff; padding: 24px;
  background: radial-gradient(120% 120% at 50% 30%, rgba(60,52,40,.6), rgba(16,14,12,.92));
}
.soon svg { color: var(--accent); margin-bottom: 10px; }
.soon__title { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(18px, 3vw, 24px); }
.soon__sub { margin: 4px 0 16px; color: rgba(255,255,255,.75); font-size: 14.5px; max-width: 42ch; }
.player.is-soon .controls { display: none; }

/* ============================================================
   Sidebar item states (fallback / lock / coming-soon)
   ============================================================ */
.pl-item__fallback { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.35); }
.pl-item__lock { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.7); background: rgba(0,0,0,.35); }
.pl-item--soon { cursor: default; }
.pl-item--soon .pl-item__thumbwrap { filter: grayscale(.4); }
.pl-item--soon .pl-item__sub { color: var(--muted); }
.pl-item--soon:hover { background: transparent; }

/* Disabled download button */
.btn.is-disabled { opacity: .45; pointer-events: none; filter: grayscale(.3); }

/* ============================================================
   Password Gate (login lock) — RTL, matches the design system
   ============================================================ */
.gate {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(120% 90% at 50% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    var(--bg);
  animation: gate-in .35s var(--ease);
}
@keyframes gate-in { from { opacity: 0; } to { opacity: 1; } }
.gate--out { animation: gate-out .26s var(--ease) forwards; }
@keyframes gate-out { to { opacity: 0; transform: scale(.985); } }

.gate__card {
  width: min(400px, 100%);
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  padding: clamp(26px, 5vw, 40px) clamp(22px, 4vw, 34px);
  text-align: center;
}
.gate__card.shake { animation: shake .4s var(--ease); }
@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}

.gate__mark {
  display: grid; place-items: center; margin: 0 auto 18px;
  width: 56px; height: 56px; border-radius: 16px;
  color: var(--on-accent);
  background: linear-gradient(145deg, var(--accent), var(--accent-hover));
  box-shadow: var(--shadow-md);
}
.gate__title { margin: 0; font-family: var(--display, var(--serif)); font-weight: 800; font-size: 24px; letter-spacing: -.02em; }
.gate__sub { margin: 8px 0 24px; color: var(--muted); font-size: 14.5px; line-height: 1.5; }

.gate__form { display: grid; gap: 14px; }
.gate__field { position: relative; display: flex; align-items: center; }
.gate__input {
  width: 100%; font: inherit; font-size: 16px; color: var(--fg);
  background: var(--bg-elev); border: 1.5px solid var(--border-strong);
  border-radius: var(--r-md); padding: 14px 16px; padding-inline-end: 46px;
  text-align: center; letter-spacing: .04em;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.gate__input::placeholder { color: var(--muted); letter-spacing: normal; }
.gate__input:focus {
  outline: none; border-color: var(--accent);
  background: var(--card);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
.gate__input.is-bad {
  border-color: #dc2626;
  box-shadow: 0 0 0 4px color-mix(in srgb, #dc2626 18%, transparent);
}

.gate__eye {
  position: absolute; inset-inline-end: 6px;
  display: grid; place-items: center; width: 36px; height: 36px;
  border: none; background: transparent; color: var(--muted); cursor: pointer;
  border-radius: 9px; transition: color .18s var(--ease), background .18s var(--ease);
}
.gate__eye:hover { color: var(--fg); background: var(--bg-elev); }

.gate__error {
  margin: 0; font-size: 13.5px; font-weight: 600; color: #dc2626;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
:root[data-theme="dark"] .gate__error { color: #f87171; }
.gate__error::before { content: "⚠"; }

.gate__submit {
  margin-top: 2px; width: 100%; font: inherit; font-weight: 700; font-size: 15.5px;
  color: var(--on-accent); cursor: pointer;
  background: linear-gradient(145deg, var(--accent), var(--accent-hover));
  border: none; border-radius: var(--r-md); padding: 14px 18px;
  box-shadow: var(--shadow-sm);
  transition: transform .14s var(--ease), box-shadow .2s var(--ease), opacity .2s var(--ease);
}
.gate__submit:hover { box-shadow: var(--shadow-md); }
.gate__submit:active { transform: translateY(1px); }
.gate__submit:disabled { opacity: .7; cursor: default; }

.gate__foot { margin: 22px 0 0; font-size: 12.5px; color: var(--muted); }
