/* Twin Concept kiosk catalog — "flowing gallery"
   Built for 1920×1080 touch screens, landscape and portrait. */

@font-face {
  font-family: "Assistant";
  src: url("../fonts/assistant-hebrew-wght-normal.woff2") format("woff2");
  font-weight: 200 800; font-display: swap;
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
@font-face {
  font-family: "Assistant";
  src: url("../fonts/assistant-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-display: swap;
}

:root {
  --bronze: #836239;
  --gold: #B1916A;
  --gold-2: #C6A67F;
  --champagne: #E4C79B;
  --cream: #FAF7F2;
  --paper: #FFFFFF;
  --ink: #2B2620;
  --muted: #8C8276;
  --line: rgba(131, 98, 57, .22);
  --gap: 16px;
  --pad: 56px;
  --topbar: 132px;
  --ease: cubic-bezier(.22, .61, .21, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --font: "Inter", "Assistant", system-ui, sans-serif;
}
html[lang="he"] { --font: "Assistant", "Inter", system-ui, sans-serif; }
@media (orientation: portrait) {
  :root { --pad: 40px; --gap: 14px; --topbar: 148px; }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; background: var(--cream); color: var(--ink);
  font-family: var(--font); font-size: 22px; font-weight: 300;
  -webkit-font-smoothing: antialiased; overflow: hidden;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  touch-action: pan-y;
}
img { -webkit-user-drag: none; user-drag: none; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

/* ---------- top bar ---------- */
#topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--topbar); z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 var(--pad);
  background: linear-gradient(var(--cream) 62%, rgba(250, 247, 242, 0));
  pointer-events: none;
}
#topbar > * { pointer-events: auto; }
#homeLogo { height: 76px; width: 140px; display: flex; justify-content: center; }
#homeLogo svg { height: 100%; width: auto; }
.round-btn {
  width: 72px; height: 72px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: transform .25s var(--ease), background .25s;
}
.round-btn:active { transform: scale(.92); background: #fff; }
.round-btn svg { width: 30px; height: 30px; fill: none; stroke: var(--bronze); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
[dir="rtl"] .round-btn svg { transform: scaleX(-1); }
#backBtn[hidden] { visibility: hidden; display: grid; }

/* ---------- screens ---------- */
#screens { position: fixed; inset: 0; }
.screen {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: var(--topbar) var(--pad) 170px;
  scrollbar-width: none;
}
.screen::-webkit-scrollbar { display: none; }
.screen.enter { animation: screenIn .7s var(--ease-out) both; }
.screen.leave { animation: screenOut .38s var(--ease) both; pointer-events: none; }
@keyframes screenIn { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes screenOut { to { opacity: 0; transform: translateY(-14px); } }

/* headings */
.screen-head { text-align: center; margin: 6px 0 46px; }
.eyebrow {
  font-size: 15px; letter-spacing: .32em; text-transform: uppercase; color: var(--gold);
  font-weight: 500; margin-bottom: 14px;
}
.title {
  font-size: 56px; font-weight: 200; letter-spacing: .14em; text-transform: uppercase;
  margin: 0; line-height: 1.12; color: var(--ink);
}
.rule { width: 64px; height: 1px; background: var(--gold); margin: 26px auto 0; opacity: .8; }
html[lang="he"] .eyebrow { letter-spacing: .12em; font-size: 18px; }
html[lang="he"] .title { letter-spacing: .04em; font-weight: 300; }
@media (orientation: portrait) { .title { font-size: 50px; } }

/* ---------- home ---------- */
body.at-home #topbar { opacity: 0; pointer-events: none; }
#topbar { transition: opacity .5s var(--ease); }
.screen.home { padding-top: 50px; }
.home-hero { display: flex; flex-direction: column; align-items: center; margin: 0 0 40px; }
.home-hero .brand { height: 190px; }
.home-hero .brand svg { height: 100%; width: auto; }
@media (orientation: landscape) {
  /* the whole home fits one landscape screen */
  .tiles.home .tile .frame { aspect-ratio: auto; height: calc(100vh - 560px); min-height: 300px; }
  .tiles.home .col:nth-child(even) { padding-top: 60px; }
}
@media (orientation: portrait) { .screen.home { padding-top: 90px; } .home-hero { margin: 0 0 70px; } .home-hero .brand { height: 300px; } }

/* collection / category tiles */
.tiles { display: flex; gap: calc(var(--gap) * 2); align-items: flex-start; }
.tiles .col { flex: 1; display: flex; flex-direction: column; gap: calc(var(--gap) * 3); min-width: 0; }
.tile { position: relative; display: block; width: 100%; text-align: start; }
.tile .frame {
  position: relative; overflow: hidden; background: var(--paper);
  aspect-ratio: 3 / 4; border-radius: 2px;
}
.tile .frame img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out); }
.tile .frame.iso img { object-fit: contain; padding: 9%; }
.tile:active .frame img { transform: scale(1.04); }
.tile .caption { display: flex; align-items: baseline; gap: 14px; padding: 20px 2px 0; }
.tile .idx { font-size: 15px; color: var(--gold); letter-spacing: .12em; font-weight: 500; }
.tile .name { font-size: 23px; letter-spacing: .16em; text-transform: uppercase; font-weight: 300; line-height: 1.25; }
html[lang="he"] .tile .name { letter-spacing: .02em; font-size: 26px; font-weight: 400; }
.tiles.home .col:nth-child(even) { padding-top: 90px; }
.tiles.home .tile .frame { aspect-ratio: 3 / 4.6; }
.tiles.cats .tile .frame { aspect-ratio: 4 / 5; }
.tiles.cats .col:nth-child(even) { padding-top: 70px; }
@media (orientation: portrait) {
  .tiles.home .tile .frame { aspect-ratio: 4 / 5; }
}

/* ---------- product masonry ---------- */
.masonry { display: flex; gap: var(--gap); align-items: flex-start; }
.masonry .col { flex: 1; display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.ptile { position: relative; display: block; width: 100%; overflow: hidden; background: #EFE9E1; border-radius: 2px; }
.ptile.iso { background: var(--paper); }
.ptile img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s var(--ease); }
.ptile img.loaded { opacity: 1; }
.ptile .multi {
  position: absolute; inset-inline-end: 14px; bottom: 14px; display: flex; gap: 5px;
}
.ptile .multi i { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); opacity: .85; }

/* staggered entrance */
.reveal { opacity: 0; transform: translateY(34px) scale(.985); }
.reveal.in { opacity: 1; transform: none; transition: opacity .9s var(--ease-out), transform 1.1s var(--ease-out); transition-delay: var(--d, 0ms); }

/* ---------- language pill ---------- */
#langPill {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%); z-index: 30;
  display: flex; align-items: center; padding: 8px; gap: 4px;
  background: rgba(255, 255, 255, .86); border: 1px solid var(--line); border-radius: 999px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 40px rgba(60, 40, 20, .08);
  transition: opacity .4s var(--ease), transform .4s var(--ease);
  direction: ltr;
}
#langPill.hide { opacity: 0; pointer-events: none; transform: translate(-50%, 20px); }
#langPill button {
  display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 24px 0 18px;
  border-radius: 999px; font-size: 20px; letter-spacing: .12em; font-weight: 500; color: var(--muted);
  font-family: "Inter", "Assistant", sans-serif;
  transition: background .3s, color .3s;
}
#langPill button[lang="he"] { font-family: "Assistant", sans-serif; letter-spacing: .02em; font-size: 22px; }
#langPill button svg { width: 34px; height: 24px; border-radius: 4px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
#langPill button.on { background: var(--bronze); color: #fff; }
#langPill .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--gold-2); opacity: .7; }

/* ---------- viewer ---------- */
#viewer {
  position: fixed; inset: 0; z-index: 40; background: var(--paper);
  opacity: 0; pointer-events: none; transition: opacity .35s var(--ease);
  overflow: hidden; touch-action: none;
}
#viewer.open { opacity: 1; pointer-events: auto; }
#viewerTrack { position: absolute; inset: 0; will-change: transform; }
#viewerTrack .slide { position: absolute; inset: 0; display: grid; place-items: center; padding: 40px 40px 110px; }
#viewerTrack .slide img { max-width: calc(100vw - 80px); max-height: calc(100vh - 150px); object-fit: contain; }
#viewerBack { position: absolute; top: 32px; inset-inline-start: 32px; }
#viewerDots {
  position: absolute; left: 0; right: 0; bottom: 42px; display: flex; justify-content: center; gap: 14px;
}
#viewerDots i { width: 10px; height: 10px; border-radius: 50%; background: var(--gold-2); opacity: .35; transition: opacity .3s, transform .3s; }
#viewerDots i.on { opacity: 1; transform: scale(1.25); background: var(--bronze); }

