/* Portfolio + gallery lightbox */

.portfolio-trigger {
  width: 100%;
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 1.1rem;
  align-items: center;
  text-align: left;
  padding: 1rem 1.2rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  color: inherit;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.5s var(--ease),
    border-color 0.5s var(--ease),
    box-shadow 0.5s var(--ease),
    background 0.5s var(--ease);
}

.portfolio-trigger::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 25%, rgba(46, 232, 228, 0.1) 48%, transparent 72%);
  transform: translateX(-120%);
  transition: transform 0.85s var(--ease);
  pointer-events: none;
  z-index: 2;
}

.portfolio-trigger:hover,
.portfolio-trigger.is-hover,
.portfolio-trigger.is-open {
  transform: translateY(-8px);
  border-color: rgba(46, 232, 228, 0.45);
  box-shadow:
    0 22px 50px rgba(7, 6, 12, 0.35),
    0 0 0 1px rgba(46, 232, 228, 0.12),
    0 16px 40px rgba(46, 232, 228, 0.08);
}

.portfolio-trigger:hover::before,
.portfolio-trigger.is-hover::before,
.portfolio-trigger.is-open::before {
  transform: translateX(120%);
}

.portfolio-trigger-visual {
  height: 88px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 30% 80%, #2ee8e4, transparent 45%),
    radial-gradient(circle at 80% 20%, #b31a78, transparent 42%),
    #121e8a;
  transition: transform 0.8s var(--ease), filter 0.8s var(--ease);
}

.portfolio-trigger:hover .portfolio-trigger-visual,
.portfolio-trigger.is-hover .portfolio-trigger-visual,
.portfolio-trigger.is-open .portfolio-trigger-visual {
  transform: scale(1.07);
  filter: saturate(1.15) brightness(1.08);
}

.portfolio-trigger-body,
.portfolio-chevron {
  position: relative;
  z-index: 3;
}

.portfolio-trigger-body h3 {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0.2rem 0 0.35rem;
}

.portfolio-trigger-body p {
  color: var(--muted);
  font-weight: 400;
  line-height: 1.4;
}

.portfolio-chevron {
  width: 12px;
  height: 12px;
  border-right: 2px solid var(--lime);
  border-bottom: 2px solid var(--lime);
  transform: rotate(45deg);
  transition: transform 0.35s var(--ease);
  margin-right: 0.4rem;
}

.portfolio-trigger.is-open .portfolio-chevron {
  transform: rotate(225deg);
}

.portfolio-panel {
  margin-top: 1rem;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.55s var(--ease), opacity 0.4s var(--ease);
}

.portfolio-panel.is-open {
  max-height: 4200px;
  opacity: 1;
  overflow: visible;
  padding-block: 14px 24px;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto;
  gap: 1rem;
  isolation: isolate;
  align-items: stretch;
}

.shot-emozioni { grid-column: 1; grid-row: 1 / span 2; }
.shot-moonlight { grid-column: 2; grid-row: 1; }
.shot-logo { grid-column: 2; grid-row: 2; }

.shot {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  padding: 0.7rem 0.7rem 0.9rem;
  cursor: zoom-in;
  position: relative;
  z-index: 1;
  transition:
    transform 0.5s var(--ease),
    border-color 0.5s var(--ease),
    box-shadow 0.5s var(--ease),
    background 0.5s var(--ease),
    z-index 0s;
}

.shot::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 25%, rgba(46, 232, 228, 0.1) 48%, transparent 72%);
  transform: translateX(-120%);
  transition: transform 0.85s var(--ease);
  pointer-events: none;
  z-index: 2;
}

.shot:hover,
.shot.is-hover {
  z-index: 8;
  transform: translateY(-8px);
  border-color: rgba(46, 232, 228, 0.45);
  box-shadow:
    0 22px 50px rgba(7, 6, 12, 0.35),
    0 0 0 1px rgba(46, 232, 228, 0.12),
    0 16px 40px rgba(46, 232, 228, 0.08);
}

.shot:hover::before,
.shot.is-hover::before {
  transform: translateX(120%);
}

.shot:hover .shot-screen,
.shot.is-hover .shot-screen {
  transform: scale(1.04);
  filter: saturate(1.12) brightness(1.06);
}

.browser {
  display: flex;
  gap: 5px;
  margin-bottom: 0.55rem;
}

.browser span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
}

