/* =====================================================================
   Motion & experience layer (loaded after site.css)
   Hooks set by templates: data-reveal, data-tilt, data-parallax, data-count, data-rail, data-timeline, data-hero
   ===================================================================== */

/* Sticky header that tightens on scroll */
.site-header { position: sticky; top: 0; background: rgba(245, 239, 230, 0.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: box-shadow .3s; }
.site-header__inner { transition: padding .3s; }
.site-header.is-scrolled { box-shadow: 0 10px 24px -18px rgba(31, 37, 40, .45); }
.site-header.is-scrolled .site-header__inner { padding-block: 10px; }
@media (max-width: 860px) { .site-nav a::after { display: none; } }

/* Oval paintings: the image box is the painting's bounding box, so a 50% radius is exactly its ellipse
   (box-shadow follows the curve too). */
img.is-oval { border-radius: 50%; }

/* Side-entering reveals must never cause horizontal page scroll */
main { overflow-x: clip; }
/* Anchored sections land below the sticky header */
[id] { scroll-margin-top: 90px; }

/* Scroll reveals (only when JS runs; without JS everything is simply visible) */
html.js [data-reveal] { opacity: 0; transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0ms); }
html.js [data-reveal="up"] { transform: translateY(32px); }
html.js [data-reveal="left"] { transform: translateX(-48px); }
html.js [data-reveal="right"] { transform: translateX(48px); }
html.js [data-reveal="zoom"] { transform: scale(.94); }
html.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* Headline lines rising out of a mask */
.line { display: block; overflow: hidden; padding-bottom: .1em; margin-bottom: -.1em; }
.line > span { display: inline-block; }
html.js [data-reveal="line"] { opacity: 1; }
html.js [data-reveal="line"] > span { transform: translateY(110%); transition: transform 1.1s cubic-bezier(.2,.8,.2,1); transition-delay: var(--d, 0ms); }
html.js [data-reveal="line"].is-visible > span { transform: none; }
.hero__title em { font-style: normal; color: var(--accent); position: relative; display: inline-block; }
.hero__title em::after { content: ''; position: absolute; inset-inline: -6px; bottom: .08em; height: .14em; background: var(--accent); opacity: .22; border-radius: 4px; transform: scaleX(0); transform-origin: right; transition: transform 1s cubic-bezier(.2,.8,.2,1) 1s; }
.line.is-visible em::after, html:not(.js) .hero__title em::after { transform: scaleX(1); }

/* Home hero: rotating paintings with a slow zoom */
.hero-slides { flex: 1.3 1 480px; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.hero-slides__stage { position: relative; height: clamp(320px, 46vw, 580px); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-art); }
.hero-slides__slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.4s ease; }
.hero-slides__slide.is-active { opacity: 1; z-index: 1; }
.hero-slides__slide img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.12); transition: transform 7s linear; }
.hero-slides__slide.is-active img { transform: scale(1); }
.hero-slides__bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.hero-slides__title { font-family: var(--font-display); font-size: 19px; }
.hero-slides__dots { display: flex; }
.hero-slides__dots button { position: relative; width: 36px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; }
.hero-slides__dots button::before,
.hero-slides__dots button::after { content: ''; position: absolute; top: 50%; inset-inline: 6px; height: 3px; border-radius: 2px; transform: translateY(-50%); }
.hero-slides__dots button::before { background: var(--line-strong); }
.hero-slides__dots button[aria-current="true"]::after { background: var(--accent); transform-origin: right; animation: dot-fill 6s linear forwards; }
@keyframes dot-fill { from { transform: translateY(-50%) scaleX(0); } to { transform: translateY(-50%) scaleX(1); } }