.zoom-ghost {
  position: fixed; z-index: 45; object-fit: contain; pointer-events: none;
  transform-origin: 0 0; will-change: transform;
}

/* ---------- screensaver ---------- */
#screensaver {
  position: fixed; inset: 0; z-index: 60; overflow: hidden;
  background: radial-gradient(120% 90% at 30% 20%, #8c6a40 0%, #6e5130 45%, #4a361f 100%);
  opacity: 0; pointer-events: none; transition: opacity 1.4s var(--ease);
}
#screensaver.on { opacity: 1; pointer-events: auto; }
#ssStage { position: absolute; inset: 0; }
#ssStage svg { position: absolute; overflow: visible; }
#ssStage path { fill: url(#ss-fill); fill-opacity: 0; stroke: #F3DDB3; stroke-width: 1.3; stroke-linejoin: round; }

/* ---------- exit ---------- */
#exitHotspot { position: fixed; left: 0; bottom: 0; width: 110px; height: 110px; z-index: 70; }
#exitDialog {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center;
  background: rgba(40, 30, 20, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
#exitDialog.open { opacity: 1; pointer-events: auto; }
.exit-card { background: var(--cream); padding: 44px 52px 34px; border-radius: 6px; text-align: center; min-width: 420px; }
.exit-title { font-size: 22px; letter-spacing: .2em; text-transform: uppercase; color: var(--bronze); margin-bottom: 26px; }
html[lang="he"] .exit-title { letter-spacing: .04em; }
.exit-dots { display: flex; justify-content: center; gap: 18px; margin-bottom: 30px; }
.exit-dots i { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--gold); }
.exit-dots i.f { background: var(--gold); }
.exit-dots.err { animation: shake .4s; }
.exit-dots.err i { border-color: #b04a3a; }
@keyframes shake { 25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }
.exit-pad { display: grid; grid-template-columns: repeat(3, 96px); gap: 14px; justify-content: center; direction: ltr; }
.exit-pad button { height: 82px; border-radius: 50%; border: 1px solid var(--line); font-size: 30px; font-weight: 300; background: #fff; }
.exit-pad button:active { background: var(--champagne); }
.exit-cancel { margin-top: 24px; font-size: 18px; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; padding: 12px 24px; }
.exit-msg { margin-top: 10px; min-height: 24px; font-size: 18px; color: #b04a3a; }

/* loading / error state */
.boot { position: fixed; inset: 0; display: grid; place-items: center; }
.boot svg { width: 220px; opacity: .9; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.in { opacity: 1; transform: none; transition: none; }
}
