/* Shen Yafa, Dr David Vinegrad's dental clinic: a proposed site.
   Phone first (390px). Colour from the clinic's own logo: its sky band for the
   hero and its royal band for the one statement that matters, on white.
   The base CSS is the finished page; motion lives in the block at the end. */

:root {
  --sky: #dde9f9;          /* the logo's light band, lifted */
  --sky-deep: #c9dcf5;
  --royal: #2a3fd0;        /* the logo's dark band: 7.7:1 under white text */
  --royal-press: #2234b3;
  --royal-ink: #e9eeff;
  --royal-soft: #b9c6ff;
  --ink: #0b1633;
  --soft: #4b5672;
  --line: #dfe5ef;
  --paper: #ffffff;
  --mist: #f5f8fd;
  --wa: #12833f;           /* the kit's deepened WhatsApp green, AA under white */
  --wa-press: #0e6a33;
  --focus: #2a3fd0;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Hebrew", "Segoe UI", "Arial Hebrew", Arial, sans-serif;
  --gutter: clamp(20px, 5.2vw, 48px);
  --max: 1160px;
  --section: clamp(72px, 13vw, 136px);
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 17px/1.55 var(--sans); -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 10px; }

/* A transform keeps the hidden skip link inside the page in RTL (an inset far
   off to one side would widen the document). */
.skip {
  position: fixed; top: 10px; inset-inline-start: 10px; z-index: 30;
  padding: 12px 18px; border-radius: 12px; background: var(--ink); color: #fff; text-decoration: none;
  transform: translateY(-160%);
}
.skip:focus { transform: none; }

