/* The taxi notification in the dynamic island: the top of a titanium phone on a near black page, with a warm light
   behind it and a fine grain. Every size is a share of --w (the width of the phone) through --u, so the phone and the
   island keep their proportions from the phone box to a wide screen. The island's shape ([data-island]) is moved by
   GSAP only in width, height and radius, its button ([data-press]) only in scale. */
:root {
  --page: #09090a;           /* the page */
  --island: #000000;         /* the island */
  --ink: #f5f4f0;            /* the words in the island */
  --muted: #8f8d88;          /* the small words */
  --accent: #ffc83d;         /* the taxi yellow */
  --plate: #f3efe3;          /* the number plate */
  --plate-ink: #111111;      /* its letters */
  --ti-light: #c9c4bb;       /* the titanium in the light */
  --ti-dark: #5f5b55;        /* the titanium in the shadow */
  --w: min(740px, 92vw, 130vh);
  --u: calc(var(--w) / 370);
}

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

.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;
  padding: 16px;
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(120% 80% at 50% 0%, #17150f 0%, var(--page) 60%);
}

/* the lights behind: a warm one behind the top of the phone, a cold one low on the left */
.aura {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}

.aura span {
  position: absolute;
  border-radius: 50%;
  filter: blur(min(10vw, 10vh, 80px));
}

.aura__a {
  left: calc(50% - min(30vw, 30vh, 260px));
  top: calc(50% - min(34vh, 30vw, 230px));
  width: min(60vw, 60vh, 520px);
  height: min(30vw, 30vh, 240px);
  background: color-mix(in srgb, var(--accent) 34%, transparent);
  opacity: var(--warm, 0.4);
}

.aura__b {
  left: calc(50% - min(48vw, 56vh, 420px));
  top: calc(50% + min(4vh, 4vw, 30px));
  width: min(40vw, 40vh, 320px);
  height: min(24vw, 24vh, 180px);
  background: rgba(110, 140, 255, 0.3);
  opacity: 0.45;
}

.grain {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0.08;
  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");
}

/* the top of the phone: it fades out at the bottom, as if the picture were cropped */
.phone {
  position: relative;
  width: var(--w);
  height: calc(250 * var(--u));
  -webkit-mask-image: linear-gradient(180deg, #000 62%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 62%, transparent 100%);
}

.phone__frame {
  position: absolute;
  left: calc(2 * var(--u));
  right: calc(2 * var(--u));
  top: 0;
  bottom: calc(-60 * var(--u));
  border-radius: calc(64 * var(--u)) calc(64 * var(--u)) 0 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 8%),
    linear-gradient(90deg, var(--ti-dark) 0%, var(--ti-light) 3%, #9c978f 9%, #b4afa6 50%, #9c978f 91%, var(--ti-light) 97%, var(--ti-dark) 100%);
  box-shadow:
    inset 0 0 0 calc(0.6 * var(--u)) rgba(255, 255, 255, 0.35),
    inset 0 calc(1.2 * var(--u)) 0 rgba(255, 255, 255, 0.5),
    0 calc(30 * var(--u)) calc(60 * var(--u)) calc(-10 * var(--u)) rgba(0, 0, 0, 0.8),
    0 calc(4 * var(--u)) calc(10 * var(--u)) rgba(0, 0, 0, 0.5);
}

/* the brushed lines of the titanium */
.phone__frame::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 1px, rgba(0, 0, 0, 0.04) 1px 2px, transparent 2px 4px);
  mix-blend-mode: overlay;
}

.phone__key {
  position: absolute;
  width: calc(3 * var(--u));
  border-radius: calc(2 * var(--u));
  background: linear-gradient(90deg, var(--ti-dark), var(--ti-light) 60%, #8a857e);
}

.phone__key--action {
  left: 0;
  top: calc(118 * var(--u));
  height: calc(26 * var(--u));
}

.phone__key--up {
  left: 0;
  top: calc(170 * var(--u));
  height: calc(46 * var(--u));
}

.phone__key--side {
  right: 0;
  top: calc(150 * var(--u));
  height: calc(70 * var(--u));
  transform: scaleX(-1);
}

.screen {
  position: absolute;
  inset: calc(7 * var(--u)) calc(7 * var(--u)) 0;
  border: calc(4.5 * var(--u)) solid #050505;
  border-bottom: 0;
  border-radius: calc(57 * var(--u)) calc(57 * var(--u)) 0 0;
  overflow: hidden;
  background: #0b0a09;
  box-shadow: 0 0 0 calc(0.5 * var(--u)) rgba(0, 0, 0, 0.6);
}

.screen__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.screen__glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0) 32%, rgba(255, 255, 255, 0) 70%, rgba(255, 255, 255, 0.04) 100%);
}

