/* Or Kedem · אני אתה — palette taken from the album cover (deep brown, bone, ember) */
:root {
  --ground: #0f0b09;
  --ground-2: #17110d;
  --bone: #efe7d8;
  --bone-dim: #c9bda8;
  --muted: #9d8f7a;
  --ember: #b8673f;
  --line: rgba(239, 231, 216, .28);
  --head: "Karantina", "Heebo", system-ui, sans-serif;
  --body: "Heebo", system-ui, sans-serif;
  --bar-h: 52px;
}

* { box-sizing: border-box; }
html { background: var(--ground); color-scheme: dark; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--bone);
  font-family: var(--body);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.7;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.locked { overflow: hidden; }
img { display: block; max-inline-size: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 4px; border-radius: 4px; }

/* ---------- background loop ---------- */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.bg-video {
  inline-size: 100%; block-size: 100%; object-fit: cover; object-position: 50% 40%;
  filter: saturate(.8) contrast(1.05);
  transform: scale(1.04);
}
.bg-shade {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(15,11,9,.18) 0%, rgba(15,11,9,.6) 75%),
    linear-gradient(to bottom, rgba(15,11,9,.2), rgba(15,11,9,.35) 55%, rgba(15,11,9,.82));
  transition: background-color .8s ease;
}
body.past-story .bg-shade { background-color: rgba(15,11,9,.55); }

main, .top, .bar { position: relative; z-index: 2; }

