:root {
  --bg: #242528;
  --header-bg: #121314;
  --ink: #f2f0eb;
  --sub: #9b9890;
  --accent: #eab308;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: #ffffff; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px clamp(20px, 4vw, 64px);
  background: color-mix(in srgb, var(--header-bg) 88%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(242, 240, 235, 0.08);
}

.logo-name {
  font-family: 'Lato', sans-serif;
  font-weight: 900;
  font-size: 23px;
  letter-spacing: .01em;
  color: var(--accent);
}

.logo-role {
  font-family: 'Lato', sans-serif;
  font-weight: 100;
  font-size: 23px;
  letter-spacing: .01em;
  color: var(--ink);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(16px, 3vw, 32px);
}

.nav-toggle {
  display: none;
  position: relative;
  z-index: 2;
  background: none;
  border: none;
  margin-left: auto;
  padding: 8px 10px;
  font-size: 20px;
  line-height: 1;
  color: var(--accent);
  cursor: pointer;
}

.logo-mobile { display: none; }

/* Touch devices (phones, tablets, in either orientation): the full header
   bar costs too much fixed height, especially in landscape. Collapse it to
   just a menu icon — tapping it opens the logo + links as a dropdown —
   matching what Daniele asked for after seeing albertwatson.net's mobile
   header. Keyed on touch capability (hover:none/pointer:coarse) rather than
   a width breakpoint, since the problem showed up on an iPad in landscape,
   not just on narrow phones. */
@media (hover: none) and (pointer: coarse) {
  .site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    background: none;
    backdrop-filter: none;
    border-bottom: none;
    padding: 8px clamp(16px, 4vw, 28px);
  }

  .site-header > .logo { display: none; }

  .nav-toggle { display: block; }

  .site-nav {
    display: none;
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0;
    background: rgba(10, 10, 9, .97);
    border-bottom: 1px solid rgba(242, 240, 235, 0.08);
    padding-bottom: 8px;
  }

  .site-nav.is-open { display: flex; }

  .logo-mobile {
    display: block;
    padding: 16px clamp(16px, 4vw, 28px) 12px;
  }

  .site-nav .navlink {
    padding: 14px clamp(16px, 4vw, 28px);
    border-top: 1px solid rgba(242, 240, 235, 0.06);
  }

  .stage,
  .decades-main {
    padding-top: clamp(52px, 12vw, 72px);
  }
}

.navlink {
  font-family: 'Courier Prime', monospace;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 400;
}

.navlink:hover { color: var(--accent); }

.coming-soon {
  text-align: center;
}

.coming-soon-title {
  font-family: 'Lato', sans-serif;
  font-weight: 900;
  font-size: clamp(32px, 6vw, 56px);
  letter-spacing: .02em;
  color: var(--accent);
}

.coming-soon-sub {
  margin-top: 14px;
  font-family: 'Courier Prime', monospace;
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--sub);
}

.stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 6vw, 80px) clamp(20px, 4vw, 64px);
  background: #000;
}

.carousel-figure {
  margin: 0;
  width: 100%;
  max-width: 1180px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.carousel-frame {
  position: relative;
  min-height: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #000;
}

.intro {
  position: absolute;
  top: 0;
  bottom: 0;
  /* full viewport width, not the frame's -- the frame is now sized to the
     photo (see updateImgMaxHeight/serial fix), which can be narrower than
     "Daniele Gobbin photographer" needs, wrapping it to two lines */
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  align-content: center;
  flex-wrap: wrap;
  gap: 8px;
  text-align: center;
  opacity: 0; /* stays invisible until script.js confirms the webfont is ready */
  transition: opacity 1s linear;
  will-change: opacity;
}

.intro .logo-name,
.intro .logo-role {
  font-size: clamp(34.5px, 7vw, 56px);
  text-shadow: 0 2px 16px rgba(0, 0, 0, .7); /* name now sits over the first photo, not a plain black backdrop */
}

.carousel-caption-row {
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  align-items: center;
  width: 100%;
}

.carousel-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.carousel-btn {
  background: none;
  border: none;
  margin: 0;
  padding: 8px;
  font-family: 'Courier Prime', monospace;
  font-size: 13px;
  line-height: 1;
  color: var(--sub);
  cursor: pointer;
}

.carousel-btn:hover,
.carousel-btn:focus-visible { color: var(--accent); }

.carousel-btn:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 1px;
}

.carousel-btn-arrow {
  font-size: 11px;
}