/* Endless strip of paintings */
.marquee { overflow: hidden; padding-block: 8px 56px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee__track { display: flex; gap: 20px; width: max-content; direction: ltr; animation: marquee 70s linear infinite; }
.marquee__track img { height: 150px; width: auto; box-shadow: 0 12px 24px -14px rgba(60,35,15,.5); }
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Counters */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 28px; padding-bottom: 80px; }
.stat { display: flex; flex-direction: column; gap: 6px; padding-top: 18px; border-top: 2px solid var(--ink); }
.stat__num { font-family: var(--font-display); font-size: clamp(52px, 6vw, 76px); line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat__label { font-size: 16px; font-weight: 600; color: var(--muted); }

/* Artwork cards: 3D tilt + light that follows the cursor */
.art-card__frame { position: relative; overflow: hidden; perspective: 900px; }
.art-card__frame img { transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(var(--s, 1)); transition: transform .45s cubic-bezier(.2,.7,.2,1), box-shadow .45s; }
.art-card:hover .art-card__frame img { --s: 1.04; box-shadow: 0 30px 50px -22px rgba(60,35,15,.6); }
.art-card__frame::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.35), transparent 45%); opacity: 0; transition: opacity .4s; }
.art-card:hover .art-card__frame::after { opacity: 1; }
.art-card__cta { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: var(--accent); opacity: 0; transform: translateX(10px); transition: opacity .35s, transform .35s; }
.art-card:hover .art-card__cta, .art-card:focus-visible .art-card__cta { opacity: 1; transform: none; }

