/*
  Shvil Guided Desert Walks (demo) - art direction
  Scene:   a walker's map spread on a warm rock at first light. The land is
           painted in sandstone colours with the sun low in the north-west;
           the trail is a red line that grows as you walk it.
  Palette: the map carries the colour. Around it: cream paper, dark earth
           ink, one trail red, one water teal for the walker.
  Type:    Suez One (a sturdy Hebrew display serif, like a trail sign),
           Assistant for text and numbers.
  Shape:   paper cards with an ink edge and a hard little shadow, like
           notes pinned on the map.
*/

:root {
  --paper: #f6eedd;
  --card: #fffaf0;
  --ink: #2b2118;
  --ink-soft: #6a5a48;
  --line: rgba(43, 33, 24, 0.2);
  --red: #c23b22;
  --teal: #12757a;
  --display: 'Suez One', 'Times New Roman', serif;
  --text: 'Assistant', system-ui, sans-serif;
  --gutter: clamp(1rem, 4vw, 3.5rem);
  --pin: 4px 4px 0 var(--ink);
}

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

html {
  background: var(--ink);
  scroll-padding-top: 4.5rem;
  scroll-padding-bottom: 9rem;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.55;
  overflow-x: clip;
}

h1, h2, h3, p, ol, dl, dd { margin: 0; }
ol { padding: 0; list-style: none; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
em { font-style: normal; color: var(--red); }

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

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

.ribbon-bar {
  position: sticky;
  top: 0;
  z-index: 6;
  padding: 0.4rem var(--gutter);
  background: var(--ink);
  color: var(--paper);
  font-size: 0.875rem;
  text-align: center;
}
.ribbon-bar a:focus-visible { outline-color: var(--paper); }

.top {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  block-size: 4.2rem;
  padding: 0.9rem var(--gutter) 0;
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.brand, .lang {
  padding: 0.15rem 0.7rem;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  background: var(--card);
  box-shadow: 3px 3px 0 var(--ink);
}
.brand { font-size: 0.9375rem; color: var(--ink-soft); }
.brand strong { margin-inline-end: 0.4em; font-family: var(--display); font-weight: 400; font-size: 1.5rem; color: var(--ink); }
.lang { font-weight: 600; text-decoration: none; }

/* ---------- The walk ---------- */

.journey {
  position: relative;
  /* The header floats over the map. */
  margin-top: -4.2rem;
  block-size: 620vh;
  background: #d9b98a;
}
.stage {
  position: sticky;
  top: 0;
  block-size: 100vh;
  block-size: 100svh;
  overflow: hidden;
  isolation: isolate;
}
.map {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  display: block;
}
/* A soft darkening at the edges, like a lens. */
.stage::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(rgba(43, 33, 24, 0.55), transparent 30%),
    radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(43, 33, 24, 0.42));
}


