/* המספריים של בן · "שלומי, בן, ואתה": עץ משפחה מתיל פליז על קיר ירוק.
   Layout = a wall of wire shelves (.shelf). Motion = brass that grows (scaleX / scaleY) and
   the owner's stretched letters. Only transform + opacity move; nothing moves with reduced motion. */

:root {
  --bg: #114753;
  --surface: #0C3741;
  --ink: #F4F0E1;
  --muted: #C3D3CF;
  --primary: #D2C393;
  --primary-ink: #0B2B33;
  --soft: #1A5865;
  --accent: #86D9A1;
  --line: #B3A57D;
  --focus: #FFE7A3;
  --paper: #F4F0E1;
  --paper-ink: #114753;
  --paper-muted: #2E5A63;
  --radius: 14px;
  --k-outline-fill: var(--soft);
  --font-head: "Gveret Levin", "Miriam Libre Variable", system-ui, sans-serif;
  --font-body: "Miriam Libre Variable", system-ui, sans-serif;
  --h1: clamp(3.25rem, 2.2rem + 5vw, 6rem);
  --h2: clamp(2.375rem, 1.8rem + 3vw, 4rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.7;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip-link {
  position: absolute;
  inset-inline-start: 12px;
  top: -60px;
  z-index: 50;
  padding: .6rem 1rem;
  border-radius: 8px;
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 700;
}
.skip-link:focus { top: 12px; }

.wrap { max-width: 1152px; margin-inline: auto; padding-inline: 16px; }

/* ---------- Wire basket: brass on three sides, open top, two hooks ---------- */
.shelf {
  position: relative;
  border: 2px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 20px 18px 22px;
}
.shelf::before,
.shelf::after {
  content: "";
  position: absolute;
  top: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line);
}
.shelf::before { inset-inline-start: -4px; }
.shelf::after { inset-inline-end: -4px; }

/* ---------- Demo banner + header ---------- */
.demo-banner {
  padding: .55rem 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--soft);
  color: var(--ink);
  font-size: .9375rem;
  line-height: 1.5;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  transition: background-color 300ms ease;
}
.site-header.is-scrolled { background: var(--surface); box-shadow: 0 1px 0 var(--soft); }
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1152px;
  height: 56px;
  margin-inline: auto;
  padding-inline: 16px;
}
.brand {
  margin-inline-end: auto;
  font-family: var(--font-head);
  font-size: 26px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transform-origin: right center;
  transition: transform 300ms ease;
}
.site-header.is-scrolled .brand { transform: scale(.88); }
.site-nav { display: none; }
.site-header .header-wa { display: none; }

/* ---------- Hero: the brass tree ---------- */
.hero {
  display: grid;
  align-content: center;
  gap: 32px;
  max-width: 1152px;
  min-height: 88svh;
  margin-inline: auto;
  padding: 24px 16px 48px;
}
.hero__text { padding-inline-start: 28px; }
.tree { position: relative; }
.tree__trunk {
  position: absolute;
  inset-inline-start: -26px;
  top: 6px;
  bottom: calc(var(--h1) * .5);
  width: 2px;
  background: var(--line);
  transform-origin: top;
}
.eyebrow {
  color: var(--primary);
  font-size: .9375rem;
  font-weight: 600;
  line-height: 1.4;
}
.hero__title {
  margin: 10px 0 0;
  font-family: var(--font-head);
  font-size: var(--h1);
  font-weight: 400;
  line-height: 1.02;
}
.limb { position: relative; display: block; }
.limb--you { color: var(--accent); }
.limb__branch {
  position: absolute;
  inset-inline-start: -26px;
  top: 50%;
  width: 20px;
  height: 2px;
  background: var(--line);
  transform-origin: right center;
}
.limb__knot {
  position: absolute;
  inset-inline-start: -28.5px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -2.5px;
  border-radius: 50%;
  background: var(--line);
}
.limb__heart {
  position: absolute;
  inset-inline-start: -32px;
  top: 50%;
  width: 14px;
  height: 13px;
  margin-top: -5.5px;
  color: var(--accent);
}
.hero__lead {
  max-width: 30ch;
  margin-top: 20px;
  color: var(--muted);
  font-size: 1.125rem;
}
.rating {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  color: var(--ink);
  font-size: .9375rem;
  font-weight: 600;
}
.rating__stars { display: inline-flex; gap: 2px; color: var(--primary); }
.rating__stars svg { width: 16px; height: 16px; }
.hero__actions { display: grid; gap: 12px; margin-top: 28px; }
.hero__photo { padding: 0; }
.hero__photo img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  object-position: 62% 38%;
  border-radius: 0 0 12px 12px;
}

