/*
  Sheket Desert Stay (demo) - art direction
  Scene:   one full-screen picture of a cabin in the Negev. Scrolling moves
           the clock, and the whole picture follows: sky, sun, moon, stars,
           lamps and campfire.
  Palette: the sky supplies the colour. Text sits on night-blue glass in the
           scene and on deep night blue below it. Sand and ember for accents.
  Type:    Karantina (tall poster face, Hebrew + Latin) for the clock and
           headings, Alef for text.
  Shape:   soft glass panels in the scene, plain hairlines below it.
*/

:root {
  --night: #0b1026;
  --night-2: #151b3d;
  --glass: rgba(11, 16, 38, 0.78);
  --sand: #f3e3c6;
  --sand-dim: #b9b1a3;
  --line: rgba(243, 227, 198, 0.22);
  --ember: #ff9d4d;
  --display: 'Karantina', 'Impact', sans-serif;
  --text: 'Alef', system-ui, sans-serif;
  --gutter: clamp(1rem, 4vw, 3.5rem);
  --ribbon-h: 3.2rem; /* a starting guess; the script measures the real ribbon */
  /* Set by the script as you scroll. */
  --sky-top: #0b1026;
  --sky-bottom: #1b2145;
  --stars: 1;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { background: var(--night); }

body {
  margin: 0;
  background: var(--night);
  color: var(--sand);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.55;
}

h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.ribbon {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 2.4rem;
  display: grid;
  place-items: center;
  padding: 0.3rem var(--gutter);
  background: var(--sand);
  color: var(--night);
  font-size: 0.875rem;
  font-weight: 700;
  text-align: center;
}

/* The day: a tall section you scroll through, with the scene pinned in view. */
.day { position: relative; height: 620vh; }

.scene {
  position: sticky;
  top: var(--ribbon-h);
  height: calc(100svh - var(--ribbon-h));
  overflow: hidden;
  background: linear-gradient(var(--sky-top), var(--sky-bottom) 72%);
}

#stars,
#constellations {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
}
#stars { opacity: var(--stars); }
/* Above the land, so a constellation is never hidden behind a ridge on a short screen. */
#constellations { z-index: 2; overflow: visible; pointer-events: none; opacity: var(--stars); }

#sun,
#moon {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  will-change: transform;
}
#sun {
  inline-size: 9rem;
  block-size: 9rem;
  margin: -4.5rem 0 0 -4.5rem;
  border-radius: 50%;
  background: radial-gradient(circle, #fff6cf 0 26%, rgba(255, 214, 120, 0.6) 30%, rgba(255, 190, 90, 0) 70%);
}
#moon {
  inline-size: 4.5rem;
  block-size: 4.5rem;
  margin: -2.25rem 0 0 -2.25rem;
  filter: drop-shadow(0 0 14px rgba(244, 239, 220, 0.45));
}
#moon svg { display: block; inline-size: 100%; block-size: 100%; }

#land {
  z-index: 1;
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  block-size: 56%;
}
.land { display: block; inline-size: 100%; block-size: 100%; }
.flame {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: flicker 0.32s ease-in-out infinite alternate;
}
.flame-2 { animation-duration: 0.24s; }
@keyframes flicker {
  from { transform: scale(1, 1) skewX(-3deg); }
  to { transform: scale(0.92, 1.14) skewX(4deg); }
}

/* A shooting star, now and then, once the night is dark. */
.shooting {
  position: absolute;
  top: 12%;
  inset-inline-start: 22%;
  inline-size: 7rem;
  block-size: 2px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff);
  opacity: 0;
  transform: rotate(18deg);
}
.is-night .shooting { animation: shoot 9s linear infinite; }
@keyframes shoot {
  0%, 86% { opacity: 0; translate: 0 0; }
  88% { opacity: 1; }
  94% { opacity: 0; translate: 26vw 9vw; }
  100% { opacity: 0; translate: 26vw 9vw; }
}

