/* The transition from the search bar to the search screen: a phone with the home of Nookbay, an app for stays. The
   phone is drawn at a fixed size (308 x 628) and scaled as a whole to fit the window (--s, set by script.js), so every
   position inside the screen is in plain design pixels. Layers inside the screen, bottom to top: the home, the frosted
   search sheet, the pill (the shared element), the status bar and the glass glare. */
:root {
  --page: #0e0f12;          /* the page around the phone */
  --warm: #ff7a4a;          /* the warm glow behind the phone */
  --cool: #5a74ff;          /* the cool glow */
  --paper: #f6f4f0;         /* the background of the app */
  --card: #ffffff;          /* the search bar, the keys */
  --ink: #17181c;           /* the words of the app */
  --muted: #8d8a85;         /* the small words */
  --line: rgba(23, 24, 28, 0.08); /* the thin rules */
  --accent: #e2562e;        /* the accent of the app: Cancel, the search key, the match */
  --frame: #2b2c31;         /* the titanium of the phone */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(120% 80% at 50% 110%, rgba(255, 255, 255, 0.05), transparent 60%),
    var(--page);
}

/* a fine grain over the page, so the dark is never flat */
.stage::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.glow {
  position: absolute;
  z-index: -1;
  width: min(70vw, 70vh, 520px);
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(min(9vw, 9vh, 70px));
  opacity: 0.55;
  pointer-events: none;
}

.glow--warm {
  left: 50%;
  top: 50%;
  margin: calc(min(70vw, 70vh, 520px) * -0.72) 0 0 calc(min(70vw, 70vh, 520px) * -0.85);
  background: radial-gradient(circle, var(--warm), transparent 66%);
}

.glow--cool {
  left: 50%;
  top: 50%;
  margin: calc(min(70vw, 70vh, 520px) * -0.2) 0 0 calc(min(70vw, 70vh, 520px) * -0.1);
  background: radial-gradient(circle, var(--cool), transparent 66%);
  opacity: 0.42;
}

/* the holder takes the scaled size of the phone, so the layout around it is right */
.holder {
  --s: 0.6;
  position: relative;
  width: calc(308px * var(--s));
  height: calc(628px * var(--s));
  opacity: 0;
}

.floor {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -4%;
  height: 7%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.75), transparent);
  filter: blur(6px);
}

.device {
  position: absolute;
  left: 0;
  top: 0;
  width: 308px;
  height: 628px;
  transform: scale(var(--s));
  transform-origin: 0 0;
  border-radius: 50px;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 22%, rgba(255, 255, 255, 0) 72%, rgba(255, 255, 255, 0.12)),
    linear-gradient(180deg, #3a3b41, var(--frame) 40%, #1a1b1f);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    inset 0 0 0 3px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(0, 0, 0, 0.7),
    0 2px 4px rgba(0, 0, 0, 0.35),
    0 24px 40px -16px rgba(0, 0, 0, 0.6),
    0 60px 90px -30px rgba(0, 0, 0, 0.75);
}

.device__key {
  position: absolute;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, #4a4b51, #222327);
}

.device__key--a { left: -3px; top: 118px; height: 26px; }
.device__key--b { left: -3px; top: 160px; height: 46px; }
.device__key--c { right: -3px; top: 178px; height: 70px; transform: scaleX(-1); }

.screen {
  position: absolute;
  inset: 8px;
  overflow: hidden;
  border-radius: 42px;
  background: var(--paper);
  font-size: 12px;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}

/* ---------------------------------------------------------------- the home */
.home {
  position: absolute;
  inset: 0;
  transform-origin: 50% 24%;
}

.home__hello {
  position: absolute;
  left: 20px;
  top: 58px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 450;
}

.home__title {
  position: absolute;
  left: 20px;
  top: 73px;
  margin: 0;
  font-size: 26px;
  line-height: 1.1;
  font-weight: 620;
  font-stretch: 108%;
  letter-spacing: -0.025em;
}

.home__avatar {
  position: absolute;
  right: 20px;
  top: 62px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.02em;
  background: radial-gradient(circle at 30% 25%, #ffb08a, var(--accent) 60%, #a83a1d);
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px rgba(226, 86, 46, 0.25), 0 6px 12px -6px rgba(168, 58, 29, 0.6);
}

.chips {
  position: absolute;
  left: 16px;
  top: 188px;
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

.chip {
  padding: 7px 12px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 520;
  background: rgba(23, 24, 28, 0.045);
  box-shadow: inset 0 0 0 1px var(--line);
}

.chip--on {
  color: #fff;
  background: var(--ink);
  box-shadow: 0 4px 10px -4px rgba(23, 24, 28, 0.5);
}

.stay {
  position: absolute;
  left: 16px;
  top: 228px;
  width: 260px;
  height: 238px;
  overflow: hidden;
  border-radius: 24px;
  box-shadow: 0 1px 2px rgba(23, 24, 28, 0.08), 0 18px 30px -18px rgba(60, 30, 20, 0.55);
}

.stay--small {
  top: 478px;
  height: 120px;
}

.stay__photo {
  position: absolute;
  inset: 0;
}

/* real photos (CC0): the roofs of Lisbon under the castle hill, a still fjord in Norway */
.stay__photo--castelo {
  background: url('lisbona.webp') 50% 40% / cover no-repeat, #6b4a3c;
}

/* a soft shade on top and at the bottom, so the glass pills and the price read on the photo */
.stay__photo--castelo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 16, 14, 0.28), rgba(20, 16, 14, 0) 30%, rgba(20, 16, 14, 0) 58%, rgba(20, 16, 14, 0.42));
}

