/* The store finder of Fennick Coffee: an app frame on a warm page. Inside, the map (an SVG drawn by script.js inside
   a camera layer that GSAP moves), the pins, the search bar and the footer; on top, the lifted block that becomes the
   page of the store. The blocks have a stroke in the colour of the streets, so the streets are the strokes: they do
   not grow with the camera and script.js makes them thinner while it moves in. */
:root {
  --page: #f3efe8;          /* the page around the app */
  --street: #fbf8f3;        /* the streets */
  --block: #e6dfd3;         /* the blocks */
  --block-store: #ead8c4;   /* the block of a store */
  --lot: #d9d0c1;           /* the thin lines between the buildings */
  --park: #dfe2d2;          /* the park */
  --water: #dde4e3;         /* the harbour */
  --hole: #d3c9b8;          /* the ground left behind when a block lifts */
  --side: #c9bca7;          /* the side of the lifted block */
  --card: #fffdf9;          /* the page of the store */
  --ink: #1d1a16;           /* the words */
  --muted: #7b7268;         /* the small words */
  --edge: rgba(40, 30, 18, 0.09); /* thin edges */
  --accent: #c4552c;        /* Fennick terracotta */
  --accent-soft: #f6e4d9;   /* the tint behind the open tag */
}

* {
  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;
}

button {
  font: inherit;
  color: inherit;
}

.stage {
  min-height: 100svh;
  height: 100svh;
  display: grid;
  place-items: center;
  padding: 12px;
  overflow: hidden;
  background:
    radial-gradient(70% 60% at 50% 40%, #faf7f2 0%, rgba(250, 247, 242, 0) 70%),
    var(--page);
}

.app {
  position: relative;
  width: min(92vw, 420px);
  height: min(calc(100svh - 24px), 560px);
  border-radius: 26px;
  overflow: hidden;
  background: var(--street);
  box-shadow:
    0 0 0 1px var(--edge),
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 2px 4px rgba(60, 40, 20, 0.05),
    0 18px 40px -12px rgba(60, 40, 20, 0.18),
    0 50px 90px -40px rgba(60, 40, 20, 0.25);
  isolation: isolate;
  opacity: 0;
}

/* the map */
.map {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.cam {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
  will-change: transform;
}

.map__svg {
  position: absolute;
  overflow: visible;
  --road: 7px;
  --avenue: 13px;
}

.map__svg .blk {
  fill: var(--block);
  stroke: var(--street);
  stroke-width: var(--road);
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
}

.map__svg .blk.is-store {
  fill: var(--block-store);
}

.map__svg .blk.is-park {
  fill: var(--park);
}

.map__svg .blk.is-gone {
  fill: var(--hole);
}

.map__svg .lot {
  stroke: var(--lot);
  stroke-width: 0.7px;
  vector-effect: non-scaling-stroke;
  fill: none;
}

.map__svg .tree {
  stroke: #c9cfb8;
  stroke-width: 0.8px;
  vector-effect: non-scaling-stroke;
  fill: none;
}

.map__svg .ave {
  stroke: var(--street);
  stroke-width: var(--avenue);
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  fill: none;
}

.map__svg .ave-line {
  stroke: #e7dfd2;
  stroke-width: 0.8px;
  stroke-dasharray: 5 6;
  vector-effect: non-scaling-stroke;
  fill: none;
}

.map__svg .water {
  fill: var(--water);
  stroke: var(--street);
  stroke-width: var(--road);
  vector-effect: non-scaling-stroke;
}

.map__svg .wave {
  stroke: #cfd9d8;
  stroke-width: 0.8px;
  vector-effect: non-scaling-stroke;
  fill: none;
}

.map__grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.32;
  mix-blend-mode: multiply;
  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='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.45 0 0 0 0 0.38 0 0 0 0 0.3 0 0 0 0.16 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.map__veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(80% 70% at 50% 50%, rgba(251, 248, 243, 0.2), rgba(236, 229, 218, 0.62));
  opacity: 0;
}

/* the pins: the wrapper sits on the store, inside the camera, and is scaled back so it keeps its size */
.pins {
  position: absolute;
  inset: 0;
}

.pin {
  position: absolute;
  width: 0;
  height: 0;
  z-index: 1;
}

.pin.is-on {
  z-index: 3;
}

.pin__hit {
  position: absolute;
  left: -22px;
  top: -46px;
  width: 44px;
  height: 52px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pin__hit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 12px;
}

.pin__body {
  position: absolute;
  left: -16px;
  top: -42px;
  width: 32px;
  height: 38px;
  transform-origin: 16px 40px;
  pointer-events: none;
}

.pin__shadow {
  position: absolute;
  left: -9px;
  top: -3px;
  width: 18px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(50, 32, 16, 0.32), rgba(50, 32, 16, 0));
  pointer-events: none;
}

.pin__drop {
  position: absolute;
  inset: 0;
  overflow: visible;
}

.pin__drop .pin__shape {
  fill: #fffdf9;
  stroke: rgba(40, 30, 18, 0.14);
  stroke-width: 1;
}