/* ---------- The bar: the brand and the call, nothing else on a phone ---------- */
.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  height: 64px; padding-inline: var(--gutter);
  padding-top: env(safe-area-inset-top);
  background: var(--sky);
  transition: background-color 240ms ease, box-shadow 240ms ease;
}
.bar.scrolled { background: var(--paper); box-shadow: 0 1px 0 var(--line); }
.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; }
.mark { width: 30px; height: 32px; fill: var(--royal); flex: none; }
.brand-name { display: flex; flex-direction: column; font-size: 19px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.05; }
.brand-name small { font-size: 14px; font-weight: 500; color: var(--soft); letter-spacing: 0; margin-top: 2px; }
.links { display: none; }
.bar-call {
  margin-inline-start: auto;
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: 999px; background: var(--paper); color: var(--ink);
  font-size: 16px; font-weight: 700; text-decoration: none;
  box-shadow: inset 0 0 0 1px var(--sky-deep);
  transition: transform 140ms var(--ease-out);
}
.bar.scrolled .bar-call { background: var(--royal); color: #fff; box-shadow: none; }
.bar-call:active { transform: scale(.97); }
.icon { width: 18px; height: 18px; flex: none; }

/* ---------- Hero: the confession, and the smile under it ---------- */
.hero {
  background: var(--sky); overflow: hidden;
  display: grid; padding-top: clamp(20px, 5vw, 48px);
}
.hero-copy { padding-inline: var(--gutter); }
.eyebrow { font-size: 16px; font-weight: 600; color: var(--royal); }
.hero h1 {
  margin-top: 10px;
  font-size: clamp(44px, 12.6vw, 96px); font-weight: 800; line-height: 1.02; letter-spacing: -0.03em;
  text-wrap: balance;
}
.lede {
  margin-top: 18px; max-width: 30em;
  font-size: clamp(18px, 4.7vw, 22px); line-height: 1.5; color: var(--ink);
}
.sign { margin-top: 10px; font-size: 16px; font-weight: 700; color: var(--soft); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
/* On a phone the number and the icon say "call"; the verb returns where there is room. */
.verb { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (min-width: 420px) { .verb { position: static; width: auto; height: auto; overflow: visible; clip: auto; } }
.primary, .wa {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 22px; border-radius: 999px;
  font-size: 17px; font-weight: 700; text-decoration: none; white-space: nowrap;
  transition: transform 140ms var(--ease-out), background-color 160ms ease;
}
.primary { background: var(--royal); color: #fff; }
.wa { background: var(--wa); color: #fff; padding-inline: 18px; }
.wa .kit-mark { fill: #fff; width: 20px; height: 20px; }
.primary:active, .wa:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) {
  .primary:hover { background: var(--royal-press); }
  .wa:hover { background: var(--wa-press); }
}

.hero-portrait { margin-top: 18px; display: flex; justify-content: center; }
.hero-portrait img { width: min(310px, 80vw); }

/* ---------- The one statement, in the logo's royal band ---------- */
.calm { background: var(--royal); color: #fff; padding-block: var(--section); }
.kicker { font-size: 16px; font-weight: 600; color: var(--royal); }
.calm .kicker { color: var(--royal-soft); }
h2 {
  margin-top: 8px;
  font-size: clamp(36px, 9.6vw, 72px); font-weight: 800; line-height: 1.04; letter-spacing: -0.03em;
  text-wrap: balance;
}
.calm-lede { margin-top: 20px; max-width: 34em; font-size: clamp(18px, 4.6vw, 22px); color: var(--royal-ink); }
.tools { margin-top: clamp(32px, 6vw, 56px); display: grid; gap: 0; border-top: 1px solid rgba(255, 255, 255, .22); }
.tools li {
  display: grid; gap: 2px; padding-block: 18px; border-bottom: 1px solid rgba(255, 255, 255, .22);
  font-size: 17px; color: var(--royal-ink);
}
.tools strong { font-size: 21px; font-weight: 700; color: #fff; letter-spacing: -0.01em; }

/* ---------- Pain: his own words, and the number that answers ---------- */
.urgent { padding-block: var(--section); }
.urgent h2 { font-size: clamp(40px, 11vw, 80px); }
.urgent-body { margin-top: 20px; }
.urgent-body > p:first-child { font-size: clamp(18px, 4.6vw, 22px); max-width: 30em; }
.urgent-call {
  margin-top: 22px; display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 22px;
  border-radius: 999px; background: var(--ink); color: #fff; font-size: 17px; font-weight: 700; text-decoration: none;
  transition: transform 140ms var(--ease-out);
}
.urgent-call:active { transform: scale(.97); }
.note { margin-top: 12px; font-size: 16px; color: var(--soft); }

/* ---------- Treatments: a list a person can read in one pass ---------- */
.care { background: var(--mist); padding-block: var(--section); }
.treatments { margin-top: clamp(28px, 5vw, 48px); border-top: 1px solid var(--line); }
.treatments > div { padding-block: 18px; border-bottom: 1px solid var(--line); }
.treatments dt { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; }
.treatments dd { margin-top: 2px; color: var(--soft); }

/* ---------- The first visit ---------- */
.first { background: var(--sky); padding-block: var(--section); }
.first h2 { font-size: clamp(44px, 12.6vw, 96px); }
.first-grid > div > p:last-child { margin-top: 18px; max-width: 30em; font-size: clamp(18px, 4.6vw, 22px); }
.terms { margin-top: 28px; border-top: 1px solid var(--sky-deep); }
.terms li { padding-block: 14px; border-bottom: 1px solid var(--sky-deep); }

/* ---------- Beyond the clinic ---------- */
.reach { padding-block: var(--section); }
.reach-grid { margin-top: clamp(28px, 5vw, 48px); display: grid; gap: 28px; }
.reach article { padding-top: 20px; border-top: 2px solid var(--ink); }
.reach h3 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.reach p { margin-top: 6px; color: var(--soft); }

/* ---------- Children, and the books he wrote for them ---------- */
.kids { background: var(--mist); padding-block: var(--section); }
.kids-lede { margin-top: 20px; max-width: 34em; font-size: clamp(18px, 4.6vw, 22px); }
.books {
  margin-top: clamp(36px, 6vw, 64px); padding: 24px; border-radius: 28px; background: var(--paper);
  box-shadow: 0 1px 0 var(--line), 0 24px 48px -32px rgba(11, 22, 51, .28);
}
.books h3 { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.books-text p { margin-top: 8px; color: var(--soft); }
.quiet {
  display: inline-flex; align-items: center; min-height: 44px; margin-top: 6px;
  color: var(--royal); font-weight: 600; text-decoration: none;
}
@media (hover: hover) and (pointer: fine) { .quiet:hover { text-decoration: underline; } }
/* The three books lie in a loose cascade, as they would on a table: each one
   shows its title, the one on top shows its whole cover. */
.covers { margin-top: 24px; display: grid; padding-bottom: 8px; }
.covers li { width: 74%; }
.covers li:nth-child(1) { justify-self: start; transform: rotate(2.5deg); }
.covers li:nth-child(2) { justify-self: end; margin-top: -15%; transform: rotate(-3deg); }
.covers li:nth-child(3) { justify-self: start; margin-top: -15%; margin-inline-start: 8%; transform: rotate(1deg); }
.covers img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: #fff; box-shadow: 0 0 0 1px var(--line), 0 14px 28px -14px rgba(11, 22, 51, .45); }

/* ---------- About ---------- */
.about { padding-block: var(--section); }
.about-grid { display: grid; gap: 32px; }
.about-photo { justify-self: center; width: min(260px, 66vw); border-radius: 50% 50% 28px 28px / 38% 38% 28px 28px; overflow: hidden; background: var(--sky); }
.about-photo img { width: 100%; }
.about-text header > p:last-child { margin-top: 18px; max-width: 34em; font-size: clamp(18px, 4.6vw, 21px); }
.years { margin-top: 28px; border-top: 1px solid var(--line); }
.years li { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: baseline; padding-block: 13px; border-bottom: 1px solid var(--line); }
.years b { font-size: 17px; font-weight: 800; color: var(--royal); font-variant-numeric: tabular-nums; }

/* ---------- Visit ---------- */
.visit { background: var(--ink); color: #fff; padding-block: var(--section); }
.visit .kicker { color: var(--royal-soft); }
.visit h2 { font-size: clamp(34px, 9vw, 64px); }
.visit-note { margin-top: 14px; font-size: clamp(18px, 4.6vw, 21px); color: #c9d1e6; }
.visit .actions { margin-top: 28px; }
.visit .primary { background: #fff; color: var(--ink); }
@media (hover: hover) and (pointer: fine) { .visit .primary:hover { background: var(--sky); } }
.nav-label { margin-top: 32px; font-size: 16px; font-weight: 600; color: #c9d1e6; }
.nav { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 10px; }
.kit-nav {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px;
  border-radius: 14px; background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);
  font-size: 16px; font-weight: 600; text-decoration: none; color: #fff;
  transition: transform 140ms var(--ease-out), background-color 160ms ease;
}
.kit-nav:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .kit-nav:hover { background: rgba(255, 255, 255, .14); } }
.kit-mark { width: 20px; height: 20px; border-radius: 5px; flex: none; }
.contact { margin-top: 40px; border-top: 1px solid rgba(255, 255, 255, .16); }
.contact > div { display: grid; gap: 2px; padding-block: 14px; border-bottom: 1px solid rgba(255, 255, 255, .16); }
.contact dt { font-size: 16px; color: #aab4cf; }
.contact dd { font-size: 18px; font-weight: 600; }
.contact a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .contact a:hover { text-decoration: underline; } }

.foot {
  display: grid; justify-items: center; gap: 6px; padding: 40px var(--gutter) calc(40px + env(safe-area-inset-bottom));
  background: var(--ink); color: #aab4cf; font-size: 16px; text-align: center;
  border-top: 1px solid rgba(255, 255, 255, .1);
}
.foot .mark { width: 26px; height: 28px; fill: #fff; opacity: .9; }
.foot p:first-of-type { color: #fff; font-weight: 600; }

/* ---------- Tablet and up ---------- */
@media (min-width: 720px) {
  .reach-grid { grid-template-columns: repeat(3, 1fr); gap: 32px; }
  .treatments { display: grid; grid-template-columns: 1fr 1fr; column-gap: 48px; }
  .books { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 32px; align-items: center; padding: 36px; }
  .covers { margin-top: 0; }
  .contact { margin-top: 0; }
  .visit-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 56px; align-items: start; }
  .first-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 56px; align-items: end; }
  .urgent-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: end; }
}

/* ---------- Desktop: the copy beside the portrait ---------- */
@media (min-width: 900px) {
  .links { display: flex; gap: 4px; margin-inline-start: 24px; }
  .links a {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 10px;
    font-size: 16px; font-weight: 500; color: var(--soft); text-decoration: none;
  }
  .links a:hover { color: var(--ink); }
  .hero {
    grid-template-columns: minmax(0, 1fr) auto; align-items: end;
    /* A fixed height, not vh: it fills a laptop's first screen and still
       leaves a strip of the royal band to say there is more. */
    min-height: 740px; max-width: none; padding-top: 0;
    padding-inline: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
  }
  .hero-copy { padding: 64px 0; align-self: center; }
  .lede { font-size: 22px; max-width: 26em; }
  .hero-portrait { margin-top: 0; padding-top: 48px; margin-inline-start: 40px; }
  .hero-portrait img { width: 388px; }
  .about-grid { grid-template-columns: 300px 1fr; gap: 72px; align-items: start; }
  .about-photo { width: 300px; justify-self: start; position: sticky; top: 104px; }
  .tools { grid-template-columns: 1fr 1fr; column-gap: 48px; }
}

/* ---------- Motion: only when the visitor has not asked for less ----------
   app.js adds .motion to <html> only when reduced motion is not requested.
   The hero settles in once and the portrait rises into the frame; sections
   fade up as they arrive. Nothing loops. */
@media (prefers-reduced-motion: no-preference) {
  .motion [data-intro] {
    opacity: 0; transform: translateY(14px);
    transition: opacity 640ms var(--ease-out), transform 820ms var(--ease-out);
    transition-delay: calc(var(--i, 0) * 70ms + 60ms);
  }
  .motion.ready [data-intro] { opacity: 1; transform: none; }
  .motion [data-intro-photo] img {
    opacity: 0; transform: translateY(56px);
    transition: opacity 520ms var(--ease-out) 220ms, transform 1000ms var(--ease-out) 220ms;
  }
  .motion.ready [data-intro-photo] img { opacity: 1; transform: none; }
  .motion [data-reveal] {
    opacity: 0; transform: translateY(18px);
    transition: opacity 600ms var(--ease-out), transform 760ms var(--ease-out);
  }
  .motion [data-reveal].in { opacity: 1; transform: none; }
}