.stay__photo--fjord {
  background: url('fiordo.webp') 50% 55% / cover no-repeat, #3e5d66;
}

.stay__rating,
.stay__save {
  position: absolute;
  top: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.stay__rating {
  left: 12px;
  padding: 5px 9px 5px 7px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}

.stay__rating svg {
  width: 11px;
  height: 11px;
  fill: #fff;
}

.stay__save {
  right: 12px;
  width: 32px;
  height: 32px;
  justify-content: center;
  border-radius: 50%;
}

.stay__save svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.5;
}

.stay__info {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  padding: 10px 12px;
  border-radius: 16px;
  color: #fff;
  background: rgba(20, 22, 40, 0.32);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
}

.stay__name {
  font-size: 14px;
  font-weight: 620;
}

.stay__where {
  grid-row: 2;
  font-size: 10.5px;
  opacity: 0.75;
}

.stay__price {
  grid-row: 1 / 3;
  grid-column: 2;
  align-self: center;
  font-size: 15px;
  font-weight: 650;
}

.stay__price small {
  margin-left: 3px;
  font-size: 10px;
  font-weight: 450;
  opacity: 0.75;
}

.tabs {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 78px;
  display: flex;
  justify-content: space-around;
  padding: 14px 26px 0;
  background: rgba(250, 249, 246, 0.78);
  box-shadow: inset 0 1px 0 var(--line);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
}

.tabs__icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tabs__icon--on {
  stroke: var(--ink);
  fill: var(--ink);
}

/* ---------------------------------------------------------------- the search sheet */
.sheet {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  background: rgba(246, 244, 240, 0.8);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  backdrop-filter: blur(18px) saturate(1.5);
}

.cancel {
  position: absolute;
  right: 14px;
  top: 61px;
  padding: 4px 4px;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 13.5px;
  font-weight: 560;
  cursor: pointer;
}

.group {
  position: absolute;
  left: 0;
  right: 0;
  top: 108px;
}

.group--results {
  visibility: hidden;
}

.group__label {
  display: flex;
  justify-content: space-between;
  margin: 0 20px 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 560;
  letter-spacing: 0.01em;
}

.group__label span {
  color: var(--accent);
  font-weight: 520;
}

.group__label--gap {
  margin-top: 14px;
}

.rows {
  margin: 0;
  padding: 0 8px;
  list-style: none;
}

.row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 52px;
  padding: 0 12px;
  border-radius: 14px;
  cursor: pointer;
}

.row + .row::before {
  content: '';
  position: absolute;
  left: 59px;
  right: 12px;
  top: 0;
  height: 1px;
  background: var(--line);
}

.row__press {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(23, 24, 28, 0.06);
  opacity: 0;
}

.row__thumb {
  position: relative;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25), 0 4px 8px -4px rgba(23, 24, 28, 0.45);
}