.pin__drop .pin__cup {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pin__fill {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.pin__fill .pin__shape {
  fill: var(--accent);
  stroke: rgba(0, 0, 0, 0.08);
}

.pin__fill .pin__cup {
  stroke: #fff8f1;
}

.pin__label {
  position: absolute;
  left: 0;
  top: -76px;
  transform: translateX(-50%);
  pointer-events: none;
}

.pin__label-in {
  display: block;
  white-space: nowrap;
  padding: 6px 10px 7px;
  border-radius: 999px;
  background: var(--ink);
  color: #f8f3ec;
  font-size: 12px;
  font-weight: 600;
  font-variation-settings: 'wdth' 104;
  letter-spacing: 0.005em;
  box-shadow: 0 6px 16px -6px rgba(30, 20, 10, 0.5);
  opacity: 0;
  transform-origin: 50% 100%;
}

.pin__label-in em {
  font-style: normal;
  color: #c4b8aa;
  font-weight: 500;
  margin-left: 6px;
}

/* the bar at the top and the foot */
.bar {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  z-index: 4;
  pointer-events: none;
}

.bar__brand,
.bar__search,
.foot__chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 13px 0 10px;
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.86);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  backdrop-filter: blur(10px) saturate(1.2);
  box-shadow: 0 0 0 1px var(--edge), 0 6px 18px -10px rgba(60, 40, 20, 0.35);
  font-size: 13px;
}

.bar__mark {
  width: 20px;
  height: 20px;
  fill: var(--accent);
  stroke: none;
}

.bar__mark path {
  fill: none;
  stroke: #fff8f1;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.bar__name {
  font-weight: 680;
  font-variation-settings: 'wdth' 108;
  letter-spacing: -0.01em;
}

.bar__search {
  flex: 1;
  min-width: 0;
  color: var(--muted);
}

.bar__search span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.bar__search svg {
  flex: none;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.foot {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 4;
  pointer-events: none;
}

.foot__chip {
  padding: 0 14px;
  font-weight: 560;
}

.foot__chip span {
  font-variant-numeric: tabular-nums;
}

.foot__scale {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.02em;
  margin-right: 4px;
}

.foot__scale i {
  display: block;
  width: 44px;
  height: 4px;
  border: 1px solid #b6ab9c;
  border-top: 0;
}

/* the block that lifts and becomes the page */
.lift {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 5;
  visibility: hidden;
  border-radius: 3px;
  background: var(--block-store);
  overflow: hidden;
  transform-origin: 50% 50%;
}

.page {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  padding: clamp(12px, 2.6vh, 18px) 18px clamp(14px, 2.8vh, 18px);
  gap: clamp(8px, 2vh, 14px);
}

.page__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 32px;
  padding: 0 12px 0 7px;
  border: 0;
  border-radius: 999px;
  background: #f3ede4;
  box-shadow: inset 0 0 0 1px var(--edge);
  font-size: 13px;
  font-weight: 560;
  cursor: pointer;
  transition: background-color 0.2s;
}

.back svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (hover: hover) {
  .back:hover {
    background: #ece4d8;
  }
}

.back:focus-visible,
.order:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.page__far {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.page__brand {
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.page__name {
  margin: 0;
  font-size: clamp(22px, 5.4vh, 30px);
  line-height: 1.02;
  font-weight: 680;
  font-variation-settings: 'wdth' 112;
  letter-spacing: -0.025em;
}

.page__addr {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.page__status {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
}

.tag {
  padding: 4px 9px 5px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #9b3d1a;
  font-weight: 620;
  font-size: 11.5px;
}

.tag.is-soon {
  background: #f0eadf;
  color: #6f5a3c;
}

.page__closes {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.hours {
  list-style: none;
  margin: 0;
  padding: 2px 0;
  border-top: 1px solid var(--edge);
  border-bottom: 1px solid var(--edge);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.hours li {
  position: relative;
  display: flex;
  justify-content: space-between;
  padding: clamp(4px, 1vh, 7px) 0;
  color: var(--muted);
}

.hours li + li {
  border-top: 1px dashed rgba(40, 30, 18, 0.07);
}

.hours li.is-today {
  color: var(--ink);
  font-weight: 620;
}

.hours li.is-today::before {
  content: '';
  position: absolute;
  left: -18px;
  top: 22%;
  bottom: 22%;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: var(--accent);
}

.page__order {
  margin-top: auto;
  display: grid;
  gap: 9px;
}

.page__wait {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}

.page__wait b {
  color: var(--ink);
  font-weight: 640;
  font-variant-numeric: tabular-nums;
}

.order {
  position: relative;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.order__face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: inherit;
  background: linear-gradient(180deg, #2a2520, #16130f);
  color: #fbf6ef;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 10px 22px -10px rgba(30, 20, 10, 0.6);
}

.order__words {
  font-size: 14.5px;
  font-weight: 620;
  font-variation-settings: 'wdth' 100;
  transition: font-variation-settings 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.order__icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (hover: hover) {
  .order:hover .order__words,
  .order.is-hover .order__words {
    font-variation-settings: 'wdth' 114;
  }
}

.order.is-hover .order__words {
  font-variation-settings: 'wdth' 114;
}

/* the drawn pointer of the autopilot */
.hand {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  z-index: 8;
  fill: #1d1a16;
  stroke: #fffdf9;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 3px 4px rgba(30, 20, 10, 0.28));
  pointer-events: none;
  opacity: 0;
  transform-origin: 5px 3px;
}