/* ---------- Sections ---------- */
section:not(.hero) { padding-block: 72px; }
.h2 {
  margin: 0 0 12px;
  font-family: var(--font-head);
  font-size: var(--h2);
  font-weight: 400;
  line-height: 1.1;
}
.h3 {
  margin: 0 0 10px;
  color: var(--primary);
  font-family: var(--font-head);
  font-size: 30px;
  font-weight: 400;
  line-height: 1.15;
}
.intro { margin-bottom: 36px; color: var(--muted); }
.quote { margin: 0; }
.quote p { font-size: 1.1875rem; line-height: 1.6; }
.quote footer, .by {
  margin-top: 8px;
  color: var(--muted);
  font-size: .9375rem;
  font-weight: 600;
  line-height: 1.4;
}
.quote-s { font-size: 1.0625rem; line-height: 1.55; }
.by + .quote-s { margin-top: 14px; }

/* ---------- השושלת: staggered shelves hung on L-shaped brass wire ---------- */
.stairs { display: flex; flex-direction: column; }
.step { width: 88%; }
.step--2, .step--4 { margin-inline-start: 12%; }
.step .quote { margin-top: 4px; }
.step > p { color: var(--muted); }
.step__cta { margin-top: 18px; }
.conn { position: relative; height: 28px; }
.conn__v,
.conn__h { position: absolute; background: var(--line); }
.conn__v {
  top: 0;
  bottom: 0;
  inset-inline-start: var(--v);
  width: 2px;
  transform-origin: top;
}
.conn__h {
  bottom: 0;
  inset-inline-start: var(--hs);
  width: var(--hw);
  height: 2px;
  transform-origin: var(--ho);
}
/* After a shelf at the start side: drop near its end, run to the next shelf's end corner. */
.conn--1, .conn--3 { --v: calc(88% - 16px); --hs: calc(88% - 16px); --hw: calc(12% + 18px); --ho: right center; }
/* After a shelf pushed to the end side: drop near its start, run back to the start corner. */
.conn--2 { --v: calc(12% + 14px); --hs: -2px; --hw: calc(12% + 18px); --ho: left center; }

/* ---------- מי מסתפר: crooked little shelves ---------- */
.who__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 12px;
  margin: 28px 0 0;
  padding: 0 0 18px;
  list-style: none;
}
.who__box { padding: 16px 12px 18px; }
.who__box:nth-child(even) { translate: 0 18px; }
.who__box .h3 { font-size: 30px; }
.who__more { margin-top: 36px; color: var(--muted); font-size: .9375rem; }

/* ---------- הקיר ---------- */
.wall { padding-block: 24px 72px; }
.wall__figure { margin: 0; }
.wall__frame {
  --k-reveal-cover: #0C3741;
  position: relative;
  height: 420px;
  overflow: hidden;
}
.wall__drift { position: absolute; inset: -12% 0; }
.wall__drift picture, .wall__drift img { width: 100%; height: 100%; }
.wall__drift img { object-fit: cover; object-position: 50% 50%; }
.wall__cap { padding-top: 14px; color: var(--muted); font-size: .9375rem; }

/* ---------- מה אומרים: cream notes + the owner's handwriting ---------- */
.rating--sub { margin: -20px 0 36px; }
.pairs { display: grid; gap: 44px; }
.note {
  margin: 0;
  padding: 20px 20px 18px;
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--paper-ink);
  box-shadow: 0 14px 30px -18px rgb(0 0 0 / .6);
}
.note p { font-size: 1.1875rem; line-height: 1.6; }
.note footer { margin-top: 10px; color: var(--paper-muted); font-size: .9375rem; font-weight: 600; }
.reply { margin: 16px 24px 0 0; }
.reply__label { color: var(--muted); font-size: .8125rem; font-weight: 600; }
.reply__hand {
  margin-top: 2px;
  color: var(--accent);
  font-family: var(--font-head);
  font-size: 28px;
  line-height: 1.25;
}
.nw { white-space: nowrap; }
.x { display: inline-block; }
.reply__heart { display: inline-block; width: 24px; height: 22px; vertical-align: -3px; color: var(--accent); }
.hearts { display: inline-flex; gap: 4px; vertical-align: -3px; }
.shorts {
  display: grid;
  gap: 24px;
  margin: 56px 0 0;
  padding: 0;
  list-style: none;
}
.more { margin-top: 28px; }
.k-link { font-weight: 600; }

