/* Home: intro landing, then three full-height panels (עבודות / הסיפור / סטילס) over one photo.
   Hovering a panel reveals its media; the other two go dark. Source rules: BRIEF.md "Home". */
.landing { position: fixed; inset: 0; z-index: 90; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; transition: opacity 2.6s cubic-bezier(.45, 0, .25, 1); }   /* a slow fade from black (Shahar 29.11) */
/* the mark stands steady over the flickering name; it comes up first (.8s) */
.landing img { width: 76px; height: auto; animation: mark-in .8s var(--swing) both; }
@keyframes mark-in { from { opacity: 0; transform: translateY(8px); } }
.landing span { color: #fff; font-family: var(--latin); font-size: 30px; letter-spacing: .2em; padding-inline-start: .2em; direction: ltr; animation: flicker 1.5s ease infinite; }
.landing.gone { opacity: 0; pointer-events: none; }
@keyframes flicker { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }

.panels { position: relative; height: 100vh; height: 100svh; min-height: 560px; background: var(--ink); overflow: hidden; }
/* the background: places Emil filmed (Shahar's stars, Peki'in first). Each one stands completely still for 6.5s
   (Shahar 29.11: no zoom, no drift); the next fades in over 2s on top */
.bgshow { position: absolute; inset: 0; z-index: 0; background: #3a3630 50% 50% / cover no-repeat; }   /* the inline 40px Peki'in under the photo */
.bgshow img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 2s ease-in-out; }
.bgshow img.on { opacity: 1; z-index: 1; }
.bgshow img.was { opacity: 0; }
.bgshow img.first { opacity: 1; transition: none; } /* Peki'in shows at once, no fade */
/* a black gradient over every photo, deepest on the right and easing off to the left, with a little at the top
   and the foot. Measured on the source's home photo (its darkening is in the picture itself, its CSS has no
   gradient): luminance by tenths from its dark side 39 59 72 105 108 117 123 139 129 108, i.e. about 60%
   darker at the edge, fading out over the first third (Shahar 30.11: darker, from right to left) */
.bgshow::after { content: ""; position: absolute; inset: 0; z-index: 2; background:
  linear-gradient(to left, rgba(12, 10, 9, .62), rgba(12, 10, 9, .46) 12%, rgba(12, 10, 9, .24) 30%, rgba(12, 10, 9, .08) 50%, rgba(12, 10, 9, 0) 70%),
  linear-gradient(to top, rgba(12, 10, 9, .38), rgba(12, 10, 9, 0) 42%),
  linear-gradient(to bottom, rgba(12, 10, 9, .3), rgba(12, 10, 9, 0) 22%); }
.panels section { position: absolute; top: 0; bottom: 0; width: 33.334%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 140px; overflow: hidden; z-index: 1;
  transition: width .35s ease-in-out, right .35s ease-in-out, background-color .35s ease-in-out, backdrop-filter .35s ease-in-out; }
/* hover in settles in about 740ms (Velocity 400ms swing chased by CSS .3s), hover out in about 350ms */
.panels.hovering section { transition-duration: .74s; transition-timing-function: var(--swing); }
.panels .p-works { right: 0; }
.panels .p-story { right: 33.333%; border-inline: 1px solid rgba(255, 255, 255, .12); z-index: 2; }
.panels .p-field { right: 66.666%; }
.panels a.word { position: relative; z-index: 10; color: #fff; font-family: var(--display); font-size: clamp(62px, 5.6vw, 88px); line-height: 1; letter-spacing: .2em; padding-inline-start: .2em; transition: opacity .3s ease-in-out, color .3s ease-in-out; }
/* the word is the hover target; padding keeps it under the pointer while its panel widens (the word moves 120px) */
.panels a.word { padding-block: 40px; padding-inline: calc(170px + .2em) 170px; margin: -40px -170px; }
.panels .edge { position: absolute; bottom: 180px; width: 40px; height: 1px; background: #fff; z-index: 10; pointer-events: none; transition: width .5s ease-in-out, opacity .4s ease-in-out, background-color .3s; }
.p-works .edge { right: 0; } .p-field .edge { left: 0; }
.panels .cue { position: absolute; bottom: 0; left: 50%; width: 1px; height: 40px; background: #fff; z-index: 10; pointer-events: none; transition: opacity .5s ease-in-out; }
.panels .media { position: absolute; inset: 0; opacity: 0; transition: opacity .9s var(--swing); z-index: 1; }
.panels video.media { width: 100%; height: 100%; object-fit: cover; }
/* about panel: the portrait stands on the light ground (source: a portrait PNG on white, centred) */
.p-story .media { background: var(--ground) url("../img/portrait-bw.webp") 50% 34% / auto 56% no-repeat; }
.p-field .media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s var(--swing); }
.p-field .media img.on { opacity: 1; }
/* hover state, driven by .on / .hovering (set from pointer and keyboard focus) */
/* the panels that are not hovered take a colour theme (Shahar 29.11: exploring options; data-hover on .panels picks one,
   none = the original ink) */
.panels { --hv-a: var(--ink); --hv-b: var(--ink-2); --hv-word: #fff; --hv-op: .16; --hv-fx: none; }
.panels[data-hover="tally"] { --hv-a: #CD4726; --hv-b: #B93F20; --hv-op: .32; }
.panels[data-hover="ember"] { --hv-a: #3B1A12; --hv-b: #4A2318; --hv-op: .2; }
.panels[data-hover="sand"] { --hv-a: #E9E6E0; --hv-b: #F5F3EF; --hv-word: var(--ink); --hv-op: .22; }
.panels[data-hover="veil"] { --hv-a: rgba(38, 32, 28, .74); --hv-b: rgba(38, 32, 28, .62); --hv-op: .24; }
.panels[data-hover="glass"] { --hv-a: rgba(38, 32, 28, .32); --hv-b: rgba(38, 32, 28, .24); --hv-op: .3; --hv-fx: blur(16px) saturate(.8); }
/* mono (Shahar's pick 29.11): the photo turns black and white behind both closed panels, one even dim tone over the
   whole fan (no grey card). The fan is in the cut: the far panel is clipped at the edge where the middle one starts,
   so its word slides under it like a card tucked under another; a soft shadow on the middle panel's edge says which
   one is on top */
.panels[data-hover="mono"] { --hv-a: rgba(12, 10, 9, .55); --hv-b: rgba(12, 10, 9, .55); --hv-op: .34; --hv-fx: grayscale(1); }
.panels[data-hover="mono"] .p-works, .panels[data-hover="mono"] .p-field { clip-path: inset(0 0 0 0); }   /* not הסיפור: a clip would hide its shadow */
.panels[data-hover="mono"].hovering .p-story:not(.on) { border-color: rgba(255, 255, 255, .24); }
.panels[data-hover="mono"].h-works { --hv-shadow: -26px 0 40px -14px rgba(0, 0, 0, .85); }   /* הסיפור casts on the far panel, to its left */
.panels[data-hover="mono"].h-field { --hv-shadow: 26px 0 40px -14px rgba(0, 0, 0, .85); }    /* and to its right */
.panels[data-hover="mono"].hovering section { transition-property: width, right, background-color, backdrop-filter, clip-path; }
.panels[data-hover="mono"].h-works .p-field { clip-path: inset(0 50% 0 0); }   /* its right half lies under הסיפור */
.panels[data-hover="mono"].h-field .p-works { clip-path: inset(0 0 0 50%); }   /* its left half lies under הסיפור */
.panels.hovering section:not(.on) { background: var(--hv-a); -webkit-backdrop-filter: var(--hv-fx); backdrop-filter: var(--hv-fx); }
.panels.hovering .p-story:not(.on) { background: var(--hv-b); box-shadow: var(--hv-shadow, none); }
.panels.hovering section:not(.on) a.word { opacity: var(--hv-op); color: var(--hv-word); }
.panels.hovering section:not(.on) .edge { opacity: var(--hv-op); background: var(--hv-word); }
.panels section.on .media { opacity: 1; }
/* geometry per hovered panel (source: Velocity targets, mirrored): the hovered one opens to 50% */
.panels.h-works .p-works { width: 50%; }
.panels.h-works .p-story { right: 50%; }
.panels.h-field .p-field { width: 50%; right: 50%; }
.panels.h-field .p-story { right: 16.666%; }
.panels.h-story .p-story { width: 50%; right: 25%; background: var(--ground); }
.panels.h-story .p-story a.word { color: var(--ink); }
.panels.h-works .p-works .edge, .panels.h-field .p-field .edge { width: 50%; }
.panels.h-works .cue, .panels.h-field .cue { opacity: 0; }
/* click: the line reaches 80px, word and line fade, the panel takes the screen */
.panels section.c1 .edge { width: 80px; transition-duration: .4s; }
.panels section.c2 a.word, .panels section.c2 .edge { opacity: 0; transition: opacity .4s var(--swing); }
.panels .p-story.c2 a.word { transition-duration: 1s; }
.panels section.c3 { width: 100% !important; right: 0 !important; z-index: 6; transition: width .3s ease-in-out, right .3s ease-in-out; }
.panels .p-story.c3 { transition-duration: .8s; transition-timing-function: var(--swing); }
/* story click: the portrait grows into the story page's first frame (full height, centred, top 0), so the page change is seamless */
/* story click: the panel opens and the portrait grows with it from its hover size to full height (no fade, no jump) */
.panels .p-story.c3 .media { background-size: auto 100%; background-position: calc(50% - var(--sb, 0px) / 2) 0; transition: opacity 1.1s var(--swing), background-size 1s var(--swing), background-position 1s var(--swing); }
.panels.leaving a.word { pointer-events: none; }
/* the header reads over the bright sky: a soft shade at the top of the photo (it lifts while a panel is open), and one
   line under the mark that says what Emil does, for whoever lands here first */
.panels::before { content: ""; position: absolute; inset: 0 0 auto; height: 190px; z-index: 7; pointer-events: none; background: linear-gradient(rgba(20, 16, 13, .42), rgba(20, 16, 13, 0)); transition: opacity .5s var(--swing); }
.panels.hovering::before, .panels.leaving::before { opacity: 0; }
.tagline { position: absolute; z-index: 8; top: 88px; inset-inline: 0; margin: 0; text-align: center; color: #fff; font-size: 15px; letter-spacing: .04em; text-shadow: 0 1px 12px rgba(0, 0, 0, .35); pointer-events: none; transition: opacity .4s var(--swing); }
.panels.hovering .tagline, .panels.leaving .tagline { opacity: 0; }
body.leaving .hdr { opacity: 0; transition: opacity .4s var(--swing); }   /* the full panel goes out clean, the next page brings its own header */
/* click: a ground-coloured sheet slides over before the page changes */
.sheet { position: fixed; inset: 0; z-index: 70; background: var(--ground); transform: translateX(100%); transition: transform 1.3s var(--ease); }
.sheet.from-left { transform: translateX(-100%); }
.sheet.go { transform: none; }

/* phone: three stacked words over the photo */
@media (max-width: 1024px) {
  .landing span { font-size: 26px; }
  .panels { height: 100svh; min-height: 0; display: flex; flex-direction: column; padding-top: 70px; background-position: 66% 50%; } /* keeps Emil (right of centre) in frame */
  .panels section { position: relative; inset: auto !important; width: 100%; flex: 1; padding: 0; justify-content: center; border: 0 !important; }
  .panels section + section { border-top: 1px solid rgba(255, 255, 255, .55) !important; }
  .panels a.word { font-size: 50px; letter-spacing: .22em; padding: 0 0 0 0; padding-inline-start: .22em; margin: 0; }
  .panels .edge, .panels .cue, .panels .media { display: none; }
  .tagline { top: 62px; font-size: 13px; letter-spacing: .02em; }
  .panels::before { height: 150px; }
  /* long press (site.js): the desktop's fan turned on its side. The pressed panel opens to half the height and shows
     its film / portrait / photos; the other two take the mono theme (black and white, dimmed word). The media are
     laid out from the first touch (.armed), so they fade in rather than pop */
  .panels a.word { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
  /* the whole panel takes the long press (site.js), so the browser's own gestures are off on it: its link / image menu,
     drag, text selection and panning each cancelled the touch and shut the panel (Shahar 30.11). The home page does
     not scroll on a phone, so nothing is lost; overscroll off stops pull-to-refresh from stealing the touch */
  .panels section { touch-action: none; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; cursor: pointer; }
  .panels img, .panels video { -webkit-user-drag: none; pointer-events: none; }
  html:has(.panels) { overscroll-behavior: none; }
  .panels.armed .media { display: block; }
  .panels section { transition-property: flex-grow, background-color, backdrop-filter; }
  .panels.hovering section.on { flex-grow: 2; }
  .panels.h-works .p-works, .panels.h-field .p-field, .panels.h-story .p-story { width: 100%; }
  .panels[data-hover="mono"].h-works .p-field, .panels[data-hover="mono"].h-field .p-works { clip-path: none; }
  .panels.hovering .p-story:not(.on) { box-shadow: none; }
  /* הסיפור as on the desktop: the portrait on the light ground with the word under it, so here the word glides from
     the middle of the panel to its foot (top in % of the panel, so it follows the panel as it grows) */
  .panels a.word { position: absolute; top: 50%; inset-inline: 0; transform: translateY(-50%); text-align: center; transition: top .74s var(--swing), opacity .3s ease-in-out, color .3s ease-in-out; }
  .panels.h-story .p-story a.word { top: calc(100% - 46px); }
  .p-story .media { background-position: 50% 14px; background-size: auto calc(100% - 96px); }
}
