/* The swelling lens: a list of services on the left, the picture on the right; on a phone the picture goes first */
:root {
  --paper: #efebe4;
  --ink: #1e2a24;
  --ink-soft: #5b655f;
  --line: rgba(30, 42, 36, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page {
  min-height: 100svh;
  padding: clamp(18px, 3.4vh, 32px) clamp(20px, 4vw, 56px) 40px;
}

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

.brand {
  margin: 0;
  font-size: 19px;
  font-weight: 720;
  font-stretch: 108%;
  letter-spacing: -0.02em;
}

.top__line {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.services {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1.05fr);
  align-items: center;
  gap: clamp(28px, 6vw, 96px);
  min-height: calc(100svh - 120px);
}

.services__title {
  margin: 0 0 clamp(20px, 4vh, 40px);
  font-size: clamp(40px, 6vw, 78px);
  font-weight: 700;
  font-stretch: 106%;
  letter-spacing: -0.04em;
  line-height: 0.98;
}

.list {
  position: relative;
  display: grid;
  gap: 4px;
  max-width: 440px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* the dark pill over the chosen service: one element that slides, a window on a light copy of the list */
.list__pill {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  height: 56px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--ink);
  pointer-events: none;
  isolation: isolate;
}

.list__copy {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  gap: 4px;
}

.list__copy .item {
  color: #f4f1ea;
}

/* in the copy every arrow is already turned: the window only ever shows the chosen one */
.list__copy .item__arrow {
  transform: rotate(-45deg);
}

.item {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 56px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  font-weight: 560;
  font-stretch: 104%;
  cursor: pointer;
}

.item:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.item__arrow {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.services__note {
  max-width: 34ch;
  margin: clamp(24px, 4vh, 40px) 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.45;
}

.panel {
  position: relative;
  margin: 0;
}

.panel__canvas {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: calc(100svh - 150px);
  border-radius: 22px;
  background: #d9d2c6;
  touch-action: none;
}

.panel__caption {
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 13px;
}

@media (max-width: 760px) {
  .services {
    grid-template-columns: 1fr;
    gap: 22px;
    padding-top: 18px;
  }

  .panel {
    order: -1;
  }

  .panel__canvas {
    aspect-ratio: 5 / 4;
    max-height: 46svh;
    touch-action: pan-y;
  }

  .services__title {
    font-size: 40px;
  }
}

/* una casella bassa e stretta (l'anteprima sul telefono, 341 per 410): come sul computer, la lista a sinistra e la
   figura a destra, tutto un po' più piccolo, così sta in altezza senza rimpicciolirsi */
@media (max-width: 760px) and (max-height: 520px) {
  .page {
    padding: 12px 18px 12px;
  }

  .services {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
    gap: 14px;
    padding-top: 12px;
    min-height: calc(100vh - 56px);
  }

  .panel {
    order: 0;
  }

  .panel__canvas {
    aspect-ratio: 3 / 4;
    max-height: calc(100vh - 110px);
    border-radius: 16px;
  }

  .panel__caption {
    margin-top: 8px;
    font-size: 12px;
  }

  .services__title {
    margin-bottom: 12px;
    font-size: 28px;
  }

  .list,
  .list__copy {
    gap: 2px;
  }

  .item,
  .list__pill {
    height: 42px;
  }

  .item {
    padding: 0 12px 0 14px;
    font-size: 15px;
  }

  .item__arrow {
    width: 16px;
    height: 16px;
  }

  .services__note {
    margin-top: 14px;
    font-size: 12px;
    line-height: 1.4;
  }
}
