/* ═══════════════════════════════════════════════════════════════
   Claude Code Mastery — Premium Course Visual System
   Editorial typography · refined motion · terminal-inspired
   ═══════════════════════════════════════════════════════════════ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* Pro-tier: hide the course-nav upgrade button BEFORE first paint so no flicker.
   Narrow selector — only the nav-actions upgrade CTA, NOT every "#pricing" anchor (which breaks
   landing-page hero CTAs and "מחירון" buttons that users still need to see). */
html[data-ccm-tier="pro"] .course-nav .nav-actions a.nav-cta[href*="pricing"],
html[data-ccm-tier="pro"] [data-ccm-hide-if-top-tier] { display: none !important; }

:root {
  /* Palette — slightly darker/more technical than main landing */
  --canvas: #F7F3EC;
  --canvas-2: #EFE8DC;
  --surface: #FFFFFF;
  --ink: #0A0906;
  --ink-2: #1C1917;
  --muted: #6B6257;
  --muted-2: #928A7E;
  --rule-col: #E6DFD3;
  --rule-strong: #D4CFC6;
  --accent: #C9402E;
  --accent-2: #A2301F;
  --accent-soft: rgba(201, 64, 46, 0.08);
  --gold: #B8914D;
  --green: #22C55E;

  /* Code palette (dark theme) */
  --code-bg: #0F0E0C;
  --code-border: rgba(247,243,236,0.08);
  --tok-keyword: #F59E0B;
  --tok-string: #22C55E;
  --tok-comment: rgba(247,243,236,0.4);
  --tok-function: #60A5FA;
  --tok-number: #F472B6;
  --tok-prop: #E4E4E7;

  /* Typography */
  --f-display: 'Heebo', 'Fraunces', 'Times New Roman', serif;
  --f-body: 'Rubik', 'Heebo', 'Inter', sans-serif;
  --f-serif: 'Fraunces', 'Times New Roman', serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', 'Cascadia Code', monospace;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(10,9,6,0.04), 0 2px 8px rgba(10,9,6,0.04);
  --shadow-md: 0 4px 12px rgba(10,9,6,0.06), 0 12px 32px rgba(10,9,6,0.08);
  --shadow-lg: 0 12px 40px rgba(10,9,6,0.10), 0 32px 80px rgba(10,9,6,0.10);

  /* Layout */
  --container: 1220px;
  --reader: 760px;
  --section: 120px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--f-body);
  background: var(--canvas);
  color: var(--ink);
  line-height: 1.65;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16px;
  overflow-x: hidden;
}

