/* Hero scene: the client's phone with a salon booking page, the owner's lock screen,
   and the path a booking travels between them. */

.stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px minmax(100px, 190px) 300px minmax(0, 1fr);
  grid-template-areas: "cnote client air owner onote";
  margin-top: clamp(2.5rem, 5vw, 4rem);
}

.stage__note { align-self: center; max-width: 15rem; color: var(--on-ink); font-size: 0.98rem; line-height: 1.5; }
.stage__note--client { grid-area: cnote; justify-self: end; padding-right: 1.8rem; text-align: right; }
.stage__note--owner { grid-area: onote; justify-self: start; padding-left: 1.8rem; }
.stage__who {
  margin-bottom: 0.45rem;
  color: var(--accent);
  font-family: var(--f-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Phones */
.device {
  position: relative;
  z-index: 1;
  padding: 11px;
  border-radius: 46px;
  background: linear-gradient(160deg, #1f4a50, var(--night) 45%);
  box-shadow:
    inset 0 0 0 1.5px rgb(var(--paper-rgb) / 0.14),
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 40px 80px -30px rgba(0, 0, 0, 0.75);
}
.device--client { grid-area: client; }
.device--owner { grid-area: owner; }

.device__screen {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 600px;
  overflow: hidden;
  padding: 0 16px 26px;
  border-radius: 36px;
}
/* The camera island and the home bar. */
.device__screen::before {
  content: "";
  position: absolute;
  top: 11px;
  left: 50%;
  width: 86px;
  height: 25px;
  margin-left: -43px;
  border-radius: 20px;
  background: #041517;
}
.device__screen::after {
  content: "";
  position: absolute;
  bottom: 8px;
  left: 50%;
  width: 110px;
  height: 4px;
  margin-left: -55px;
  border-radius: 4px;
  background: currentColor;
  opacity: 0.35;
}

.device__status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  height: 46px;
  padding: 0 12px;
  font-family: var(--f-display);
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.device__bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 10px; }
.device__bars i { width: 3px; border-radius: 1px; background: currentColor; }
.device__bars i:nth-child(1) { height: 4px; }
.device__bars i:nth-child(2) { height: 6px; }
.device__bars i:nth-child(3) { height: 8px; }
.device__bars i:nth-child(4) { height: 10px; }

.device.is-buzz { animation: buzz 420ms ease-in-out; }
@keyframes buzz {
  0%, 100% { transform: none; }
  20% { transform: translateX(-3px) rotate(-0.6deg); }
  40% { transform: translateX(3px) rotate(0.6deg); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}

/* Client screen: the salon has its own brand, mint, so it reads as someone else's site. */
.salon {
  --mint: #1d6b57;
  --mint-deep: #175847;
  --mint-soft: #e1f1ea;
  --mint-line: #d3e3dc;
  --mint-ink: #12392f;
  --mint-mute: #52685f;
  background: #f7faf8;
  color: var(--mint-ink);
}
.salon :focus-visible { outline-color: var(--action); }

.salon__head { display: flex; align-items: center; gap: 0.6rem; margin: 0.4rem 0 1rem; }
.salon__logo {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--mint);
  color: #fff;
  font-family: var(--f-display);
  font-size: 0.95rem;
  font-weight: 700;
}
.salon__title { font-size: 1.05rem; font-weight: 650; letter-spacing: -0.015em; line-height: 1.2; }
.salon__tag {
  margin-left: auto;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: var(--mint-soft);
  color: var(--mint);
  font-family: var(--f-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.salon__form { display: flex; flex: 1; flex-direction: column; gap: 0.9rem; }
.salon__group { min-width: 0; margin: 0; padding: 0; border: 0; }
.salon__group legend { margin-bottom: 0.45rem; padding: 0; color: var(--mint-mute); font-family: var(--f-display); font-size: 0.8rem; }
.salon__services { display: grid; gap: 0.4rem; }
.salon__slots { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; }

.pick { position: relative; display: block; }
.pick input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.pick > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.45rem 0.8rem;
  border: 1.5px solid var(--mint-line);
  border-radius: 12px;
  background: #fff;
  font-family: var(--f-display);
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
  transition: background-color var(--fast) ease, border-color var(--fast) ease, color var(--fast) ease;
}
.pick small { color: var(--mint-mute); font-family: var(--f-mono); font-size: 0.72rem; }
.pick > span:hover { border-color: var(--mint); }
.pick input:checked + span { border-color: var(--mint); background: var(--mint); color: #fff; }
.pick input:checked + span small { color: #cfe9de; }
.pick input:focus-visible + span { outline: 3px solid var(--action); outline-offset: 2px; }
.pick input:disabled + span { border-style: dashed; background: transparent; color: #8fa39b; cursor: not-allowed; }
.pick input:disabled + span .pick__label { text-decoration: line-through; }

.pick--slot > span {
  flex-direction: column;
  justify-content: center;
  gap: 0;
  min-height: 48px;
  font-family: var(--f-mono);
  font-size: 0.86rem;
}
.pick--slot small { font-size: 0.62rem; }

.salon__book {
  margin-top: auto;
  min-height: 50px;
  border: 0;
  border-radius: 14px;
  background: var(--mint);
  color: #fff;
  font-family: var(--f-display);
  font-size: 0.98rem;
  font-weight: 600;
  transition: background-color var(--fast) ease, transform var(--fast) ease;
}
.salon__book:hover, .salon__book.is-pressed { background: var(--mint-deep); }
.salon__book.is-pressed { transform: scale(0.97); }
.salon__book:disabled { background: #9fbdb2; cursor: default; }

/* Always takes its space, so the phone never changes height under the flying dot. */
.salon__done {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.7rem;
  color: var(--mint);
  font-family: var(--f-display);
  font-size: 0.8rem;
  line-height: 1.35;
}
.salon__done:empty { visibility: hidden; }
.salon__again {
  flex: none;
  min-height: 32px;
  margin-left: auto;
  padding: 0.2rem 0;
  border: 0;
  background: none;
  color: var(--mint-ink);
  font-family: var(--f-display);
  font-size: 0.8rem;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* Owner screen: a lock screen with Telegram notifications. */
.lock {
  background:
    radial-gradient(120% 70% at 15% 0%, rgb(var(--action-rgb) / 0.6), transparent 60%),
    radial-gradient(90% 60% at 100% 100%, rgb(var(--accent-rgb) / 0.2), transparent 60%),
    #0c2a2f;
  color: var(--sheet);
  text-align: center;
}
.lock__date { margin-top: 1.2rem; color: rgba(255, 255, 255, 0.82); font-family: var(--f-display); font-size: 0.9rem; font-weight: 500; }
.lock__time {
  font-family: var(--f-display);
  font-size: 4.6rem;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.03em;
}

.lock__notes { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.5rem; margin: 2rem 0 0; padding: 0; list-style: none; text-align: left; }

.note {
  padding: 0.7rem 0.8rem 0.75rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 24px -14px rgba(0, 0, 0, 0.6);
}
.note + .note { opacity: 0.7; }
.note__head { display: flex; align-items: center; gap: 0.5rem; color: rgba(255, 255, 255, 0.75); font-family: var(--f-mono); font-size: 0.66rem; }
.note__icon { display: grid; place-items: center; flex: none; width: 1.35rem; height: 1.35rem; border-radius: 6px; background: var(--action); }
.note__icon svg { width: 0.95rem; height: auto; }
.note__app { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note__time { margin-left: auto; white-space: nowrap; }
.note__text { margin-top: 0.3rem; font-family: var(--f-display); font-size: 0.84rem; line-height: 1.35; }
.note__text b { font-weight: 600; }

.note.is-new { animation: note-in 620ms var(--ease-out) both; }
@keyframes note-in {
  0% { opacity: 0; transform: translateY(-16px) scale(0.94); }
  60% { opacity: 1; transform: translateY(2px) scale(1.01); }
  100% { opacity: 1; transform: none; }
}

/* The path between phones: a dotted track always, a green line and a dot while a booking travels. */
.flow {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.flow__track { fill: none; stroke: rgb(var(--paper-rgb) / 0.28); stroke-width: 1.6; stroke-dasharray: 1 7; stroke-linecap: round; }
.flow__lit { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; opacity: 0; transition: opacity 600ms ease 250ms; }
.flow__dot, .flow__halo { fill: var(--accent); opacity: 0; }
.is-flying .flow__lit { opacity: 1; transition: none; }
.is-flying .flow__dot { opacity: 1; }
.is-flying .flow__halo { opacity: 0.22; }

/* Notes move above the phones. */
@media (max-width: 1100px) {
  .stage {
    grid-template-columns: 300px minmax(70px, 150px) 300px;
    grid-template-areas: "cnote air onote" "client air owner";
    justify-content: center;
    row-gap: 1.4rem;
  }
  .stage__note { align-self: end; max-width: 300px; padding: 0; }
  .stage__note--client { justify-self: start; text-align: left; }
}

/* One column: client phone, the path down, then the owner's phone. */
@media (max-width: 760px) {
  .stage {
    grid-template-columns: minmax(0, 320px);
    grid-template-rows: auto auto 76px auto auto;
    grid-template-areas: "cnote" "client" "air" "onote" "owner";
    row-gap: 1rem;
  }
  .device__screen { min-height: 0; }
  .lock { min-height: 440px; }
}
