/* Schermata di scelta (index.html, "/"): base A "Foglio del CV". Colori del CV, Montserrat come nel CV,
 * Patrick Hand per le note a mano. Intro solo con html.intro (una volta per visita, js/scelta.js). */
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(../assets/fonts/montserrat-latin.woff2) format('woff2'); }
@font-face { font-family: 'Patrick Hand'; font-style: normal; font-weight: 400; font-display: swap; src: url(../assets/fonts/patrickhand-latin.woff2) format('woff2'); }

:root {
  --teal: #50c5cb;
  --teal-ink: #1d8a90;   /* turchese scuro per le icone: leggibile sul bianco */
  --yellow: #f8be19;
  --ink: #1d1d1b;
  --paper: #ffffff;
  --soft: #5d5d58;
  --sans: 'Montserrat', 'Segoe UI', Arial, sans-serif;
  --hand: 'Patrick Hand', 'Comic Sans MS', cursive;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--paper); color: var(--ink);
  font: 500 18px/1.5 var(--sans);
  display: grid; place-items: center;
  padding: max(56px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  overflow-x: hidden;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }

/* lingua in alto a destra */
.sc-lang { position: fixed; top: max(14px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); display: flex; gap: 4px; z-index: 5; }
/* lingua scelta: passata di evidenziatore giallo (niente bordi) */
.sc-lang button { font: 700 14px/1 var(--sans); letter-spacing: .06em; color: var(--soft); background: none; border: 0; border-radius: 4px; padding: 9px 10px; cursor: pointer; }
.sc-lang button[aria-pressed="true"] { color: var(--ink); background: linear-gradient(100deg, transparent 4%, var(--yellow) 6% 94%, transparent 96%) 0 60% / 100% 62% no-repeat; }
.sc-lang button:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

/* colonna dei contenuti a sinistra, posto del personaggio a destra (da telefono sotto le scelte) */
.sc {
  position: relative; width: min(860px, 100%);
  display: grid; grid-template-columns: minmax(0, 470px) minmax(0, 1fr); column-gap: 40px;
  grid-template-areas: "name char" "role char" "motto char" "ask char" "choices char" "foot char";
  align-items: start;
}
.sc-name { grid-area: name; }
.sc-role { grid-area: role; }
.sc-motto { grid-area: motto; }
.sc-ask { grid-area: ask; }
.sc-choices { grid-area: choices; }
.sc-foot { grid-area: foot; }
.sc-char { grid-area: char; align-self: stretch; min-height: 380px; }

/* nome come nel CV: FLAVIO piccolo, MARTUSCIELLO grande, sotto la barra turchese e gialla */
.sc-first { margin: 0; font: 800 clamp(20px, 3.4vw, 28px)/1 var(--sans); text-transform: uppercase; }
.sc h1 { margin: 2px 0 0; font: 800 clamp(34px, 7.4vw, 60px)/1 var(--sans); text-transform: uppercase; letter-spacing: -.01em; }
.sc-bars { display: flex; height: clamp(8px, 1.3vw, 12px); margin-top: 10px; }
.sc-bars i { display: block; height: 100%; transform-origin: left center; }
.sc-bars i:first-child { width: 31%; background: var(--teal); }
.sc-bars i:last-child { width: 69%; background: var(--yellow); }
.sc-role { margin: 14px 0 0; font-weight: 700; font-size: 16px; letter-spacing: .02em; }
.sc-motto { margin: 2px 0 0; font-size: 15px; color: var(--soft); }

/* domanda scritta a mano */
.sc-ask { position: relative; margin: 34px 0 12px; font: 400 clamp(25px, 4vw, 30px)/1.1 var(--hand); display: flex; align-items: flex-end; gap: 6px; }
.sc-ask.sr { position: absolute; margin: 0; }   /* la domanda non si vede piu: resta solo per i lettori di schermo */

