/* TuoPilota — versione corta, stile social */
@font-face { font-family: "Bricolage"; src: url("fonts/bricolage.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree-600.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }

:root {
  --adriatico: #0B3C49;
  --mare: #1F7A8C;
  --vetro: #D7ECE8;
  --calce: #F5F8F7;
  --sole: #F2B035;
  --verde-wa: #1FA855;
  --inchiostro: #102A33;
  --grigio: #5A6E75;
  --linea: #DCE5E3;
  --grigio-btn: #E8EEED;
  --f-display: "Bricolage", "Avenir Next", system-ui, sans-serif;
  --f-testo: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--calce); color: var(--inchiostro); font: 400 16px/1.5 var(--f-testo); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body.bloccato { overflow: hidden; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--f-display); margin: 0; letter-spacing: -0.02em; line-height: 1.05; }
p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sole); outline-offset: 2px; border-radius: 6px; }
.salta { position: absolute; left: -9999px; }
.salta:focus { left: 12px; top: 12px; z-index: 100; background: #fff; padding: 8px 12px; }

/* Bottoni */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 13px 20px; font: 600 15px/1 var(--f-testo); text-decoration: none; cursor: pointer; white-space: nowrap; transition: transform .15s, background .15s; }
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-sole { background: var(--sole); color: var(--adriatico); }
.btn-sole:hover { background: #F7C25E; }
.btn-wa { background: var(--verde-wa); color: #fff; }
.btn-wa:hover { background: #179247; }
.btn-scuro { background: var(--adriatico); color: #fff; }
.btn-scuro:hover { background: var(--mare); }
.btn-grigio { background: var(--grigio-btn); color: var(--inchiostro); }
.btn-grigio:hover { background: #DDE6E4; }
.btn-piccolo { padding: 9px 14px; font-size: 14px; border-radius: 99px; }
.btn-grande { padding: 18px 28px; font-size: 18px; border-radius: 16px; }
.btn-grande svg { width: 24px; height: 24px; }

/* Testata */
.testata { position: fixed; top: 0; left: 0; right: 0; z-index: 30; display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); transition: background .25s, box-shadow .25s; }
.testata.piena { background: rgba(255,255,255,.94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 1px 0 var(--linea); }
.marchio { display: flex; align-items: center; gap: 8px; text-decoration: none; color: #fff; font: 700 20px/1 var(--f-display); letter-spacing: -0.02em; transition: color .25s; }
.marchio svg { width: 30px; height: 30px; }
.marchio .tuo { font-weight: 400; opacity: .85; }
.testata.piena .marchio { color: var(--adriatico); }

/* Apertura */
.apertura { position: relative; min-height: 100svh; display: flex; flex-direction: column; justify-content: space-between; color: #fff; overflow: hidden; background: var(--adriatico); }
.apertura-foto { position: absolute; inset: 0; }
.apertura-foto img { width: 100%; height: 100%; object-fit: cover; object-position: 48% 50%; }
.apertura-foto::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,60,73,.45) 0%, rgba(11,60,73,0) 22%, rgba(11,60,73,0) 42%, rgba(11,60,73,.88) 72%, rgba(11,60,73,.97) 100%); }
.apertura-testo { position: relative; z-index: 2; padding: 0 20px 36px; width: 100%; max-width: 980px; margin: 0 auto; }
.sigla { display: inline-block; font: 800 15px/1 var(--f-display); letter-spacing: .02em; background: var(--sole); color: var(--adriatico); padding: 7px 12px; border-radius: 8px; transform: rotate(-2deg); margin-bottom: 14px; }
.apertura h1 { font-size: clamp(2.6rem, 11vw, 5.6rem); font-weight: 800; letter-spacing: -0.04em; max-width: 11ch; line-height: .98; }
.apertura .sotto { font-size: clamp(1.05rem, 3.6vw, 1.35rem); opacity: .9; margin: 14px 0 22px; max-width: 30ch; }
.azioni { display: flex; gap: 10px; flex-wrap: wrap; }

/* Notifiche sopra la foto: il sito che lavora */
.notifiche { position: relative; z-index: 2; list-style: none; margin: 76px 16px 24px auto; padding: 0; display: grid; gap: 8px; width: min(300px, calc(100% - 32px)); }
.notifiche li { display: flex; gap: 10px; align-items: center; background: rgba(255,255,255,.93); color: var(--inchiostro); border-radius: 16px; padding: 10px 12px; box-shadow: 0 10px 30px -10px rgba(0,0,0,.35); font-size: 13px; line-height: 1.3;
  opacity: 0; transform: translateY(-10px); animation: arriva .5s cubic-bezier(.2,.9,.3,1.2) forwards; animation-delay: calc(.8s + var(--i) * 1.1s); }
.notifiche b { display: block; font-size: 14px; }
.notifiche .app { display: none; font-style: normal; font-size: 11px; color: var(--grigio); text-transform: none; }
/* Telefono: sul cellulare vero la cornice sparisce e restano solo le notifiche */
.telefono, .schermo { display: contents; }
.ora-tel, .data-tel { display: none; }
.spunta { width: 30px; height: 30px; border-radius: 50%; background: var(--verde-wa); color: #fff; display: grid; place-items: center; flex: none; }
.spunta svg { width: 16px; height: 16px; }
@keyframes arriva { to { opacity: 1; transform: none; } }

/* Storie */
.storie-sez { max-width: 980px; margin: 0 auto; padding: 26px 0 8px; }
.storie-sez h2 { font-size: 22px; padding: 0 16px; display: flex; align-items: baseline; gap: 10px; }
.storie-sez h2 small { font: 500 14px var(--f-testo); color: var(--grigio); letter-spacing: 0; }
.storie { display: flex; gap: 16px; overflow-x: auto; padding: 16px 16px 12px; scrollbar-width: none; scroll-snap-type: x proximity; }
.storie::-webkit-scrollbar { display: none; }
.storia { flex: none; background: none; border: 0; padding: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; width: 80px; scroll-snap-align: start; }
.anello { width: 78px; height: 78px; border-radius: 50%; padding: 3px; background: conic-gradient(from 200deg, var(--sole), #F48C3A, var(--mare), var(--sole)); display: block; }
.anello img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 3px solid var(--calce); background: var(--vetro); }
.storia.vista .anello { background: #C9D5D3; }
.storia:hover .anello { transform: scale(1.04); }
.anello { transition: transform .2s; }

/* Profilo */
.profilo-sez { max-width: 935px; margin: 0 auto; padding: 22px 0 0; border-top: 1px solid var(--linea); }
.profilo { display: flex; gap: 22px; align-items: center; padding: 0 16px; }
.avatar { width: 88px; height: 88px; flex: none; border-radius: 50%; background: var(--adriatico); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 3px var(--calce), 0 0 0 5px var(--sole); }
.avatar svg { width: 56%; height: 56%; }
.profilo-info h2 { font: 600 20px/1.2 var(--f-testo); letter-spacing: 0; }
.numeri { list-style: none; display: flex; gap: 18px; margin: 8px 0 0; padding: 0; font-size: 14px; color: var(--grigio); }
.numeri b { color: var(--inchiostro); font-size: 16px; display: block; }
.bio { padding: 14px 16px 0; font-size: 15px; line-height: 1.45; }
.profilo-info .bio { display: none; }
.profilo-azioni { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; padding: 14px 16px 18px; }
.profilo-azioni .btn { padding: 10px 8px; font-size: 14px; border-radius: 10px; }
.schede { display: flex; border-top: 1px solid var(--linea); }
.schede button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; background: none; border: 0; border-top: 2px solid transparent; margin-top: -1px; padding: 13px 0; cursor: pointer; color: var(--grigio); font-size: 14px; font-weight: 600; }
.schede button svg { width: 20px; height: 20px; }
.schede button[aria-selected="true"] { color: var(--inchiostro); border-top-color: var(--inchiostro); }

/* Griglia */
.griglia { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.post[hidden] { display: none; }
.post .contenuto { display: none; }
.miniatura { position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; cursor: pointer; overflow: hidden; background: var(--vetro); }
.miniatura img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.miniatura:hover img { transform: scale(1.05); }
.velo { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 10px 9px; background: linear-gradient(180deg, transparent, rgba(0,0,0,.65)); color: #fff; text-align: left; font-size: 12px; line-height: 1.25; }
.velo b { display: block; font-family: var(--f-display); font-size: 15px; letter-spacing: -0.01em; }
.badge { position: absolute; top: 8px; right: 8px; color: #fff; filter: drop-shadow(0 1px 3px rgba(0,0,0,.5)); }
.badge svg { width: 22px; height: 22px; }

/* Finale */
.finale { background: var(--adriatico); color: #fff; text-align: center; padding: 56px 20px 60px; margin-top: 40px; }
.finale h2 { font-size: clamp(2rem, 7vw, 3.2rem); font-weight: 800; letter-spacing: -0.03em; max-width: 14ch; margin: 0 auto; }
.finale p { opacity: .85; margin: 14px auto 26px; max-width: 34ch; font-size: 17px; }
.altri { display: flex; justify-content: center; gap: 22px; margin-top: 22px; flex-wrap: wrap; }
.altri a { display: inline-flex; gap: 8px; align-items: center; text-decoration: none; opacity: .85; font-weight: 500; }
.altri a:hover { opacity: 1; color: var(--sole); }
.altri svg { width: 18px; height: 18px; color: var(--sole); }

.piede { background: #072A33; color: rgba(255,255,255,.65); text-align: center; padding: 32px 20px 40px; font-size: 14px; display: grid; gap: 8px; justify-items: center; }
.piede .marchio { color: #fff; font-size: 18px; }
.piede .marchio svg { width: 24px; height: 24px; }
.piede .dati { font-size: 12px; opacity: .8; }

/* Visori a tutto schermo */
.visore { position: fixed; inset: 0; z-index: 60; background: rgba(5,15,18,.92); display: grid; place-items: center; }
.visore[hidden] { display: none; }
.chiudi { background: none; border: 0; color: #fff; cursor: pointer; padding: 6px; }
.chiudi svg { width: 26px; height: 26px; }
.chiudi.no-anello:focus-visible { outline: none; }

/* Storia aperta */
.storia-schermo { position: relative; width: 100%; height: 100svh; max-width: 460px; background: #000; overflow: hidden; color: #fff; }
.barre { position: absolute; top: max(10px, env(safe-area-inset-top)); left: 10px; right: 10px; z-index: 4; display: flex; gap: 4px; }
.barre span { flex: 1; height: 3px; border-radius: 3px; background: rgba(255,255,255,.35); overflow: hidden; }
.barre span i { display: block; height: 100%; width: 0; background: #fff; }
.barre span.fatta i { width: 100%; }
.barre span.ora i { animation: carica var(--durata, 6s) linear forwards; }
.storia-schermo.pausa .barre span.ora i { animation-play-state: paused; }
@keyframes carica { to { width: 100%; } }
.storia-testa { position: absolute; top: calc(max(10px, env(safe-area-inset-top)) + 12px); left: 12px; right: 6px; z-index: 4; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.storia-testa #storia-etichetta { opacity: .75; }
.storia-testa .chiudi { margin-left: auto; }
.mini-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--adriatico); display: grid; place-items: center; border: 2px solid var(--sole); }
.mini-avatar svg { width: 20px; height: 20px; color: #fff; }
.storia-corpo { position: absolute; inset: 0; }
.storia-corpo img { width: 100%; height: 100%; object-fit: cover; }
.storia-corpo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.5) 0%, transparent 20%, transparent 38%, rgba(0,0,0,.85) 70%, rgba(0,0,0,.95)); }
.storia-testo { position: absolute; left: 20px; right: 20px; bottom: max(28px, env(safe-area-inset-bottom)); z-index: 5; }
.storia-testo h3 { font-size: clamp(2.2rem, 10vw, 2.9rem); font-weight: 800; letter-spacing: -0.035em; margin-bottom: 18px; }
.prima-dopo { display: grid; gap: 8px; margin-bottom: 22px; font-size: 16px; line-height: 1.35; }
.prima-dopo .no { opacity: .7; text-decoration: line-through; text-decoration-color: rgba(255,255,255,.6); }
.prima-dopo .si { font-weight: 600; display: flex; gap: 8px; }
.prima-dopo .si::before { content: ""; flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--verde-wa) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center/12px no-repeat; margin-top: 1px; }
.storia-testo .btn { width: 100%; }
.zona-tocco { position: absolute; top: 70px; bottom: 200px; z-index: 3; background: none; border: 0; cursor: pointer; }
.zona-tocco.sx { left: 0; width: 35%; }
.zona-tocco.dx { right: 0; width: 65%; }

/* Post aperto: feed verticale */
.post-aperto { width: 100%; height: 100svh; background: #fff; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.feed-testa { position: sticky; top: 0; z-index: 3; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; background: rgba(255,255,255,.97); border-bottom: 1px solid var(--linea); padding: 6px 6px; padding-top: max(6px, env(safe-area-inset-top)); text-align: center; font-size: 16px; }
.feed-testa .chiudi { color: var(--inchiostro); display: grid; place-items: center; }
.feed-post { border-bottom: 1px solid var(--linea); padding-bottom: 10px; }
.feed-post .p-testa { display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-size: 14px; }
.feed-post .p-testa .mini-avatar { width: 34px; height: 34px; }
.feed-post .p-testa small { display: block; color: var(--grigio); font-size: 12px; }
.feed-post .p-foto { position: relative; width: 100%; aspect-ratio: 1 / 1; background: var(--vetro); overflow: hidden; }
.feed-post .p-foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.feed-post .p-icone { display: flex; gap: 16px; padding: 12px 14px 4px; }
.feed-post .p-icone button { background: none; border: 0; padding: 0; cursor: pointer; color: var(--inchiostro); }
.feed-post .p-icone svg { width: 26px; height: 26px; transition: transform .2s; }
.feed-post .p-icone .piace[aria-pressed="true"] { color: #E0245E; }
.feed-post .p-icone .piace[aria-pressed="true"] svg { fill: currentColor; transform: scale(1.12); }
.feed-post .p-testo { padding: 6px 14px 14px; display: grid; gap: 10px; }
.feed-post h3 { font-size: 21px; }
.feed-post .p-testo p { color: var(--grigio); font-size: 15px; }
.feed-post .non-serve { color: var(--inchiostro) !important; font-weight: 600; background: var(--vetro); border-radius: 10px; padding: 10px 12px; }
.feed-post .btn { width: 100%; margin-top: 2px; }
.feed-post .due-btn { display: grid; gap: 8px; }
.feed-giro { text-align: center; color: var(--grigio); font-size: 14px; padding: 26px 20px; margin: 0; border-bottom: 1px solid var(--linea); background: var(--calce); }
.feed-fondo { height: 1px; }

/* Computer */
@media (min-width: 760px) {
  .testata { padding: 16px 28px; }
  .apertura { min-height: 92vh; flex-direction: row; align-items: center; justify-content: flex-start; }
  .apertura-foto img { object-position: 40% 50%; }
  .apertura-foto::after { background: linear-gradient(90deg, rgba(11,60,73,.94) 0%, rgba(11,60,73,.8) 34%, rgba(11,60,73,.1) 62%, rgba(11,60,73,0) 100%), linear-gradient(180deg, rgba(11,60,73,.4), transparent 25%); }
  .apertura-testo { padding: 120px 32px 80px; max-width: 1180px; }
  .apertura h1 { font-size: clamp(3.2rem, 5.2vw, 4.6rem); max-width: none; }
  .apertura .sotto { max-width: 26ch; }
  /* smartphone disegnato, nitido a ogni dimensione */
  .telefono { display: block; position: absolute; z-index: 2; right: clamp(40px, 9vw, 160px); top: 50%; transform: translateY(-46%) rotate(3deg); width: 290px; height: 590px; border-radius: 48px; background: #111518; padding: 11px; box-shadow: 0 40px 80px -20px rgba(0,0,0,.55), inset 0 0 0 2px #2b3238; }
  .telefono::before { content: ""; position: absolute; top: 22px; left: 50%; width: 92px; height: 26px; margin-left: -46px; border-radius: 20px; background: #111518; z-index: 3; }
  .schermo { display: block; position: relative; height: 100%; border-radius: 38px; overflow: hidden; padding: 74px 12px 20px; color: #fff;
    background: linear-gradient(180deg, rgba(11,60,73,.15), rgba(11,60,73,.55)), url("img/spiaggia-sfondo.webp") 62% 50% / cover; }
  .ora-tel { display: block; text-align: center; font: 700 64px/1 var(--f-display); letter-spacing: -0.03em; text-shadow: 0 2px 12px rgba(0,0,0,.25); }
  .data-tel { display: block; text-align: center; font-size: 15px; font-weight: 500; margin: 6px 0 26px; opacity: .95; text-transform: capitalize; text-shadow: 0 1px 8px rgba(0,0,0,.3); }
  .notifiche { position: static; width: 100%; margin: 0; gap: 9px; }
  .notifiche li { background: rgba(255,255,255,.9); border-radius: 18px; padding: 10px 11px; font-size: 12.5px; box-shadow: 0 6px 18px -8px rgba(0,0,0,.35); }
  .notifiche b { font-size: 13.5px; }
  .notifiche .app { display: block; margin-bottom: 1px; }
  .spunta { width: 34px; height: 34px; border-radius: 9px; }
  .storie-sez { padding-top: 40px; }
  .storie { gap: 26px; justify-content: flex-start; }
  .storia { width: 96px; font-size: 14px; }
  .anello { width: 94px; height: 94px; }
  .profilo-sez { padding-top: 36px; border-top: 0; }
  .profilo { gap: 70px; padding: 0 40px 0 60px; align-items: flex-start; }
  .avatar { width: 150px; height: 150px; }
  .profilo-info h2 { font-size: 24px; }
  .numeri { gap: 36px; font-size: 16px; margin-top: 16px; }
  .numeri b { display: inline; margin-right: 4px; }
  .profilo-info .bio { display: block; padding: 16px 0 0; }
  .profilo-azioni { padding: 20px 40px 30px 280px; grid-template-columns: repeat(3, 160px); }
  .profilo-sez > .bio-mobile { display: none; }
  .griglia { gap: 5px; }
  .velo { font-size: 13px; padding: 40px 14px 12px; opacity: .92; }
  .velo b { font-size: 18px; }
  .finale { margin-top: 70px; padding: 80px 20px; }

  .storia-schermo { height: min(92vh, 820px); border-radius: 14px; }
  .post-aperto { width: min(500px, 100%); height: 100vh; box-shadow: 0 0 60px rgba(0,0,0,.4); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .notifiche li { animation: none; opacity: 1; transform: none; }
  .miniatura img, .anello, .btn { transition: none; }
}

/* Apertura più bassa (circa -35/40%) */
.apertura { min-height: 0; }
.apertura-testo { padding-bottom: 28px; }
.notifiche { margin-top: 70px; margin-bottom: 18px; }
@media (min-width: 760px) {
  .apertura { min-height: 0; height: clamp(440px, 58vh, 560px); }
  .apertura-testo { padding: 90px 32px 40px; }
  .apertura h1 { font-size: clamp(2.8rem, 4.4vw, 3.9rem); }
  .apertura .sotto { margin: 12px 0 20px; }
  .telefono { top: 54%; transform: translateY(-50%) rotate(3deg) scale(.74); transform-origin: center; }
}


/* ===== Novembre: griglia sfalsata stile Pinterest, più respiro ===== */
.profilo-sez { max-width: 1120px; border-top: 0; }
.schede { margin: 0 16px; }
.griglia { display: block; columns: 2; column-gap: 12px; padding: 16px 12px 0; }
.post { break-inside: avoid; margin: 0 0 18px; display: block; }
.miniatura { aspect-ratio: auto; overflow: visible; background: none; text-align: left; }
.miniatura img { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 18px; background: var(--vetro); box-shadow: 0 10px 24px -16px rgba(11,60,73,.5); transition: transform .3s ease, box-shadow .3s ease; }
.post:nth-child(5n+2) .miniatura img { aspect-ratio: 1 / 1; }
.post:nth-child(5n+3) .miniatura img { aspect-ratio: 4 / 5; }
.post:nth-child(5n+4) .miniatura img { aspect-ratio: 2 / 3; }
.post:nth-child(5n+5) .miniatura img { aspect-ratio: 5 / 6; }
.miniatura:hover img { transform: translateY(-3px); box-shadow: 0 18px 32px -16px rgba(11,60,73,.55); }
.velo { position: static; display: block; background: none; padding: 9px 4px 0; font-size: 13px; color: var(--grigio); }
.velo b { color: var(--inchiostro); font-size: 16px; margin-bottom: 1px; }
.badge { top: 10px; right: 10px; background: rgba(11,60,73,.6); border-radius: 10px; padding: 5px; filter: none; }
.badge svg { width: 18px; height: 18px; }
@media (min-width: 760px) {
  .griglia { columns: 3; column-gap: 22px; padding: 24px 0 0; }
  .post { margin-bottom: 28px; }
  .velo { font-size: 14px; padding: 12px 4px 0; opacity: 1; }
  .velo b { font-size: 19px; }
}
@media (min-width: 1100px) { .griglia { columns: 4; } }
