/* ══════════════════════════════════════════════
   CARTOLERIA CATANIA — style.css
   ══════════════════════════════════════════════ */

/* ── DESIGN TOKENS ── */
:root {
  /* Color palette */
  --clr-primary:        hsl(220, 72%, 28%);
  --clr-primary-light:  hsl(220, 72%, 40%);
  --clr-primary-dark:   hsl(220, 72%, 18%);
  --clr-accent:         hsl(38, 95%, 52%);
  --clr-accent-light:   hsl(38, 95%, 65%);
  --clr-accent-dark:    hsl(38, 85%, 40%);
  --clr-surface:        hsl(220, 20%, 97%);
  --clr-surface-2:      hsl(220, 15%, 93%);
  --clr-surface-card:   hsl(0, 0%, 100%);
  --clr-text:           hsl(220, 25%, 14%);
  --clr-text-muted:     hsl(220, 15%, 48%);
  --clr-white:          #ffffff;
  --clr-footer-bg:      hsl(220, 72%, 14%);

  /* Typography */
  --font-display:  'Playfair Display', Georgia, serif;
  --font-body:     'Inter', system-ui, sans-serif;

  /* Spacing */
  --space-xs:   0.25rem;
  --space-sm:   0.5rem;
  --space-md:   1rem;
  --space-lg:   1.5rem;
  --space-xl:   2.5rem;
  --space-2xl:  4rem;
  --space-3xl:  6rem;

  /* Radii */
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --radius-xl:  32px;

  /* Shadows */
  --shadow-sm:  0 1px 4px hsl(220 30% 20% / 0.08);
  --shadow-md:  0 4px 16px hsl(220 30% 20% / 0.12);
  --shadow-lg:  0 12px 40px hsl(220 30% 20% / 0.18);
  --shadow-xl:  0 24px 60px hsl(220 30% 20% / 0.22);

  /* Transitions */
  --ease-out:   cubic-bezier(0.22, 1, 0.36, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --container-max: 1280px;
  --nav-height:    72px;
}

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--clr-text);
  background: var(--clr-surface);
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul { list-style: none; }

/* ── CONTAINER ── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

/* ── SECTION HEADER ── */
.section-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.section-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clr-accent-dark);
  background: hsl(38, 95%, 92%);
  padding: 0.3em 1em;
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-md);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--clr-primary-dark);
  line-height: 1.15;
  margin-bottom: var(--space-md);
}

.section-desc {
  font-size: 1.05rem;
  color: var(--clr-text-muted);
  max-width: 600px;
  margin-inline: auto;
}

/* ══════════════════════════════════════════
   NAVIGATION
══════════════════════════════════════════ */
.site-header {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: hsl(220, 72%, 16% / 0.92);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid hsl(220, 72%, 30% / 0.3);
  transition: background 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.site-header.scrolled {
  background: hsl(220, 72%, 14% / 0.98);
  box-shadow: var(--shadow-lg);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
  gap: var(--space-xl);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--clr-white);
  white-space: nowrap;
  user-select: none;
}

.logo-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.logo-accent { color: var(--clr-accent); }

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.nav-link {
  padding: 0.45rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: hsl(220, 30%, 82%);
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover { color: var(--clr-white); background: hsl(220, 60%, 30%); }

.nav-link--cta {
  background: var(--clr-accent);
  color: var(--clr-primary-dark) !important;
  font-weight: 600;
  padding: 0.45rem 1.25rem;
}

.nav-link--cta:hover {
  background: var(--clr-accent-light) !important;
  color: var(--clr-primary-dark) !important;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--clr-white);
  border-radius: 2px;
  transition: transform 0.3s var(--ease-out), opacity 0.3s;
}

.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ══════════════════════════════════════════
   HERO
══════════════════════════════════════════ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  background: linear-gradient(
    155deg,
    var(--clr-primary-dark) 0%,
    var(--clr-primary) 45%,
    hsl(220, 60%, 35%) 100%
  );
  overflow: hidden;
  padding-top: var(--nav-height);
}

.hero__bg-shapes { position: absolute; inset: 0; pointer-events: none; }

.shape {
  position: absolute;
  border-radius: 50%;
  mix-blend-mode: soft-light;
  animation: float 12s ease-in-out infinite;
}

