:root {
  --fondo: #ebe9e4;
  --inchiostro: #17171a;
  --grigio: #8b8a86;
  --accento: #ff5b2e;
  --metallo-1: #d9dbdf;
  --metallo-2: #8e9198;
  --metallo-3: #f6f7f9;
  --schermo: #fbfaf8;
  --h: min(76vh, 132vw);
  --w: calc(var(--h) * 0.486);
  --r: calc(var(--h) * 0.092);
  --sheen: 50%;
}

* { box-sizing: border-box; margin: 0; }

html, body { height: 100%; overflow: hidden; }

body {
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.stage {
  position: relative;
  height: 100vh;
  display: grid;
  place-items: center;
  overflow: clip;
  touch-action: none;
  cursor: grab;
  user-select: none;
  background:
    radial-gradient(60% 50% at 50% 42%, #f6f5f1 0%, transparent 70%),
    var(--fondo);
}

.stage.is-holding { cursor: grabbing; }

.scene {
  position: relative;
  width: var(--w);
  height: var(--h);
  perspective: calc(var(--h) * 3.4);
  margin-top: calc(var(--h) * -0.04);
}

.shadow {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: calc(var(--h) * -0.075);
  height: calc(var(--h) * 0.07);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(20, 20, 24, 0.34), rgba(20, 20, 24, 0));
  filter: blur(6px);
  pointer-events: none;
}

.tilt,
.phone {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.edges { position: absolute; inset: 0; transform-style: preserve-3d; }

.edge {
  position: absolute;
  inset: 0;
  border-radius: var(--r);
  background: linear-gradient(115deg, var(--metallo-2) 0%, var(--metallo-1) 30%, var(--metallo-3) 46%, var(--metallo-1) 56%, var(--metallo-2) 82%, #6f727a 100%);
  background-size: 320% 100%;
  background-position: var(--sheen) 0;
}

/* the side buttons stick out of the middle layers only, so they show from the side when the phone turns */
.edge__btn {
  position: absolute;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, #a5a8ae, #e8e9ec 50%, #8a8d94);
}

.edge__btn--power { right: -2.5px; top: 27%; height: 13%; }
.edge__btn--vol1 { left: -2.5px; top: 22%; height: 8%; }
.edge__btn--vol2 { left: -2.5px; top: 32%; height: 8%; }

.back {
  position: absolute;
  inset: 0;
  border-radius: var(--r);
  background: linear-gradient(160deg, #cfd1d5, #b8bbc1 60%, #a7aab1);
  transform: translateZ(calc(var(--depth, 12px) * -1)) rotateY(180deg);
  backface-visibility: hidden;
}

.back__cam {
  position: absolute;
  top: 5%;
  left: 7%;
  width: 34%;
  aspect-ratio: 1;
  border-radius: 28%;
  background: #9fa2a9;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.back__cam i {
  position: absolute;
  width: 38%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #4b4f58, #111216 60%);
  box-shadow: 0 0 0 2px #7d8088;
}

.back__cam i:nth-child(1) { top: 9%; left: 9%; }
.back__cam i:nth-child(2) { bottom: 9%; left: 9%; }
.back__cam i:nth-child(3) { top: 31%; right: 9%; width: 26%; }

.back__logo {
  position: absolute;
  left: 0;
  right: 0;
  top: 52%;
  text-align: center;
  font-size: calc(var(--h) * 0.03);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.55);
}

.front {
  position: absolute;
  inset: 0;
  border-radius: var(--r);
  background: #0c0c0e;
  padding: calc(var(--h) * 0.016);
  backface-visibility: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: calc(var(--r) - var(--h) * 0.016);
  background: var(--schermo);
  overflow: hidden;
  font-size: calc(var(--h) * 0.0315);
}

.island {
  position: absolute;
  top: 2.2%;
  left: 50%;
  width: 30%;
  height: 4.2%;
  translate: -50% 0;
  border-radius: 99px;
  background: #0c0c0e;
  z-index: 3;
}

.status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3.2% 9% 0;
  font-size: 0.78em;
  font-weight: 600;
}

.status svg { width: 2.6em; height: 0.8em; fill: currentColor; }

.app { padding: 9% 7% 0; }

.app__head { display: flex; flex-direction: column; gap: 0.15em; }

.app__hello { font-size: 0.82em; color: var(--grigio); font-weight: 500; }

.app__brand {
  font-size: 1.55em;
  font-weight: 640;
  font-stretch: 112%;
  letter-spacing: -0.02em;
}

.card {
  margin-top: 6%;
  padding: 7% 7% 5%;
  border-radius: 1em;
  background: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04), 0 6px 16px -10px rgba(20, 20, 30, 0.35);
}

.card__top { display: flex; justify-content: space-between; align-items: baseline; }

.card__label { font-size: 0.74em; color: var(--grigio); font-weight: 500; }

.card__km { font-size: 0.74em; color: var(--grigio); }

.card__km b { font-size: 1.6em; color: var(--inchiostro); font-weight: 650; }

.chart { display: block; width: 100%; height: 3.6em; margin-top: 0.5em; overflow: visible; }

.chart__grid { stroke: #ecebe7; stroke-width: 1; fill: none; vector-effect: non-scaling-stroke; }

.chart__area { fill: color-mix(in srgb, var(--accento) 14%, transparent); }

.chart__line { fill: none; stroke: var(--accento); stroke-width: 2; stroke-linecap: round; vector-effect: non-scaling-stroke; }

.chart__tip { fill: #fff; stroke: var(--accento); stroke-width: 2; vector-effect: non-scaling-stroke; }

.days {
  display: flex;
  justify-content: space-between;
  margin-top: 0.4em;
  font-size: 0.62em;
  color: #b2b1ad;
  font-weight: 500;
}

.list__title { margin: 7% 0 3%; font-size: 0.74em; color: var(--grigio); font-weight: 500; }

.list {
  height: 9.2em;
  overflow: hidden;
  mask-image: linear-gradient(180deg, transparent 0, #000 12%, #000 80%, transparent 100%);
}

.row {
  display: flex;
  align-items: center;
  gap: 0.7em;
  padding: 0.55em 0;
  border-bottom: 1px solid #efeeea;
}

.row__icon {
  flex: none;
  width: 2em;
  height: 2em;
  border-radius: 0.6em;
  display: grid;
  place-items: center;
  background: #f2f1ed;
}

.row__icon svg { width: 1.1em; height: 1.1em; fill: none; stroke: var(--inchiostro); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

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

.row__name { font-size: 0.82em; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.row__meta { font-size: 0.66em; color: var(--grigio); }

.row__km { font-size: 0.82em; font-weight: 600; }

.tabs {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-around;
  padding: 3.5% 12% 7%;
  background: linear-gradient(180deg, rgba(251, 250, 248, 0), var(--schermo) 40%);
}

.tabs svg { width: 1.3em; height: 1.3em; fill: none; stroke: #b9b8b3; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.tabs svg:nth-child(2) { stroke: var(--accento); }

/* the glass: a soft diagonal reflection that slides against the tilt */
.glare {
  position: absolute;
  inset: -40%;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, 0.62) 46%, rgba(255, 255, 255, 0.18) 52%, rgba(255, 255, 255, 0) 60%);
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 4;
}

.hint {
  position: absolute;
  bottom: max(3.5vh, 10px);
  left: 0;
  right: 0;
  text-align: center;
  font-size: clamp(11px, 1.6vh, 14px);
  letter-spacing: 0.02em;
  color: var(--grigio);
  font-weight: 500;
}

.pointer {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  fill: #fff;
  stroke: var(--inchiostro);
  stroke-width: 1.4;
  stroke-linejoin: round;
  pointer-events: none;
  opacity: 0;
  z-index: 20;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.18));
}

@media (prefers-reduced-motion: reduce) {
  .stage { cursor: default; }
}
