:root {
  --bg: #090909;
  --panel: #111111;
  --line: #1d1d1d;
  --text: #ece2d3;
  --soft: #b9aa95;
  --muted: #7f7263;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  opacity: 0;
  animation: fadeIn 0.8s ease forwards;
}

h1, h2, .logo {
  font-family: "Cormorant Garamond", serif;
  letter-spacing: -0.04em;
}

.logo {
  font-size: 22px;
}

h1 {
  font-weight: 400;
}

h2 {
  font-weight: 400;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

section {
  scroll-margin-top: 80px;
}

.page {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 24px clamp(16px, 4vw, 40px) 88px;
}

/* header */

.site-header {
  margin-bottom: 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.logo {
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.main-nav > a {
  font-size: 13px;
  color: var(--soft);
  transition: color 0.3s ease;
}

.main-nav > a:hover {
  color: var(--text);
}

/* hero */

.hero {
  max-width: 520px;
  margin: 48px 0 0;
  text-align: left;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-size: clamp(48px, 8vw, 88px);
  font-weight: 400;
  letter-spacing: -0.05em;
  line-height: 0.92;
  word-break: break-word;
  animation: fadeUp 0.8s ease;
}

.intro {
  max-width: 360px;
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

.hero-link {
  margin: 14px 0 0;
}

.hero-link a {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.01em;
  transition: color 0.3s ease;
}

.hero-link a:hover {
  color: var(--text);
}

/* sections */

.section {
  margin-top: 56px;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.section-head span {
  font-size: 11px;
  color: var(--muted);
}

h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* gallery */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.card {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--panel);
  overflow: hidden;
  border: 1px solid rgba(236, 226, 211, 0.08);
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease, filter 0.6s ease, opacity 0.6s ease;
  filter: contrast(0.95) saturate(0.95);
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.overlay span {
  color: var(--text);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-align: center;
  padding: 0 18px;
}

.card:hover img {
  transform: scale(1.06);
  filter: brightness(0.85);
}

.card:hover .overlay {
  opacity: 1;
}

/* music */

.music-panel {
  padding-top: 14px;
}

.music-panel a {
  font-size: 14px;
  color: var(--soft);
  transition: color 0.3s ease;
}

.music-panel a:hover {
  color: var(--text);
}

.music-text {
  max-width: 420px;
  margin-bottom: 14px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--soft);
}

/* about */

.about p {
  max-width: 520px;
  margin: 0;
  font-size: 14px;
  line-height: 1.95;
  color: var(--soft);
}

.signature {
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
}

.signature a {
  transition: color 0.3s ease, transform 0.3s ease;
  display: inline-block;
}

.signature a:hover {
  color: var(--text);
  transform: translateY(-1px);
}

/* detail pages */

.detail-page {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 24px clamp(20px, 4vw, 40px) 72px;
}

.detail-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.back-link {
  font-size: 13px;
  color: var(--soft);
  transition: color 0.3s ease;
}

.back-link:hover {
  color: var(--text);
}

.detail-content {
  margin-top: 40px;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 80px;
  align-items: start;
}

.detail-image-wrap {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  align-items: start;
}

.detail-image-wrap:has(img:only-child) {
  grid-template-columns: 1fr;
  max-width: 700px;
}

.detail-image-wrap img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  background: transparent;
  transition: transform 0.6s ease, opacity 0.6s ease;
}

.detail-image-wrap img:hover {
  transform: scale(1.02);
  opacity: 0.9;
}

.detail-meta {
  max-width: 360px;
  padding-top: 40px;
}

.detail-meta h1 {
  font-size: clamp(22px, 2.4vw, 34px);
  line-height: 1.06;
  letter-spacing: -0.03em;
  margin-bottom: 18px;
  word-break: normal;
}

.detail-meta p {
  font-size: 13px;
  line-height: 1.8;
  color: var(--soft);
  margin: 0 0 14px;
}

/* animations */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

.section,
.card,
.hero {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.section.show,
.card.show,
.hero.show {
  opacity: 1;
  transform: translateY(0);
}

/* responsive */

@media (max-width: 900px) {
  .detail-content {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .detail-meta {
    max-width: 680px;
  }
}

@media (max-width: 700px) {
  .topbar,
  .detail-topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .main-nav {
    flex-wrap: wrap;
    gap: 14px;
  }

  .hero {
    margin-top: 44px;
  }

  .intro {
    font-size: 13px;
  }

  .detail-page {
    padding: 18px 14px 56px;
  }

  .detail-content {
    grid-template-columns: 1fr;
    gap: 22px;
    margin-top: 28px;
  }

  .detail-image-wrap {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .detail-image-wrap:has(img:only-child) {
    grid-template-columns: 1fr;
    max-width: none;
  }

  .detail-image-wrap img {
    aspect-ratio: auto;
  }

  .detail-meta {
    max-width: none;
  }

  .detail-meta h1 {
    font-size: 26px;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 14px;
  }

  .detail-meta p {
    font-size: 13px;
    line-height: 1.75;
    margin-bottom: 12px;
  }
}

@media (max-width: 560px) {
  h2 {
    font-size: 20px;
  }

  .overlay span {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .detail-image-wrap {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .detail-meta h1 {
    font-size: 24px;
  }
}

/* HOME MOBILE: 2 immagini per riga */
@media (max-width: 700px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 8px;
    row-gap: 18px;
  }

  .card {
    display: flex;
    flex-direction: column;
    aspect-ratio: auto;
    overflow: visible;
    background: transparent;
    border: 0;
  }

  .card img {
    aspect-ratio: 4 / 5;
    height: auto;
    object-fit: cover;
  }

  .overlay {
    position: static;
    order: -1;
    min-height: 42px;
    margin-bottom: 6px;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    opacity: 1;
    align-items: flex-end;
    justify-content: flex-start;
  }

  .overlay span {
    padding: 0;
    font-size: 11px;
    line-height: 1.25;
    letter-spacing: 0.01em;
    text-align: left;
  }

  .card:hover img {
    transform: none;
    filter: contrast(0.95) saturate(0.95);
  }
}

/* LIGHTBOX */

.detail-image-wrap img {
  cursor: zoom-in;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 9999;
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox img {
  max-width: min(1100px, 92vw);
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  background: transparent;
  border: 0;
  color: #f2eadf;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 700px) {
  .lightbox {
    padding: 16px;
  }

  .lightbox-close {
    top: 14px;
    right: 16px;
    font-size: 28px;
  }

  .lightbox img {
    max-width: 94vw;
    max-height: 84vh;
  }
}

.lightbox .lightbox-prev,
.lightbox .lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  z-index: 10001;
  opacity: 0.55;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.lightbox .lightbox-prev:hover,
.lightbox .lightbox-next:hover {
  opacity: 1;
  transform: translateY(-50%) scale(1.04);
}

.lightbox .lightbox-prev {
  left: 28px;
}

.lightbox .lightbox-next {
  right: 28px;
}

.lightbox .lightbox-prev::before,
.lightbox .lightbox-next::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  border-top: 1.4px solid rgba(255, 255, 255, 0.92);
  border-right: 1.4px solid rgba(255, 255, 255, 0.92);
}

.lightbox .lightbox-prev::before {
  transform: translate(-35%, -50%) rotate(-135deg);
}

.lightbox .lightbox-next::before {
  transform: translate(-65%, -50%) rotate(45deg);
}

@media (max-width: 700px) {
  .lightbox .lightbox-prev,
  .lightbox .lightbox-next {
    width: 44px;
    height: 44px;
  }

  .lightbox .lightbox-prev {
    left: 12px;
  }

  .lightbox .lightbox-next {
    right: 12px;
  }

  .lightbox .lightbox-prev::before,
  .lightbox .lightbox-next::before {
    width: 14px;
    height: 14px;
  }
}