/* ---------- שעות ומקום ---------- */
.visit__grid { display: grid; gap: 32px; margin-top: 28px; }
.address { display: flex; gap: 10px; align-items: flex-start; font-size: 1.1875rem; font-weight: 600; }
.address__icon { flex: none; width: 22px; height: 22px; margin-top: 5px; color: var(--primary); }
.live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: .9375rem;
  font-weight: 600;
}
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.live.is-open { color: var(--ink); }
.live.is-open::before { background: var(--accent); }
.hours { width: 100%; margin-top: 18px; border-collapse: collapse; font-size: 1.0625rem; }
.hours tr { border-bottom: 1px solid var(--line); }
.hours th, .hours td { padding: 10px 6px; font-weight: 400; text-align: start; }
.hours td { text-align: end; }
.hours tr.is-today { background: var(--soft); font-weight: 700; }
.hours tr.is-today th { font-weight: 700; }
.visit__nav { display: grid; gap: 12px; margin-top: 24px; }
.faq { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding-block: 8px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--primary); font-size: 1.5rem; line-height: 1; }
.faq[open] summary::after { content: "−"; }
.faq p { padding-bottom: 14px; color: var(--muted); }

/* ---------- הענף הבא ---------- */
.next { background: var(--surface); }
section.next { padding-block: 56px; }
.next__inner { display: flex; gap: 18px; }
.sprout { position: relative; flex: none; width: 24px; padding-top: 10px; }
.sprout__stem {
  display: block;
  width: 2px;
  height: 64px;
  margin-inline: auto;
  background: var(--line);
  transform-origin: top;
}
.sprout__heart { display: block; width: 24px; height: 22px; margin-top: -2px; color: var(--accent); }
.next__lead { color: var(--muted); }
.next__actions { display: grid; gap: 12px; margin-top: 24px; }

/* ---------- Footer + mobile dock ---------- */
.site-footer {
  padding: 32px 0 40px;
  border-top: 1px solid var(--soft);
  background: var(--surface);
  color: var(--muted);
  font-size: .9375rem;
}
.site-footer p + p { margin-top: 8px; }
.site-footer a { color: var(--ink); }
.site-footer a[href^="tel"] { display: inline-block; min-height: 24px; }

.dock {
  position: fixed;
  inset-inline: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 35;
  display: flex;
  gap: 8px;
  padding: 8px;
  border: 2px solid var(--line);
  border-top: 0;
  border-radius: 0 0 18px 18px;
  background: var(--surface);
  box-shadow: 0 -10px 24px -14px rgb(0 0 0 / .7);
}
.dock > * { flex: 1 1 0; }
.dock.is-hidden { visibility: hidden; opacity: 0; transform: translateY(calc(100% + 24px)); pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  .dock { transition: transform 420ms cubic-bezier(.16, 1, .3, 1), opacity 300ms ease, visibility 0s; }
  .dock.is-hidden { transition: transform 420ms cubic-bezier(.16, 1, .3, 1), opacity 300ms ease, visibility 0s 420ms; }
}
@media (prefers-reduced-motion: reduce) { .dock.is-hidden { transform: none; } }
@media (max-width: 899px) { body { padding-bottom: 88px; } }
@media (min-width: 900px) { .dock { display: none; } }

/* ---------- Tablet ---------- */
@media (min-width: 768px) {
  .shorts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .visit__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .visit__faq { margin-top: 32px; }
  .next__actions { display: flex; flex-wrap: wrap; }
}

/* ---------- Desktop ---------- */
@media (min-width: 1024px) {
  .site-header__inner { height: 72px; }
  .site-nav { display: flex; gap: 28px; }
  .site-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
  }
  .site-nav a:hover { color: var(--primary); }
  .site-header .header-wa { display: inline-flex; }
  .site-header .header-call { display: none; }

  .hero {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 24px;
    min-height: min(100svh, 820px);
    padding-block: 48px;
  }
  .hero__text { grid-column: 1 / 9; align-self: center; }
  .hero__lead { font-size: 1.1875rem; }
  .hero__actions { display: flex; gap: 12px; }
  .hero__actions .k-btn--block { width: auto; }
  .hero__photo { grid-column: 9 / 13; align-self: stretch; display: flex; }
  .hero__photo picture { flex: 1; display: flex; }
  .hero__photo img { height: auto; min-height: 100%; object-position: 70% 30%; }

  body { font-size: 1.1875rem; }
  section:not(.hero) { padding-block: 112px; }
  .h3 { font-size: 34px; }
  .quote p, .note p { font-size: 1.3125rem; }

  .step { width: 44%; }
  .step--2 { margin-inline-start: 18.67%; }
  .step--3 { margin-inline-start: 37.33%; }
  .step--4 { margin-inline-start: 56%; }
  .conn { height: 40px; }
  .conn--1 { --v: calc(44% - 16px); --hs: calc(44% - 16px); --hw: calc(18.67% + 18px); --ho: right center; }
  .conn--2 { --v: calc(62.67% - 16px); --hs: calc(62.67% - 16px); --hw: calc(18.67% + 18px); --ho: right center; }
  .conn--3 { --v: calc(81.33% - 16px); --hs: calc(81.33% - 16px); --hw: calc(18.67% + 18px); --ho: right center; }

  .who__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; padding-bottom: 44px; }
  .who__box { padding: 20px 18px 22px; }
  .who__box:nth-child(1) { translate: none; }
  .who__box:nth-child(2) { translate: 0 32px; }
  .who__box:nth-child(3) { translate: 0 12px; }
  .who__box:nth-child(4) { translate: 0 44px; }

  .wall__frame { height: min(52vh, 560px); }

  .pairs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
  .pair:nth-child(1) .note { rotate: -1.5deg; }
  .pair:nth-child(2) .note { rotate: 1deg; }
  .pair:nth-child(3) .note { rotate: -.5deg; }
  .reply__hand { font-size: 32px; }
  .shorts { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .next__inner { padding-inline-start: 16.66%; gap: 28px; }
}