/* Constellations */
.c-star { fill: #fff; }
.c-line {
  fill: none;
  stroke: #cfe0ff;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.2s ease;
}
.c-name {
  fill: #cfe0ff;
  font-family: var(--text);
  font-size: 15px;
  opacity: 0;
  transition: opacity 0.6s ease 0.6s;
}
.c-key { fill: #fff; cursor: pointer; pointer-events: none; }
.c-ring {
  fill: none;
  stroke: #fff;
  stroke-width: 1.5;
  transform-box: fill-box;
  transform-origin: center;
  animation: pulse 1.8s ease-out infinite;
  pointer-events: none;
}
@keyframes pulse {
  from { transform: scale(0.6); opacity: 0.9; }
  to { transform: scale(2.4); opacity: 0; }
}
.is-night .c-key { pointer-events: auto; }
.constellation.is-found .c-line { stroke-dashoffset: 0; }
.constellation.is-found .c-name { opacity: 1; }
.constellation.is-found .c-ring { display: none; }
/* A drawn ring as well as an outline: some browsers skip outlines on SVG shapes. */
.c-key:focus-visible { outline: 2px solid var(--ember); outline-offset: 6px; stroke: var(--ember); stroke-width: 2; }

/* Words over the scene */
.top {
  position: absolute;
  inset-inline: 0;
  top: 0;
  z-index: 6;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0.6rem var(--gutter) 0;
}
/* The name and language link sit on glass, so they stay readable on a bright noon sky. */
.brand,
.lang {
  padding: 0.25rem 0.9rem;
  border-radius: 999px;
  background: var(--glass);
  color: #fff;
}
.brand { font-size: 1rem; font-weight: 400; }
.brand strong {
  font-family: var(--display);
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
  margin-inline-end: 0.3em;
}
.lang { padding-block: 0.5rem; text-underline-offset: 0.3em; }

.hud {
  position: absolute;
  z-index: 6;
  inset-inline-start: var(--gutter);
  top: 4.25rem;
  inline-size: min(22rem, calc(100% - 2 * var(--gutter)));
  padding: 0.85rem 1.1rem 1rem;
  border-radius: 14px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
}
.clock {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(3.4rem, 13vw, 5.5rem);
  line-height: 0.85;
  letter-spacing: 0.02em;
  direction: ltr;
  unicode-bidi: isolate;
}
[dir='rtl'] .clock { text-align: right; }
.kicker {
  margin-top: 0.3rem;
  color: var(--ember);
  font-weight: 700;
  letter-spacing: 0.06em;
}
.hud h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.7rem, 6vw, 2.3rem);
  line-height: 1.02;
}
.moment-body { margin-top: 0.35rem; color: #e8e2d6; font-size: 0.9875rem; }
.found { margin-top: 0.5rem; color: #cfe0ff; font-weight: 700; }
.found[hidden] { display: none; }

.dial {
  position: absolute;
  z-index: 6;
  inset-inline: var(--gutter);
  bottom: 0.9rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.4rem 1rem;
  padding: 0.6rem 1rem 0.7rem;
  border-radius: 14px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
}
.dial-hint {
  grid-column: 1 / -1;
  font-size: 0.9375rem;
  transition: opacity 0.4s ease;
}
.dial-hint.is-gone { opacity: 0; block-size: 0; overflow: hidden; }
.dial input {
  inline-size: 100%;
  min-block-size: 2rem;
  accent-color: var(--ember);
  /* Time runs left to right in both languages, like the sun across the sky. */
  direction: ltr;
}
.skip { font-weight: 700; text-underline-offset: 0.3em; white-space: nowrap; }

.fallback {
  position: absolute;
  inset: 30% var(--gutter) auto;
  z-index: 7;
  padding: 1.5rem;
  border-radius: 14px;
  background: var(--glass);
  text-align: center;
}

/* Booking */
.book { padding: 4rem var(--gutter) 3rem; background: var(--night); scroll-margin-top: var(--ribbon-h); }
.book-head { max-width: 40rem; margin-bottom: 2rem; }
.book-head h2,
.facts h2,
dialog h2 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1;
}
.book-head h2 { font-size: clamp(2.8rem, 9vw, 4.5rem); }
.book-head p { margin-top: 0.6rem; color: var(--sand-dim); }

.book-grid { display: grid; gap: 2rem; }
.book-form { display: grid; gap: 1.75rem; }

fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend,
.field > span {
  padding: 0;
  margin-bottom: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--sand);
}
.field > span { display: block; }

.cabins { display: grid; gap: 0.75rem; }
.cabins button {
  display: grid;
  gap: 0.2rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--night-2);
  text-align: start;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.cabins button:hover { border-color: var(--sand-dim); }
.cabins button[aria-pressed='true'] { border-color: var(--ember); background: #1d2450; box-shadow: inset 0 0 0 1px var(--ember); }
.cabin-name { font-family: var(--display); font-size: 1.8rem; line-height: 1; }
.cabin-blurb { color: var(--sand-dim); }
.cabin-price { margin-top: 0.3rem; font-weight: 700; color: var(--ember); }

.row { display: flex; flex-wrap: wrap; gap: 1.25rem 2rem; }
.field input[type='date'] {
  min-height: 3rem;
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--night-2);
  color-scheme: dark;
}
.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--night-2);
}
.stepper button {
  inline-size: 3rem;
  block-size: 3rem;
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  cursor: pointer;
}
.stepper button:hover { color: var(--ember); }
.stepper button[aria-disabled='true'] { opacity: 0.35; cursor: not-allowed; }
.stepper output { min-inline-size: 2.2rem; text-align: center; font-weight: 700; }

.addons { display: grid; gap: 0.5rem; }
.addons label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  min-height: 3rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--night-2);
  cursor: pointer;
}
.addons input { inline-size: 1.25rem; block-size: 1.25rem; accent-color: var(--ember); }
.addons .addon-price { color: var(--sand-dim); font-size: 0.9375rem; white-space: nowrap; }