.browser span:nth-child(1) { background: #ff5f57; }
.browser span:nth-child(2) { background: #febc2e; }
.browser span:nth-child(3) { background: #28c840; }

.shot-screen {
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background: #0b0a12;
  transition: transform 0.8s var(--ease), filter 0.8s var(--ease);
}

.shot-screen picture,
.shot-screen img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.shot-emozioni,
.shot.shot-phone {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  min-height: 0;
}

.shot.shot-phone {
  grid-column: 3;
  grid-row: 1 / span 2;
}

.shot-emozioni .browser,
.shot-phone .browser {
  flex-shrink: 0;
}

.shot-emozioni figcaption,
.shot-phone figcaption {
  flex: 1 1 auto;
  margin-top: 0;
  margin-bottom: 0;
  justify-content: center;
}

.shot-screen-phone {
  width: min(100%, 250px);
  flex: 0 0 auto;
  aspect-ratio: 9 / 16;
  margin-inline: auto;
  border-radius: 12px;
  overflow: hidden;
}

.shot-screen-phone picture,
.shot-screen-phone img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  border-radius: 12px;
}

.shot-screen-logo {
  background: #f7f4ee;
}

.shot-screen-logo picture,
.shot-screen-logo img {
  object-fit: cover;
  object-position: center;
  background: #f7f4ee;
}

.gallery-frame .shot-screen-logo {
  background: #f7f4ee;
  overflow: hidden;
}

.gallery-frame .shot-screen-logo picture,
.gallery-frame .shot-screen-logo img {
  background: #f7f4ee;
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.shot-hero {
  height: 58%;
}

.shot-lines {
  height: 42%;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.14) 60%, transparent 60%) 12px 14px / 70% 8px no-repeat,
    linear-gradient(90deg, rgba(255,255,255,0.08) 80%, transparent 80%) 12px 28px / 50% 6px no-repeat,
    rgba(7, 6, 12, 0.45);
}

.shot-a .shot-hero { background: linear-gradient(160deg, #2ee8e4, #121e8a); }
.shot-b .shot-hero { background: linear-gradient(160deg, #b31a78, #2a0848); }
.shot-c .shot-hero { background: linear-gradient(160deg, #8ff7f3, #b31a78); }
.shot-d .shot-hero { background: linear-gradient(160deg, #121e8a, #2ee8e4); }
.shot-e .shot-hero { background: linear-gradient(160deg, #2a0848, #2ee8e4); }
.shot-f .shot-hero { background: linear-gradient(160deg, #b31a78, #8ff7f3); }

.shot figcaption {
  margin-top: 0.65rem;
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

.shot-status {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lime);
  border: 1px solid rgba(46, 232, 228, 0.4);
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
}

.about-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.3rem;
  align-items: center;
  padding: 1.15rem 1.3rem;
  margin-bottom: 1.4rem;
}

.about-photo {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.about-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 12%;
}

.about-copy h3 {
  margin-bottom: 0.45rem;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 2rem 0.8rem 2.4rem;
  background: rgba(7, 6, 12, 0.82);
  backdrop-filter: blur(18px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.45s var(--ease), visibility 0.45s var(--ease);
}

.gallery-lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.gallery-lightbox[hidden] {
  display: none;
}

.gallery-lightbox.is-open[hidden] {
  display: flex;
}

.gallery-figure {
  width: min(1280px, calc(100% - 8rem));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  transform: translateY(18px) scale(0.96);
  opacity: 0;
  transition: transform 0.55s var(--ease), opacity 0.55s var(--ease);
}

.gallery-lightbox.is-open .gallery-figure {
  transform: none;
  opacity: 1;
}

.gallery-frame {
  width: 100%;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.85rem;
  box-shadow:
    0 22px 50px rgba(7, 6, 12, 0.35),
    0 0 0 1px rgba(46, 232, 228, 0.12);
}

.gallery-frame .browser {
  margin-bottom: 0.7rem;
}

.gallery-frame .shot-screen {
  height: auto;
  aspect-ratio: auto;
  max-height: min(84vh, 920px);
  transform: none;
  border-radius: 12px;
  overflow: hidden;
}

.gallery-frame .shot-screen picture,
.gallery-frame .shot-screen img {
  display: block;
  width: 100%;
  object-fit: contain;
  background: transparent;
  border-radius: 12px;
}

.gallery-lightbox.is-phone .gallery-figure {
  width: min(420px, calc(100% - 4.5rem));
}

.gallery-frame .shot-screen-phone {
  width: 100%;
  height: auto;
  max-height: min(78vh, 820px);
  aspect-ratio: auto;
  margin-inline: auto;
  background: transparent;
  border-radius: 12px;
  overflow: hidden;
}

.gallery-frame .shot-screen-phone picture {
  display: block;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
}

.gallery-frame .shot-screen-phone img {
  width: 100%;
  height: auto;
  max-height: min(78vh, 820px);
  object-fit: cover;
  background: transparent;
  border-radius: 12px;
  clip-path: inset(0 round 12px);
}

.gallery-caption {
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
  letter-spacing: -0.01em;
}

.gallery-counter {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lime);
}

.gallery-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  font-size: 1.6rem;
  line-height: 1;
  color: var(--ink);
  z-index: 2;
  transition:
    transform 0.4s var(--ease),
    border-color 0.4s var(--ease),
    box-shadow 0.4s var(--ease),
    color 0.4s var(--ease);
}

.gallery-nav {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-size: 2rem;
  line-height: 1;
  display: grid;
  place-items: center;
  z-index: 2;
  transition:
    transform 0.4s var(--ease),
    border-color 0.4s var(--ease),
    box-shadow 0.4s var(--ease),
    color 0.4s var(--ease),
    background 0.4s var(--ease);
}

.gallery-close:hover,
.gallery-close.is-hover,
.gallery-nav:hover,
.gallery-nav.is-hover {
  transform: translateY(-6px);
  color: var(--lime);
  border-color: rgba(46, 232, 228, 0.45);
  box-shadow:
    0 22px 50px rgba(7, 6, 12, 0.35),
    0 0 0 1px rgba(46, 232, 228, 0.12);
}

@media (max-width: 960px) {
  .gallery-figure {
    width: min(920px, 100%);
  }

  .gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(14, 12, 22, 0.72);
  }

  .gallery-prev { left: 0.4rem; }
  .gallery-next { right: 0.4rem; }

  .gallery-nav:hover,
  .gallery-nav.is-hover {
    transform: translateY(-58%);
  }
}

.cookie-banner {
  position: fixed; bottom: 20px; left: 20px; right: 20px; max-width: 700px; margin: 0 auto;
  z-index: 9998; background: #14081f; color: var(--ink); border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(7,6,12,0.45); border-radius: var(--radius); padding: 1.5rem;
  display: flex; justify-content: space-between; align-items: center; gap: 1.5rem;
}
.cookie-banner[hidden] { display: none !important; }
.cookie-banner-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; width: 100%; }
.cookie-copy h2 { color: var(--lime); font-size: 1rem; margin: 0 0 5px; letter-spacing: 0; }
.cookie-copy p { margin: 0; color: var(--ink); font-size: 0.85rem; line-height: 1.45; }
.cookie-copy a { color: var(--lime-2); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.cookie-banner .btn-ghost { color: var(--ink); border-color: rgba(142,247,243,0.35); }
.cookie-actions { display: flex; gap: 10px; flex-shrink: 0; }
.cookie-actions .btn { flex: none; padding: 8px 16px; font-size: 0.85rem; }
.footer-cookie-btn { color: var(--muted); font-size: 0.82rem; padding-bottom: 0.15rem; }
.footer-cookie-btn:hover { color: var(--lime); }
@media (max-width: 700px) {
  .cookie-banner, .cookie-banner-inner { flex-direction: column; align-items: stretch; }
  .cookie-actions { justify-content: flex-end; }
}

.policy-page .header {
  opacity: 1;
}

.policy-main {
  padding-top: calc(var(--header) + 2rem);
}

.policy-panel {
  text-align: left;
}

.policy-panel .section-header {
  margin-bottom: 0;
}

.policy-panel .section-title {
  font-size: clamp(1.85rem, 4vw, 2.55rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.policy-panel .section-desc,
.policy-panel.contact-panel .section-desc {
  max-width: none;
  margin: 0;
}

.policy-copy {
  margin-top: 2rem;
  display: grid;
  gap: 1.35rem;
}

.policy-mod h2 {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lime);
  margin: 0 0 0.4rem;
}

.policy-mod p {
  margin: 0;
}

.policy-copy code {
  color: var(--lime);
  font-size: 0.82rem;
}

.policy-updated {
  margin-top: 0.2rem;
  font-size: 0.78rem;
}

@media (max-width: 960px) {
  .portfolio-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

  .shot-emozioni,
  .shot-moonlight,
  .shot-logo,
  .shot.shot-phone {
    grid-column: auto;
    grid-row: auto;
  }

  .shot-emozioni,
  .shot.shot-phone {
    display: block;
    height: auto;
  }

  .shot:hover .shot-screen,
  .shot.is-hover .shot-screen {
    transform: none;
    filter: none;
  }

  .shot-screen-phone {
    width: min(100%, 250px);
    aspect-ratio: 9 / 16;
    flex: none;
    overflow: hidden;
  }

  .shot figcaption,
  .shot-emozioni figcaption,
  .shot-phone figcaption {
    position: relative;
    z-index: 3;
    flex: none;
    margin-top: 0.65rem;
    justify-content: flex-start;
  }

  .portfolio-trigger {
    grid-template-columns: 72px 1fr auto;
  }

  .cookie-actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  .cookie-actions .btn {
    height: 54px;
    min-height: 54px;
    width: 100%;
    font-size: 1.05rem;
    padding: 0 1.2rem;
  }

  .about-row {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
  }

  .about-photo {
    width: min(220px, 70vw);
  }
}
