/* ==========================================================================
   GF Design — Gessica Federici (site-due, ricostruzione minimale)
   Galleria infinita + transizione immagine → contenuto
   Tinta di default: bosco (#0E1F10)
   Tipografia: Syne (display) + Instrument Sans (base)
   ========================================================================== */

*,
*::after,
*::before {
  box-sizing: border-box;
}

:root {
  font-size: 12px;

  /* tinta di default: bosco */
  --color-bg: #0e1f10;
  --color-ink: #eef5ea;
  --color-muted: #9fb49a;
  --color-soft: #c3d4bd;
  --color-line: #284a2b;

  --font-display: "Syne", "Helvetica Neue", sans-serif;
  --font-body: "Instrument Sans", "Helvetica Neue", sans-serif;

  --page-padding: 2rem;
}

/* ---------- Tinte: ogni tinta ritinteggia sfondo e testo dell'intero sito.
   Il default (bosco) è nel :root e NON ha attributo data-theme. ---------- */
body[data-theme="carbone"] {
  --color-bg: #141414;
  --color-ink: #f4f4f4;
  --color-muted: #a8a8a8;
  --color-soft: #c4c4c4;
  --color-line: #2f2f2f;
}

body[data-theme="piombo"] {
  --color-bg: #3c3c3c;
  --color-ink: #f4f4f4;
  --color-muted: #bdbdbd;
  --color-soft: #d6d6d6;
  --color-line: #5a5a5a;
}

body[data-theme="cemento"] {
  --color-bg: #5c5c5c;
  --color-ink: #ffffff;
  --color-muted: #d9d9d9;
  --color-soft: #e8e8e8;
  --color-line: #464646;
}

body[data-theme="nebbia"] {
  --color-bg: #b9b9b9;
  --color-ink: #0a0a0a;
  --color-muted: #4f4f4f;
  --color-soft: #333333;
  --color-line: #8f8f8f;
}

body[data-theme="carta"] {
  --color-bg: #ffffff;
  --color-ink: #0a0a0a;
  --color-muted: #8c8c8c;
  --color-soft: #6f6f6f;
  --color-line: #e2e2e2;
}

body[data-theme="acido"] {
  --color-bg: #cdf545;
  --color-ink: #0a0a0a;
  --color-muted: #55631f;
  --color-soft: #3d4a12;
  --color-line: #a9d63a;
}

body[data-theme="muschio"] {
  --color-bg: #79b743;
  --color-ink: #0a0a0a;
  --color-muted: #2e4d1f;
  --color-soft: #24401c;
  --color-line: #5c9434;
}

body[data-theme="abete"] {
  --color-bg: #2e5d2a;
  --color-ink: #f2f7ef;
  --color-muted: #b8cbb2;
  --color-soft: #d3e0cd;
  --color-line: #4a7a42;
}

/* ---------- Intro / preload ---------- */
/* Il cerchio che si disegna: contatore e orbita testuale mentre
   caricano le immagini; alla fine il cerchio si espande oltre lo
   schermo e lascia il posto alla galleria. Senza JS resta nascosto. */
.intro {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  background: var(--color-bg);
}

html.no-js .intro {
  display: none;
}

.intro__stage {
  position: relative;
  width: min(38vmin, 320px);
  aspect-ratio: 1;
}

/* scritta circolare rotante attorno al cerchio */
.intro__orbit {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: cursorSpin 16s linear infinite;

  text {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    fill: var(--color-ink);
  }
}

/* il tratto del cerchio, disegnato dal progresso reale */
.intro__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);

  circle {
    fill: none;
    stroke: var(--color-ink);
    stroke-width: 1.5;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
  }
}

/* contatore Syne, in basso a destra */
.intro__count {
  position: absolute;
  right: calc(var(--page-padding) + 0.5rem);
  bottom: calc(var(--page-padding) + 0.2rem);
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(5.6rem, 16vmin, 12rem);
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--color-ink);
}

.intro__pct {
  font-size: 0.25em;
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  .intro__orbit {
    animation: none;
  }
}