/* ---------- entry gate ---------- */
.gate {
  position: fixed; inset: 0; z-index: 20;
  display: grid; place-items: center; align-content: center; gap: 18px;
  background: radial-gradient(circle at 50% 42%, #1d1510 0%, var(--ground) 62%);
  transition: opacity .9s ease, visibility .9s;
  padding: 24px;
  text-align: center;
}
.gate.gone { opacity: 0; visibility: hidden; }
.gate-eye { position: relative; inline-size: min(62vw, 340px); aspect-ratio: 1; display: grid; place-items: center; }
.gate-eye .rings { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; opacity: .9; }
.gate-eye .core { position: relative; inline-size: 40%; transition: transform .4s ease; animation: breathe 3.2s ease-in-out infinite; }
.gate-eye:hover .core { transform: scale(1.08); }
.gate-title {
  margin: 6px 0 0; font-family: var(--head); font-weight: 400;
  font-size: clamp(56px, 12vw, 96px); line-height: .9; letter-spacing: .01em;
}
.gate-title span { display: block; font-size: .45em; color: var(--bone-dim); margin-block-start: 8px; }
.gate-hint { margin: 0; font-size: 14px; letter-spacing: .06em; color: var(--muted); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.spin { animation: spin 90s linear infinite; }

/* ---------- header ---------- */
.top {
  position: absolute; inset-block-start: 0; inset-inline: 0; z-index: 6;
  padding: 18px 22px; pointer-events: none;
}
.brand {
  pointer-events: auto; text-decoration: none;
  font-family: var(--head); font-size: clamp(40px, 6vw, 64px); line-height: .9;
  display: inline-block; text-shadow: 0 2px 18px rgba(0,0,0,.5);
}
.brand span { display: block; font-size: .42em; color: var(--bone-dim); letter-spacing: .04em; margin-block-start: 4px; }

/* ---------- story ---------- */
.story { position: relative; block-size: 100svh; min-block-size: 560px; }
.path { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; overflow: visible; }
.path path { fill: none; stroke: var(--line); stroke-width: 1.4; stroke-dasharray: 1.5 7; stroke-linecap: round; }
.path path.done { stroke: rgba(239,231,216,.6); }

.eyes { position: absolute; inset: 0; }
.eye {
  position: absolute; inline-size: var(--s, 74px); aspect-ratio: 1;
  translate: -50% -50%;
  opacity: .32; filter: grayscale(.4) brightness(.8);
  transition: opacity .6s ease, filter .6s ease, scale .5s cubic-bezier(.2,.8,.2,1);
  scale: .82;
}
.eye img { inline-size: 100%; block-size: 100%; }
.eye.seen { opacity: .7; filter: none; scale: .9; }
.eye.active { opacity: 1; filter: none; scale: 1.08; animation: breathe 2.6s ease-in-out infinite; }
.eye:disabled { cursor: default; }
.eye:focus-visible, .to-works:focus-visible, .gate-eye:focus-visible { outline-offset: 6px; border-radius: 50%; }

.halo {
  position: absolute; inline-size: calc(var(--s, 74px) * 3.4); aspect-ratio: 1;
  translate: -50% -50%;
  pointer-events: none; opacity: 0;
  transition: left .9s cubic-bezier(.65,0,.35,1), top .9s cubic-bezier(.65,0,.35,1), opacity .6s ease;
}
.halo.on { opacity: .85; }

.line {
  position: absolute; margin: 0; inline-size: min(640px, 88vw);
  font-size: clamp(18px, 1.8vw, 23px); line-height: 1.65; font-weight: 300; text-align: center;
  text-shadow: 0 1px 14px rgba(0,0,0,.85), 0 0 2px rgba(0,0,0,.6);
  translate: -50% 0;
  opacity: 0; transition: opacity .6s ease;
  text-wrap: balance;
}
.line.show { opacity: 1; }

.to-works {
  position: absolute; translate: -50% 0;
  display: grid; justify-items: center; gap: 6px; font-size: 14px; letter-spacing: .08em; color: var(--bone-dim);
  opacity: 0; transition: opacity .8s ease;
}
.to-works[hidden] { display: none; }
.to-works.show { opacity: 1; }
.to-works img { inline-size: 58px; block-size: 58px; max-inline-size: none; animation: breathe 2.6s ease-in-out infinite; }

/* ---------- works ---------- */
.works { padding: 40px clamp(16px, 7vw, 120px) 40px; }
.works-head { display: flex; align-items: baseline; gap: 12px; margin-block-end: 18px; }
.works-head h2 { margin: 0; font-family: var(--head); font-weight: 400; font-size: 44px; line-height: 1; }
.count { color: var(--muted); font-size: 14px; }
.rule { flex: 1; block-size: 1px; background: var(--line); }

.grid { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: auto auto; gap: 14px; }
.card { position: relative; background: var(--ground-2); overflow: hidden; border-radius: 6px; aspect-ratio: 16 / 9; }
.card.big { grid-row: span 2; aspect-ratio: auto; min-block-size: 100%; }
.play { position: absolute; inset: 0; display: block; inline-size: 100%; text-align: start; text-decoration: none; color: inherit; }
.play img { inline-size: 100%; block-size: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.8,.2,1), filter .5s ease; filter: brightness(.82); }
.play:hover img, .play:focus-visible img { transform: scale(1.04); filter: brightness(.95); }
.play::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(15,11,9,.85), rgba(15,11,9,0) 55%); }
.tag {
  position: absolute; z-index: 1; inset-block-start: 14px; inset-inline-start: 14px;
  font-size: 12px; letter-spacing: .08em; padding: 3px 10px; border-radius: 99px;
  background: rgba(15,11,9,.55); color: var(--bone-dim);
}
.meta { position: absolute; z-index: 1; inset-inline: 22px; inset-block-end: 18px; display: grid; gap: 2px; }
.meta strong { font-family: var(--head); font-weight: 400; font-size: clamp(40px, 5vw, 76px); line-height: .9; }
.card:not(.big) .meta strong { font-size: clamp(34px, 3.4vw, 48px); }
.meta em { font-style: normal; font-size: 14px; color: var(--bone-dim); }
.card iframe, .card video { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; border: 0; background: #000; }

/* ---------- contact ---------- */
.contact { padding: 40px clamp(16px, 7vw, 120px) calc(var(--bar-h) + 40px); }
.contact h2 { margin: 0 0 14px; font-family: var(--head); font-weight: 400; font-size: 44px; line-height: 1; }
.contact ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-inline-size: 520px; }
.contact li { display: flex; gap: 16px; align-items: baseline; padding-block: 10px; border-block-end: 1px solid var(--line); }
.contact li span { min-inline-size: 84px; color: var(--muted); font-size: 14px; }
.contact li a { text-decoration: none; font-size: 18px; }
.contact li a:hover { color: var(--ember); }
.made-by { margin: 48px 0 0; font-size: 13px; color: var(--muted); }
.made-by a { color: var(--bone-dim); }

/* ---------- bottom bar ---------- */
.bar {
  position: fixed; inset-block-end: 0; inset-inline: 0; z-index: 6; block-size: var(--bar-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 22px env(safe-area-inset-bottom); font-size: 13px; letter-spacing: .06em;
  background: linear-gradient(to top, rgba(15,11,9,.75), rgba(15,11,9,0));
}
.bar a { text-decoration: none; color: var(--bone-dim); }
.bar a:hover { color: var(--bone); }
.sound { justify-self: start; color: var(--bone-dim); }
.sound b { font-weight: 500; color: var(--bone); }
.bar-end { justify-self: end; }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .grid { grid-template-columns: 1fr; }
  .card.big { grid-row: auto; aspect-ratio: 16 / 9; min-block-size: 0; }

  .top { padding: 14px 16px; }
  .bar { padding-inline: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .spin, .eye.active, .gate-eye .core, .to-works img { animation: none; }
  .halo { transition: opacity .3s ease; }
}
