.profile-main { display: block; margin-inline: auto; width: min(100%, 80rem); line-height: 1.65; }
.profile-main section { scroll-margin-top: 1.5rem; }
.profile-hero, .split, .section-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  align-items: start;
  gap: clamp(2rem, 6vw, 6rem);
}
.profile-hero { align-items: end; padding-block: clamp(3rem, 7vw, 6.5rem); }
.profile-hero h1 { font-size: clamp(4.2rem, 7.5vw, 7.6rem); }
.profile-hero strong { display: block; }
.profile-hero p { max-width: 32ch; font-size: clamp(1.3rem, 2.2vw, 2.2rem); line-height: 1.3; letter-spacing: -.035em; }
.contents { display: flex; flex-wrap: wrap; gap: 0 1.5rem; padding: .35rem 0; border-top: 1px solid var(--rule); }
.contents a, .project-copy a { display: inline-flex; align-items: center; gap: .6em; min-height: 44px; }
.contents a:hover, .project-copy a, .contact-list a { text-decoration: underline; text-underline-offset: .22em; }
.chapter { border-top: 1px solid var(--rule); padding-block: clamp(2.75rem, 6vw, 5.5rem); }
.chapter h2 { font-size: clamp(2.65rem, 4.8vw, 4.85rem); letter-spacing: -.06em; line-height: 1.02; }
.story, .section-intro p, #contatti p { max-width: 62ch; font-size: clamp(1rem, 1.2vw, 1.15rem); }
.story p + p { margin-top: .9em; }
.story strong { font-weight: 610; }
.section-intro { margin-bottom: clamp(1.75rem, 4vw, 3.25rem); }
.projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(1.25rem, 3vw, 3rem); row-gap: clamp(4rem, 7vw, 6rem); }
.project-media { display: grid; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface); }
.project-media img { width: 100%; height: 100%; min-height: 0; display: block; object-fit: cover; }
.project-media img[src$="friginfest.webp"] { object-fit: contain; }
.placeholder { display: grid; place-items: center; margin: .8rem; border: 1px dashed var(--outline); color: var(--muted); text-align: center; padding: 1rem; font-size: .88rem; }
.project-copy { padding-top: 1rem; }
.category { font-size: .8rem; color: var(--muted); font-weight: 600; letter-spacing: .025em; }
.project-card h3 { margin: .4rem 0 .7rem; font-size: clamp(1.45rem, 2.1vw, 2.1rem); line-height: 1.12; letter-spacing: -.04em; }
.project-copy p:not(.category) { max-width: 59ch; color: var(--muted); }
.project-copy a { margin-top: .4rem; }
.project-card:last-child:nth-child(odd) { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.25rem, 3vw, 3rem); align-items: center; }
.contact-list { display: grid; justify-items: start; gap: .55rem; margin-top: 1.25rem; }
.contact-list div { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; }
.contact-list a { overflow-wrap: anywhere; }
.contact-list button { padding: .5rem .85rem; border: 1px solid var(--muted); border-radius: 2rem; background: transparent; color: inherit; font: inherit; font-size: .88rem; cursor: pointer; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .project-media img { transition: transform .24s ease-out; }
  .project-card:hover .project-media img { transform: scale(1.015); }
}
@media (max-width: 700px) {
  .profile-hero, .split, .section-intro, .projects, .project-card:last-child:nth-child(odd) { grid-template-columns: minmax(0, 1fr); }
  .profile-hero, .split, .section-intro { gap: 1.35rem; }
  .projects { row-gap: 4.5rem; }
  .project-card:last-child:nth-child(odd) { display: block; }
  .contents { column-gap: 1.1rem; }
}

