/* Agents 101 - landing
   Direction: micro-design (care label / spec sheet + one date stamp) x apple-design (restraint, springs, reduced motion)
   Substrate: care label. Fields, hairlines, one dark ink, one operational accent. Paper ground.
   No em dash anywhere. Hebrew never gets letter-spacing. LTR runs isolated. */

@font-face {
  font-family: "Heebo";
  src: url("fonts/Heebo-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "OHAmitFridman";
  src: url("fonts/OHAmitFridman-Regular.woff2") format("woff2");
  font-display: swap;
}

:root {
  --paper: #f3f0e8;
  --paper-2: #ebe7dc;
  --ink: #161513;
  --ink-2: #4a4741;
  --ink-3: #8a857b;
  --line: rgba(22, 21, 19, 0.16);
  --line-strong: rgba(22, 21, 19, 0.5);
  --accent: #e0521c;
  --accent-ink: #b7401a;
  --stamp: #c93d1a;
  --radius: 4px;
  --max: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --spring: cubic-bezier(0.2, 0.9, 0.25, 1); /* critically damped feel, no overshoot */
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --hand: "OHAmitFridman", "Heebo", sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Heebo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.7;
  letter-spacing: normal;
  word-spacing: 0.04em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: rgba(22,21,19,.35); text-underline-offset: 0.16em; }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.2; }
ul, ol { margin: 0; padding: 0; list-style: none; }
code, .mono { font-family: var(--mono); }
.ltr, [dir="ltr"] { direction: ltr; unicode-bidi: isolate; }
.mono { font-size: 0.82em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- layout ---------- */
.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.section { padding-block: clamp(3rem, 8vw, 6rem); }
.section + .section { border-top: 1px solid var(--line); }
.narrow { max-width: 42rem; }
.two-col { display: grid; gap: clamp(1.5rem, 4vw, 4rem); align-items: start; }
@media (min-width: 60em) { .two-col { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); } .two-col.flip > :first-child { order: 2; } }

/* ---------- field / label system ---------- */
.field-head {
  display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; align-items: baseline;
  padding-bottom: 0.6rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--line-strong);
}
.field-head .no { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em; color: var(--ink-3); }
.field-head h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 600; }
.field-head .aside { margin-inline-start: auto; font-size: 0.85rem; color: var(--ink-3); }