/* Lo slider guida la galleria: il documento non scorre */
html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  color: var(--color-ink);
  background-color: var(--color-bg);
  font-family: var(--font-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior: none;
  touch-action: none;
}

/* ============ FRAME: elementi in blend con la galleria ============ */
/* Testo bianco + blend "difference": sul bianco appare nero,
   quando passa un'immagine dietro si inverte e resta leggibile.
   Ogni elemento è position:fixed e figlio diretto del root: dentro
   un contenitore fixed con z-index lo stacking context bloccherebbe il blend. */
.frame__overlay {
  pointer-events: none;
}

.frame__title,
.frame__nav,
.frame__logo,
.frame__mail,
.frame__hint {
  position: fixed;
  z-index: 100;
  color: #fff;
  mix-blend-mode: difference;
}

.frame__title {
  top: var(--page-padding);
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.9rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* sulle tinte sature il difference tingerebbe il testo (bianco ⊕ verde = viola):
   si usa l'inchiostro della tinta, senza fusione */
body:is([data-theme="acido"], [data-theme="muschio"])
  :is(.frame__title, .frame__nav, .frame__logo, .frame__mail, .frame__hint) {
  mix-blend-mode: normal;
  color: var(--color-ink);
}

body:is([data-theme="acido"], [data-theme="muschio"]) .frame__nav-link {
  color: var(--color-ink);

  &::after {
    background: var(--color-ink);
  }
}

.frame__nav {
  top: var(--page-padding);
  right: var(--page-padding);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.9rem;
}

.frame__nav-link {
  pointer-events: auto;
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: row-reverse;
  align-items: baseline;
  gap: 0.8rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  opacity: 0.45;
  transition: opacity 0.35s ease;

  /* tratteggio che si estende all'hover, verso sinistra */
  &::after {
    content: "";
    width: 0;
    height: 1px;
    background: #fff;
    align-self: center;
    transition: width 0.4s cubic-bezier(0.65, 0, 0.35, 1);
  }

  &:hover,
  &:focus-visible,
  &.active {
    opacity: 1;

    &::after {
      width: 2.4rem;
    }
  }

  &:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 4px;
  }
}

.frame__logo {
  top: calc(var(--page-padding) - 0.4rem);
  left: var(--page-padding);
  pointer-events: auto;
  transition: opacity 0.35s ease;

  &:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 4px;
  }

  svg {
    display: block;
    width: 56px;
    height: 63px;
  }
}

.frame__mail {
  bottom: var(--page-padding);
  left: var(--page-padding);
  pointer-events: auto;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  opacity: 0.45;
  text-decoration: none;
  transition: opacity 0.35s ease;

  &:hover,
  &:focus-visible {
    opacity: 1;
  }

  &:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 4px;
  }
}

.frame__hint {
  bottom: var(--page-padding);
  right: var(--page-padding);
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.65;
  transition: opacity 0.6s ease;
}

/* ---------- Tinte: selettore sempre visibile sul lato sinistro ---------- */
/* Come una tavolozza di progetto: campione + codice esadecimale.
   I campioni mostrano il loro colore reale (niente blend difference qui). */
.tints {
  position: fixed;
  left: var(--page-padding);
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: grid;
  gap: 0.55rem;
  pointer-events: auto;
}

.tints__swatch {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}

.tints__chip {
  display: block;
  width: 1.7rem;
  height: 1.7rem;
  background: var(--sw);
  border: 1px solid rgb(255 255 255 / 0.25);
  outline: none;
  transition: transform 0.25s cubic-bezier(0.65, 0, 0.35, 1), box-shadow 0.25s ease;
}

.tints__code {
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  color: var(--color-muted);
  transition: color 0.3s ease;
}

.tints__swatch:hover .tints__chip {
  transform: scale(1.18);
}

.tints__swatch:focus-visible {
  outline: none;

  .tints__chip {
    box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 3.5px #fff;
  }
}

.tints__swatch[aria-pressed="true"] {
  .tints__chip {
    box-shadow:
      0 0 0 2px var(--color-bg),
      0 0 0 3.5px rgb(255 255 255 / 0.85);
  }

  .tints__code {
    color: var(--color-ink);
  }
}

