@font-face { font-family: "Ploni"; src: url("fonts/ploni-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Ploni"; src: url("fonts/ploni-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Ploni"; src: url("fonts/ploni-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* טוקנים מתוך rollin-design-system: פחם, אדום אחד, לבן */
:root {
  --ink-900: #1c1b1d; --ink-800: #2a292b; --ink-700: #353436; --ink-600: #414042;
  --ink-500: #565558; --ink-400: #6f6e72; --ink-300: #939296; --ink-200: #bcbbbf; --ink-100: #dddce0; --ink-50: #f0eff1;
  --neutral-0: #ffffff; --neutral-25: #fafafa; --neutral-50: #f5f5f6; --neutral-100: #ededee; --neutral-200: #e2e2e4; --neutral-300: #cbcbce;
  --red-700: #951818; --red-600: #b31f1f; --red-500: #cc2626; --red-200: #f5bcbc; --red-100: #fbe2e2; --red-50: #fdf1f1;
  --warning-500: #e0a417; --warning-100: #fbf0d6;

  --text-strong: var(--ink-900);
  --text-primary: var(--ink-600);
  --text-secondary: var(--ink-400);
  --text-accent: var(--red-500);
  --surface-page: var(--neutral-25);
  --surface-card: var(--neutral-0);
  --surface-sunken: var(--neutral-50);
  --surface-inverse: var(--ink-600);
  --surface-accent-soft: var(--red-50);
  --border-subtle: var(--neutral-200);
  --border-default: var(--neutral-300);
  --border-accent: var(--red-500);
  --border-inverse: rgba(255, 255, 255, 0.24);
  --action-bg: var(--red-500);
  --action-bg-hover: var(--red-600);
  --action-bg-active: var(--red-700);
  --focus-ring: rgba(204, 38, 38, 0.40);

  --font: "Ploni", "Arial Hebrew", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 14px;
  --radius-sm: 10px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--surface-page); color: var(--text-primary);
  font: 400 18px/1.6 var(--font);
}
a { color: var(--text-accent); }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Mac / Windows: מסתירים את מה שלא שייך למחשב שנבחר */
html[data-os="mac"] [data-os="win"], html[data-os="win"] [data-os="mac"] { display: none; }

/* ───── כותרת ───── */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  background: var(--surface-inverse); color: var(--neutral-0);
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 700; font-size: 18px; }
.brand img { height: 28px; width: auto; }
.os { margin-inline-start: auto; display: flex; padding: 3px; border: 1px solid var(--border-inverse); border-radius: 999px; }
.os button {
  font: 500 14px/1 var(--font); color: var(--neutral-0); background: none; border: 0;
  padding: 7px 12px; border-radius: 999px; cursor: pointer;
}
.os button[aria-pressed="true"] { background: var(--neutral-0); color: var(--ink-600); }

main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 24px 16px 56px; }
.foot { padding: 20px 16px 28px; text-align: center; font-size: 14px; color: var(--text-secondary); border-top: 1px solid var(--border-subtle); }
.foot p { margin: 2px 0; }

/* ───── טיפוגרפיה ───── */
h1 { font-size: 28px; line-height: 1.25; font-weight: 700; color: var(--text-strong); margin: 6px 0 12px; }
h2 { font-size: 22px; line-height: 1.3; font-weight: 700; color: var(--text-strong); margin: 0 0 12px; }
h3 { font-size: 18px; font-weight: 700; color: var(--text-strong); margin: 20px 0 8px; }
h1:focus { outline: none; }
.eyebrow { font-weight: 700; font-size: 15px; color: var(--text-accent); margin: 0; }
.lead { font-size: 19px; color: var(--text-primary); margin: 0 0 20px; }
.small { font-size: 15px; color: var(--text-secondary); }
code, kbd {
  font-family: var(--mono); font-size: 0.85em; direction: ltr; unicode-bidi: isolate;
  background: var(--surface-sunken); border: 1px solid var(--border-subtle); border-radius: 6px; padding: 1px 6px;
}
q { quotes: "״" "״"; font-weight: 500; color: var(--text-strong); }
@media (min-width: 640px) {
  h1 { font-size: 36px; }
  .lead { font-size: 20px; }
}

/* ───── כפתורים ───── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 22px; border-radius: 999px; border: 1.5px solid transparent;
  font: 700 17px/1.2 var(--font); text-decoration: none; cursor: pointer;
}
.btn.primary { background: var(--action-bg); color: var(--neutral-0); }
.btn.primary:hover { background: var(--action-bg-hover); }
.btn.primary:active { background: var(--action-bg-active); }
.btn.ghost { background: transparent; color: var(--text-primary); border-color: var(--border-default); }
.btn.ghost:hover { border-color: var(--ink-400); }
.btn.small { min-height: 38px; padding: 6px 16px; font-size: 15px; }
.nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; }

/* ───── עמוד ראשי ───── */
.hero { margin-bottom: 24px; }
.cards { display: grid; gap: 14px; }
@media (min-width: 700px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card {
  display: flex; flex-direction: column; gap: 6px; padding: 20px;
  background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius);
  color: inherit; text-decoration: none; transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--border-accent); transform: translateY(-2px); }
