:root {
  --fondo: #f6f3ee;
  --inchiostro: #121214;
  --grigio: #77736c;
  --grigio-chiaro: #a8a49c;
  --bordo: rgba(18, 18, 20, 0.08);
  --scheda: #ffffff;
  --cornice: #17171a;
  --alluminio: #d9d7d3;
  --alluminio-scuro: #b9b6b0;
  --accento: #4f46e5;
  /* the three invented sites */
  --negozio: #e9572b;
  --negozio-fondo: #fbf4ec;
  --portfolio: #111111;
  --portfolio-fondo: #f2f2ef;
  --blog: #2f6b5a;
  --blog-fondo: #f7f5ef;
}

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

html, body { height: 100%; }

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

button { font: inherit; color: inherit; }

.palco {
  position: relative;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  padding: clamp(14px, 4vh, 40px) 16px clamp(14px, 4.5vh, 44px);
  gap: clamp(6px, 2vh, 18px);
  overflow: hidden;
}

/* a soft warm light behind the devices */
.palco::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 52%;
  width: min(900px, 140vw);
  height: min(620px, 90vh);
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.testa { position: relative; text-align: center; }

.occhiello {
  font-size: clamp(10px, 1.6vh, 12px);
  font-weight: 560;
  letter-spacing: 0.02em;
  color: var(--accento);
  margin-bottom: clamp(2px, 0.8vh, 6px);
}