/* =====================================================================
   Motion
   Hero: pure CSS, so the brass grows from the very first paint (no flash
   while scripts load). Text and buttons never move.
   Below the fold: start states only under html.k-motion (motion.js), keyed
   on .is-in. Reduced motion: everything is drawn in its final state.
   ===================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .tree__trunk { animation: grow-y 700ms var(--k-ease-out) both; }
  .limb__branch { animation: grow-x 300ms var(--k-ease-out) both; }
  .limb:nth-child(1) .limb__branch { animation-delay: 300ms; }
  .limb:nth-child(2) .limb__branch { animation-delay: 450ms; }
  .limb:nth-child(3) .limb__branch { animation-delay: 600ms; }
  .limb__knot { animation: pop 200ms var(--k-spring) both; }
  .limb:nth-child(1) .limb__knot { animation-delay: 600ms; }
  .limb:nth-child(2) .limb__knot { animation-delay: 750ms; }
  .limb__heart { animation: heart 350ms var(--k-spring) 900ms both; }

  /* L-shaped wire between family shelves */
  .k-motion .conn__v { transform: scaleY(0); transition: transform 260ms var(--k-ease-out) 300ms; }
  .k-motion .conn__h { transform: scaleX(0); transition: transform 260ms var(--k-ease-out) 520ms; }
  .k-motion .step.is-in + .conn .conn__v,
  .k-motion .step.is-in + .conn .conn__h { transform: none; }

  /* The owner's stretched letters, one after another (delays set in main.js) */
  .k-motion .reply:not(.is-in) .x,
  .k-motion .reply:not(.is-in) .reply__heart { opacity: 0; }
  .k-motion .reply.is-in .x { animation: letter 160ms var(--k-ease-out) var(--d, 0ms) both; }
  .k-motion .reply.is-in .reply__heart { animation: pop 300ms var(--k-spring) var(--d, 0ms) both; }

  /* The last branch: stem grows, heart pops */
  .k-motion .sprout:not(.is-in) .sprout__stem { transform: scaleY(0); }
  .k-motion .sprout:not(.is-in) .sprout__heart { transform: scale(0); }
  .k-motion .sprout.is-in .sprout__stem { animation: grow-y 600ms var(--k-ease-out) both; }
  .k-motion .sprout.is-in .sprout__heart { animation: heart 350ms var(--k-spring) 550ms both; }
}

@keyframes grow-y { from { transform: scaleY(0); } }
@keyframes grow-x { from { transform: scaleX(0); } }
@keyframes pop { from { transform: scale(0); } }
@keyframes heart {
  0% { transform: scale(0); }
  60% { transform: scale(1.18); }
  100% { transform: scale(1); }
}
@keyframes letter { from { opacity: 0; transform: translateY(4px); } }

@media (forced-colors: active) {
  .shelf, .dock { border-color: CanvasText; }
  .tree__trunk, .limb__branch, .limb__knot, .conn__v, .conn__h, .sprout__stem { background: CanvasText; }
}

/* ---------- Accessibility statement + 404 ---------- */
.page { max-width: 720px; margin-inline: auto; padding: 56px 16px 72px; }
.page h1 { margin: 0 0 16px; font-family: var(--font-head); font-size: var(--h2); font-weight: 400; line-height: 1.1; }
.page h2 { margin: 36px 0 8px; color: var(--primary); font-family: var(--font-head); font-size: 30px; font-weight: 400; }
.page ul { padding-inline-start: 1.2em; }
.page li + li { margin-top: 6px; }
.page p + p { margin-top: 12px; }
.page a { display: inline-block; min-height: 24px; color: var(--accent); font-weight: 600; }