/* le due scelte: sopra il portfolio veloce, sotto Praenestum Studio (la pensilina) */
.sc-choices { display: grid; gap: 14px; }
.sc-go {
  position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr) 24px; align-items: center; gap: 16px;
  min-height: 84px; padding: 14px 18px; color: var(--ink); text-decoration: none; background: var(--paper);
  border-radius: 12px 16px 11px 15px / 14px 11px 16px 12px;
  transition: background-color .18s, transform .25s cubic-bezier(.3, 1.3, .5, 1), box-shadow .25s;
}
/* bordo pulito e sottile, come nel portfolio veloce (quello tremolante a matita si spezzava agli angoli) */
.sc-go::before { content: ''; position: absolute; inset: 0; border: 1.6px solid rgba(29, 29, 27, .55); border-radius: inherit; pointer-events: none; }
.sc-go--3d { rotate: -.6deg; }
.sc-go--fast { rotate: .5deg; }
.sc-ico { width: 48px; height: 48px; color: var(--teal-ink); }
/* Praenestum Studio: icona col solo contorno, giallo senape (piu scuro del giallo del CV, cosi si legge sul bianco) */
.sc-ico--y { color: #dfa20c; }
.sc-txt { display: grid; gap: 2px; min-width: 0; }
.sc-txt strong { font: 800 20px/1.15 var(--sans); }
.sc-txt small { font-size: 15px; line-height: 1.35; color: var(--soft); }
/* Praenestum Studio: sotto il nome che cosa e (Portfolio creativo), come testo normale, poi la descrizione */
.sc-kind { font: 600 15px/1.35 var(--sans); font-style: normal; color: var(--ink); }
.sc-go-arr { width: 24px; height: 24px; transition: transform .22s; }
.sc-go:hover, .sc-go:focus-visible { background: #fff6d6; transform: translateY(-3px); box-shadow: 0 10px 26px rgba(29, 29, 27, .12); outline: none; }
.sc-go:focus-visible::before { border-width: 2.4px; border-color: var(--teal-ink); }
.sc-go:hover .sc-txt small, .sc-go:focus-visible .sc-txt small { color: var(--ink); }
.sc-go:hover .sc-go-arr, .sc-go:focus-visible .sc-go-arr { transform: translateX(4px); }
.sc-go:active { transform: none; box-shadow: none; }

.sc-foot { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13.5px; color: var(--soft); }
.sc-foot a { color: var(--ink); text-underline-offset: 3px; }

.sc-skip { display: none; }

/* achievement fatti nel portfolio creativo: un'etichetta bianca col bordo giallo sull'angolo in basso del pulsante (tutta gialla al 100%) */
.sc-ach { position: absolute; bottom: -13px; right: -10px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px 4px 8px; font: 700 13.5px/1 var(--sans); font-variant-numeric: tabular-nums; color: #dfa20c; background: var(--paper); border-radius: 999px; box-shadow: 0 0 0 2px #dfa20c, 0 4px 10px rgba(29, 29, 27, .12); rotate: -3deg; pointer-events: none; }   /* in basso: in alto finiva a cavallo col portfolio veloce */
.sc-ach svg { width: 16px; height: 16px; color: currentColor; }
.sc-ach b { color: var(--ink); }   /* il numero in nero */
.sc-ach.is-all { color: var(--ink); background: var(--yellow); box-shadow: 0 4px 10px rgba(29, 29, 27, .15); }   /* tutti fatti: tutta gialla */
.sc-ach.is-all svg { color: var(--ink); }

/* telefono: una colonna, il personaggio tra il motto e la domanda (arriva dal fondo, passa davanti alle scelte e atterra li) */
@media (max-width: 720px) {
  body { place-items: start center; }
  .sc { grid-template-columns: minmax(0, 1fr); grid-template-areas: "name" "role" "motto" "char" "ask" "choices" "foot"; }
  .sc-char { justify-self: center; width: 60%; height: 200px; min-height: 0; margin-top: 14px; }
  .sc-ask { margin-top: 10px; }
  .sc-go { grid-template-columns: 40px minmax(0, 1fr) 20px; gap: 12px; padding: 12px 14px; min-height: 80px; }
  .sc-ico { width: 40px; height: 40px; }
  .sc-txt strong { font-size: 18px; }
  /* piede centrato: la frase su una riga, sotto Privacy e Note legali */
  .sc-foot { justify-content: center; text-align: center; }
  .sc-foot span { flex-basis: 100%; }
}

/* ---------- intro (una volta per visita): nome che sale, barre che si disegnano, poi la domanda e le scelte ---------- */
.intro .sc-first { animation: sc-rise .5s .1s cubic-bezier(.2, .8, .3, 1) both; }
.intro .sc h1 { animation: sc-rise .55s .22s cubic-bezier(.2, .8, .3, 1) both; }
.intro .sc-bars i:first-child { animation: sc-draw .42s .62s cubic-bezier(.4, .1, .2, 1) both; }
.intro .sc-bars i:last-child { animation: sc-draw .62s 1.0s cubic-bezier(.4, .1, .2, 1) both; }
.intro .sc-role { animation: sc-fade .45s 1.35s both; }
.intro .sc-motto { animation: sc-fade .45s 1.5s both; }
.intro .sc-ask { animation: sc-fade .4s 1.75s both; }
.intro .sc-go--3d { animation: sc-pop .5s 2.2s cubic-bezier(.3, 1.45, .5, 1) both; }
.intro .sc-go--fast { animation: sc-pop .5s 2.05s cubic-bezier(.3, 1.45, .5, 1) both; }
.intro .sc-foot, .intro .sc-lang { animation: sc-fade .5s 2.45s both; }
.intro .sc-skip {
  display: block; position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); translate: -50% 0; margin: 0;
  font: 400 18px/1 var(--hand); color: var(--soft); animation: sc-hint 2.6s .3s both; pointer-events: none;
}
@keyframes sc-rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes sc-draw { from { transform: scaleX(0); } }
@keyframes sc-fade { from { opacity: 0; } }
@keyframes sc-pop { from { opacity: 0; transform: translateY(16px) scale(.97); } }
@keyframes sc-hint { 0% { opacity: 0; } 15%, 75% { opacity: 1; } 100% { opacity: 0; } }

/* personaggio di carta 3D (scene3d/scelta-char.js): sopra la pagina, non prende i clic. Compare quando e pronto */
.sc-char-gl { position: absolute; z-index: 1; pointer-events: none; visibility: hidden; }
.sc-char-gl.is-on { visibility: visible; }
.sc-char-gl.is-calm { animation: sc-fade .7s both; }   /* "riduci movimento": niente salto, solo dissolvenza */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .sc-char-gl.is-calm { animation: sc-fade .7s both !important; }   /* una dissolvenza dolce si', il salto no */
}

/* telefono in orizzontale (#rot-lock): copre tutto e chiede di girarlo in verticale. Solo telefoni: col dito e schermo
   basso (in orizzontale un telefono e alto meno di 500 px; i tablet no). Uguale al portfolio creativo (css/base.css) */
#rot-lock { display: none; position: fixed; inset: 0; z-index: 1000; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 16px; background: #fff; color: #e8a400; text-align: center; }
#rot-lock p { margin: 0; color: #1d1d1b; font: 24px/1.3 'Patrick Hand', system-ui, sans-serif; }
#rot-lock .rot-lock-ph { transform-box: fill-box; transform-origin: center; animation: rot-lock 2.6s ease-in-out infinite; }
@keyframes rot-lock { 0% { rotate: 90deg; opacity: 0; } 10%, 22% { rotate: 90deg; opacity: 1; } 55%, 85% { rotate: 0deg; opacity: 1; } 100% { rotate: 0deg; opacity: 0; } }   /* sdraiato, si mette dritto girando come la freccia (antiorario), poi sparisce e ricomincia */
@media (orientation: landscape) and (hover: none) and (pointer: coarse) and (max-height: 520px) {
  #rot-lock { display: flex; }
  html, body { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) { #rot-lock .rot-lock-ph { animation: none; } }