.shape--1 {
  width: clamp(300px, 50vw, 700px);
  height: clamp(300px, 50vw, 700px);
  background: radial-gradient(circle, hsl(38, 95%, 60% / 0.35) 0%, transparent 70%);
  top: -20%;
  right: -10%;
  animation-delay: 0s;
}

.shape--2 {
  width: clamp(200px, 35vw, 450px);
  height: clamp(200px, 35vw, 450px);
  background: radial-gradient(circle, hsl(200, 80%, 70% / 0.25) 0%, transparent 70%);
  bottom: 5%;
  left: -8%;
  animation-delay: -4s;
}

.shape--3 {
  width: clamp(150px, 25vw, 320px);
  height: clamp(150px, 25vw, 320px);
  background: radial-gradient(circle, hsl(220, 30%, 90% / 0.15) 0%, transparent 70%);
  top: 55%;
  right: 20%;
  animation-delay: -8s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(20px, -25px) scale(1.04); }
  66%       { transform: translate(-15px, 15px) scale(0.97); }
}

.hero__content {
  position: relative;
  z-index: 1;
  padding-block: var(--space-3xl);
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--clr-accent);
  border: 1px solid hsl(38, 95%, 52% / 0.4);
  background: hsl(38, 95%, 52% / 0.12);
  padding: 0.35em 1em;
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-lg);
  animation: fadeSlideUp 0.6s var(--ease-out) both;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 8vw, 5.5rem);
  font-weight: 900;
  line-height: 1.05;
  color: var(--clr-white);
  margin-bottom: var(--space-lg);
  animation: fadeSlideUp 0.6s var(--ease-out) 0.1s both;
}

.hero__title--accent {
  background: linear-gradient(135deg, var(--clr-accent), var(--clr-accent-light));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero__subtitle {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: hsl(220, 30%, 82%);
  max-width: 560px;
  margin-bottom: var(--space-xl);
  animation: fadeSlideUp 0.6s var(--ease-out) 0.2s both;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
  animation: fadeSlideUp 0.6s var(--ease-out) 0.3s both;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.85rem 2rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.2s var(--ease-bounce), box-shadow 0.2s, background 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.btn:hover  { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--clr-accent);
  color: var(--clr-primary-dark);
  box-shadow: 0 4px 20px hsl(38, 95%, 52% / 0.4);
}

.btn--primary:hover {
  background: var(--clr-accent-light);
  box-shadow: 0 8px 30px hsl(38, 95%, 52% / 0.5);
}

.btn--outline {
  background: transparent;
  color: var(--clr-white);
  border-color: hsl(220, 30%, 70%);
}

.btn--outline:hover {
  background: hsl(220, 30%, 100% / 0.1);
  border-color: var(--clr-white);
}

/* Stats */
.hero__stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-lg);
  animation: fadeSlideUp 0.6s var(--ease-out) 0.4s both;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat__number {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--clr-accent);
  line-height: 1;
}

.stat__label {
  font-size: 0.78rem;
  color: hsl(220, 30%, 72%);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat__divider {
  width: 1px;
  height: 40px;
  background: hsl(220, 30%, 60% / 0.4);
}

/* Scroll hint */
.hero__scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  animation: bounce 2s ease-in-out infinite;
}

.scroll-arrow {
  width: 20px;
  height: 20px;
  border-right: 2px solid hsl(220, 30%, 70%);
  border-bottom: 2px solid hsl(220, 30%, 70%);
  transform: rotate(45deg);
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(8px); }
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════
   SERVICES
══════════════════════════════════════════ */
.services {
  padding-block: var(--space-3xl);
  background: var(--clr-surface);
}

.services__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-lg);
}

.service-card {
  position: relative;
  background: var(--clr-surface-card);
  border: 1px solid hsl(220, 20%, 90%);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-lg);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), border-color 0.3s;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--clr-primary), var(--clr-primary-light));
  opacity: 0;
  transition: opacity 0.3s;
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: hsl(220, 40%, 82%);
}

.service-card:hover::before { opacity: 1; }

.service-card--featured {
  border-color: var(--clr-accent);
  background: linear-gradient(160deg, hsl(38, 95%, 98%) 0%, var(--clr-surface-card) 100%);
}

.service-card--featured::before {
  background: linear-gradient(90deg, var(--clr-accent), var(--clr-accent-light));
  opacity: 1;
}

.service-card__badge {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--clr-accent);
  color: var(--clr-primary-dark);
  padding: 0.25em 0.75em;
  border-radius: var(--radius-xl);
}