/* ---------- Galleria ---------- */
.gallery {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14vh;
  width: 100%;
  padding-top: 16vh;
}

.gallery__slide {
  flex-shrink: 0;
  margin: 0;
  transform: translateX(var(--stagger, 0vw));
  cursor: pointer;
  outline: none;
}

.gallery__img-wrapper {
  position: relative;
  margin: 0;
  width: var(--img-w, 240px);
  height: auto;
  aspect-ratio: var(--img-ar, 0.8);
  overflow: hidden;
  pointer-events: none;
  user-select: none;

  /* sottile cornice tipo passe-partout */
  &::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid rgb(0 0 0 / 0.08);
    pointer-events: none;
  }

  /* clip esplicita a livello di compositor: evita artefatti a righe
     sull'immagine durante lo scroll (smearing del layer trasformato) */
  clip-path: inset(0);
  transform: translateZ(0); /* layer propria: la clip avviene nella GPU */

  img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    backface-visibility: hidden;
  }
}

.gallery__slide figcaption {
  display: block;
  margin-top: 0.9rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-muted);
}

/* composizione: scaglioni orizzontali e pesi alternati */
.gallery__slide:nth-child(1) { --stagger: -14vw; --img-w: 34vw; --img-ar: 0.95; }
.gallery__slide:nth-child(2) { --stagger: 18vw;  --img-w: 22vw; }
.gallery__slide:nth-child(3) { --stagger: -20vw; --img-w: 24vw; --img-ar: 0.92; }
.gallery__slide:nth-child(4) { --stagger: 16vw;  --img-w: 26vw; --img-ar: 0.95; }
.gallery__slide:nth-child(5) { --stagger: -24vw; --img-w: 18vw; --img-ar: 1; }
.gallery__slide:nth-child(6) { --stagger: 22vw;  --img-w: 22vw; --img-ar: 1.05; }
.gallery__slide:nth-child(7) { --stagger: -16vw; --img-w: 17vw; --img-ar: 0.78; }
.gallery__slide:nth-child(8) { --stagger: 12vw;  --img-w: 17vw; --img-ar: 1.1; }
.gallery__slide:nth-child(9) { --stagger: -18vw; --img-w: 21vw; --img-ar: 1.05; }

/* ---------- Overlay contenuti ---------- */
.content {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
}

/* fondo del capitolo */
.content__bg {
  position: absolute;
  inset: 0;
  background: var(--color-bg);
  opacity: 0;
}

.content-wrapper {
  position: relative;
  height: 100vh;
  height: 100dvh; /* mobile: esclude la barra degli indirizzi */
}

/* l'immagine cliccata atterra qui (aspect fisso: la colonna testo parte qui) */
.content__preview-img {
  position: fixed;
  margin: 0;
  top: 0;
  left: 0;
  height: 100vh;
  height: 100dvh;
  aspect-ratio: 0.8;
  overflow: hidden;

  img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

.content__group-list {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding-inline: calc(80vh + 3.5vw) var(--page-padding);
  padding-block: var(--page-padding);
  color: var(--color-ink);
}

.content__back {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 1.1rem;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-ink);
  transition: color 0.3s ease;

  /* freccia a tratto: all'hover scivola tutta verso sinistra */
  svg {
    width: 3.4rem;
    height: 1rem;
    overflow: visible;
    transition: transform 0.4s cubic-bezier(0.65, 0, 0.35, 1);
  }

  &:hover,
  &:focus-visible {
    color: var(--color-muted);

    svg {
      transform: translateX(-0.5rem);
    }
  }

  &:focus-visible {
    outline: 2px solid var(--color-ink);
    outline-offset: 4px;
  }
}

.content__group {
  display: none;
}

