/* yehudagelb.com/weddings — the same camera monitor as the main site, in playback.
   The picture is a still from one wedding film; the strip picks the film; a click plays it. */

:root {
  --ink: #050404;
  --cream: #f4e2c8;
  --cream-dim: rgba(244, 226, 200, .72);
  --dim: #8f877c;
  --maroon: #240b0d;
  --lock: #7dff8a;
  --wa: #25d366;

  --bar-t: 46px;
  --bar-b: 58px;
  --hf: max(440px, calc(100svh - var(--bar-t) - var(--bar-b)));
  --mx: clamp(28px, 4.4vw, 84px);              /* the left and right edge everything sits on */
  --my: calc(var(--hf) * 0.075);               /* and the bottom edge */
  --tw: calc((100vw - var(--mx) * 2) * 0.115); /* one thumbnail */
  /* what is left beside the five thumbnails: the sentence and the buttons stay inside it */
  --clear: calc(100vw - var(--mx) * 2 - var(--tw) * 5 - 40px - clamp(24px, 3vw, 56px));
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--ink); }
body {
  margin: 0; background: var(--ink); color: var(--cream);
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
.bar, .eyebrow, .reel b, .player-close {
  font-family: "Martian Mono", ui-monospace, Menlo, monospace; font-stretch: 87.5%;
}

.monitor {
  height: 100vh; height: 100svh; min-height: 544px;
  display: grid; grid-template-rows: var(--bar-t) 1fr var(--bar-b); grid-template-columns: minmax(0, 1fr);
  overflow: hidden; overflow: clip;
}

/* ---------- info bars ---------- */
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 0 clamp(14px, 2vw, 30px);
  font-size: 12px; font-weight: 500; letter-spacing: .03em; text-transform: uppercase;
  color: #ece4d8; white-space: nowrap; min-width: 0; overflow: hidden;
}
.grp { display: flex; align-items: center; gap: clamp(12px, 1.5vw, 24px); }
.dim { color: var(--dim); }
.play { display: inline-flex; align-items: center; gap: 8px; color: var(--lock); font-weight: 600; }
.play i { width: 0; height: 0; border-left: 9px solid var(--lock); border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.count, #tc { font-variant-numeric: tabular-nums; }
.contact {
  padding: 7px 14px; border-radius: 999px;
  background: var(--cream); color: var(--ink);
  font-weight: 600; letter-spacing: .02em; transition: background .2s;
}
.contact:hover { background: #fff; }
/* the other language */
.lang {
  padding: 6px 11px; border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(236, 228, 216, .38); color: #ece4d8;
  font-weight: 600; letter-spacing: .02em; transition: color .2s, box-shadow .2s;
}
.lang[lang="he"] { font-family: "Heebo", "Arial Hebrew", Arial, sans-serif; font-size: 13.5px; letter-spacing: 0; padding: 5px 12px; }
.lang:hover { color: #fff; box-shadow: inset 0 0 0 1px rgba(236, 228, 216, .85); }
.back { display: inline-flex; align-items: center; gap: 9px; padding: 9px 14px 9px 10px; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(236, 228, 216, .28); color: #cfc7bb; letter-spacing: .05em; }
.back:hover { color: #fff; box-shadow: inset 0 0 0 1px rgba(236, 228, 216, .6); }

/* ---------- the picture ---------- */
.frame { position: relative; overflow: hidden; overflow: clip; background: #150d09; isolation: isolate; }
.stills { position: absolute; inset: 0; z-index: 0; }
.still {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0; transition: opacity .6s ease;
  filter: saturate(1.04) contrast(1.03);
  transform: scale(1.02);
}
.still.on { opacity: 1; animation: drift 16s ease-in-out infinite alternate; }
@keyframes drift { from { transform: scale(1.02); } to { transform: scale(1.075); } }
.shade {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(0deg, rgba(5, 4, 4, .82) 0%, rgba(5, 4, 4, .5) 26%, transparent 58%),
    linear-gradient(90deg, rgba(5, 4, 4, .5) 0%, transparent 46%);
}
.guide { position: absolute; z-index: 2; width: 26px; height: 26px; border: 0 solid rgba(255, 255, 255, .62); pointer-events: none; }
.g-tl { left: 20px; top: 18px; border-left-width: 1.5px; border-top-width: 1.5px; }
.g-tr { right: 20px; top: 18px; border-right-width: 1.5px; border-top-width: 1.5px; }
.g-bl { left: 20px; bottom: 18px; border-left-width: 1.5px; border-bottom-width: 1.5px; }
.g-br { right: 20px; bottom: 18px; border-right-width: 1.5px; border-bottom-width: 1.5px; }

/* the words, bottom left */
.words {
  position: absolute; z-index: 3; left: var(--mx); bottom: var(--my);
  width: min(46vw, 620px);
  text-shadow: 0 1px 16px rgba(5, 4, 4, .6);
}
.eyebrow { margin: 0 0 12px; font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--cream-dim); }
h1 {
  margin: 0 0 0 -0.008em;                  /* the W's own side bearing, so its stroke sits on the edge */
  font-size: clamp(44px, min(6.4vw, calc(var(--hf) * 0.135)), 112px);
  font-weight: 800; font-stretch: 106%; line-height: .9; letter-spacing: -0.035em; text-transform: uppercase;
}
.say { margin: 16px 0 0; max-width: min(31em, var(--clear)); font-size: clamp(15px, 1.2vw, 19px); line-height: 1.42; font-weight: 450; color: rgba(244, 226, 200, .95); }
.acts { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 0; max-width: var(--clear); }
.go {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 18px; border-radius: 999px;
  background: var(--cream); color: var(--maroon);
  font-size: 15px; font-weight: 700; font-stretch: 104%; text-shadow: none;
  transition: background .2s;
}
.go:hover { background: #fff; }
.tri { width: 0; height: 0; border-left: 10px solid currentColor; border-top: 6.5px solid transparent; border-bottom: 6.5px solid transparent; }
.go-wa { background: var(--wa); color: #06270f; }
.go-wa:hover { background: #3be07a; }

/* the films, bottom right: the camera's playback index */
.reel {
  position: absolute; z-index: 3; right: var(--mx); bottom: var(--my);
  display: flex; gap: 10px;
}
.reel button { position: relative; width: var(--tw); border-radius: 4px; overflow: hidden; box-shadow: 0 0 0 2px rgba(20, 9, 6, .9), 0 14px 30px rgba(0, 0, 0, .5); opacity: .72; transition: opacity .2s, box-shadow .2s; }
.reel img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.reel b { position: absolute; left: 6px; top: 6px; padding: 3px 6px; border-radius: 3px; background: rgba(5, 4, 4, .74); font-size: 10px; font-weight: 600; letter-spacing: .05em; }
.reel button:hover, .reel button:focus-visible { opacity: 1; }
.reel button.on { opacity: 1; box-shadow: 0 0 0 2px var(--lock), 0 14px 30px rgba(0, 0, 0, .5); }
.reel button.on b { background: var(--lock); color: #0b0705; }

/* playback */
.player { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; background: rgba(5, 4, 4, .95); }
.player[hidden] { display: none; }
.player-box { width: min(92%, calc((var(--hf) - 96px) * 16 / 9)); aspect-ratio: 16 / 9; background: #000; box-shadow: 0 0 0 1px rgba(244, 226, 200, .25); }
.player-box iframe { width: 100%; height: 100%; border: 0; display: block; }
.player-close {
  position: absolute; top: 16px; right: 20px;
  padding: 8px 12px; border-radius: 6px;
  font-size: 12px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase;
  color: var(--cream); box-shadow: inset 0 0 0 1px rgba(244, 226, 200, .4);
}
.player-close:hover { background: var(--cream); color: var(--ink); }

:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .still.on { animation: none; } .still { transition: none; } }

/* ---------- phones and tall screens: picture on top, words and films under it ---------- */
@media (max-aspect-ratio: 5/4), (max-width: 820px) {
  :root { --bar-t: 44px; --hf: clamp(240px, 46svh, 560px); --mx: 16px; }
  .wide-only { display: none !important; }
  .monitor { height: auto; min-height: 100svh; grid-template-rows: var(--bar-t) auto var(--bar-b); overflow: visible; }
  .bar { padding: 0 12px; font-size: 11.5px; }
  .bar-top .grp { gap: 8px; }
  .contact { padding: 6px 10px; }
  .lang, .lang[lang="he"] { padding: 5px 9px; }
  .bar-top { position: sticky; top: 0; z-index: 5; background: var(--ink); }
  .bar-bottom { position: sticky; bottom: 0; z-index: 5; background: var(--ink); }
  .frame { overflow: visible; background: var(--ink); padding-top: var(--hf); }
  .stills, .shade { inset: 0 0 auto 0; height: var(--hf); overflow: hidden; }
  .shade { background: linear-gradient(0deg, rgba(5, 4, 4, .9) 0%, transparent 34%); }
  .guide { display: none; }
  .words { position: relative; left: auto; bottom: auto; width: auto; padding: 0 16px; margin-top: -34px; text-shadow: none; }
  h1 { font-size: clamp(40px, 12.5vw, 84px); }
  .say { font-size: 16.5px; max-width: none; }
  .acts { max-width: none; }
  .go { padding: 12px 18px; }
  .reel { position: relative; right: auto; bottom: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 26px 16px 30px; }
  .reel button { width: auto; opacity: 1; }
  .reel button:first-child { grid-column: 1 / -1; }      /* five films: the first across, then two rows of two */
  .player { position: fixed; z-index: 10; }
  .player-box { width: 96%; }
}