.service-card__icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
  display: block;
  line-height: 1;
}

.service-card__title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--clr-primary-dark);
  margin-bottom: var(--space-sm);
}

.service-card__desc {
  font-size: 0.92rem;
  color: var(--clr-text-muted);
  margin-bottom: var(--space-lg);
  line-height: 1.65;
}

.service-card__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.service-card__list li {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.88rem;
  color: var(--clr-text);
}

.service-card__list li::before {
  content: '';
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--clr-accent);
}

/* ══════════════════════════════════════════
   BRANDS MARQUEE
══════════════════════════════════════════ */
.brands {
  padding-block: var(--space-xl);
  background: var(--clr-primary-dark);
  overflow: hidden;
}

.brands__label {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: hsl(220, 30%, 65%);
  margin-bottom: var(--space-lg);
}

.brands__track {
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
}

.brands__inner {
  display: flex;
  gap: var(--space-2xl);
  width: max-content;
  animation: marquee 22s linear infinite;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: hsl(220, 30%, 60%);
  white-space: nowrap;
  transition: color 0.2s;
}

.brand-name:hover { color: var(--clr-accent); }

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ══════════════════════════════════════════
   GALLERY
══════════════════════════════════════════ */
.gallery {
  padding-block: var(--space-3xl);
  background: var(--clr-surface-2);
}

/* Filter buttons */
.gallery__filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-2xl);
}

.filter-btn {
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-xl);
  border: 2px solid hsl(220, 25%, 82%);
  background: var(--clr-surface-card);
  color: var(--clr-text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  font-family: var(--font-body);
}

.filter-btn:hover {
  border-color: var(--clr-primary-light);
  color: var(--clr-primary);
  background: hsl(220, 72%, 95%);
}

.filter-btn--active {
  background: var(--clr-primary);
  border-color: var(--clr-primary);
  color: var(--clr-white);
}

.filter-btn--active:hover {
  background: var(--clr-primary-light);
  border-color: var(--clr-primary-light);
  color: var(--clr-white);
}

/* Gallery grid */
.gallery__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md);
  contain: layout;
}

/* Gallery item */
.gallery-item {
  position: relative;
  background: var(--clr-surface-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid hsl(220, 15%, 90%);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
  cursor: pointer;
  /* Filter animation */
  animation: fadeIn 0.35s var(--ease-out) both;
}

.gallery-item.hidden {
  display: none;
}

.gallery-item:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: var(--shadow-xl);
  z-index: 2;
}

.gallery-item__img-wrap {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--clr-surface-2);
}

.gallery-item__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 0.5rem;
  transition: transform 0.45s var(--ease-out);
}

.gallery-item:hover .gallery-item__img-wrap img {
  transform: scale(1.08);
}

.gallery-item__caption {
  padding: 0.65rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--clr-text);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-top: 1px solid hsl(220, 15%, 92%);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════
   FOOTER
══════════════════════════════════════════ */
.footer {
  position: relative;
  background: var(--clr-footer-bg);
  color: hsl(220, 30%, 80%);
  padding-top: var(--space-3xl);
}

.footer__wave {
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  line-height: 0;
  color: var(--clr-surface-2);
}

.footer__wave svg {
  width: 100%;
  height: 80px;
}

.footer__inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.8fr;
  gap: var(--space-2xl);
  padding-bottom: var(--space-2xl);
}

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.footer__logo-icon {
  font-size: 2rem;
  line-height: 1;
}

.footer__logo-text {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--clr-white);
}

.footer__tagline {
  font-size: 0.95rem;
  line-height: 1.7;
  color: hsl(220, 25%, 65%);
}

.footer__section-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--clr-white);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid hsl(220, 40%, 28%);
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
}

.contact-item__icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.contact-item__label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: hsl(220, 25%, 55%);
  margin-bottom: 2px;
}

.contact-item__value {
  display: block;
  font-size: 0.95rem;
  color: hsl(220, 20%, 82%);
  line-height: 1.5;
  transition: color 0.2s;
}

a.contact-item__value:hover { color: var(--clr-accent); }

.footer__links ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer__link {
  font-size: 0.92rem;
  color: hsl(220, 20%, 68%);
  padding: 0.2rem 0;
  position: relative;
  transition: color 0.2s;
}

.footer__link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 1px;
  background: var(--clr-accent);
  transition: width 0.25s var(--ease-out);
}