.content__group.active {
  display: block;

  /* Colonna scorrevole (come il CV): il testo lungo NON va mai sotto la
     viewport — con il body in overflow:hidden sarebbe irraggiungibile. */
  height: calc(100vh - 6rem);
  height: calc(100dvh - 6rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-width: none;

  /* alone di sfumatura: il testo esconde in dolcezza, senza taglio netto */
  mask-image: linear-gradient(
    to bottom,
    transparent 0,
    #000 6rem,
    #000 calc(100% - 4rem),
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0,
    #000 6rem,
    #000 calc(100% - 4rem),
    transparent 100%
  );

  &::-webkit-scrollbar {
    display: none;
  }
}

.content__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.2rem, 7vw, 7rem);
  line-height: 0.95;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin: 28vh 0 4rem;
  max-width: 12ch;
  color: var(--color-ink);

  .content__group--cv & {
    font-size: clamp(2.4rem, 4.5vw, 4.4rem);
    max-width: 16ch;
  }
}

.content__lede {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(1.6rem, 2.4vw, 2.2rem);
  line-height: 1.4;
  max-width: 46ch;
  margin: 0 0 3rem;
  color: var(--color-ink);
}

.content__description {
  max-width: 52ch;
  font-size: clamp(1.3rem, 1.6vw, 1.7rem);
  line-height: 1.55;
  margin: 0 0 3rem;
  color: var(--color-soft);
}

.content__meta {
  font-family: var(--font-body);
  font-size: 1.05rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin: 4rem 0 0;
}

/* ---------- CV: solo le sue proporzioni specifiche ----------
   La colonna scorrevole è ora comune a TUTTI i capitoli
   (.content__group.active, sopra). */

.content__cv {
  padding-bottom: 8rem;
}

.cv__section {
  margin-top: 6rem;
}

.cv__heading {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-ink);
  margin: 0 0 2.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--color-line);
}

.cv__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cv__list li {
  display: grid;
  grid-template-columns: 16rem 1fr;
  gap: 0.4rem 2.4rem;
  padding-block: 1.6rem;
  border-bottom: 1px solid var(--color-line);
}

.cv__when {
  grid-column: 1;
  font-family: var(--font-body);
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
  align-self: baseline;
}

.cv__what {
  grid-column: 2;
  font-family: var(--font-body);
  font-size: 1.7rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--color-ink);
}

.cv__who {
  grid-column: 2;
  font-size: 1.2rem;
  color: var(--color-muted);
}

.cv__skills-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 3rem;

  li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    border-bottom: 1px solid var(--color-line);
    padding-bottom: 0.8rem;
    font-size: 1.4rem;
    color: var(--color-ink);
  }

  span {
    font-family: var(--font-body);
    font-size: 1rem;
    letter-spacing: 0.06em;
    color: var(--color-muted);
    text-align: right;
  }
}

.cv__contacts {
  font-style: normal;
  display: flex;
  flex-direction: column;
  gap: 1rem;

  a {
    color: var(--color-ink);
    text-decoration: none;
    font-size: 1.6rem;
    width: fit-content;
    border-bottom: 1px solid var(--color-line);
    transition: color 0.3s ease, border-color 0.3s ease;

    &:hover,
    &:focus-visible {
      color: var(--color-muted);
      border-color: var(--color-muted);
    }

    &:focus-visible {
      outline: 2px solid var(--color-ink);
      outline-offset: 4px;
    }
  }
}

/* ---------- Cursore personalizzato ---------- */
/* Puntino istantaneo + cerchio in ritardo, in blend "difference":
   nero su bianco, si inverte sopra le immagini e l'overlay. */
.cursor,
.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2000;
  pointer-events: none;
  opacity: 0;
}

/* il blend sta sul contenitore: dentro un figlio con z-index
   lo stacking context isola il mix-blend-mode dai contenuti sotto */
.cursor {
  display: grid;
  place-items: center;
  mix-blend-mode: difference;
}

.cursor__ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border: 1px solid #fff;
  border-radius: 50%;
  transition:
    width 0.35s cubic-bezier(0.65, 0, 0.35, 1),
    height 0.35s cubic-bezier(0.65, 0, 0.35, 1),
    margin 0.35s cubic-bezier(0.65, 0, 0.35, 1),
    background-color 0.3s ease;
}

