:root {
  --fondo: #f2f2f2;
  --cornice: #16161a;
  --bordo: #2a2a30;
  --inchiostro: #17171c;
  --tenue: rgba(23, 23, 28, 0.56);
  --muro-1: #eef0f6;
  --muro-2: #f5efe9;
  --muro-a: #c9d6ff;
  --muro-b: #ffdccb;
  --muro-c: #d3efe2;
  --lago-1: #1f8a74;
  --lago-2: #0b4f45;
  --carta: #f7f7f3;
  --riga: rgba(23, 23, 28, 0.08);
  --accento: #13836c;
}

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

html, body { height: 100%; }

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

.stage {
  position: relative;
  height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
}

/* the phone: the script sets its size from the height and the width of the window, and one unit --s */
.phone {
  position: relative;
  border-radius: calc(var(--s, 1px) * 46);
  background: var(--cornice);
  padding: calc(var(--s, 1px) * 9);
  box-shadow:
    0 0 0 1px var(--bordo) inset,
    0 calc(var(--s, 1px) * 30) calc(var(--s, 1px) * 60) -20px rgba(20, 20, 30, 0.35),
    0 calc(var(--s, 1px) * 4) calc(var(--s, 1px) * 10) rgba(20, 20, 30, 0.12);
}
.phone::after {
  content: "";
  position: absolute; inset: 1px;
  border-radius: inherit;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.22), transparent 30%, transparent 70%, rgba(255, 255, 255, 0.08));
  pointer-events: none;
}
.phone__screen {
  position: relative;
  width: 100%; height: 100%;
  border-radius: calc(var(--s, 1px) * 38);
  overflow: hidden;
  background: var(--muro-1);
  touch-action: none;
}
.phone__notch {
  position: absolute;
  left: 50%; top: calc(var(--s, 1px) * 17);
  width: calc(var(--s, 1px) * 74); height: calc(var(--s, 1px) * 20);
  transform: translateX(-50%);
  border-radius: 999px;
  background: #0b0b0d;
  z-index: 6;
}

/* ---- the home screen ---- */
.home {
  position: absolute; inset: 0;
  background: linear-gradient(170deg, var(--muro-1), var(--muro-2));
  transform-origin: 50% 50%;
}
.wall i {
  position: absolute;
  border-radius: 50%;
  filter: blur(calc(var(--s, 1px) * 26));
  opacity: 0.85;
}
.wall__a { width: 70%; height: 40%; left: -18%; top: 8%; background: var(--muro-a); }
.wall__b { width: 66%; height: 38%; right: -20%; top: 40%; background: var(--muro-b); }
.wall__c { width: 70%; height: 34%; left: 6%; bottom: -8%; background: var(--muro-c); }

.status {
  z-index: 4;
  color: var(--inchiostro);
  position: absolute; left: 0; right: 0; top: 0;
  height: calc(var(--s, 1px) * 52);
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--s, 1px) * 6) calc(var(--s, 1px) * 26) 0;
  font-size: calc(var(--s, 1px) * 12.5);
  font-weight: 640;
  font-variant-numeric: lining-nums;
}
.status__icons { display: flex; gap: calc(var(--s, 1px) * 5); align-items: center; }
.status__icons svg { height: calc(var(--s, 1px) * 9.5); width: auto; fill: currentColor; }
.status__icons .s { fill: none; stroke: currentColor; stroke-width: 1.4; }