.footer__link:hover { color: var(--clr-accent); }
.footer__link:hover::after { width: 100%; }

.footer__bottom {
  border-top: 1px solid hsl(220, 40%, 22%);
  padding-block: var(--space-lg);
  text-align: center;
  font-size: 0.82rem;
  color: hsl(220, 20%, 50%);
}

/* ══════════════════════════════════════════
   BACK TO TOP
══════════════════════════════════════════ */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--clr-primary);
  color: var(--clr-white);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  z-index: 900;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s var(--ease-out), background 0.2s;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--clr-primary-light);
  transform: translateY(-2px);
}

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 1024px) {
  .footer__inner {
    grid-template-columns: 1fr 1fr;
  }

  .footer__brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav-menu {
    position: fixed;
    top: var(--nav-height);
    left: 0; right: 0;
    background: var(--clr-primary-dark);
    flex-direction: column;
    padding: var(--space-lg);
    gap: var(--space-xs);
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s var(--ease-out), opacity 0.35s;
    border-bottom: 1px solid hsl(220, 40%, 25%);
  }

  .nav-menu.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-link, .nav-link--cta {
    width: 100%;
    text-align: center;
    padding: 0.75rem 1rem;
  }

  .hero__stats { gap: var(--space-md); }
  .stat__divider { display: none; }

  .gallery__grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--space-sm);
  }

  .footer__inner {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .back-to-top { bottom: 1.25rem; right: 1.25rem; }
}

@media (max-width: 480px) {
  .albums-grid {
    grid-template-columns: 1fr;
  }

  .hero__actions { flex-direction: column; }
  .btn { justify-content: center; }
}

/* ══════════════════════════════════════════
   ALBUMS / FOLDER COVERS GRID
══════════════════════════════════════════ */
.albums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-lg);
}

/* Album Card — clickable folder cover */
.album-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--clr-surface-card);
  border: 1px solid hsl(220, 20%, 88%);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  padding: 0;
  transition: transform 0.32s var(--ease-out), box-shadow 0.32s var(--ease-out), border-color 0.25s;
}

.album-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  border: 2px solid transparent;
  transition: border-color 0.25s;
  pointer-events: none;
}

.album-card:hover {
  transform: translateY(-7px) scale(1.02);
  box-shadow: var(--shadow-xl);
}

.album-card:hover::after {
  border-color: var(--clr-accent);
}

.album-card:focus-visible {
  outline: 3px solid var(--clr-accent);
  outline-offset: 3px;
}

/* 2×2 mosaic preview inside the card */
.album-card__mosaic {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--clr-surface-2);
  gap: 2px;
}

.album-card__mosaic img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: var(--clr-surface-2);
  padding: 6px;
  transition: transform 0.45s var(--ease-out);
}

.album-card:hover .album-card__mosaic img {
  transform: scale(1.06);
}

/* Info bar at the bottom */
.album-card__info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: linear-gradient(135deg, var(--clr-primary-dark) 0%, var(--clr-primary) 100%);
  color: var(--clr-white);
}

.album-card__icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.album-card__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--clr-white);
  flex: 1;
  line-height: 1.25;
}

.album-card__count {
  font-size: 0.75rem;
  font-weight: 500;
  color: hsl(38, 95%, 75%);
  white-space: nowrap;
}

/* ══════════════════════════════════════════
   LIGHTBOX MODAL
══════════════════════════════════════════ */
.lb-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: hsl(220, 40%, 8% / 0.88);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  backdrop-filter: blur(8px) saturate(140%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  /* open/close animation */
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
}

.lb-overlay:not([hidden]) {
  opacity: 1;
}

.lb-overlay[hidden] {
  display: none;
}

.lb-modal {
  background: var(--clr-surface-card);
  border-radius: var(--radius-xl);
  width: min(1100px, 100%);
  max-height: 90svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.35s var(--ease-bounce);
}

.lb-overlay:not([hidden]) .lb-modal {
  transform: translateY(0) scale(1);
}

/* Modal header */
.lb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-xl);
  background: linear-gradient(135deg, var(--clr-primary-dark) 0%, var(--clr-primary) 100%);
  flex-shrink: 0;
}

.lb-header__left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.lb-header__icon {
  font-size: 1.75rem;
  line-height: 1;
}

.lb-title {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  font-weight: 700;
  color: var(--clr-white);
}