/* scritta circolare che ruota, visibile solo sulle slide */
.cursor__orbit {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.25s ease 0.1s;
  animation: cursorSpin 9s linear infinite;

  text {
    font-family: var(--font-body);
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    fill: #fff;
  }
}

@keyframes cursorSpin {
  to {
    transform: rotate(360deg);
  }
}

/* link e bottoni: anello medio */
.cursor--link .cursor__ring {
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
}

/* slide della galleria: anello vuoto con scritta rotante fuori */
.cursor--view .cursor__ring {
  width: 86px;
  height: 86px;
  margin: -43px 0 0 -43px;

  .cursor__orbit {
    top: -45%;
    left: -45%;
    width: 190%;
    height: 190%;
    opacity: 1;

    text {
      font-size: 7.5px;
    }
  }
}

/* punto più presente sulle slide */
.cursor-dot.cursor--view {
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
}

.cursor-dot {
  width: 5px;
  height: 5px;
  margin: -2.5px 0 0 -2.5px;
  border-radius: 50%;
  background: #fff;
  mix-blend-mode: difference;
}

/* il cursore di sistema lascia il posto a quello custom — SOLO sulla
   one-page: nelle pagine di policy non c'è main.js, il cursore resta normale */
@media (pointer: fine) and (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  body.gf-home,
  body.gf-home a,
  body.gf-home button,
  body.gf-home .gallery__slide {
    cursor: none;
  }
}

/* ---------- Responsive ---------- */
@media screen and (max-width: 53em) {
  :root {
    --page-padding: 1.4rem;
  }

  .frame__title {
    font-size: 1.25rem;
  }

  /* safe-area: gli elementi a ridosso del bordo rispettano il notch */
  .frame__logo {
    top: calc(var(--page-padding) + env(safe-area-inset-top, 0px) - 0.25rem);

    svg {
      width: 34px;
      height: 39px;
    }
  }

  .frame__title {
    top: calc(var(--page-padding) + env(safe-area-inset-top, 0px));
  }

  /* menu come desktop: colonna in alto a destra, sempre visibile.
     Tap target più comodi col dito. */
  .frame__nav {
    top: calc(var(--page-padding) + env(safe-area-inset-top, 0px));

    .frame__nav-link {
      font-size: 1rem;
      padding-block: 0.35rem;
    }
  }

  .frame__hint {
    display: none;
  }

  /* l'email vive solo nel capitolo CV */
  .frame__mail {
    display: none;
  }

  /* switcher tinte: solo campioncini, niente codici esadecimali.
     Chip più grandi e riga più alta per il tocco. */
  .tints {
    gap: 0.2rem;
  }

  .tints__swatch {
    padding-block: 0.45rem;
  }

  .tints__chip {
    width: 2rem;
    height: 2rem;
  }

  .tints__code {
    display: none;
  }

  .gallery {
    gap: 10vh;
    padding-top: 18vh;
    padding-bottom: 8vh;
  }

  .gallery__slide:nth-child(n) {
    --stagger: -6vw;
    --img-w: 62vw;
  }

  .gallery__slide:nth-child(even) {
    --stagger: 8vw;
    --img-w: 48vw;
  }

  .content__preview-img {
    height: 46vh;
    height: 46dvh;
    width: 100vw;
    aspect-ratio: auto;
    top: 0;
    left: 0;
  }

  .content__group-list {
    padding-inline: var(--page-padding);
    padding-top: 50vh;
    padding-top: 50dvh;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .content__title {
    margin-top: 0;
    font-size: clamp(2.6rem, 11vw, 4.4rem);
  }

  /* anche i capitoli standard scorrono: sotto l'immagine in alto,
     fermandosi sopra il bordo (padding + back button) */
  .content__group.active {
    height: calc(50vh - 5rem);
    height: calc(50dvh - 5rem);
    padding-right: 0.6rem;
  }

  .cv__list li {
    grid-template-columns: 1fr;
  }

  .cv__when,
  .cv__what,
  .cv__who {
    grid-column: 1;
  }

  .cv__skills-list {
    grid-template-columns: 1fr;
  }
}

/* ---------- Desktop piccolo (≈1230px): titolo più compatto,
   più testo visibile subito nel pannello ---------- */
@media screen and (min-width: 53em) and (max-width: 1360px) {
  .content__title {
    margin: 14vh 0 3rem;
    font-size: clamp(2.6rem, 5vw, 4.6rem);
  }

  .content__lede {
    font-size: clamp(1.4rem, 2.1vw, 1.9rem);
    margin-bottom: 2.4rem;
  }

  .content__description {
    font-size: clamp(1.2rem, 1.5vw, 1.5rem);
    margin-bottom: 2.4rem;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .frame__nav-link,
  .frame__hint,
  .frame__mail,
  .tints__chip,
  .tints__code,
  .cv__contacts a {
    transition: none;
  }

  .cursor__orbit {
    animation: none;
  }

  .cursor {
    display: none;
  }
}
/* =====================================================================
   Banner cookie — discreto, in basso a destra, solo cookie tecnici WP
   ===================================================================== */
.gf-cookie {
  position: fixed;
  right: var(--page-padding);
  bottom: var(--page-padding);
  z-index: 9000;
  max-width: 21rem;
  padding: 1.1rem 1.2rem 1rem;
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  border-radius: 3px;
  box-shadow: 0 18px 40px rgb(0 0 0 / 0.28);
  opacity: 0;
  transform: translateY(0.8rem);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.gf-cookie.is-in {
  opacity: 1;
  transform: translateY(0);
}

.gf-cookie__title {
  font-family: "Syne", sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-ink);
  margin-bottom: 0.45rem;
}

.gf-cookie__text {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--color-muted);
  margin-bottom: 0.8rem;
}

.gf-cookie__row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.gf-cookie__link {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--color-soft);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  transition: color 0.25s ease;
}