.book-side { display: grid; gap: 1.25rem; align-content: start; }
.sky-card {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(160deg, #1d2450, #0e1330);
}
.sky-moon { inline-size: 5rem; block-size: 5rem; filter: drop-shadow(0 0 12px rgba(244, 239, 220, 0.35)); }
.sky-card h3 { font-size: 0.9375rem; letter-spacing: 0.04em; color: var(--ember); }
#moon-line { font-family: var(--display); font-size: 1.7rem; line-height: 1.05; margin-top: 0.2rem; }
#star-line { margin-top: 0.3rem; }
.sun-line { margin-top: 0.3rem; color: var(--sand-dim); font-size: 0.9375rem; }

.summary { padding-top: 1rem; border-top: 1px solid var(--line); }
.summary-line { color: var(--sand-dim); }
.total { font-family: var(--display); font-size: 3.4rem; line-height: 1; margin-top: 0.2rem; }
.weekend { margin-top: 0.3rem; color: var(--sand-dim); font-size: 0.9375rem; }
.weekend[hidden] { display: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.1rem;
  padding: 0.6rem 1.6rem;
  border: 1px solid var(--sand);
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn-main { background: var(--ember); border-color: var(--ember); color: var(--night); }
.btn-main:hover { background: var(--sand); border-color: var(--sand); }
.btn-quiet { background: transparent; color: var(--sand); border-color: var(--line); }
.btn-quiet:hover { border-color: var(--sand); }

/* Facts and footer */
.facts { display: grid; padding: 0 var(--gutter); border-top: 1px solid var(--line); }
.facts article { padding: 2rem 0; border-bottom: 1px solid var(--line); }
.facts h2 { font-size: 2.2rem; margin-bottom: 0.4rem; }
.facts p { color: var(--sand-dim); max-width: 36ch; }

.foot {
  display: grid;
  gap: 1.5rem;
  justify-items: center;
  padding: 4rem var(--gutter) 5rem;
  text-align: center;
}
.foot p {
  font-family: var(--display);
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  line-height: 1;
  max-width: 20ch;
  text-wrap: balance;
}

dialog {
  width: min(31rem, calc(100vw - 2rem));
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--night-2);
  color: var(--sand);
}
dialog::backdrop { background: rgba(5, 8, 20, 0.75); }
dialog h2 { font-size: 2.3rem; }
.bubble {
  margin: 1.25rem 0;
  padding: 1rem 1.1rem;
  border-radius: 10px;
  background: var(--sand);
  color: var(--night);
  white-space: pre-line;
  text-align: start;
  overflow-wrap: anywhere;
}
.note { margin-bottom: 1.5rem; color: var(--sand-dim); }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }

/* Phones: the land is cropped to the cabin, pool and fire and takes its
   natural height; the words stay compact at the top. */
@media (max-width: 43.99rem) and (orientation: portrait) {
  /* The land sits above the dial so the cabin is not hidden behind it,
     with a strip of sand underneath that darkens with the night. */
  #land { block-size: auto; aspect-ratio: 720 / 480; bottom: 6rem; }
  .scene::after {
    content: '';
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    block-size: 6.05rem;
    background:
      linear-gradient(rgba(11, 16, 48, var(--dark, 0)), rgba(11, 16, 48, var(--dark, 0))),
      #cf9d68;
  }
  .moment-body { display: none; }
  .is-night .moment-body { display: block; }
  .hud { top: 3.9rem; padding: 0.6rem 0.9rem 0.7rem; }
  .skip { grid-column: 1 / -1; justify-self: end; }
}

/* Wider screens: the words sit at the top left in both languages, clear of
   the cabin and the fire, and the constellations keep to the sky beside them. */
@media (min-width: 44rem), (orientation: landscape) {
  .hud { inset-inline-start: auto; left: var(--gutter); }
}

/* A phone on its side: very little height, so the words panel stays small. */
@media (orientation: landscape) and (max-height: 30rem) {
  .moment-body { display: none; }
  .hud { top: 3.4rem; inline-size: 15rem; padding: 0.5rem 0.8rem 0.6rem; }
  .clock { font-size: 2.4rem; }
}

@media (min-width: 62rem) {
  .cabins { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .book-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); column-gap: 3.5rem; }
  .book-side { position: sticky; top: calc(var(--ribbon-h) + 1.5rem); }
  .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .facts article { padding-block: 2.5rem 3rem; padding-inline: 0 2rem; border-bottom: 0; }
  .facts article + article { padding-inline-start: 2rem; border-inline-start: 1px solid var(--line); }
}

@media (prefers-reduced-motion: reduce) {
  .flame,
  .c-ring,
  .is-night .shooting { animation: none; }
  .c-line, .c-name, .dial-hint, .btn, .cabins button { transition: none; }
}