.lb-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid hsl(220, 30%, 60%);
  background: transparent;
  color: var(--clr-white);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, transform 0.2s var(--ease-bounce);
  flex-shrink: 0;
}

.lb-close:hover {
  background: hsl(220, 50%, 40%);
  border-color: var(--clr-white);
  transform: rotate(90deg) scale(1.1);
}

.lb-close:focus-visible {
  outline: 3px solid var(--clr-accent);
  outline-offset: 3px;
}

/* Modal image grid */
.lb-grid {
  /* Responsive grid: auto-fill columns, minimum 170 px wide.
     Grid rows grow to match image height — no squishing. */
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  grid-auto-rows: auto;          /* rows size to content, not a fixed track */
  align-items: start;            /* items do NOT stretch to fill the row */
  gap: var(--space-md);
  padding: var(--space-xl);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Scrollbar styling */
.lb-grid::-webkit-scrollbar { width: 6px; }
.lb-grid::-webkit-scrollbar-track { background: var(--clr-surface-2); border-radius: 3px; }
.lb-grid::-webkit-scrollbar-thumb { background: hsl(220, 30%, 70%); border-radius: 3px; }

/* Individual image in lightbox */
.lb-item {
  position: relative;
  background: var(--clr-surface-2);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid hsl(220, 15%, 90%);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s;
  animation: fadeIn 0.35s var(--ease-out) both;
  cursor: default;
}

.lb-item:hover {
  transform: scale(1.04);
  box-shadow: var(--shadow-lg);
  z-index: 1;
}

.lb-item__img-wrap {
  /* No fixed aspect-ratio: let the image height flow naturally */
  width: 100%;
  overflow: hidden;
  background: var(--clr-surface-2);
}

.lb-item__img-wrap img {
  width: 100%;
  height: auto;                  /* natural image height preserved */
  max-height: 260px;             /* cap very tall images to stay uniform */
  object-fit: contain;           /* never crop or distort */
  object-position: center;
  padding: 8px;
  display: block;
  transition: transform 0.4s var(--ease-out);
}

.lb-item:hover .lb-item__img-wrap img {
  transform: scale(1.07);
}

.lb-item__caption {
  padding: 0.5rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--clr-text);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-top: 1px solid hsl(220, 15%, 92%);
}

/* Staggered entrance animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════
   RESPONSIVE — Albums & Lightbox
══════════════════════════════════════════ */
@media (max-width: 768px) {
  .albums-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-md);
  }

  .lb-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    padding: var(--space-lg);
    gap: var(--space-sm);
  }

  .lb-header {
    padding: var(--space-md) var(--space-lg);
  }
}

@media (max-width: 480px) {
  .albums-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
  }

  .lb-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .album-card__info {
    padding: var(--space-sm) var(--space-md);
  }

  .album-card__title { font-size: 0.9rem; }
}

/* ── Accessibility: reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}


/* --- REGOLAZIONE LOGHI IMMAGINE --- */
.brand-logo {
  /* ...mantieni intatte le regole di altezza/larghezza... */
  height: 45px !important;
  max-height: 45px !important;
  width: auto !important;
  object-fit: covers;
  margin: 0 30px;
  display: inline-block;
  vertical-align: middle;
  
  /* NUOVO FILTRO (Senza bianco e nero) */
  filter: opacity(0.7); 
  transition: filter 0.3s ease;
}

/* Aggiorniamo anche l'effetto Hover/Active per togliere la regola del grayscale inutile */
.brand-logo:hover,
.brand-logo:active {
  filter: opacity(1);
}

/* --- REGOLAZIONE LOGHI TESTUALI (PER SFONDO BLU) --- */
.brand-name {
  font-size: 32px !important;
  font-weight: 800 !important;
  line-height: 45px !important;
  text-transform: uppercase;
  margin: 0 30px;
  opacity: 0.6;              /* Leggera trasparenza base */
  color: #ffffff !important; /* <--- BIANCO invece che grigio scuro! */
  display: inline-block;
  vertical-align: middle;
  transition: opacity 0.3s ease, color 0.3s ease;
}

/* Effetto hover (mouse) e active (click da smartphone) */
.brand-name:hover,
.brand-name:active {
  opacity: 1;
  color: #ffffff !important; /* Rimane bianco ma diventa acceso (pieno) */
}

/* Aggiungiamo il supporto al click (active) anche per le immagini */
.brand-logo:hover,
.brand-logo:active {
  filter: grayscale(0%) opacity(1);
}