.titolo {
  font-size: clamp(17px, min(4vw, 4.6vh), 34px);
  font-weight: 660;
  font-stretch: 105%;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

.titolo .grigio { color: var(--grigio-chiaro); }

/* the scene is drawn at a fixed size and scaled by the script to fit the free space */
.scena-box {
  position: relative;
  width: 100%;
  min-height: 0;
  height: 100%;
}

.scena {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 660px;
  height: 420px;
  flex: none;
  perspective: 1600px;
  transform-origin: 50% 50%;
}

/* ---- the laptop ---- */
.portatile {
  position: absolute;
  left: 12px;
  top: 14px;
  width: 520px;
  transform-style: preserve-3d;
  transform: rotateY(-14deg) rotateX(5deg);
  transform-origin: 50% 90%;
}

.coperchio {
  position: relative;
  width: 520px;
  height: 336px;
  padding: 12px 12px 16px;
  border-radius: 16px 16px 6px 6px;
  background: var(--cornice);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.schermo {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
  isolation: isolate;
}

.barra {
  position: relative;
  z-index: 3;
  height: 26px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  background: #f4f3f1;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.frecce { display: flex; gap: 2px; }
.frecce svg { width: 12px; height: 12px; fill: none; stroke: #9a968f; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.indirizzo {
  flex: 1;
  height: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 6px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
  font-size: 9px;
  color: #6b675f;
  overflow: hidden;
}

.indirizzo svg { width: 9px; height: 9px; fill: none; stroke: #9a968f; stroke-width: 1.4; }

.url { display: inline-flex; overflow: hidden; height: 12px; line-height: 12px; }
.url .c { display: inline-block; white-space: pre; }

.barra-vuoto { width: 26px; }

.pagine {
  position: absolute;
  inset: 26px 0 0 0;
  overflow: hidden;
}

.schermo--tel .pagine { inset: 0; }

.pagina {
  position: absolute;
  inset: 0;
  overflow: hidden;
  transform-origin: 50% 0%;
  will-change: transform;
}

/* the glass: a soft diagonal sheen over each screen */
.riflesso {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: linear-gradient(118deg, rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, 0.16) 46%, rgba(255, 255, 255, 0) 58%);
  mix-blend-mode: screen;
}

.base {
  position: relative;
  width: 600px;
  height: 14px;
  margin-left: -40px;
  border-radius: 2px 2px 14px 14px;
  background: linear-gradient(var(--alluminio), var(--alluminio-scuro));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 1px 0 rgba(0, 0, 0, 0.06);
}

.incavo {
  position: absolute;
  left: 50%;
  top: 0;
  width: 92px;
  height: 6px;
  transform: translateX(-50%);
  border-radius: 0 0 8px 8px;
  background: linear-gradient(#bdbab4, #cfcdc8);
}

.ombra {
  position: absolute;
  left: -30px;
  right: -60px;
  bottom: -22px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(40, 32, 20, 0.22), rgba(40, 32, 20, 0));
  transform: translateZ(-40px);
  z-index: -1;
}

/* ---- the phone ---- */
.telefono {
  position: absolute;
  right: 2px;
  bottom: 18px;
  width: 132px;
  height: 270px;
  padding: 6px;
  border-radius: 26px;
  background: var(--cornice);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 18px 36px -14px rgba(40, 32, 20, 0.45);
  transform-style: preserve-3d;
  transform: rotateY(-14deg) rotateX(5deg) translateZ(40px);
  transform-origin: 50% 90%;
}

.schermo--tel { border-radius: 20px; }

.isola {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 6px;
  width: 40px;
  height: 11px;
  transform: translateX(-50%);
  border-radius: 8px;
  background: #0c0c0e;
}

.ombra--tel { left: -10px; right: -10px; bottom: -26px; }

/* ---- the template tabs ---- */
.schede {
  position: relative;
  display: inline-flex;
  padding: 4px;
  gap: 2px;
  border-radius: 999px;
  background: var(--scheda);
  box-shadow: 0 0 0 1px var(--bordo), 0 10px 24px -14px rgba(40, 32, 20, 0.35);
}

.indicatore {
  position: absolute;
  left: 0;
  top: 4px;
  height: calc(100% - 8px);
  border-radius: 999px;
  background: var(--inchiostro);
  box-shadow: 0 4px 10px -4px rgba(0, 0, 0, 0.4);
}

.scheda {
  position: relative;
  z-index: 1;
  border: 0;
  background: none;
  padding: clamp(7px, 1.4vh, 9px) clamp(11px, 3vw, 16px);
  border-radius: 999px;
  font-size: clamp(12px, 1.9vh, 13.5px);
  font-weight: 560;
  color: var(--grigio);
  cursor: pointer;
  transition: color 0.25s;
  white-space: nowrap;
}

.scheda[aria-pressed="true"] { color: #fff; }

.scheda:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }

@media (hover: hover) {
  .scheda[aria-pressed="false"]:hover { color: var(--inchiostro); }
}

.scheda.e-premuto { transform: scale(0.96); }

.puntatore {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  z-index: 20;
  pointer-events: none;
  opacity: 0;
}

.puntatore path { fill: #111; stroke: #fff; stroke-width: 1.3; stroke-linejoin: round; }

/* ================= the invented sites, drawn in HTML ================= */
.sito { position: absolute; inset: 0; display: flex; flex-direction: column; font-size: 10px; }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  font-size: 8.5px;
}
.nav .marchio { font-weight: 700; font-size: 10.5px; letter-spacing: -0.01em; }
.nav .voci { display: flex; gap: 12px; color: inherit; opacity: 0.6; }
.nav .icona { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.5; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 8.5px;
  font-weight: 600;
}
.btn svg { width: 9px; height: 9px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* the online store */
.sito--negozio { background: var(--negozio-fondo); color: #2a1b12; }
.sito--negozio .hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 14px; padding: 6px 16px 10px; align-items: center; }
.sito--negozio h2 { font-size: 22px; line-height: 0.98; font-weight: 720; font-stretch: 112%; letter-spacing: -0.03em; }
.sito--negozio .sotto { margin: 7px 0 9px; font-size: 8.5px; line-height: 1.45; opacity: 0.65; max-width: 190px; }
.sito--negozio .btn { background: var(--negozio); color: #fff; }
.prodotto-grande { position: relative; height: 122px; border-radius: 10px; background: linear-gradient(150deg, #f6c7a6, #ec8b5e); overflow: hidden; }
.prodotto-grande::before { content: ''; position: absolute; left: 50%; top: 54%; width: 68px; height: 82px; transform: translate(-50%, -50%); border-radius: 34px 34px 14px 14px; background: linear-gradient(160deg, #fff7ef, #f2d6c1); box-shadow: 0 14px 22px -10px rgba(120, 50, 20, 0.5); }
.prodotto-grande::after { content: ''; position: absolute; left: 50%; top: 22%; width: 26px; height: 10px; transform: translateX(-50%); border-radius: 4px; background: #2a1b12; opacity: 0.85; }
.prezzo-tag { position: absolute; right: 8px; bottom: 8px; padding: 3px 7px; border-radius: 999px; background: #fff; font-size: 8px; font-weight: 650; }
.griglia { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 16px 12px; }
.carta { border-radius: 8px; background: #fff; padding: 5px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04); }
.carta .img { height: 40px; border-radius: 5px; margin-bottom: 4px; }
.carta b { display: block; font-size: 7.5px; font-weight: 620; }
.carta span { font-size: 7px; opacity: 0.55; }

/* the portfolio */
.sito--portfolio { background: var(--portfolio-fondo); color: var(--portfolio); }
.sito--portfolio .hero { padding: 6px 16px 10px; }
.sito--portfolio h2 { font-size: 30px; line-height: 0.92; font-weight: 760; font-stretch: 120%; letter-spacing: -0.04em; }
.sito--portfolio .riga-ruolo { display: flex; justify-content: space-between; align-items: end; margin-top: 8px; font-size: 8.5px; opacity: 0.6; }
.sito--portfolio .btn { background: var(--portfolio); color: #fff; }
.sito--portfolio .griglia { grid-template-columns: 1.3fr 1fr 1fr; grid-template-rows: 58px 46px; }
.lavoro { position: relative; border-radius: 7px; overflow: hidden; }
.lavoro:first-child { grid-row: span 2; }
.lavoro i { position: absolute; left: 6px; bottom: 5px; font-style: normal; font-size: 7px; font-weight: 600; color: #fff; }

/* the blog */
.sito--blog { background: var(--blog-fondo); color: #1f2a26; }
.sito--blog .hero { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 4px 16px 10px; align-items: end; }
.sito--blog .data { font-size: 7.5px; color: var(--blog); font-weight: 650; letter-spacing: 0.02em; margin-bottom: 4px; }
.sito--blog h2 { font-family: Georgia, 'Times New Roman', serif; font-size: 21px; line-height: 1.02; font-weight: 400; letter-spacing: -0.02em; }
.sito--blog .sotto { margin: 6px 0 8px; font-size: 8.5px; line-height: 1.45; opacity: 0.65; }
.sito--blog .btn { background: var(--blog); color: #fff; }
.copertina-blog { height: 104px; border-radius: 9px; background: linear-gradient(180deg, #cfe3d6 0%, #a9cbb8 55%, #6f9e88 56%, #4f7f6b 100%); position: relative; overflow: hidden; }
.copertina-blog::after { content: ''; position: absolute; left: 62%; top: 22%; width: 22px; height: 22px; border-radius: 50%; background: #f7efd9; }
.articoli { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 16px 12px; }
.articolo { border-top: 1px solid rgba(0, 0, 0, 0.1); padding-top: 5px; }
.articolo span { display: block; font-size: 7px; color: var(--blog); font-weight: 650; margin-bottom: 2px; }
.articolo b { font-family: Georgia, serif; font-weight: 400; font-size: 9px; line-height: 1.2; }

/* the phone layouts: one column, everything a little smaller */
.tel .nav { padding: 22px 10px 6px; }
.tel .nav .voci { display: none; }
.tel .hero { grid-template-columns: 1fr !important; gap: 8px !important; padding: 4px 10px 8px !important; }
.tel h2 { font-size: 16px !important; }
.tel .sito--portfolio h2, .tel.sito--portfolio h2 { font-size: 20px !important; }
.tel .sotto { display: none; }
.tel .prodotto-grande { height: 70px; }
.tel .copertina-blog { height: 60px; }
.tel .griglia, .tel .articoli { grid-template-columns: 1fr 1fr !important; padding: 0 10px 10px; gap: 6px; }
.tel .griglia .carta:nth-child(3), .tel .articolo:nth-child(3) { display: none; }
.tel.sito--portfolio .griglia { grid-template-rows: 44px 34px; }
.tel .lavoro:nth-child(3) { display: none; }
.tel .riga-ruolo span:last-child { display: none; }