/* Newspaper clippings */
.press-card__paper { display: block; overflow: hidden; perspective: 900px; background: #fff; border: 1px solid var(--line); transition: transform .5s cubic-bezier(.2,.7,.2,1), box-shadow .5s; }
.press-card .press-card__paper img { border: 0; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .4s; }
.press-card:hover .press-card__paper { transform: rotate(-1.2deg) translateY(-6px); box-shadow: 0 26px 40px -24px rgba(31,37,40,.5); }

/* Horizontal rail (drag / arrows / progress) */
.rail { display: flex; flex-direction: column; gap: 24px; }
.rail__track { display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; padding-block: 10px 14px; scrollbar-width: none; cursor: grab; overscroll-behavior-x: contain; }
.rail__track::-webkit-scrollbar { display: none; }
.rail__track.is-dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; user-select: none; }
.rail-card { flex: 0 0 min(82%, 320px); scroll-snap-align: start; display: flex; flex-direction: column; gap: 12px; padding: 28px; background: #262D30; border: 1px solid #3A4246; transition: transform .35s, border-color .35s, background-color .35s; }
.rail-card:hover { transform: translateY(-6px); border-color: var(--accent-on-dark); background: #2B3337; }
.rail-card__year { font-family: var(--font-display); font-weight: 700; font-size: 60px; line-height: 1; color: transparent; -webkit-text-stroke: 1.5px var(--accent-on-dark); transition: color .35s; }
.rail-card:hover .rail-card__year { color: var(--accent-on-dark); }
.rail-card h3 { font-size: 24px; color: var(--bg); }
.rail-card p { font-size: 16px; line-height: 1.6; color: #C9C1B6; }
.rail__controls { display: flex; align-items: center; gap: 16px; }
.rail__btn { width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid currentColor; background: transparent; color: var(--on-dark); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background-color .2s, color .2s, opacity .2s; }
.rail__btn:hover:not(:disabled) { background: var(--accent-on-dark); border-color: var(--accent-on-dark); color: var(--ink); }
.rail__btn:disabled { opacity: .3; cursor: default; }
.rail__progress { position: relative; flex: 1; height: 2px; background: #3A4246; overflow: hidden; }
.rail__progress span { position: absolute; inset: 0; background: var(--accent-on-dark); transform-origin: right; transform: scaleX(var(--p, .1)); transition: transform .2s; }
.muted-on-dark { font-size: 15px; color: var(--on-dark-muted); }

/* Tags */
.tag, .place { align-self: flex-start; font-size: 13px; font-weight: 700; padding: 3px 12px; border-radius: 999px; }
.tag--life { background: #F3DCCB; color: #7A3818; }
.tag--study { background: #DCE8E7; color: #1F4241; }
.tag--show { background: #EBDDB8; color: #5C4510; }
.place { border: 1px solid var(--accent-on-dark); color: var(--accent-on-dark); }
.chip--life[aria-pressed="true"] { background: #7A3818; border-color: #7A3818; }
.chip--study[aria-pressed="true"] { background: #1F4241; border-color: #1F4241; }
.chip--show[aria-pressed="true"] { background: #5C4510; border-color: #5C4510; }

/* "התחנות בחיי" vertical timeline */
.timeline-v { position: relative; padding-block: 24px; }
.timeline-v__line { position: absolute; top: 0; bottom: 0; inset-inline-start: 50%; width: 2px; background: #D0C3AE; transform: translateX(50%); }
.timeline-v__line span { position: absolute; inset: 0; background: var(--accent); transform-origin: top; transform: scaleY(var(--progress, 0)); }
.timeline-v__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 56px; }
.stop { position: relative; display: grid; grid-template-columns: 1fr 72px 1fr; align-items: center; }
.stop__dot { grid-column: 2; grid-row: 1; justify-self: center; z-index: 1; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 3px solid #C5B79F; transition: background-color .4s, border-color .4s, transform .4s, box-shadow .4s; }
.stop.is-active .stop__dot { background: var(--accent); border-color: var(--accent); transform: scale(1.3); box-shadow: 0 0 0 8px rgba(156,74,36,.15); }
.stop__year { grid-column: 3; grid-row: 1; justify-self: start; font-family: var(--font-display); font-weight: 700; font-size: clamp(56px, 8vw, 104px); line-height: 1; color: transparent; -webkit-text-stroke: 1.5px var(--line-strong); transition: color .5s, -webkit-text-stroke-color .5s, opacity .4s; }
.stop.is-active .stop__year { color: var(--accent); -webkit-text-stroke-color: var(--accent); }
.stop__card { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; gap: 8px; padding: 24px 28px; background: var(--paper); border: 1px solid var(--line); box-shadow: 0 18px 40px -30px rgba(31,37,40,.45); }
html.js .stop__card[data-reveal] { transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1), filter .45s; }
.stop:nth-child(even) .stop__card { grid-column: 3; }
.stop:nth-child(even) .stop__year { grid-column: 1; justify-self: end; }
.stop__card h3 { font-size: 26px; }
.stop__card p { font-size: 17px; line-height: 1.7; color: var(--ink-soft); }
html.js .timeline-v .stop.is-dim .stop__card { opacity: .3; filter: grayscale(1); }
.timeline-v .stop.is-dim .stop__year { opacity: .25; }
@media (max-width: 760px) {
  .timeline-v__line { inset-inline-start: 8px; transform: none; }
  .stop, .stop:nth-child(even) { grid-template-columns: 18px 1fr; column-gap: 20px; row-gap: 6px; align-items: start; }
  .stop__dot { grid-column: 1; grid-row: 1; margin-top: 16px; }
  .stop__year, .stop:nth-child(even) .stop__year { grid-column: 2; grid-row: 1; justify-self: start; font-size: 52px; }
  .stop__card, .stop:nth-child(even) .stop__card { grid-column: 2; grid-row: 2; }
}

/* About */
.dropcap::first-letter { float: right; font-family: var(--font-display); font-size: 4.2em; line-height: .85; padding-inline-end: 12px; color: var(--accent); }
.cv-list { margin: 0; display: flex; flex-direction: column; }
.cv-list > div { display: flex; flex-wrap: wrap; gap: 4px 28px; padding-block: 16px; border-top: 1px solid var(--line); }
.cv-list dt { flex: 0 0 110px; font-family: var(--font-display); font-size: 20px; color: var(--accent); }
.cv-list dd { margin: 0; flex: 1 1 320px; font-size: 17px; color: var(--ink-soft); }
.contact-layout__intro .contact-art img { height: 120%; }

/* Exhibitions hero with parallax photo */
.exh-hero { position: relative; display: flex; align-items: flex-end; min-height: clamp(460px, 72vh, 680px); overflow: hidden; background: var(--ink); color: #F5EFE6; }
.exh-hero__bg { position: absolute; top: -12%; inset-inline: 0; width: 100%; height: 124%; object-fit: cover; }
.exh-hero__shade { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(20,22,24,.9) 0%, rgba(20,22,24,.5) 55%, rgba(20,22,24,.2) 100%); }
.exh-hero__content { position: relative; width: 100%; display: flex; flex-direction: column; gap: 18px; padding-bottom: 64px; }
.exh-hero h1 { font-size: clamp(56px, 9vw, 108px); line-height: .95; }
.exh-hero p { font-size: 20px; max-width: 520px; color: #E8E1D6; }
.exh-hero .eyebrow { color: var(--accent-on-dark); }
.exh-hero__nav { display: flex; flex-wrap: wrap; gap: 10px; }
.exh-hero__nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border: 1px solid rgba(245,239,230,.5); border-radius: 999px; color: #F5EFE6; text-decoration: none; font-weight: 700; transition: background-color .2s, color .2s; }
.exh-hero__nav a:hover { background: #F5EFE6; color: var(--ink); }

/* Solo exhibitions: big outlined year behind the card */
.solo-card { position: relative; overflow: hidden; min-height: 380px; justify-content: flex-end; padding: 40px; }
html.js .solo-card[data-reveal] { transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .5s cubic-bezier(.2,.7,.2,1); }
html.js .solo-card.is-visible:hover { transform: translateY(-6px); }
.solo-card__year { position: absolute; top: 10px; inset-inline-start: 24px; font-weight: 900; font-size: clamp(120px, 16vw, 200px); color: transparent; -webkit-text-stroke: 1.5px rgba(232,180,143,.45); pointer-events: none; }
.solo-card__body { position: relative; display: flex; flex-direction: column; gap: 10px; }
.solo-card h3 { font-size: 34px; }
.solo-card__teaser { font-size: 18px; color: #E8E1D6; }

/* Exhibition photos */
.photo-duo { display: grid; grid-template-columns: 1.3fr 1fr .8fr; gap: 28px; align-items: center; }
.photo-duo__item { padding: 0; border: 0; background: none; overflow: hidden; cursor: zoom-in; }
.photo-duo__item img { width: 100%; height: 380px; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.photo-duo__item--tall img { height: 460px; }
.photo-duo__item:hover img { transform: scale(1.05); }
.photo-duo__text { display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 900px) {
  .photo-duo { grid-template-columns: 1fr; }
  .photo-duo__item img, .photo-duo__item--tall img { height: 320px; }
}

/* Artwork page: previous / next */
.art-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 20px; padding-top: 32px; border-top: 1px solid var(--line); }
.art-nav__item { display: flex; align-items: center; gap: 16px; padding: 12px; border: 1px solid transparent; color: var(--ink); text-decoration: none; transition: border-color .3s, background-color .3s; }
.art-nav__item:hover { border-color: var(--line); background: var(--paper); color: var(--ink); }
.art-nav__item--next { flex-direction: row-reverse; text-align: end; }
.art-nav__item img { width: 84px; height: 84px; object-fit: cover; transition: transform .4s; }
.art-nav__item:hover img { transform: scale(1.06); }
.art-nav__item > span { display: flex; flex-direction: column; gap: 2px; }
.art-nav__item strong { font-family: var(--font-display); font-size: 22px; font-weight: 500; }

@media (prefers-reduced-motion: reduce) {
  html.js [data-reveal], html.js [data-reveal="line"] > span { opacity: 1 !important; transform: none !important; }
  .marquee__track { animation: none; }
  .hero-slides__slide img { transform: none !important; }
  .hero-slides__dots button[aria-current="true"]::after { animation: none; transform: translateY(-50%); }
  [data-parallax] { transform: none !important; }
}