/* the status bar */
.bar {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: calc(52 * var(--u));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 calc(26 * var(--u)) 0 calc(34 * var(--u));
  color: #fff;
  font-size: calc(15 * var(--u));
  font-weight: 600;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}

.bar__icons {
  display: flex;
  align-items: center;
  gap: calc(5 * var(--u));
}

.bar__icons svg {
  height: calc(11 * var(--u));
  width: auto;
  fill: currentColor;
}

.bar__icons svg:last-child {
  height: calc(12 * var(--u));
}

/* the island */
.slot {
  position: absolute;
  left: 50%;
  top: calc(10 * var(--u));
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
}

.press {
  grid-area: 1 / 1;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: calc(20 * var(--u));
  -webkit-tap-highlight-color: transparent;
}

.press:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.island {
  position: relative;
  display: block;
  width: calc(118 * var(--u));
  height: calc(35 * var(--u));
  border-radius: calc(17.5 * var(--u));
  background: var(--island);
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 calc(2 * var(--u)) calc(6 * var(--u)) rgba(0, 0, 0, 0.35),
    0 calc(14 * var(--u)) calc(30 * var(--u)) calc(-8 * var(--u)) rgba(0, 0, 0, 0.6);
}

/* a whisper of light on the top edge of the black glass, and a warm glow where the car drives */
.island__sheen {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0) calc(14 * var(--u))),
    radial-gradient(calc(140 * var(--u)) calc(60 * var(--u)) at var(--gx, 20%) 100%, rgba(255, 200, 61, var(--glow, 0)), transparent 70%);
}

.ring {
  grid-area: 1 / 1;
  width: calc(270 * var(--u));
  height: calc(35 * var(--u));
  border-radius: calc(17.5 * var(--u));
  border: calc(1.4 * var(--u)) solid var(--accent);
  opacity: 0;
  pointer-events: none;
}

.face {
  position: absolute;
  inset: 0;
  display: flex;
  opacity: 0;
  visibility: hidden;
  white-space: nowrap;
}

.face--compact,
.face--here {
  align-items: center;
  justify-content: space-between;
  padding: 0 calc(14 * var(--u)) 0 calc(9 * var(--u));
  font-size: calc(13.5 * var(--u));
  font-weight: 600;
}

.lead {
  display: flex;
  align-items: center;
  gap: calc(7 * var(--u));
}

.glyph {
  width: calc(23 * var(--u));
  height: calc(23 * var(--u));
  color: var(--accent);
  flex: none;
}

.trail {
  display: flex;
  align-items: baseline;
  gap: calc(3 * var(--u));
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.trail__unit {
  font-weight: 500;
}

/* a drum of minutes: a window one line tall over a column of numbers */
.drum {
  position: relative;
  display: inline-block;
  height: 1.15em;
  line-height: 1.15em;
  overflow: hidden;
  vertical-align: bottom;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 78%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 78%, transparent 100%);
}