.trail-ahead { fill: none; stroke: rgba(43, 33, 24, 0.5); stroke-width: 2; stroke-dasharray: 1.5 7; stroke-linecap: round; }
.trail-case, .trail {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.trail-case { stroke: #fff6e6; stroke-width: 8; }
.trail { stroke: var(--red); stroke-width: 4; }

.stop-pin { transform: scale(0.6); opacity: 0.55; transition: transform 0.45s cubic-bezier(0.2, 1.6, 0.4, 1), opacity 0.3s ease; }
.stop-disc { fill: var(--card); stroke: var(--ink); stroke-width: 2; }
.stop-glyph { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.stop.is-reached .stop-pin { transform: scale(1); opacity: 1; }
.stop.is-reached .stop-disc { fill: #ffe9a8; }
.stop-name {
  font-family: var(--text);
  font-size: 15px;
  font-weight: 700;
  fill: var(--ink);
  paint-order: stroke;
  stroke: #fff6e6;
  stroke-width: 4px;
  stroke-linejoin: round;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.stop.is-reached .stop-name { opacity: 1; }

.walker-dot { fill: var(--teal); stroke: #fff; stroke-width: 3; }
.walker-ring {
  fill: rgba(18, 117, 122, 0.25);
  stroke: var(--teal);
  stroke-width: 1.5;
  transform-box: fill-box;
  transform-origin: center;
  animation: ping 1.8s ease-out infinite;
}
@keyframes ping {
  from { transform: scale(0.4); opacity: 1; }
  to { transform: scale(1.5); opacity: 0; }
}

.furniture path { fill: var(--ink); }
.furniture .scale { fill: none; stroke: var(--ink); stroke-width: 2; }
.furniture text { font-family: var(--text); font-size: 13px; font-weight: 700; fill: var(--ink); }

/* Cloud shadows drifting over the land. */
.clouds { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: multiply; }
.clouds i {
  position: absolute;
  inline-size: 46vmax;
  block-size: 22vmax;
  border-radius: 50%;
  background: rgba(60, 40, 30, 0.34);
  filter: blur(46px);
  animation: cloud 70s linear infinite;
}
.clouds i:nth-child(1) { top: 8%; left: -50vmax; }
.clouds i:nth-child(2) { top: 52%; left: -50vmax; inline-size: 34vmax; animation-duration: 95s; animation-delay: -40s; }
@keyframes cloud {
  to { translate: calc(100vw + 100vmax) 6vh; }
}

.stage-head {
  position: absolute;
  inset-inline: 0;
  top: clamp(6.2rem, 15vh, 8.5rem);
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 0.8rem;
  padding-inline: var(--gutter);
  text-align: center;
  color: #fff8ea;
  text-shadow: 0 2px 18px rgba(43, 33, 24, 0.75);
  /* A soft dark pool behind the words, so they read on the pale sand too. It fades with them. */
  padding-block: 1.5rem 2.2rem;
  background: radial-gradient(closest-side, rgba(43, 33, 24, 0.7), rgba(43, 33, 24, 0.36) 58%, transparent);
}
h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.8rem, 10vw, 6.2rem);
  line-height: 1;
  text-wrap: balance;
}
h1 em { color: #ffd98a; }
.stage-head .lede { max-inline-size: 36ch; font-size: 1.1875rem; font-weight: 600; }
.skip { font-weight: 700; text-underline-offset: 0.3em; }

.hud {
  position: absolute;
  /* Always on the right: the trail starts at the bottom left of the map. */
  left: var(--gutter);
  right: var(--gutter);
  bottom: calc(5.2rem + 0.9rem);
  z-index: 3;
  display: grid;
  gap: 0.6rem;
  justify-items: end;
  direction: ltr;
  transition: opacity 0.2s linear;
  pointer-events: none;
}
.card {
  inline-size: min(100%, 25rem);
  padding: 0.9rem 1.1rem 1rem;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: var(--card);
  box-shadow: var(--pin);
}
/* The box is placed left-to-right; what is written in it follows the page. */
[dir='rtl'] .hud > * { direction: rtl; }
.card.is-fresh { animation: pinned 0.45s cubic-bezier(0.2, 1.5, 0.4, 1); }
@keyframes pinned {
  from { transform: translateY(14px) rotate(-1.5deg); }
}
.card-kicker { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.04em; color: var(--red); }
.card-title { font-family: var(--display); font-weight: 400; font-size: 1.6rem; line-height: 1.15; }
.card-text { margin-top: 0.2rem; color: #4a3d30; }

.stats {
  display: flex;
  gap: 0;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: 4px 4px 0 rgba(43, 33, 24, 0.35);
}
.stats div { padding: 0.35rem 0.9rem 0.45rem; }
.stats div + div { border-inline-start: 1px solid rgba(246, 238, 221, 0.25); }
.stats dt { font-size: 0.75rem; color: #d6c6a8; }
.stats b { font-size: 1.15rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

.profile {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 2;
  inline-size: 100%;
  block-size: 5.2rem;
  display: block;
  background: linear-gradient(transparent, rgba(43, 33, 24, 0.55));
}
/* Not mirrored in Hebrew: it runs the same way as the trail on the map above it. */
.profile-area { fill: rgba(255, 246, 230, 0.35); }
.profile-walked { fill: var(--red); opacity: 0.88; }
.profile-line { fill: none; stroke: #fff6e6; stroke-width: 2; vector-effect: non-scaling-stroke; }
.profile-tick { stroke: rgba(255, 246, 230, 0.7); stroke-width: 1; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }
.profile-dot { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; vector-effect: non-scaling-stroke; }

.fallback { padding: 2rem var(--gutter); text-align: center; }

/* ---------- Booking ---------- */

.booking { padding: 4rem var(--gutter) 2.5rem; }
h2 { font-family: var(--display); font-weight: 400; line-height: 1.08; text-wrap: balance; }
.booking > h2 { font-size: clamp(2.2rem, 7vw, 4rem); }
.booking .lede { margin-top: 0.7rem; max-inline-size: 44ch; color: var(--ink-soft); font-size: 1.125rem; }

.form { display: grid; margin-top: 2rem; max-inline-size: 46rem; }
.step { padding: 1.4rem 0; border-top: 1.5px solid var(--ink); }
.step h3 { margin-bottom: 0.8rem; font-family: var(--display); font-weight: 400; font-size: 1.5rem; }
.step h3 span { margin-inline-end: 0.5em; font-family: var(--text); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.1em; color: var(--red); }
.step-note { margin-top: 0.8rem; color: var(--ink-soft); font-size: 0.9375rem; }

.field { display: block; }
.field input {
  inline-size: min(100%, 18rem);
  min-block-size: 3rem;
  padding: 0.5rem 0.9rem;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: var(--card);
  box-shadow: 3px 3px 0 var(--ink);
}
.plan { margin-top: 0.9rem; min-block-size: 3.1em; max-inline-size: 44ch; font-weight: 600; }
.plan.is-warning { color: var(--red); }

.counters { display: grid; gap: 0.6rem; max-inline-size: 26rem; }
.counter { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 0.5rem; }
.counter-name { font-weight: 600; }
.counter button {
  inline-size: 2.75rem;
  block-size: 2.75rem;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--card);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}
.counter button[aria-disabled='true'] { opacity: 0.35; cursor: not-allowed; }
.counter output { min-inline-size: 2rem; text-align: center; font-family: var(--display); font-size: 1.5rem; }

.chips { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.chips button {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-block-size: 2.9rem;
  padding: 0.35rem 1rem;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: var(--card);
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.chips b { color: var(--red); white-space: nowrap; }
.chips button:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.chips button[aria-pressed='true'] { background: #ffe9a8; box-shadow: 3px 3px 0 var(--ink); transform: translate(-1px, -1px); }
.chips button[aria-pressed='true'] b { color: #9c2a14; }
.chips button[aria-pressed='true']::before { content: '✓'; font-weight: 700; }

.summary {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem 1rem;
  margin-inline: calc(var(--gutter) * -1);
  padding: 0.8rem var(--gutter) 1rem;
  border-top: 1.5px solid var(--ink);
  background: var(--paper);
}
.summary-line { font-weight: 700; }
.discount { font-size: 0.9375rem; color: var(--teal); font-weight: 600; }
.total { font-family: var(--display); font-size: 2.2rem; line-height: 1; }
.summary .btn { grid-column: 1 / -1; justify-self: start; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 3.1rem;
  padding: 0.5rem 1.7rem;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-main { background: var(--red); color: #fff; box-shadow: var(--pin); }
.btn-main:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn-main:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-quiet { background: var(--card); }

/* ---------- Facts and footer ---------- */

.facts { display: grid; gap: 1rem; padding: 1rem var(--gutter) 3.5rem; }
.facts article { padding: 1.3rem 1.3rem 1.5rem; border: 1.5px solid var(--ink); border-radius: 6px; background: var(--card); box-shadow: var(--pin); }
.facts h2 { font-size: 1.5rem; margin-bottom: 0.4rem; }
.facts p { color: #4a3d30; }

.foot {
  display: grid;
  gap: 1.5rem;
  justify-items: center;
  padding: 4rem var(--gutter) 5rem;
  background: var(--ink);
  color: var(--paper);
  text-align: center;
}
.foot p { font-family: var(--display); font-size: clamp(1.6rem, 4.2vw, 2.5rem); line-height: 1.15; max-inline-size: 24ch; text-wrap: balance; }
.foot .btn-main { border-color: var(--paper); box-shadow: 4px 4px 0 #ffd98a; }
.foot .btn-main:hover { box-shadow: 6px 6px 0 #ffd98a; }
.foot :focus-visible { outline-color: #ffd98a; }

/* ---------- Sheet ---------- */

dialog {
  inline-size: min(31rem, calc(100vw - 2rem));
  padding: 1.8rem;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
}
dialog::backdrop { background: rgba(43, 33, 24, 0.65); }
dialog h2 { font-size: 1.7rem; }
.bubble {
  margin: 1.25rem 0;
  padding: 1rem 1.1rem;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: #e6f2ee;
  white-space: pre-line;
  text-align: start;
  overflow-wrap: anywhere;
}
.note { margin-bottom: 1.5rem; color: var(--ink-soft); }
.actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }

@media (max-width: 39.99rem) {
  /* On a phone the notes sit at the top, and the walker stays in view below them. */
  .hud { top: 4.4rem; bottom: auto; justify-items: stretch; }
  .card { inline-size: 100%; padding: 0.7rem 0.9rem 0.8rem; }
  .stats { justify-self: end; }
  .card-text { font-size: 0.9375rem; }
  .card-title { font-size: 1.35rem; }
  .stop-name { font-size: 12px; stroke-width: 3px; }
  .brand { font-size: 0; }
  .brand strong { font-size: 1.4rem; margin: 0; }
}

/* A phone on its side: very little height, so the note is small and stays clear of the walker. */
@media (max-height: 30rem) and (orientation: landscape) {
  .hud { top: 3.9rem; bottom: auto; justify-items: end; }
  .card { inline-size: 15rem; padding: 0.5rem 0.8rem 0.6rem; }
  .card-text, .stats { display: none; }
  .stage-head { top: 4rem; }
  .stage-head .lede { display: none; }
}

@media (min-width: 40rem) {
  .hud { bottom: calc(5.2rem + 1.4rem); }
  .summary { grid-template-columns: minmax(0, 1fr) auto auto; margin-inline: 0; padding-inline: 0; }
  .summary .btn { grid-column: auto; }
  .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .walker-ring, .clouds i, .card.is-fresh { animation: none; }
  .stop-pin, .stop-name, .chips button, .btn { transition: none; }
  .chips button:hover, .btn-main:hover, .btn-main:active { transform: none; }
}