/* Grain texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
  opacity: 0.4;
  mix-blend-mode: multiply;
}
body > * { position: relative; z-index: 2; }

/* ---- Typography ---- */
h1, h2, h3, h4 {
  font-family: var(--f-display);
  color: var(--ink);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.eyebrow::before {
  content: '';
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

em.serif, .serif-i {
  font-family: var(--f-serif);
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
}

/* ---- Top bar ---- */
.top-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 40px;
  background: var(--ink);
  color: rgba(247,243,236,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  z-index: 101;
  border-bottom: 1px solid rgba(247,243,236,0.08);
  padding: 0 16px;
}
.top-bar a {
  color: rgba(247,243,236,0.95);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.top-bar a:hover { color: var(--accent); }
.top-bar .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  animation: pulse-live 2.4s infinite;
}
@keyframes pulse-live {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* ---- Nav ---- */
nav.course-nav {
  position: fixed;
  top: 40px; left: 0; right: 0;
  padding: 12px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  z-index: 100;
  transition: background 0.4s var(--ease-out), backdrop-filter 0.4s, border-color 0.4s, padding 0.4s;
  border-bottom: 1px solid transparent;
}
nav.course-nav.scrolled {
  background: rgba(247,243,236,0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom-color: var(--rule-col);
  padding: 9px 32px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  letter-spacing: -0.025em;
  min-width: 0;
}
.nav-brand img { height: 22px; }
.nav-brand .course-badge {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 3px 8px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(201,64,46,0.2);
  border-radius: 999px;
  font-weight: 500;
}
.nav-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.nav-link {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  transition: background 0.3s, color 0.3s;
  line-height: 1.2;
}
.nav-link:hover { background: var(--accent-soft); color: var(--accent); }
.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--ink);
  color: var(--canvas);
  font-weight: 600;
  font-size: 12px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.35s var(--ease-out), background 0.3s, border-color 0.3s;
  letter-spacing: -0.01em;
  line-height: 1.2;
  text-align: center;
}
.nav-cta:hover { background: var(--accent); border-color: var(--accent); transform: translateY(-1px); }

.nav-login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  background: transparent;
  color: var(--ink-2);
  font-weight: 600;
  font-size: 13px;
  border: 1px solid var(--rule-col);
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.35s var(--ease-out), background 0.3s, color 0.3s, border-color 0.3s;
  letter-spacing: -0.01em;
  line-height: 1;
  text-align: center;
}
.nav-login-btn:hover { background: var(--ink); color: var(--canvas); border-color: var(--ink); transform: translateY(-1px); }

/* ---- Scroll progress ---- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: var(--progress, 0%);
  background: linear-gradient(90deg, var(--accent), var(--gold) 60%, var(--green));
  z-index: 105;
  transition: width 0.06s linear;
  box-shadow: 0 0 8px rgba(201,64,46,0.5);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 30px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.3s var(--ease-out), background 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.btn-primary {
  background: var(--ink);
  color: var(--canvas);
  border-color: var(--ink);
  box-shadow: 0 2px 8px rgba(10,9,6,0.08), 0 16px 40px rgba(10,9,6,0.16);
}
.btn-primary:hover { background: var(--accent); border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 14px rgba(201,64,46,0.22), 0 24px 56px rgba(201,64,46,0.28); }
.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-strong);
}
.btn-secondary:hover { background: var(--ink); color: var(--canvas); border-color: var(--ink); }
.btn-accent { background: var(--accent); color: var(--canvas); border-color: var(--accent); }
.btn-accent:hover { background: var(--accent-2); border-color: var(--accent-2); transform: translateY(-2px); }

/* ---- TERMINAL WIDGET ---- */
.term {
  background: var(--code-bg);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(247,243,236,0.06);
  direction: ltr;
  text-align: left;
  margin: 28px 0;
  font-family: var(--f-mono);
  position: relative;
}
.term-chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: #161411;
  border-bottom: 1px solid rgba(247,243,236,0.08);
}
.term-dot { width: 11px; height: 11px; border-radius: 50%; background: rgba(247,243,236,0.16); }
.term-dot:nth-child(1) { background: #FF5F57; }
.term-dot:nth-child(2) { background: #FEBC2E; }
.term-dot:nth-child(3) { background: #28C840; }
.term-title {
  margin-left: 12px;
  color: rgba(247,243,236,0.55);
  font-size: 11px;
  letter-spacing: 0.05em;
}
.term-body {
  padding: 20px 22px;
  font-size: 13.5px;
  line-height: 1.7;
  color: rgba(247,243,236,0.92);
  white-space: pre-wrap;
  min-height: 120px;
}
.term-body .prompt { color: var(--gold); font-weight: 500; }
.term-body .prompt::before { content: '$ '; opacity: 0.7; }
.term-body .cmd { color: #93C5FD; }
.term-body .out { color: rgba(247,243,236,0.75); }
.term-body .ok { color: var(--green); }
.term-body .err { color: #F87171; }
.term-body .dim { color: rgba(247,243,236,0.45); }
.term-body .caret::after {
  content: '▋';
  color: var(--gold);
  animation: caret 1s steps(2) infinite;
  margin-left: 2px;
}
@keyframes caret { 50% { opacity: 0; } }

/* ---- CODE BLOCK ---- */
.code {
  background: var(--code-bg);
  border-radius: 12px;
  padding: 20px 22px;
  font-family: var(--f-mono);
  font-size: 13px;
  line-height: 1.75;
  color: rgba(247,243,236,0.92);
  direction: ltr;
  text-align: left;
  overflow-x: auto;
  margin: 24px 0;
  border: 1px solid var(--code-border);
  box-shadow: var(--shadow-sm);
  white-space: pre;
}
.code .k { color: var(--tok-keyword); }
.code .s { color: var(--tok-string); }
.code .c { color: var(--tok-comment); font-style: italic; }
.code .f { color: var(--tok-function); }
.code .n { color: var(--tok-number); }
.code .p { color: var(--tok-prop); }
.code .d { color: rgba(247,243,236,0.55); }
.code .g { color: var(--green); font-weight: 600; }
.code .r { color: #F87171; font-weight: 600; }

/* ---- COMPARE: bad vs good ---- */
.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 28px 0;
}
@media (max-width: 720px) { .compare { grid-template-columns: 1fr; } }
.compare > div {
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--rule-col);
}
.compare .bad {
  background: rgba(239, 68, 68, 0.04);
  border-color: rgba(239, 68, 68, 0.2);
}
.compare .good {
  background: rgba(34, 197, 94, 0.04);
  border-color: rgba(34, 197, 94, 0.24);
}
.compare-label {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.bad .compare-label { color: #DC2626; }
.good .compare-label { color: #16A34A; }
.bad .compare-label::before { content: '✕'; font-family: var(--f-body); font-size: 14px; }
.good .compare-label::before { content: '✓'; font-family: var(--f-body); font-size: 14px; }

/* ---- CALLOUT BOXES ---- */
.callout {
  padding: 20px 24px;
  border-radius: 14px;
  border: 1px solid var(--rule-col);
  margin: 24px 0;
  position: relative;
}
.callout-quote {
  background: linear-gradient(135deg, rgba(201,64,46,0.04), rgba(184,145,77,0.04));
  border-right: 3px solid var(--accent);
  border-radius: 14px 2px 2px 14px;
  padding: 24px 28px;
  font-family: var(--f-display);
  font-size: clamp(1.1rem, 1.8vw, 1.4rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.4;
  color: var(--ink);
}
.callout-warn {
  background: rgba(239, 68, 68, 0.04);
  border-color: rgba(239, 68, 68, 0.2);
}
.callout-warn strong { color: #DC2626; }
.callout-tip {
  background: rgba(34, 197, 94, 0.04);
  border-color: rgba(34, 197, 94, 0.24);
}
.callout-tip strong { color: #16A34A; }

/* ---- CHECKLIST ---- */
.checklist {
  background: var(--surface);
  border: 1px solid var(--rule-col);
  border-radius: 18px;
  padding: 28px 28px 22px;
  margin: 32px 0;
}
.checklist-head {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.checklist-head::before { content: '✓'; font-family: var(--f-body); font-size: 14px; }
.checklist ul {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.checklist li {
  padding: 10px 0;
  border-top: 1px solid var(--rule-col);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.5;
  cursor: pointer;
  user-select: none;
}
.checklist li:first-child { border-top: none; }
.checklist li .box {
  flex-shrink: 0;
  width: 20px; height: 20px;
  border: 1.5px solid var(--rule-strong);
  border-radius: 5px;
  margin-top: 2px;
  position: relative;
  transition: background 0.25s, border-color 0.25s;
}
.checklist li.done .box {
  background: var(--accent);
  border-color: var(--accent);
}
.checklist li.done .box::after {
  content: '';
  position: absolute;
  top: 3px; left: 6px;
  width: 6px; height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.checklist li.done .label { color: var(--muted-2); text-decoration: line-through; }
.checklist li .label { transition: color 0.25s; }

/* ---- STEP LIST (numbered) ---- */
.steps {
  list-style: none;
  padding: 0;
  margin: 32px 0;
  counter-reset: step;
  display: grid;
  gap: 16px;
}
.steps > li {
  counter-increment: step;
  padding: 24px 28px 24px 28px;
  padding-right: 80px;
  background: var(--surface);
  border: 1px solid var(--rule-col);
  border-radius: 16px;
  position: relative;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s, border-color 0.35s;
}
.steps > li:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: transparent; }
.steps > li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  right: 24px; top: 24px;
  font-family: var(--f-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.1em;
  padding: 4px 10px;
  background: var(--accent-soft);
  border-radius: 999px;
}
.steps h4 {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}
.steps p {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.7;
}

/* ---- TYPING ANIMATION (terminal demo) ---- */
.term[data-play] .term-body .line {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  width: 0;
  animation: typeLine 1.4s steps(40) forwards;
}
.term[data-play] .term-body .line:nth-child(1) { animation-delay: 0.3s; }
.term[data-play] .term-body .line:nth-child(2) { animation-delay: 1.8s; width: 100%; animation: fadeIn 0.4s forwards 1.8s; }
.term[data-play] .term-body .line:nth-child(3) { animation-delay: 2.4s; }
.term[data-play] .term-body .line:nth-child(4) { animation-delay: 3.8s; width: 100%; animation: fadeIn 0.4s forwards 3.8s; }
@keyframes typeLine { to { width: 100%; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---- Focus visibility ---- */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
a, button { outline-offset: 3px; }

/* ---- Reveal animation ---- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  body::before { display: none; }
}

/* ---- FOOTER (shared, fully responsive) ---- */
.course-footer {
  background: var(--ink);
  color: rgba(247,243,236,0.8);
  padding: clamp(44px, 8vw, 72px) clamp(20px, 5vw, 40px) clamp(28px, 4vw, 40px);
  margin-top: clamp(56px, 10vw, 120px);
  position: relative;
  overflow: hidden;
}
.course-footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(50% 60% at 50% 0%, rgba(201,64,46,0.14), transparent 70%);
  pointer-events: none;
}
.course-footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: clamp(28px, 4vw, 56px);
  padding-bottom: clamp(32px, 4vw, 48px);
  border-bottom: 1px solid rgba(247,243,236,0.08);
}
.course-footer-inner > div { min-width: 0; }

/* Tablet: 3 cols, brand row full width */
@media (max-width: 960px) {
  .course-footer-inner {
    grid-template-columns: repeat(3, 1fr);
    gap: 40px 28px;
  }
  .course-footer-inner > :first-child {
    grid-column: 1 / -1;
    max-width: 560px;
  }
  .course-footer-tagline { max-width: 100%; }
}

/* Small tablet / large phone: 2 cols */
@media (max-width: 640px) {
  .course-footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 28px 20px;
  }
  .course-footer-inner > :first-child {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
  }
  .course-footer-brand { justify-content: center; }
  .course-footer-tagline { max-width: 460px; margin-inline: auto; margin-bottom: 0; font-size: 13px; }
  .course-footer h4 { margin-bottom: 14px; }
  .course-footer ul { gap: 10px; }
  .course-footer a { font-size: 13px; }
}

/* Tiny phone: single column, fully centered (tighter breakpoint so 390px phones stay 2-col) */
@media (max-width: 360px) {
  .course-footer-inner {
    grid-template-columns: 1fr;
    gap: 28px;
    text-align: center;
  }
  .course-footer-inner > div { text-align: center; }
  .course-footer ul { align-items: center; }
}

/* Tagline bidi safety — Hebrew + English shouldn't reorder visually */
.course-footer-tagline {
  unicode-bidi: plaintext;
  word-spacing: 0.02em;
}
.course-footer-tagline bdi { font-weight: 600; color: rgba(247,243,236,0.92); }

.course-footer h4 {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(247,243,236,0.55);
  font-weight: 500;
  margin-bottom: 20px;
}
.course-footer ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  margin: 0;
}
.course-footer a {
  color: rgba(247,243,236,0.85);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s;
  word-break: break-word;
}
.course-footer a:hover { color: var(--accent); }
.course-footer-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(17px, 2vw, 20px);
  color: var(--canvas);
  letter-spacing: -0.025em;
  margin-bottom: 16px;
}
.course-footer-brand img { height: 26px; filter: brightness(0) invert(1); }
.course-footer-tagline {
  color: rgba(247,243,236,0.6);
  font-size: 14px;
  line-height: 1.7;
  max-width: 360px;
  margin-bottom: 24px;
}
.course-footer-bar {
  max-width: var(--container);
  margin: clamp(20px, 3vw, 32px) auto 0;
  padding: clamp(18px, 2.5vw, 24px) clamp(12px, 3vw, 24px) 0;
  font-family: var(--f-mono);
  font-size: clamp(10px, 1.5vw, 11px);
  color: rgba(247,243,236,0.4);
  letter-spacing: 0.08em;
  text-align: center;
  line-height: 1.6;
}

/* ---- Responsive base ---- */
@media (max-width: 768px) {
  nav.course-nav { padding: 9px 16px; gap: 10px; top: 34px; }
  nav.course-nav.scrolled { padding: 7px 16px; }
  .nav-brand { font-size: 13px; gap: 7px; }
  .nav-brand img { height: 20px; }
  .nav-brand .course-badge { font-size: 8px; padding: 2px 7px; letter-spacing: 0.12em; }
  .nav-actions { gap: 6px; }
  .nav-actions .nav-link { display: none; }
  .nav-cta { padding: 6px 11px; font-size: 11px; }
}

/* ---- Access Gate ---- */
.access-gate {
  position: fixed;
  inset: 0;
  background: rgba(247,243,236,0.92);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 40px 20px;
}
.gate-card {
  max-width: 520px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--rule-col);
  border-radius: 24px;
  padding: 48px 40px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.gate-card h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 1;
  margin: 10px 0 20px;
}
.gate-card p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
  margin-bottom: 28px;
}
.gate-card p strong { color: var(--ink); font-weight: 700; }
.gate-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.gate-note {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 24px 0 12px;
}
.gate-form {
  display: flex;
  gap: 8px;
  max-width: 360px;
  margin: 0 auto;
}
.gate-form input {
  flex: 1;
  padding: 12px 16px;
  font-family: var(--f-mono);
  font-size: 13px;
  border: 1px solid var(--rule-col);
  border-radius: 999px;
  background: var(--canvas);
  color: var(--ink);
  text-align: center;
}
.gate-form input:focus { outline: none; border-color: var(--ink); }
.gate-form button {
  padding: 12px 20px;
  background: var(--ink);
  color: var(--canvas);
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}
.gate-form button:hover { background: var(--accent); }

/* ═══════════════════════════════════════════════════════════════
   RTL/LTR — Latin-only strings force LTR direction
   ═══════════════════════════════════════════════════════════════ */
.eyebrow,
.hero-tag,
.section-kicker,
.cp-eyebrow,
.track-tag,
.track-num,
.track-meta,
.track-right,
.mod-num,
.mod-num-small,
.artifact-chip,
.artifact-sub,
.tier-label,
.tier-name,
.cp-card-sub,
.cp-card-chip,
.cp-card-bottom span,
.stat-l,
.cp-stat-l,
.aside-label,
.reader-meta-label,
.reader-nav-bar,
.rpage-label,
.aud-label,
.mod-meta-small,
.hero-note,
.cp-note,
.compare-label,
.term-title,
.top-bar,
.toc-label,
.checklist-head {
  direction: ltr;
  unicode-bidi: isolate;
}
/* When element contains mixed content, isolate inner Latin spans */
.hero-tag, .eyebrow, .section-kicker, .cp-eyebrow, .track-num {
  text-align: start;
}
/* Numbers inside Hebrew text — number blocks that should stay together */
.stat-n, .cp-stat-n, .bento-bignum, .tier-price, .reader-meta-value, .aside-value {
  direction: ltr;
  unicode-bidi: isolate;
}

/* ═══════════════════════════════════════════════════════════════
   User menu (logged-in state)
   ═══════════════════════════════════════════════════════════════ */
.nav-user-menu {
  position: relative;
  display: inline-block;
}
.nav-user-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-family: inherit;
}
.nav-user-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--rule-col);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 200;
  overflow: hidden;
}
.nav-user-info {
  padding: 12px 14px 14px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--rule-col);
}
.nav-user-email {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.01em;
  word-break: break-all;
  direction: ltr;
  text-align: left;
}
.nav-user-tier {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 4px;
  direction: ltr;
  text-align: left;
}
.nav-user-tier strong { color: var(--accent); font-weight: 600; }
.nav-user-dropdown a,
.nav-user-dropdown button {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  text-align: right;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.nav-user-dropdown a:hover,
.nav-user-dropdown button:hover {
  background: var(--canvas-2);
  color: var(--accent);
}
.nav-user-dropdown button:last-child {
  color: #DC2626;
  border-top: 1px solid var(--rule-col);
  border-radius: 0 0 10px 10px;
  margin-top: 4px;
  padding-top: 12px;
}
.nav-user-dropdown button:last-child:hover {
  background: rgba(239,68,68,0.06);
}

/* Scrolled nav dropdown adjustment */
nav.course-nav.scrolled .nav-user-dropdown { top: calc(100% + 8px); }
