/* יואל פרחי באך — screens over living water */
:root {
  --tile: #f8fbfa;
  --surface: #e0e9e6;
  --ink: #102a2e;
  --muted: #4a6367;
  --accent: #0d6c75;
  --accent-hover: #0a5860;
  --accent-ink: #ffffff;
  --glow: #f1d27a;
  --glow-hover: #f6dd92;
  --glow-ink: #1d2a1f;
  --field: #0e2a30;
  --field-2: #15434b;
  --field-ink: #eef6f4;
  --field-muted: #b4cbc9;
  --glass: rgba(10, 34, 39, .55);
  --frame: rgba(13, 108, 117, .28);
  --water-deep: #0b2429;
  --water-mid: #165159;
  --water-light: #63aaa7;
  --water-glint: #f1d27a;

  --serif: "Frank Ruhl Libre", "Times New Roman", serif;
  --sans: "Heebo", system-ui, sans-serif;
  --step-small: clamp(0.875rem, 0.85rem + 0.1vw, 0.9375rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.1875rem, 1.05rem + 0.6vw, 1.5rem);
  --step-head: clamp(2rem, 1.3rem + 2.6vw, 3.5rem);
  --step-display: clamp(2.75rem, 0.9rem + 5.6vw, 6.25rem);

  --margin: clamp(16px, 4.5vw, 72px);
  --gap: clamp(8px, 1vw, 14px);
  --radius: 18px;
  --top: 76px;
  --ease: cubic-bezier(.22, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; overflow: hidden; background: var(--field); color: var(--field-ink);
  font-family: var(--sans); font-size: var(--step-body); line-height: 1.6;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { list-style: none; padding: 0; }
h1, h2 { font-family: var(--serif); font-weight: 300; line-height: 1.04; letter-spacing: -0.01em; }
h3 { font-weight: 500; line-height: 1.25; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--glow); outline-offset: 3px; }
::selection { background: var(--glow); color: var(--glow-ink); }

/* the moving water behind every screen */
.bg { position: fixed; inset: 0; z-index: 0; background: var(--field); }
canvas.water { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 54px; padding: 0 30px; border-radius: 999px; border: 0; cursor: pointer;
  font: 500 var(--step-body)/1 var(--sans); text-decoration: none; white-space: nowrap;
  transition: transform .3s var(--ease), background-color .3s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn[disabled] { opacity: .6; cursor: wait; }
.btn-glow { background: var(--glow); color: var(--glow-ink); }
.btn-glow:hover { background: var(--glow-hover); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: var(--accent-hover); }
.btn-light { background: var(--field-ink); color: var(--field); }
.btn-light:hover { background: #fff; }
.btn-text {
  background: none; border: 0; padding: 6px 0; cursor: pointer; color: inherit;
  font: 500 var(--step-body)/1.3 var(--sans);
  text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1.5px;
  transition: color .2s, text-underline-offset .2s;
}
.btn-text:hover { color: var(--glow); text-underline-offset: 9px; }
.panel-paper .btn-text { color: var(--accent); }
.panel-paper .btn-text:hover { color: var(--ink); }

/* top bar */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 20; height: var(--top);
  display: flex; align-items: center; gap: 32px; padding: 0 var(--margin);
  font-size: var(--step-small);
}
.wordmark { font-family: var(--serif); font-size: 1.5rem; text-decoration: none; white-space: nowrap; }
.progress { display: flex; gap: 6px; margin-inline: auto; counter-reset: none; }
.progress li { display: flex; align-items: center; gap: 8px; color: var(--field-muted); transition: color .4s; }
.progress li::before { content: ""; width: 26px; height: 4px; border-radius: 4px; background: rgba(238,246,244,.22); transition: background-color .4s, width .4s var(--ease); }
.progress li.done::before { background: var(--field-ink); }
.progress li.now { color: var(--field-ink); }
.progress li.now::before { background: var(--glow); width: 40px; }
.progress span { margin-inline-end: 10px; }
.topbar-link { text-decoration: none; opacity: .85; white-space: nowrap; }
.topbar-link:hover { opacity: 1; color: var(--glow); }
body[data-screen="start"] .progress, body[data-screen="contact"] .progress { visibility: hidden; }

.legal {
  position: fixed; inset: auto 0 0 0; z-index: 5; padding: 0 var(--margin) 14px;
  font-size: 0.8125rem; color: var(--field-muted); pointer-events: none;
}
body:not([data-screen="start"]) .legal { display: none; }
.legal a { pointer-events: auto; text-underline-offset: 4px; white-space: nowrap; }
.legal a:hover { color: var(--glow); }
.inline-link { color: var(--accent); text-underline-offset: 4px; white-space: nowrap; }

/* screens */
.screen {
  position: fixed; inset: 0; z-index: 10; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  padding: calc(var(--top) + 24px) var(--margin) 48px;
}
.screen[hidden] { display: none; }
.screen { scrollbar-width: thin; scrollbar-color: rgba(238,246,244,.35) transparent; }
.screen::-webkit-scrollbar { width: 8px; }
.screen::-webkit-scrollbar-thumb { background: rgba(238,246,244,.35); border-radius: 8px; }
.screen::-webkit-scrollbar-track { background: transparent; }

/* panels */
.panel { border-radius: calc(var(--radius) * 1.4); padding: clamp(24px, 3.2vw, 52px); }
.panel-paper { background: var(--tile); color: var(--ink); }
.panel-glass { background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.panel h2 { font-size: var(--step-head); margin-bottom: 28px; }

/* 1. start */
.screen-start { display: grid; }
.screen-start[hidden] { display: none; }
.start-grid { display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: calc(var(--gap) * 5); min-height: 100%; }
.start-text h1 { font-size: clamp(2.5rem, 0.6rem + 4.4vw, 5rem); line-height: 1; }
.lead { margin: 28px 0 36px; max-width: 32ch; color: var(--field-muted); font-size: var(--step-lead); line-height: 1.5; }
.actions { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.byline { margin-top: 40px; color: var(--field-muted); font-size: var(--step-small); }
.fan { --px: 0; --py: 0; position: relative; height: min(66svh, 600px); }
.hcard {
  position: absolute; top: 50%; left: 50%;
  width: min(28vw, 380px); aspect-ratio: 4 / 5; border-radius: var(--radius);
  background: var(--tile); display: grid; place-items: center; padding: 16%;
  box-shadow: inset 0 0 0 10px var(--tile), inset 0 0 0 11px var(--frame);
}
.hcard img { width: 100%; height: 100%; object-fit: contain; }
.hcard-back2 { transform: translate(-50%, -50%) translate(-34%, 6%) rotate(-11deg); translate: calc(var(--px) * -10px) calc(var(--py) * -8px); background: var(--field-2); box-shadow: inset 0 0 0 10px var(--field-2), inset 0 0 0 11px rgba(238,246,244,.18); }
.hcard-back2 img { filter: invert(1); opacity: .6; }
.hcard-back1 { transform: translate(-50%, -50%) translate(30%, -4%) rotate(8deg); translate: calc(var(--px) * 14px) calc(var(--py) * 10px); background: var(--accent); box-shadow: inset 0 0 0 10px var(--accent), inset 0 0 0 11px rgba(238,246,244,.25); }
.hcard-back1 img { filter: invert(1); opacity: .85; }
.hcard-front { transform: translate(-50%, -50%) rotate(-2deg); translate: calc(var(--px) * 24px) calc(var(--py) * 18px); }
.print-stack { position: absolute; inset: 16%; }
.print-stack img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; }
.print-stack img.is-on { opacity: 1; }

/* 2. rules */
.rules-grid { display: grid; grid-template-columns: 1fr 1fr; gap: calc(var(--gap) * 2); align-items: stretch; max-width: 1280px; margin: 0 auto; min-height: 100%; align-content: center; }
.rules { display: grid; gap: 18px; font-size: var(--step-lead); line-height: 1.45; }
.rules li { position: relative; padding-inline-start: 28px; }
.rules li::before { content: ""; position: absolute; inset-inline-start: 0; top: .55em; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.note { margin-top: 32px; padding: 18px 22px; border-radius: 14px; background: #edf3f1; color: var(--muted); }
.breath { display: grid; align-content: center; justify-items: start; gap: 0; }
.breath-cards { display: flex; gap: 12px; margin-bottom: 32px; }
.breath-cards .next-pic:nth-child(1) { rotate: -6deg; }
.breath-cards .next-pic:nth-child(2) { rotate: 3deg; translate: 0 -8px; }
.breath-cards .next-pic:nth-child(3) { rotate: -2deg; }
.breath-text { color: var(--field-muted); font-size: var(--step-lead); line-height: 1.5; max-width: 34ch; margin-bottom: 36px; }
.next { display: grid; gap: 22px; margin-bottom: 36px; }
.next li { display: grid; grid-template-columns: 72px 1fr; gap: 18px; align-items: center; }
.next-pic { width: 72px; aspect-ratio: 1; border-radius: 14px; background: var(--tile); display: grid; place-items: center; padding: 12px; }
.next p { color: var(--field-muted); }
.next b { color: var(--field-ink); font-weight: 500; }

/* 3. pick */
.screen-pick { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 24px; }
.screen-pick[hidden] { display: none; }
.pick-head { display: flex; align-items: end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 20px; }
.pick-head h2 { font-size: var(--step-head); }
.pick-status { display: flex; align-items: center; gap: 22px; }
.slots { display: flex; gap: 8px; }
.slots i { width: 14px; height: 14px; border-radius: 50%; background: rgba(238,246,244,.25); transition: background-color .35s var(--ease), transform .35s var(--ease); }
.slots i.on { background: var(--glow); transform: scale(1.15); }
.count { font-size: var(--step-lead); white-space: nowrap; }
.btn-done { min-height: 48px; padding: 0 30px; }
.btn-done:disabled { background: rgba(238,246,244,.16); color: var(--field-muted); cursor: not-allowed; transform: none; }
.count b { font-weight: 500; color: var(--glow); }
.deck-wrap { flex: 1; min-height: 0; display: grid; place-items: center; }
.deck { display: grid; gap: var(--gap); justify-content: center; align-content: center; }

/* a card: paper with a printed inner frame */
.tile {
  position: relative; border: 0; padding: 0; margin: 0; cursor: pointer; color: inherit;
  background: var(--tile); border-radius: calc(var(--radius) * .7);
  box-shadow: inset 0 0 0 6px var(--tile), inset 0 0 0 7px var(--frame);
  transition: background-color .35s var(--ease), transform .45s var(--ease), box-shadow .35s var(--ease), opacity .35s;
}
.tile img { position: absolute; inset: 18%; width: 64%; height: 64%; object-fit: contain; transition: filter .35s var(--ease), transform .6s var(--ease); }
.tile:hover { transform: translateY(-4px) rotate(-1deg); }
.tile:hover img { transform: scale(1.08); }
.tile[aria-pressed="true"] { background: var(--accent); box-shadow: inset 0 0 0 6px var(--accent), inset 0 0 0 7px rgba(241,210,122,.7); }
.tile[aria-pressed="true"] img { filter: invert(1); }
.tile[aria-pressed="true"]::after { content: ""; position: absolute; top: 12px; inset-inline-start: 12px; width: 9px; height: 9px; border-radius: 50%; background: var(--glow); }
.deck.is-full .tile[aria-pressed="false"] { cursor: default; opacity: .62; }
.deck.is-full .tile[aria-pressed="false"]:hover { transform: none; }

/* cards after the choice (details + reveal) */
.card { position: relative; perspective: 1400px; }
.card .card-inner { position: absolute; inset: 0; transform-style: preserve-3d; }
.card-face { position: absolute; inset: 0; border-radius: var(--radius); backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.card-front { background: var(--accent); box-shadow: inset 0 0 0 8px var(--accent), inset 0 0 0 9px rgba(241,210,122,.65); }
.card-front img { position: absolute; inset: 20%; width: 60%; height: 60%; object-fit: contain; filter: invert(1); }
.card-back {
  background: var(--tile); color: var(--ink); transform: rotateY(180deg);
  box-shadow: inset 0 0 0 8px var(--tile), inset 0 0 0 9px var(--frame);
  display: flex; flex-direction: column; justify-content: center; gap: 14px; text-align: right;
  padding: clamp(20px, 2vw, 32px);
  font-family: var(--serif); font-size: clamp(1.0625rem, 0.8rem + 0.55vw, 1.375rem); line-height: 1.42;
}
.card-back img { height: clamp(30px, 3vw, 46px); width: auto; max-width: 65%; object-fit: contain; object-position: right; opacity: .5; }

/* 4. details */
.details-wrap { max-width: 1180px; margin: 0 auto; display: grid; gap: 28px; min-height: 100%; align-content: center; }
.chosen-row { --n: 5; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 128px)); justify-content: center; gap: var(--gap); width: 100%; margin: 0 auto; }
.chosen-row .card { aspect-ratio: 4 / 5; }
.details-panel { display: grid; grid-template-columns: 1fr 1.2fr; gap: 24px 56px; align-items: start; }
.details-text { display: grid; gap: 18px; justify-items: start; }
.details-text h2 { margin-bottom: 0; }
.details-text p { font-size: var(--step-lead); line-height: 1.45; max-width: 30ch; }
.form { display: grid; gap: 16px; }
.field-row { display: grid; gap: 6px; }
.field-row span { font-weight: 500; }
.field-row small { font-size: var(--step-small); color: var(--muted); }
.form input[type="text"], .form input[type="tel"], .form input[type="email"] {
  font: 400 var(--step-body)/1.2 var(--sans); color: var(--ink);
  background: #edf3f1; border: 0; border-radius: 14px;
  padding: 14px 18px; min-height: 54px; text-align: right;
  transition: background-color .2s, box-shadow .2s;
}
.form input:focus { outline: none; background: #fff; box-shadow: 0 0 0 3px var(--accent); }
.form input[aria-invalid="true"] { background: #f6e6e3; }
.check { display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: start; cursor: pointer; font-size: var(--step-body); line-height: 1.45; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--accent); cursor: pointer; }
.check input[aria-invalid="true"] { outline: 3px solid #c0392b; outline-offset: 2px; }
.form-error { color: #9c2b1f; font-weight: 500; }
.form-error[hidden] { display: none; }
.form .btn { justify-self: start; margin-top: 4px; }

/* 5. reveal */
.reveal-wrap { max-width: 1280px; margin: 0 auto; display: grid; gap: 32px; }
.reveal-title { font-size: var(--step-head); }
.reveal-row { --n: 5; --nt: 3; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 300px)); justify-content: center; gap: var(--gap); }
.reveal-row .card { aspect-ratio: 3 / 4; }
.reveal-next { display: grid; grid-template-columns: 1.25fr 1fr; gap: calc(var(--gap) * 1.5); }
.reveal-next .panel { display: grid; gap: 16px; justify-items: start; align-content: start; }
.reveal-next h3 { font-family: var(--serif); font-weight: 300; font-size: var(--step-head); line-height: 1.05; }
.reveal-next p { max-width: 44ch; }
.offer-main p { color: var(--muted); font-size: var(--step-lead); line-height: 1.45; }
.panel-glass p { color: var(--field-muted); }
.offer-note { font-size: var(--step-lead); color: var(--glow); }
.offer-note[hidden] { display: none; }

/* contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: calc(var(--gap) * 2); max-width: 1280px; margin: 0 auto; min-height: 100%; align-content: center; }
.contact-text { display: grid; gap: 24px; justify-items: start; align-content: center; }
.contact-text h2 { margin-bottom: 0; }
.lead-dark { font-size: var(--step-lead); line-height: 1.45; max-width: 30ch; }
.contact-links { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.contact-phone { font-size: var(--step-lead); font-weight: 500; text-underline-offset: 6px; }
.contact-phone:hover { color: var(--accent); }
.contact-meta { color: var(--muted); }
.contact-meta a { color: var(--ink); text-underline-offset: 5px; }
.contact-map { border-radius: calc(var(--radius) * 1.4); overflow: hidden; min-height: 440px; background: var(--surface); }
.contact-map iframe { width: 100%; height: 100%; min-height: 440px; border: 0; display: block; filter: saturate(.55); }

/* tablet */
@media (max-width: 1024px) {
  .progress span { display: none; }
  .start-grid { grid-template-columns: 1fr; gap: 12px; align-content: center; }
  .fan { order: -1; height: 40svh; }
  .hcard { width: min(32vw, 280px); }
  .rules-grid, .contact-grid { grid-template-columns: 1fr; }
  .details-panel { grid-template-columns: 1fr; }
  .reveal-row { grid-template-columns: repeat(var(--nt), minmax(0, 300px)); }
  .reveal-next { grid-template-columns: 1fr; }
}

/* phone */
@media (max-width: 640px) {
  :root { --radius: 14px; --top: 60px; }
  .topbar { gap: 14px; }
  .wordmark { font-size: 1.2rem; }
  .progress li::before { width: 16px; }
  .progress li.now::before { width: 26px; }
  .progress span { margin: 0; }
  .start-text h1 { font-size: 11.5vw; }
  .lead { margin: 16px 0 24px; font-size: 1.0625rem; }
  .byline { margin-top: 20px; }
  .fan { height: 36svh; }
  .hcard { width: 44vw; }
  .tile { border-radius: 10px; box-shadow: inset 0 0 0 4px var(--tile), inset 0 0 0 5px var(--frame); }
  .tile[aria-pressed="true"] { box-shadow: inset 0 0 0 4px var(--accent), inset 0 0 0 5px rgba(241,210,122,.7); }
  .tile[aria-pressed="true"]::after { top: 7px; inset-inline-start: 7px; width: 7px; height: 7px; }
  .pick-head { margin-bottom: 12px; }
  .pick-status { width: 100%; justify-content: space-between; gap: 12px; }
  .chosen-row .card-front { box-shadow: inset 0 0 0 4px var(--accent), inset 0 0 0 5px rgba(241,210,122,.65); }
  .reveal-row { grid-template-columns: 1fr; }
  .chosen-row { grid-template-columns: repeat(var(--n), minmax(0, 1fr)); max-width: calc(var(--n) * 76px); }
  .reveal-row .card { aspect-ratio: 16 / 10; }
  .contact-map, .contact-map iframe { min-height: 300px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