.drum__col {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.face--big {
  flex-direction: column;
  padding: calc(17 * var(--u)) calc(20 * var(--u)) calc(14 * var(--u));
}

.big__top {
  display: flex;
  align-items: center;
  gap: calc(12 * var(--u));
}

.brand {
  flex: none;
  width: calc(40 * var(--u));
  height: calc(40 * var(--u));
  border-radius: calc(12 * var(--u));
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #ffd765, var(--accent) 55%, #e9a91a);
  box-shadow: inset 0 calc(1 * var(--u)) 0 rgba(255, 255, 255, 0.5), inset 0 calc(-1 * var(--u)) 0 rgba(0, 0, 0, 0.18);
}

.brand svg {
  width: 58%;
  height: 58%;
  fill: none;
  stroke: #141006;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.eta {
  display: flex;
  flex-direction: column;
  gap: calc(1 * var(--u));
  min-width: 0;
}

.eta__label {
  font-size: calc(11.5 * var(--u));
  color: var(--muted);
  font-weight: 500;
}

.eta__num {
  display: flex;
  align-items: baseline;
  gap: calc(4 * var(--u));
  font-size: calc(30 * var(--u));
  font-weight: 700;
  font-stretch: 92%;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.eta__unit {
  font-size: calc(15 * var(--u));
  font-weight: 500;
  color: var(--ink);
  opacity: 0.7;
  letter-spacing: 0;
}

.car-id {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: calc(6 * var(--u));
}

.plate {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: calc(22 * var(--u));
  padding: 0 calc(8 * var(--u)) 0 calc(13 * var(--u));
  border-radius: calc(5 * var(--u));
  overflow: hidden;
  background: linear-gradient(180deg, #fffdf6, var(--plate));
  color: var(--plate-ink);
  font-size: calc(12.5 * var(--u));
  font-weight: 700;
  font-stretch: 112%;
  letter-spacing: 0.06em;
  box-shadow: inset 0 0 0 calc(0.8 * var(--u)) rgba(0, 0, 0, 0.25), 0 calc(1 * var(--u)) calc(3 * var(--u)) rgba(0, 0, 0, 0.5);
}

.plate__band {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: calc(5 * var(--u));
  background: #2a4fb0;
}

.car-id__model {
  font-size: calc(11.5 * var(--u));
  color: var(--muted);
  font-weight: 500;
}

/* the road: a thin line with small marks, the stretch already driven in yellow, the pickup pin at the end */
.track {
  position: relative;
  display: block;
  height: calc(30 * var(--u));
  margin-top: calc(16 * var(--u));
}

.track__line,
.track__fill {
  position: absolute;
  left: 0;
  right: calc(22 * var(--u));
  top: 50%;
  height: max(1px, calc(1 * var(--u)));
  border-radius: 1px;
}

.track__line {
  background: rgba(255, 255, 255, 0.16);
}

.track__fill {
  background: linear-gradient(90deg, rgba(255, 200, 61, 0.1), var(--accent));
  transform-origin: left center;
  transform: scaleX(0);
}

.track__ticks {
  position: absolute;
  left: 0;
  right: calc(22 * var(--u));
  top: 50%;
}

.tick {
  position: absolute;
  top: calc(-3 * var(--u));
  width: max(1px, calc(1 * var(--u)));
  height: calc(6 * var(--u));
  background: rgba(255, 255, 255, 0.22);
  border-radius: 1px;
}

.pin {
  position: absolute;
  right: 0;
  top: 50%;
  width: calc(22 * var(--u));
  height: calc(22 * var(--u));
  margin-top: calc(-17 * var(--u));
}

.pin svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: var(--accent);
}

.pin .pin__core {
  fill: #000;
}

.car {
  position: absolute;
  left: 0;
  top: 50%;
  width: calc(38 * var(--u));
  height: calc(19 * var(--u));
  margin-top: calc(-9.5 * var(--u));
}

.car__body {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.car__shadow {
  position: absolute;
  left: 4%;
  right: 4%;
  top: 18%;
  bottom: -4%;
  border-radius: 40%;
  background: rgba(0, 0, 0, 0.9);
  filter: blur(calc(3 * var(--u)));
}

/* the headlights on the road ahead */
.car__beam {
  position: absolute;
  left: 96%;
  top: 50%;
  width: calc(36 * var(--u));
  height: calc(22 * var(--u));
  margin-top: calc(-11 * var(--u));
  background: radial-gradient(ellipse at 0% 50%, rgba(255, 244, 214, 0.32), rgba(255, 244, 214, 0) 70%);
  pointer-events: none;
}

.big__foot {
  display: flex;
  justify-content: space-between;
  margin-top: calc(10 * var(--u));
  font-size: calc(11.5 * var(--u));
  font-weight: 500;
  color: var(--muted);
}

.foot__away span {
  color: var(--ink);
}

.here__plate {
  height: calc(18 * var(--u));
  display: inline-flex;
  align-items: center;
  padding: 0 calc(6 * var(--u));
  border-radius: calc(4 * var(--u));
  background: var(--plate);
  color: var(--plate-ink);
  font-size: calc(10.5 * var(--u));
  font-weight: 700;
  font-stretch: 112%;
  letter-spacing: 0.05em;
}

@media (hover: hover) {
  .press:hover .island__sheen {
    filter: brightness(1.6);
  }
}