.spec { border-top: 1px solid var(--line-strong); }
.spec .row {
  display: grid; grid-template-columns: minmax(6.5rem, 9rem) minmax(0, 1fr);
  gap: 0.25rem 1rem; padding: 0.55rem 0; border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.spec .k { font-size: 0.78rem; color: var(--ink-3); font-weight: 500; text-transform: uppercase; }
.spec .k.ltr { letter-spacing: 0.06em; font-family: var(--mono); }
.spec .v { font-size: 0.98rem; }
.spec .v strong { font-weight: 600; }
@media (max-width: 36em) { .spec .row { grid-template-columns: 1fr; gap: 0.1rem; padding: 0.5rem 0; } .spec .k { font-size: 0.72rem; } }

.tag {
  display: inline-block; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.06em;
  border: 1px solid var(--line-strong); padding: 0.05rem 0.4rem; border-radius: 2px; color: var(--ink-2);
  vertical-align: middle;
}
.tag.he { font-family: inherit; letter-spacing: normal; font-size: 0.75rem; }
.tag.accent { border-color: var(--accent); color: var(--accent-ink); }

/* one trace of use: hand annotation + date stamp */
.hand { font-family: var(--hand); font-size: 1.55em; line-height: 1.15; color: var(--accent-ink); }
.stamp {
  display: inline-grid; place-items: center; text-align: center;
  padding: 0.55rem 0.9rem; border: 2px solid var(--stamp); border-radius: 6px;
  color: var(--stamp); font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; line-height: 1.35;
  transform: rotate(-3deg); opacity: 0.92;
  mask-image: radial-gradient(circle at 30% 40%, #000 60%, rgba(0,0,0,.85) 100%);
}
.stamp b { font-size: 0.95rem; font-weight: 700; }
.stamp .he { font-family: "Heebo", sans-serif; letter-spacing: normal; font-size: 0.78rem; }

/* ---------- top bar (translucent material, content scrolls under) ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(243, 240, 232, 0.72);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid rgba(22,21,19,0.10);
}
.top .wrap { display: flex; align-items: center; gap: 1rem; min-height: 3.25rem; }
.top .brand { font-weight: 700; font-size: 0.95rem; text-decoration: none; display: flex; align-items: baseline; gap: 0.5rem; white-space: nowrap; flex: none; }
.top .brand .ver { font-family: var(--mono); font-size: 0.68rem; color: var(--ink-3); letter-spacing: 0.06em; }
@media (max-width: 40em) { .top .brand .ver { display: none; } .top nav a { font-size: 0.82rem; padding-inline: 0.5rem; } }
.top nav { margin-inline-start: auto; display: flex; gap: 0.25rem; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.top nav::-webkit-scrollbar { display: none; }
.top nav a {
  font-size: 0.85rem; text-decoration: none; padding: 0.35rem 0.6rem; border-radius: 999px; white-space: nowrap;
  color: var(--ink-2); transition: background 160ms var(--spring), color 160ms var(--spring);
}
.top nav a:hover, .top nav a:active { background: rgba(22,21,19,0.07); color: var(--ink); }
.top nav a[aria-current="true"] { background: var(--ink); color: var(--paper); }
@media (prefers-reduced-transparency: reduce) { .top { background: var(--paper); backdrop-filter: none; -webkit-backdrop-filter: none; } }
@media (prefers-contrast: more) { .top { background: var(--paper); border-bottom-color: var(--ink); } }

/* ---------- hero: the care label ---------- */
.hero { padding-block: clamp(2rem, 6vw, 5rem) clamp(2.5rem, 6vw, 5rem); }
.label {
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--paper);
  padding: clamp(1.1rem, 3vw, 2rem);
  position: relative;
}
.label::before, .label::after {
  /* stitch marks along the label edges - substrate logic, not decoration */
  content: ""; position: absolute; inset-block: 0.5rem; width: 0; border-inline-start: 1px dashed var(--line);
}
.label::before { inset-inline-start: 0.5rem; }
.label::after { inset-inline-end: 0.5rem; }
.label-inner { padding-inline: 0.75rem; }
@media (max-width: 36em) { .label { padding: 1rem 0.9rem; } .label-inner { padding-inline: 0.5rem; } }
.kicker { font-size: 0.78rem; color: var(--ink-3); margin-bottom: 0.9rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }
.kicker .ltr, .figcap .ltr, .field-head .no, .top .ver, .stamp .ltr, .toc .n, .fine, .btn .meta, .card .k, .gloss .term, .gloss .ch, .list .m, .tag:not(.he), .spec .k.ltr { font-family: var(--mono); }
.display {
  font-size: clamp(2.6rem, 9vw, 5.5rem); font-weight: 700; line-height: 1.02; letter-spacing: -0.03em; /* Latin only */
}
.display .he { letter-spacing: normal; }
.subtitle { font-size: clamp(1.25rem, 3vw, 1.85rem); font-weight: 500; line-height: 1.3; margin-top: 0.75rem; max-width: 22ch; }
.quote { margin: 1.5rem 0 0; padding-inline-start: 1rem; border-inline-start: 2px solid var(--accent); color: var(--ink-2); font-size: 1rem; }
.hero .spec { margin-top: 1.75rem; }
.hero-figure { position: relative; }
@media (min-width: 60em) { .hero-figure { position: sticky; top: 4.5rem; } }
.hero-figure img { border-radius: var(--radius); border: 1px solid var(--line); aspect-ratio: 4/3; object-fit: cover; }
.hero-figure .stamp { position: absolute; inset-inline-start: 1rem; top: 1rem; background: rgba(243,240,232,0.85); }
.figcap { font-size: 0.78rem; color: var(--ink-3); margin-top: 0.5rem; display: flex; gap: 0.75rem; flex-wrap: wrap; }
.figcap .ltr { font-family: var(--mono); }

/* CTAs: stacked, below copy, never beside */
.ctas { display: grid; gap: 0.6rem; margin-top: 1.75rem; max-width: 26rem; }
.btn {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.85rem 1.1rem; border-radius: 6px; text-decoration: none; font-weight: 600; font-size: 1rem;
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  transition: transform 220ms var(--spring), background 160ms var(--spring), box-shadow 220ms var(--spring);
  -webkit-tap-highlight-color: transparent;
}
.btn .meta { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.06em; opacity: 0.75; font-weight: 400; direction: ltr; unicode-bidi: isolate; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px -8px rgba(22,21,19,0.5); }
.btn:active { transform: translateY(0) scale(0.99); transition-duration: 60ms; }
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.secondary:hover { background: rgba(22,21,19,0.05); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.accent:hover { background: var(--accent-ink); }

/* ---------- prose ---------- */
.prose p { max-width: 62ch; }
.prose p.lead { font-size: 1.2rem; line-height: 1.55; font-weight: 500; }
.prose strong { font-weight: 600; }
.figure { margin: 0; }
.figure img { border-radius: var(--radius); border: 1px solid var(--line); aspect-ratio: 4/3; object-fit: cover; width: 100%; }

/* ---------- path picker (segmented control) ---------- */
.seg { display: inline-flex; flex-wrap: wrap; gap: 0.35rem; padding: 0.3rem; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--paper-2); }
.seg button {
  appearance: none; border: 0; background: transparent; font: inherit; font-size: 0.92rem; font-weight: 500; color: var(--ink-2);
  padding: 0.45rem 0.9rem; border-radius: 999px; cursor: pointer; position: relative;
  transition: color 160ms var(--spring), background 220ms var(--spring), transform 220ms var(--spring);
  -webkit-tap-highlight-color: transparent;
}
.seg button:hover { color: var(--ink); }
.seg button:active { transform: scale(0.97); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.path-note { margin-top: 1rem; font-size: 1rem; color: var(--ink-2); min-height: 2.5em; }
.path-note strong { color: var(--ink); }

/* ---------- table of contents ---------- */
.toc { border-top: 1px solid var(--line-strong); counter-reset: ch; }
.toc li {
  display: grid; grid-template-columns: 2.6rem minmax(0, 1fr) auto; gap: 0.5rem 1rem; align-items: start;
  padding: 1rem 0; border-bottom: 1px solid var(--line);
  transition: background 260ms var(--spring), opacity 260ms var(--spring);
}
.toc li .n { font-family: var(--mono); font-size: 0.85rem; color: var(--ink-3); padding-top: 0.35rem; }
.toc li h3 { font-size: 1.15rem; font-weight: 600; }
.toc li p { margin: 0.2rem 0 0; font-size: 0.93rem; color: var(--ink-2); max-width: 60ch; }
.toc li .dl { direction: ltr; unicode-bidi: isolate; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.04em; color: var(--ink-3); text-decoration: none; padding: 0.35rem 0.55rem; border: 1px solid var(--line); border-radius: 3px; white-space: nowrap; align-self: start; margin-top: 0.15rem; }
.toc li .dl:hover { border-color: var(--ink); color: var(--ink); }
.toc.filtered li:not(.hit) { opacity: 0.38; }
.toc li.hit { background: linear-gradient(90deg, rgba(224,82,28,0.09), transparent 60%); }
.toc li.hit .n { color: var(--accent-ink); font-weight: 700; }
@media (max-width: 40em) {
  .toc li { grid-template-columns: 2.2rem minmax(0, 1fr); }
  .toc li .dl { grid-column: 2; justify-self: start; }
}

/* ---------- gallery strip of analogies (images + overlaid live text) ---------- */
.analogies { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--paper); }
.card img { aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.card .body { padding: 0.9rem 1rem 1rem; border-top: 1px solid var(--line); }
.card .body .k { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.06em; color: var(--ink-3); }
.card .body h3 { font-size: 1.05rem; margin-top: 0.15rem; }
.card .body p { margin: 0.25rem 0 0; font-size: 0.92rem; color: var(--ink-2); }

/* ---------- glossary ---------- */
.gloss { border-top: 1px solid var(--line-strong); columns: 1; }
@media (min-width: 52em) { .gloss-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 0 3rem; } .gloss-wrap .gloss + .gloss { border-top: 1px solid var(--line-strong); } }
.gloss li { display: grid; grid-template-columns: minmax(7rem, 9.5rem) minmax(0, 1fr) 2rem; gap: 0.5rem 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.gloss .term { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.02em; font-weight: 600; direction: ltr; unicode-bidi: isolate; text-align: start; }
.gloss .def { font-size: 0.95rem; }
.gloss .ch { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-3); text-align: end; direction: ltr; unicode-bidi: isolate; }
@media (max-width: 36em) { .gloss li { grid-template-columns: minmax(6rem, 7.5rem) minmax(0, 1fr) 1.5rem; gap: 0.5rem 0.6rem; } .gloss .term { font-size: 0.74rem; } }

/* ---------- week one ---------- */
.week { border-top: 1px solid var(--line-strong); }
.week li { display: grid; grid-template-columns: 3rem minmax(0, 1.2fr) minmax(0, 0.8fr); gap: 0.35rem 1rem; padding: 0.85rem 0; border-bottom: 1px solid var(--line); align-items: start; }
.week .d { font-family: var(--mono); font-size: 0.8rem; color: var(--ink-3); padding-top: 0.25rem; }
.week .d b { display: block; font-size: 1.25rem; color: var(--ink); font-weight: 600; line-height: 1; }
.week .do { font-size: 0.97rem; }
.week .out { font-size: 0.9rem; color: var(--ink-2); }
.week .out::before { content: "תוצר: "; font-size: 0.72rem; color: var(--ink-3); text-transform: uppercase; }
@media (max-width: 40em) { .week li { grid-template-columns: 2.6rem minmax(0, 1fr); } .week .out { grid-column: 2; } }

/* ---------- golden rule ---------- */
.rule { text-align: center; padding-block: clamp(3rem, 10vw, 7rem); }
.rule .big { font-size: clamp(1.9rem, 6vw, 3.6rem); font-weight: 700; line-height: 1.15; max-width: 18ch; margin-inline: auto; }
.rule .small { margin-top: 1.25rem; color: var(--ink-2); max-width: 44ch; margin-inline: auto; }
.rule .check { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-top: 1.5rem; }
.rule .check span { border: 1px solid var(--line-strong); border-radius: 999px; padding: 0.3rem 0.8rem; font-size: 0.9rem; }
.rule .hand { display: block; margin-top: 2rem; }

/* ---------- downloads ---------- */
.dl-grid { display: grid; gap: 2rem; }
@media (min-width: 60em) { .dl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.dl-grid h3 { font-size: 0.8rem; font-family: var(--mono); letter-spacing: 0.06em; color: var(--ink-3); text-transform: uppercase; padding-bottom: 0.5rem; border-bottom: 1px solid var(--line-strong); margin-bottom: 0.25rem; }
.dl-grid h3.he { font-family: inherit; letter-spacing: normal; text-transform: none; font-size: 0.85rem; }
.list li { border-bottom: 1px solid var(--line); }
.list a { display: flex; align-items: baseline; gap: 0.75rem; padding: 0.6rem 0; text-decoration: none; transition: padding 220ms var(--spring); }
.list a:hover { padding-inline-start: 0.35rem; }
.list a .t { flex: 1; font-size: 0.97rem; }
.list a .m { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.04em; color: var(--ink-3); direction: ltr; unicode-bidi: isolate; white-space: nowrap; }
.list a:hover .t { text-decoration: underline; text-underline-offset: 0.16em; }
.list .arrow { color: var(--ink-3); font-size: 0.85rem; }

/* ---------- footer label ---------- */
.foot { padding-block: 3rem 4rem; border-top: 1px solid var(--line-strong); }
.foot .care { display: grid; gap: 0.5rem 2rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); font-size: 0.85rem; color: var(--ink-2); }
.foot .care b { display: block; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.06em; color: var(--ink-3); text-transform: uppercase; }
.foot .socials { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin-top: 1.5rem; font-size: 0.9rem; }
.foot .socials a { text-decoration: none; border-bottom: 1px solid var(--line-strong); }
.foot .socials a:hover { border-bottom-color: var(--ink); }
.foot .fine { margin-top: 2rem; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.04em; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }

/* ---------- reveal on scroll (opacity + small rise, spring-like ease) ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 520ms var(--spring), transform 620ms var(--spring); will-change: opacity, transform; }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { transform: none !important; transition: opacity 200ms ease; }
  .btn, .seg button, .list a, .toc li { transition: none; }
  .btn:hover { transform: none; }
  .stamp { transform: rotate(-3deg); }
}

@media print {
  .top, .ctas, .seg, .path-note { display: none !important; }
  body { background: #fff; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