.app-icon {
  position: absolute; left: 0; top: 0;
  display: flex; flex-direction: column; align-items: center;
  cursor: pointer;
}
.app-icon__tile {
  position: relative;
  display: grid; place-items: center;
  border-radius: 23%;
  box-shadow: 0 calc(var(--s, 1px) * 3) calc(var(--s, 1px) * 7) rgba(20, 20, 40, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  overflow: hidden;
}
.app-icon__tile::before {
  /* the soft light at the top of every icon */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 55%);
}
.app-icon__tile svg {
  position: relative;
  width: 56%; height: 56%;
  fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.app-icon__tile svg .f { fill: #fff; stroke: none; }
.app-icon__name {
  margin-top: calc(var(--s, 1px) * 5);
  font-size: calc(var(--s, 1px) * 9);
  font-weight: 520;
  color: rgba(23, 23, 28, 0.78);
  white-space: nowrap;
}
.dock {
  position: absolute;
  border-radius: calc(var(--s, 1px) * 28);
  background: rgba(255, 255, 255, 0.42);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}
.dock .app-icon__name { display: none; }

/* ---- the app window ---- */
.sheet {
  position: absolute; left: 0; top: 0;
  overflow: hidden;
  visibility: hidden;
  z-index: 3;
  box-shadow: 0 calc(var(--s, 1px) * 18) calc(var(--s, 1px) * 40) -10px rgba(10, 30, 25, 0.35);
}
.sheet__splash {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(255, 255, 255, 0.18), transparent 60%),
    linear-gradient(165deg, var(--lago-1), var(--lago-2));
}
.sheet__glyph {
  position: absolute; left: 0; top: 0;
  width: 100px; height: 100px;
  z-index: 2;
}
.sheet__glyph svg {
  width: 100%; height: 100%;
  fill: none; stroke: #fff; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round;
  overflow: visible;
}
.sheet__glyph .g-sun { fill: #fff; stroke: none; }
.sheet__word {
  position: absolute; left: 0; right: 0;
  text-align: center;
  color: #fff;
  font-weight: 640;
  font-stretch: 112%;
  letter-spacing: 0.01em;
  z-index: 2;
}
.sheet__word span { display: inline-block; }

/* the first screen of the app, laid out on the whole screen */
.app {
  position: absolute; inset: 0;
  background: var(--carta);
  padding: calc(var(--s, 1px) * 58) calc(var(--s, 1px) * 20) 0;
  opacity: 0;
}
.app__head {
  display: flex; align-items: center; gap: calc(var(--s, 1px) * 8);
  height: calc(var(--s, 1px) * 30);
}
.app__logo-slot {
  width: calc(var(--s, 1px) * 26); height: calc(var(--s, 1px) * 26);
  border-radius: calc(var(--s, 1px) * 7);
  background: linear-gradient(165deg, var(--lago-1), var(--lago-2));
  opacity: 0;
}
.app__title { font-size: calc(var(--s, 1px) * 15); font-weight: 680; flex: 1; }
.app__avatar {
  width: calc(var(--s, 1px) * 26); height: calc(var(--s, 1px) * 26);
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: calc(var(--s, 1px) * 9); font-weight: 650;
  color: #6b4b2a; background: #f3ddc3;
}
.app__hello {
  margin-top: calc(var(--s, 1px) * 16);
  font-size: calc(var(--s, 1px) * 21);
  font-weight: 640;
  font-stretch: 108%;
  line-height: 1.12;
  letter-spacing: -0.01em;
}
.app__card {
  margin-top: calc(var(--s, 1px) * 13);
  padding: calc(var(--s, 1px) * 12) calc(var(--s, 1px) * 13);
  border-radius: calc(var(--s, 1px) * 16);
  background: #fff;
  box-shadow: 0 0 0 1px var(--riga), 0 calc(var(--s, 1px) * 8) calc(var(--s, 1px) * 18) -10px rgba(20, 40, 30, 0.2);
}
.app__kicker { font-size: calc(var(--s, 1px) * 8.5); font-weight: 600; color: var(--accento); letter-spacing: 0.02em; }
.app__entry { margin-top: calc(var(--s, 1px) * 5); font-size: calc(var(--s, 1px) * 11); line-height: 1.38; }
.app__meta { margin-top: calc(var(--s, 1px) * 9); display: flex; gap: calc(var(--s, 1px) * 5); align-items: center; }
.chip {
  font-size: calc(var(--s, 1px) * 8.5); font-weight: 560;
  padding: calc(var(--s, 1px) * 3) calc(var(--s, 1px) * 7);
  border-radius: 999px;
  background: #e8f3ef; color: #0f6b58;
}
.app__words { margin-left: auto; font-size: calc(var(--s, 1px) * 8.5); color: var(--tenue); }
.app__label {
  margin-top: calc(var(--s, 1px) * 16);
  font-size: calc(var(--s, 1px) * 9.5); font-weight: 620; color: var(--tenue);
  letter-spacing: 0.03em;
}
.app__list { list-style: none; margin-top: calc(var(--s, 1px) * 4); }
.app__list li {
  display: grid; grid-template-columns: 1fr auto;
  row-gap: calc(var(--s, 1px) * 1);
  padding: calc(var(--s, 1px) * 8) 0;
  border-bottom: 1px solid var(--riga);
}
.app__list b { font-size: calc(var(--s, 1px) * 10.5); font-weight: 640; }
.app__list span { grid-column: 1; font-size: calc(var(--s, 1px) * 9.5); color: var(--tenue); }
.app__list em { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-style: normal; font-size: calc(var(--s, 1px) * 8.5); color: var(--tenue); }
.app__photos {
  margin-top: calc(var(--s, 1px) * 7);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: calc(var(--s, 1px) * 6);
}
.ph {
  position: relative;
  aspect-ratio: 1;
  border-radius: calc(var(--s, 1px) * 10);
  overflow: hidden;
}
.ph::after {
  /* a low hill line on every photo */
  content: ""; position: absolute; left: -10%; right: -10%; bottom: -20%; height: 55%;
  border-radius: 50% 50% 0 0;
  background: rgba(0, 0, 0, 0.16);
}
.ph--a { background: linear-gradient(170deg, #cfe3ea, #7fb0b8); }
.ph--b { background: linear-gradient(170deg, #f6d8b8, #c98a6a); }
.ph--c { background: linear-gradient(170deg, #dfe6d2, #8fa77a); }
.ph--d { background: linear-gradient(170deg, #d9d6ef, #8a86b8); }
.app__tabs {
  position: absolute; left: calc(var(--s, 1px) * 14); right: calc(var(--s, 1px) * 14); bottom: calc(var(--s, 1px) * 24);
  display: flex; justify-content: space-around;
  padding: calc(var(--s, 1px) * 7) 0;
  border-radius: calc(var(--s, 1px) * 20);
  background: #fff;
  box-shadow: 0 0 0 1px var(--riga);
}
.app__tabs span { display: flex; flex-direction: column; align-items: center; gap: calc(var(--s, 1px) * 2); font-size: calc(var(--s, 1px) * 8); color: var(--tenue); }
.app__tabs span.is-on { color: var(--accento); font-weight: 620; }
.app__tabs svg { width: calc(var(--s, 1px) * 16); height: calc(var(--s, 1px) * 16); fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---- the home indicator ---- */
.indicator {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: calc(var(--s, 1px) * 22);
  display: grid; place-items: center;
  z-index: 5;
  cursor: grab;
}
.indicator i {
  width: calc(var(--s, 1px) * 92); height: calc(var(--s, 1px) * 4.5);
  border-radius: 99px;
  background: rgba(23, 23, 28, 0.82);
}

.ghost {
  position: absolute; left: 0; top: 0;
  width: 26px; height: 26px;
  fill: #111; stroke: #fff; stroke-width: 1.4; stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
  pointer-events: none;
  opacity: 0;
  z-index: 8;
}
