/*
 * When something stops the experience (the globe can't be drawn, a gift link is cut short, a page isn't
 * there): one quiet screen in the intro's own look. The night behind the globe, the globe's lit edge low in
 * the window, a large mark drawn in a hairline behind (404, a route with a piece missing, or the globe
 * unlit), one line in Manrope and the one way on, named for what it does.
 */

.notice {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 32px;
  overflow: hidden;
  text-align: center;
  color: #f3efe6;
  background: radial-gradient(ellipse 70% 60% at 50% 45%, #10141c 0%, #06080c 70%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.9s ease, visibility 0s 0.9s;
}

.notice.on {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.9s ease;
}

/* the globe's lit edge, low in the window (not when the globe itself is the mark) */
.notice::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 74vh;
  width: max(210vw, 1500px);
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle at 50% 0%, #0b1018 0%, #05070a 18%);
  box-shadow: inset 0 1px 0 rgba(170, 200, 255, 0.3), inset 0 18px 40px -26px rgba(110, 160, 230, 0.35),
    0 -20px 140px -30px rgba(90, 140, 230, 0.3);
}

.notice:has(.globe:not([hidden]))::before {
  display: none;
}

.notice h1 {
  position: relative;
  max-width: 16em;
  margin: 0;
  font: 600 44px/1.15 'Manrope', system-ui, sans-serif;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

.notice p {
  position: relative;
  max-width: 34em;
  margin: 14px 0 0;
  color: rgba(243, 239, 230, 0.72);
  font: 500 17px/1.55 'Manrope', system-ui, sans-serif;
}

.notice a,
.notice button {
  position: relative;
  height: 52px;
  margin-top: 34px;
  padding: 0 30px 0 26px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #f3efe6;
  font: 600 15px/1 'Manrope', system-ui, sans-serif;
  letter-spacing: 0.03em;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.14),
    0 24px 60px -22px rgba(90, 140, 230, 0.6);
  cursor: pointer;
  transition: background 0.3s ease, transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* hover looks only for a pointer that hovers: a tap on a phone left them on (sticky) */
@media (hover: hover) {
  .notice a:hover,
  .notice button:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-2px);
  }
}

.notice a:focus-visible,
.notice button:focus-visible {
  outline: 1.5px solid rgba(170, 200, 255, 0.9);
  outline-offset: 3px;
}

.notice a svg,
.notice button svg {
  width: 16px;
  height: 16px;
  opacity: 0.8;
}

/* the mark behind the words: drawn like the routes' pen lines */
.notice .mark {
  position: absolute;
  inset: 0 0 6vh;
  display: grid;
  place-items: center;
  pointer-events: none;
  user-select: none;
}

.notice .digits {
  font: 700 min(38vw, 66vh) / 1 'Manrope', system-ui, sans-serif;
  letter-spacing: -0.01em;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1.2px rgba(243, 239, 230, 0.2);
  /* the lines step back where the words are */
  -webkit-mask: radial-gradient(ellipse min(40vw, 500px) min(24vh, 200px) at 50% 54.5%, transparent 45%, #000);
  mask: radial-gradient(ellipse min(40vw, 500px) min(24vh, 200px) at 50% 54.5%, transparent 45%, #000);
}

/* a route between two cities with a piece missing at its height */
.notice .arc svg {
  width: min(78vw, 1100px);
  fill: none;
  stroke: rgba(243, 239, 230, 0.22);
  stroke-width: 1.4;
  stroke-dasharray: 43 14 43;
  transform: translateY(-6vh);
}

.notice .arc circle {
  fill: rgba(243, 239, 230, 0.32);
  stroke: none;
}

/* the globe, unlit: its outline and a faint breath of atmosphere */
.notice .globe::before {
  content: '';
  width: min(56vw, 82vh);
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.2px rgba(243, 239, 230, 0.18), 0 0 120px -20px rgba(90, 140, 230, 0.28);
  transform: translateY(3vh);
}

.notice [hidden] {
  display: none;
}

/* a phone held sideways (src/shared/phone.js): the same screen, its words and button a size smaller */
@media (orientation: landscape) and (max-height: 500px) {
  .notice {
    padding: 16px max(32px, env(safe-area-inset-left), env(safe-area-inset-right));
  }
  .notice h1 {
    font-size: 30px;
  }
  .notice p {
    margin-top: 10px;
    font-size: 15px;
  }
  .notice a,
  .notice button {
    height: 46px;
    margin-top: 20px;
  }
}

/* a phone upright: the numeral above the words, the others wider */
@media (max-width: 600px) {
  .notice h1 {
    font-size: 31px;
  }
  .notice p {
    font-size: 16px;
  }
  .notice .digits {
    place-items: start center;
    padding-top: 16vh;
    font-size: 52vw;
    -webkit-text-stroke-width: 1px;
    -webkit-mask: none;
    mask: none;
  }
  .notice .arc svg {
    width: 112vw;
    margin-inline: -6vw;
    transform: translateY(-17vh);
  }
  .notice .globe::before {
    width: 118vw;
    margin-inline: -9vw;
  }
}

@media (prefers-reduced-motion: reduce) {
  .notice,
  .notice.on,
  .notice a,
  .notice button {
    transition: none;
  }
  .notice a:hover,
  .notice button:hover {
    transform: none;
  }
}