.carousel-btn-text {
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.carousel-btn-text.is-on { color: var(--accent); }

.carousel-btn-text.is-on:hover,
.carousel-btn-text.is-on:focus-visible { color: var(--ink); }

@keyframes music-hint-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}

#music-toggle.hint { animation: music-hint-pulse 1.1s ease-in-out 3; }

.carousel-serial {
  grid-column: 3;
  text-align: right;
  font-family: 'Courier Prime', monospace;
  font-size: 9px;
  letter-spacing: .04em;
  color: #706d66;
  transition: opacity .6s linear;
}

.carousel-frame img {
  display: block;
  max-width: 100%;
  max-height: min(65vh, var(--img-max-height, 55vh));
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 1px;
  transition: opacity .6s linear, transform .6s cubic-bezier(.22, .9, .36, 1);
}

.carousel-caption {
  grid-column: 2;
  font-family: 'Courier Prime', monospace;
  font-size: 13px;
  letter-spacing: .01em;
  text-align: center;
  color: var(--sub);
  max-width: 640px;
  margin: 0 auto;
  transition: opacity .6s linear;
}

.navlink.is-active { color: var(--accent); }

.simple-page {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(40px, 8vw, 100px) clamp(20px, 4vw, 64px);
}

.bio-text {
  max-width: 640px;
  font-family: 'Courier Prime', monospace;
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink);
}

.contact-block {
  text-align: center;
}

.contact-label {
  margin: 0 0 14px;
  font-family: 'Courier Prime', monospace;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sub);
}

.contact-email {
  font-family: 'Lato', sans-serif;
  font-weight: 900;
  font-size: clamp(22px, 4.5vw, 36px);
  color: var(--accent);
}

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

.site-footer {
  position: relative;
  padding: 16px clamp(20px, 4vw, 64px);
  text-align: center;
}

.music-hint-banner {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  white-space: nowrap;
  font-family: 'Lato', sans-serif;
  font-weight: 900;
  font-size: clamp(18px, 4vw, 28px);
  color: var(--accent);
  text-shadow: 0 2px 12px rgba(0, 0, 0, .6);
  opacity: 0;
  pointer-events: none;
  transition: opacity .6s ease;
}

.music-hint-banner.is-visible { opacity: 1; }

.site-footer .carousel-controls { justify-content: center; }

.site-footer > .carousel-btn-text,
.site-footer > .carousel-controls {
  margin-bottom: 10px;
}

.footer-text {
  margin: 0;
  font-family: 'Courier Prime', monospace;
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--sub);
}

.footer-text + .footer-text { margin-top: 4px; }

.decades-main {
  padding: clamp(32px, 5vw, 56px) clamp(20px, 4vw, 64px) clamp(60px, 8vw, 100px);
}

.decade-section + .decade-section {
  margin-top: clamp(48px, 7vw, 88px);
}

.decade-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.decade-heading h2 {
  font-family: 'Lato', sans-serif;
  font-weight: 900;
  font-size: clamp(22px, 3vw, 32px);
  margin: 0;
}

.decade-heading span {
  font-family: 'Courier Prime', monospace;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sub);
}

.decade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 3px;
}

.decade-tile {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 1px;
  outline-offset: 3px;
  background: #000;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  cursor: pointer;
}

.decade-tile:focus-visible { outline: 2px solid var(--ink); }

.decade-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s cubic-bezier(.2,.8,.2,1);
}

.decade-tile:hover img,
.decade-tile:focus-visible img { transform: scale(1.05); }

.decade-tile-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-family: 'Courier Prime', monospace;
  font-size: 11px;
  letter-spacing: .02em;
  color: var(--ink);
  background: linear-gradient(to top, rgba(0,0,0,.82), rgba(0,0,0,0) 75%);
}

.decade-tile-serial {
  flex: none;
  font-size: 9px;
  color: #706d66;
}

.decades-empty {
  font-family: 'Courier Prime', monospace;
  color: var(--sub);
  text-align: center;
  padding: 80px 0;
}

body.lightbox-open { overflow: hidden; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: clamp(20px, 5vw, 64px);
  background: rgba(10, 10, 9, 0.96);
}

.lightbox[hidden] { display: none; }

.lightbox-img {
  max-width: 100%;
  max-height: calc(100% - 50px);
  object-fit: contain;
  -webkit-user-drag: none;
  user-select: none;
}

.lightbox-caption {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Courier Prime', monospace;
  font-size: 12px;
  color: var(--sub);
}

.lightbox-serial {
  color: #706d66;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  padding: 10px;
  font-family: 'Courier Prime', monospace;
  font-size: 18px;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
  color: var(--accent);
}