.row__thumb--kyoto { background: url('kyoto.webp') 50% 50% / cover no-repeat, #5d7a5a; }
.row__thumb--copen { background: url('copenaghen.webp') 50% 50% / cover no-repeat, #5f7f9f; }
.row__thumb--porto { background: url('porto.webp') 50% 50% / cover no-repeat, #c46a4a; }
.row__thumb--lisbon { background: url('lisbona.webp') 50% 30% / cover no-repeat, #6b4a3c; }
.row__thumb--pin {
  display: grid;
  place-items: center;
  background: rgba(23, 24, 28, 0.05);
  box-shadow: inset 0 0 0 1px var(--line);
}

.row__thumb--pin svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.4;
}

.row__text {
  display: grid;
  min-width: 0;
  flex: 1;
}

.row__text b {
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 450;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.row__text b em {
  font-style: normal;
  font-weight: 680;
  color: var(--ink);
}

.row__text small {
  color: var(--muted);
  font-size: 10.5px;
}

.row__go {
  flex: none;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.3;
  stroke-linecap: round;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 20px 0;
}

.tag {
  padding: 6px 10px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 500;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line), 0 2px 6px -4px rgba(23, 24, 28, 0.3);
}

/* the keyboard, as the phone draws it: frosted grey with white keys */
.keyboard {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 238px;
  background: rgba(214, 216, 222, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
}

.key {
  position: absolute;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--card);
  box-shadow: 0 1px 0 rgba(23, 24, 28, 0.3);
  color: var(--ink);
  font-size: 17px;
  font-weight: 400;
  cursor: pointer;
}

.key--fn {
  background: #aeb2bb;
  font-size: 12px;
}

.key--fn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.4;
  stroke-linejoin: round;
}

.key--go {
  background: var(--accent);
  color: #fff;
  font-size: 12.5px;
  font-weight: 560;
}

.key--space {
  font-size: 12px;
  color: var(--muted);
}

.key.is-down {
  background: #c8ccd3;
}

.keyboard__pop {
  position: absolute;
  z-index: 2;
  width: 40px;
  height: 52px;
  display: grid;
  place-items: center;
  padding-bottom: 6px;
  border-radius: 10px;
  background: var(--card);
  box-shadow: 0 0 0 0.5px rgba(23, 24, 28, 0.15), 0 6px 14px -4px rgba(23, 24, 28, 0.4);
  font-size: 26px;
  opacity: 0;
  pointer-events: none;
}

/* ---------------------------------------------------------------- the pill, the shared element */
.pill {
  position: absolute;
  left: 16px;
  top: 118px;
  width: 260px;
  height: 56px;
  border-radius: 28px;
  background: var(--card);
  box-shadow:
    inset 0 0 0 1px rgba(23, 24, 28, 0.06),
    0 1px 2px rgba(23, 24, 28, 0.06),
    0 10px 24px -12px rgba(23, 24, 28, 0.35);
  cursor: pointer;
  outline: none;
}

.pill__ring {
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  box-shadow: 0 0 0 1.5px var(--accent), 0 0 18px -2px rgba(226, 86, 46, 0.45);
  opacity: 0;
  pointer-events: none;
}

.pill__icon {
  position: absolute;
  left: 17px;
  top: 50%;
  width: 19px;
  height: 19px;
  margin-top: -9.5px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.7;
  stroke-linecap: round;
}

.pill__home {
  position: absolute;
  left: 46px;
  top: 50%;
  display: grid;
  transform: translateY(-50%);
  white-space: nowrap;
}

.pill__home b {
  font-size: 13.5px;
  font-weight: 620;
}

.pill__home small {
  color: var(--muted);
  font-size: 10.5px;
}

.pill__field {
  position: absolute;
  left: 38px;
  top: 50%;
  display: flex;
  align-items: center;
  height: 20px;
  margin-top: -10px;
  font-size: 13.5px;
  white-space: nowrap;
  opacity: 0;
}

.pill__query {
  font-weight: 520;
}

.pill__caret {
  width: 2px;
  height: 17px;
  margin: 0 1px;
  border-radius: 1px;
  background: var(--accent);
}

.pill__hint {
  color: var(--muted);
}

.pill__filter {
  position: absolute;
  right: 9px;
  top: 50%;
  width: 38px;
  height: 38px;
  margin-top: -19px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--line);
}

.pill__filter svg {
  width: 18px;
  height: 18px;
  fill: var(--card);
  stroke: var(--ink);
  stroke-width: 1.4;
  stroke-linecap: round;
}

/* ---------------------------------------------------------------- status bar, home indicator, glass */
.status {
  position: absolute;
  inset: 0 0 auto;
  height: 44px;
  pointer-events: none;
}

.status__time {
  position: absolute;
  left: 30px;
  top: 15px;
  font-size: 13px;
  font-weight: 620;
}

.status__island {
  position: absolute;
  left: 50%;
  top: 10px;
  width: 86px;
  height: 25px;
  margin-left: -43px;
  border-radius: 13px;
  background: #050506;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.status__icons {
  position: absolute;
  right: 24px;
  top: 17px;
  width: 46px;
  height: 11px;
  fill: var(--ink);
}

.status__cell {
  fill: none;
  stroke: var(--ink);
  stroke-opacity: 0.4;
}

.indicator {
  position: absolute;
  left: 50%;
  bottom: 7px;
  width: 104px;
  height: 4px;
  margin-left: -52px;
  border-radius: 2px;
  background: var(--ink);
  pointer-events: none;
}

.glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(118deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 34%, rgba(255, 255, 255, 0) 70%, rgba(255, 255, 255, 0.06) 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}

@media (hover: hover) {
  .pill:hover {
    box-shadow:
      inset 0 0 0 1px rgba(23, 24, 28, 0.1),
      0 1px 2px rgba(23, 24, 28, 0.06),
      0 14px 28px -12px rgba(23, 24, 28, 0.42);
  }

  .row:hover {
    background: rgba(23, 24, 28, 0.035);
  }

  .cancel:hover {
    opacity: 0.75;
  }
}