.trip-gallery { position: relative; }
.trip-gallery .project-media img[hidden], .trip-controls[hidden] { display: none; }
.trip-gallery img[height="1000"] { object-fit: contain; }
.trip-gallery .project-media a:first-child img { object-position: center 30%; }
.trip-controls {
  position: absolute; right: .5rem; bottom: .5rem;
  display: inline-flex; align-items: center; border-radius: 2rem;
  color: var(--ink); background: var(--paper); font-size: .8rem; font-variant-numeric: tabular-nums;
}
.trip-controls button {
  display: grid; place-items: center; width: 44px; height: 44px;
  padding: 0; border: 0; border-radius: 50%; color: inherit; background: transparent; cursor: pointer;
}
.trip-controls button:hover { background: var(--surface); }
.trip-controls button:focus-visible { outline-offset: -3px; }
.trip-controls button:first-child .arrow { transform: rotate(180deg); }
@media print { .trip-controls { display: none; } }

.app-gallery .project-media { background: #fafafa; }
.app-gallery .project-media a { display: block; min-height: 0; cursor: zoom-in; }
.app-gallery .project-media a[hidden] { display: none; }
.app-gallery .project-media a:focus-visible { outline-offset: -4px; outline-color: #312442; }
.app-gallery picture { display: block; height: 100%; }
.app-gallery .project-media img { object-fit: contain; transform: none; }
.app-gallery-bar { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.app-gallery-bar .trip-controls { position: static; }
.enlarge-shot { display: inline-flex; align-items: center; min-height: 44px; font-size: .85rem; text-decoration: underline; text-underline-offset: .22em; }
@media print { .app-gallery-bar { display: none; } }

@media (max-width: 700px) { .app-gallery .project-media { aspect-ratio: 11 / 10; } }

.shot-viewer {
  margin: auto; padding: .65rem; border: 1px solid var(--rule); border-radius: .8rem;
  max-width: calc(100% - 1.5rem); color: var(--ink); background: var(--paper);
}
.shot-viewer::backdrop { background: rgb(24 16 28 / .78); }
.shot-viewer header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
.shot-viewer button {
  min-height: 44px; padding: .4rem 1rem; border-radius: 2rem; border: 1px solid var(--outline);
  font: inherit; color: inherit; background: var(--surface); cursor: pointer;
}
.shot-viewer img {
  display: block; margin: auto; width: auto; height: auto; max-width: 100%;
  max-height: calc(100vh - 7rem); max-height: calc(100dvh - 7rem); object-fit: contain;
}
html:has(.shot-viewer[open]) { overflow: hidden; }

/* Swipe galleries and single-line image labels. */
[data-gallery] .project-media, .shot-frame { touch-action: pan-y pinch-zoom; }
.trip-gallery .project-media a { display: block; min-height: 0; cursor: zoom-in; }
.trip-gallery .project-media a[hidden] { display: none; }
.trip-gallery .trip-controls { position: static; display: flex; justify-content: center; }
.trip-gallery .trip-controls[hidden] { display: none; }
.app-gallery-bar .trip-controls { min-width: 0; }
.trip-controls button { flex: 0 0 44px; }
.trip-controls span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.enlarge-shot { white-space: nowrap; }
.gallery-dots, .shot-dots { display: flex; align-items: center; justify-content: center; }
.gallery-dots button, .shot-viewer .shot-dots button {
  display: grid; place-items: center; width: 34px; min-height: 36px;
  padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer;
}
.gallery-dots button::after, .shot-dots button::after {
  content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; opacity: .35;
}
.gallery-dots button[aria-current]::after, .shot-dots button[aria-current]::after { opacity: 1; }
.shot-viewer { width: min(96vw, 75rem); }
.shot-frame { overflow: hidden; display: grid; place-items: center; height: min(70vh, 58rem); height: min(70dvh, 58rem); }
.shot-viewer img { max-height: 100%; }
.shot-navigation { display: flex; gap: .25rem; justify-content: center; align-items: center; margin-top: .5rem; }
.shot-navigation > button { display: grid; place-items: center; width: 44px; padding: 0; flex: 0 0 44px; }
.shot-previous .arrow { transform: rotate(180deg); }
.shot-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media print { .gallery-dots { display: none; } }