.card .tag { align-self: flex-start; font-size: 13px; font-weight: 500; padding: 2px 10px; border-radius: 999px; background: var(--surface-sunken); color: var(--text-secondary); }
.card h2 { margin: 4px 0 0; }
.card .file { font-family: var(--mono); font-size: 14px; color: var(--text-secondary); direction: ltr; text-align: right; }
.card p { margin: 0; font-size: 16px; }
.card .analogy { color: var(--text-secondary); font-size: 15px; }
.card .go { margin-top: auto; padding-top: 10px; font-weight: 700; color: var(--text-accent); }

.section { margin-top: 36px; }
.chooser { display: grid; gap: 10px; }
.chooser a {
  display: block; padding: 14px 18px; border-radius: var(--radius-sm);
  background: var(--surface-card); border: 1px solid var(--border-subtle); color: inherit; text-decoration: none;
}
.chooser a:hover { border-color: var(--border-accent); }
.chooser b { color: var(--text-accent); }
.how { display: grid; gap: 12px; counter-reset: how; padding: 0; margin: 0; list-style: none; }
@media (min-width: 700px) { .how { grid-template-columns: repeat(3, 1fr); } }
.how li { counter-increment: how; padding: 16px; background: var(--surface-sunken); border-radius: var(--radius-sm); font-size: 16px; }
.how li::before {
  content: counter(how); display: inline-grid; place-items: center; width: 28px; height: 28px; margin-inline-end: 8px;
  border-radius: 50%; background: var(--ink-600); color: var(--neutral-0); font-weight: 700; font-size: 15px;
}
.gloss details { border-bottom: 1px solid var(--border-subtle); padding: 12px 0; }
.gloss summary { cursor: pointer; font-weight: 700; color: var(--text-strong); }
.gloss p { margin: 6px 0 0; font-size: 16px; }

/* ───── שאלה ───── */
.crumbs { font-size: 15px; color: var(--text-secondary); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumbs a { color: inherit; }
.progress { height: 6px; background: var(--neutral-200); border-radius: 999px; overflow: hidden; margin: 14px 0 18px; }
.progress span { display: block; height: 100%; background: var(--action-bg); border-radius: 999px; transition: width .25s; }
.stepno { font-size: 15px; font-weight: 500; color: var(--text-secondary); margin: 0; }
.why { margin: 0 0 20px; color: var(--text-primary); }

.presets { margin: 0 0 20px; padding: 14px; background: var(--surface-sunken); border-radius: var(--radius-sm); }
.presets p { margin: 0 0 10px; font-size: 15px; font-weight: 500; }
.presets .row { display: flex; flex-wrap: wrap; gap: 8px; }

input[type="text"], textarea {
  width: 100%; font: 400 18px/1.55 var(--font); color: var(--text-strong);
  background: var(--surface-card); border: 1.5px solid var(--border-default); border-radius: var(--radius-sm);
  padding: 12px 14px; resize: vertical;
}
input[type="text"]:focus, textarea:focus { outline: none; border-color: var(--border-accent); box-shadow: 0 0 0 3px var(--focus-ring); }
::placeholder { color: var(--ink-300); }
.hint { font-size: 14px; color: var(--text-secondary); margin: 6px 0 0; }
.check { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 12px; font-size: 16px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--red-500); flex: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: 500 16px/1.3 var(--font); padding: 9px 16px; border-radius: 999px; cursor: pointer;
  background: var(--surface-card); color: var(--text-primary); border: 1.5px solid var(--border-default);
}
.chip[aria-pressed="true"] { background: var(--ink-600); border-color: var(--ink-600); color: var(--neutral-0); }
.chip[aria-pressed="true"]::before { content: "✓ "; }
.other { display: flex; gap: 8px; margin-top: 12px; }
.other input { flex: 1; min-width: 0; }