.gf-cookie__link:hover {
  color: var(--color-ink);
}

.gf-cookie__accept {
  margin-left: auto;
  font-family: "Syne", sans-serif;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-bg);
  background: var(--color-ink);
  border: none;
  border-radius: 3px;
  padding: 0.5rem 0.95rem;
  cursor: pointer;
  transition: filter 0.25s ease;
}

.gf-cookie__accept:hover {
  filter: brightness(1.15);
}

.gf-cookie__accept:focus-visible,
.gf-cookie__link:focus-visible {
  outline: 2px solid var(--color-ink);
  outline-offset: 2px;
}

/* mobile: stessa idea, fascia bassa compatta */
@media (max-width: 640px) {
  .gf-cookie {
    right: 1rem;
    left: 1rem;
    bottom: 1rem;
    max-width: none;
    padding: 0.9rem 1rem 0.85rem;
  }
}

/* =====================================================================
   Pagine policy (privacy / cookie) — layout editoriale minimale
   ===================================================================== */
.policy {
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-ink);
  padding: calc(2rem + env(safe-area-inset-top)) var(--page-padding) 4rem;
}

.policy__inner {
  max-width: 46rem;
  margin-inline: auto;
}

.policy__back {
  display: inline-block;
  font-family: "Syne", sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-muted);
  text-decoration: none;
  transition: color 0.25s ease;
}

.policy__back:hover {
  color: var(--color-ink);
}

.policy__title {
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.4rem);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.05;
  margin: 2.2rem 0 0.6rem;
}

.policy__lede {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--color-muted);
  margin-bottom: 2rem;
}

.policy__content h2 {
  font-family: "Syne", sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  margin: 2rem 0 0.7rem;
}

.policy__content p,
.policy__content ul,
.policy__content ol {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--color-soft);
  margin-bottom: 0.9rem;
}

.policy__content ul,
.policy__content ol {
  padding-left: 1.3rem;
}

.policy__content li {
  margin-bottom: 0.35rem;
}

.policy__content a {
  color: var(--color-ink);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.policy__foot {
  margin-top: 3.5rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--color-line);
  font-family: "Syne", sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.policy__foot p:last-child {
  margin-top: 0.3rem;
}

.policy__foot a {
  color: var(--color-ink);
  text-decoration: none;
}

.policy__foot a:hover {
  text-decoration: underline;
}