.choices { display: grid; gap: 10px; }
.choice {
  text-align: right; display: flex; flex-direction: column; gap: 2px; width: 100%;
  font: 400 17px/1.45 var(--font); padding: 14px 16px; border-radius: var(--radius-sm); cursor: pointer;
  background: var(--surface-card); color: var(--text-primary); border: 1.5px solid var(--border-default);
}
.choice b { font-weight: 700; color: var(--text-strong); }
.choice span { font-size: 15px; color: var(--text-secondary); }
.choice[aria-checked="true"] { border-color: var(--border-accent); background: var(--surface-accent-soft); box-shadow: inset 4px 0 0 var(--border-accent); }
.extra { margin-top: 12px; }

.warn {
  margin: 14px 0 0; padding: 10px 14px; font-size: 16px; border-radius: var(--radius-sm);
  background: var(--warning-100); border-inline-start: 4px solid var(--warning-500); color: var(--ink-800);
}

/* ───── תוצאה ───── */
.block { margin-top: 28px; padding: 20px 16px; background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius); }
@media (min-width: 640px) { .block { padding: 24px; } }
.block h2 { display: flex; align-items: center; gap: 10px; }
.num {
  display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%;
  background: var(--action-bg); color: var(--neutral-0); font-size: 16px;
}
.block ol, .block ul { padding-inline-start: 22px; margin: 0; }
.block li { margin: 6px 0; }
.prompt .bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
pre {
  margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; unicode-bidi: plaintext;
  font: 400 16px/1.6 var(--font); color: var(--text-strong);
  background: var(--surface-sunken); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 16px;
}
.prompt pre { max-height: 60vh; overflow: auto; }
pre.tree { font: 400 14px/1.6 var(--mono); direction: ltr; text-align: left; unicode-bidi: normal; overflow-x: auto; white-space: pre; }
.path { font-size: 15px; margin: 10px 0 0; }
.expect { margin: 12px 0 0; padding: 12px 14px; background: var(--surface-accent-soft); border-radius: var(--radius-sm); font-size: 16px; }
.trouble details { border-bottom: 1px solid var(--border-subtle); padding: 12px 0; }
.trouble details:last-child { border-bottom: 0; }
.trouble summary { cursor: pointer; font-weight: 700; color: var(--text-strong); }
.trouble p { margin: 8px 0 0; font-size: 16px; }
.next { display: grid; gap: 16px; }
.next h3 { margin: 0 0 6px; font-size: 16px; }
.next .row { display: flex; gap: 8px; align-items: flex-start; }
.next pre { flex: 1; min-width: 0; font-size: 15px; padding: 10px 12px; }
.missing li a { font-weight: 500; }

/* ───── הודעה קופצת ───── */
.toast {
  position: fixed; inset-inline: 16px; bottom: 20px; z-index: 10; margin: 0 auto; max-width: 480px;
  padding: 12px 18px; border-radius: var(--radius-sm); background: var(--ink-800); color: var(--neutral-0);
  font-size: 16px; text-align: center; box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
