:root{
  --bg: #000000;      /* pure black background */
  --fg: #DDDDDD;      /* light grey for primary text */
  --accent: #888888;  /* medium grey for accents and links */
  --accent-hover: #AAAAAA; /* slightly lighter grey on hover */
  --border: #1A1A1A;  /* dark border colour for subtle delineation */
  --card-bg-start: #000000;
  --card-bg-end: #000000;
  --font-sans: 'Poppins', sans-serif;
}

.work-card.upcoming{
  opacity: 0.5;
  pointer-events: none;
  box-shadow: none;
  transition: none;
}

/* Base styles */
html, body{
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  line-height: 1.6;
  font-size: 1rem;
  font-weight: 300;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3{
  font-weight: 300;
  letter-spacing: 0.02em;
}

a{
  color: var(--fg);
  text-decoration: none;
  transition: color 0.2s ease-in-out;
}
a:hover{
  color: var(--accent);
}

/* Layout container to constrain content width */
.container{
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 16px;
}

header{
  /* Keep the header fixed at the top of the viewport on scroll */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  /* Use flexbox to centre the navigation */
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 16px;
  letter-spacing: 0.02em;
}

/* Logo anchored to the left of the header */
.logo{
  position: absolute;
  left: 16px;
  display: flex;
  align-items: center;
}

/* Toggle base */
#menu-toggle{ display:none; }

nav{
  /* Do not force the nav to occupy all available space; let it size to its contents */
  display: flex;
  justify-content: center;
  margin: 0 auto;
}

.nav-list{
  list-style: none;
  margin: 0;
  padding: 16px 0;
  display: flex;
  gap: 24px;
  justify-content: center;
}
.nav-list li a{
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  font-weight: 300;
}
.nav-list li a:hover, .nav-list li a.active{
  color: var(--accent);
  border-color: var(--accent);
}
.nav-list .nav-logo{ display:none; }

/* Skip link for accessibility */
.skip-link{
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus{
  position: static;
  width: auto;
  height: auto;
  padding: 8px;
  background: var(--accent);
  color: #fff;
  z-index: 1001;
}

/* Hero section on the home page */
.hero{
  text-align: center;
  padding: 180px 16px;
  color: var(--fg);
  position: relative;
  margin-top: 0;
  overflow: hidden;
  /* Ensure hero content floats above the portrait and decorative graphics */
  z-index: 0;
}

.hero-logo{
  display: block;
  margin: 1.5em auto 0;
  margin-bottom: -5em;
  max-width: 100%;
  width: clamp(160px, 28vw, 80px);
  opacity: 0.75;
  transition: opacity 0.3s;
}

.hero-logo:hover{
  opacity: 1;
}

/* Hide the portrait overlay on the hero section for a cleaner introduction */
.hero::before{
  content: none; /* keep overlay disabled without shadowing later rules */
}

.hero h1{
  font-size: 2rem;
  font-style: normal;
  font-weight: 300;
  letter-spacing: 0.05em;
  text-align: center;
  margin-top: -43px;
  margin-bottom: 0px;
}

.tagline{
  font-size: 1.1rem;
  font-style: normal;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-align: center;
  margin-top: 0px;
  margin-bottom: 0px;
  opacity: 0.9;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Buttons */
.btn{
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s; /* fixed */
  font: inherit; /* ensure buttons match link typography */
}

.btn.secondary{
  display: inline-block;
  padding: 8px 20px;
  background: transparent;
  color: var(--accent);
  border-radius: 4px;
  border: 1px solid var(--accent);
  transition: background-color 0.2s, color 0.2s; /* fixed */
}
.btn.secondary:hover{
  background: var(--accent);
  color: #ffffff;
}


.latest-works, .upcoming-event{
  padding: 16px 16px;
}
.latest-works h2, .upcoming-event h2{
  text-align: center;
  margin-bottom: 32px;
}
.works-grid{
  display: grid;
  gap: 32px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  margin-bottom: 32px;
}

/* Cards */
/* Card components on a dark background */
.work-card, .event-card, figure.work-card{
  /* Cards are solid black with a subtle border and shadow */
  background: var(--card-bg-start);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: transform 0.2s
}
.work-card:hover, .event-card:hover, figure.work-card:hover{
  transform: translateY(-4px);
}
.work-card h3{
  margin-top: 0;
}

/* Ensure year labels in work titles are separated from the title text */
.work-card h3 .works-details{
  margin-left: 0.4em;
  font-weight: 300;
  color: var(--accent);
  font-size: 0.9em;
}

.work-card hr{
  border: 0;
  border-top: 1px solid var(--border);
  margin: 12px 0;
}

/* Upcoming works are displayed in a muted style and are not interactive */
.work-card.upcoming{
  opacity: 0.5;
  pointer-events: none;
  box-shadow: none;
  transition: none;
}
.work-card.upcoming h3, .work-card.upcoming p{
  color: var(--accent);
}
.work-card.upcoming:hover{
  transform: none;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

.event-card p{
  margin: 0.25rem 0;
}

.event-card h3{
  margin-top: 0;
}

/* Adjust spacing between upcoming and past events to tighten layout */
.upcoming-event{
  margin-bottom: 18px;
}
/* Add consistent spacing below the single event card */
.upcoming-event .work-card{
  margin-bottom: 32px; /* matches .works-grid gap/margin */
}

.past-events{
  margin-top: 0;
}

/* Figures within photos page */
figure.work-card{
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
figure.work-card img{
  display: block;
  width: 100%;
  /* Fix a consistent height for all photos.  Use object-fit: cover so both
     portrait and landscape orientations crop elegantly within the card. */
  height: 220px;
  object-fit: cover;
  object-position: 50% 33%; /* center horizontally, show a bit more of the lower part */
  border-radius: 12px 12px 0 0;
}
figure.work-card figcaption{
  padding: 8px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--accent);
}

/* Contact form */
.contact-form{
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 500px;
  margin: 0 auto;
}
.contact-form label{
  font-weight: 300;
}
.contact-form input, .contact-form textarea{
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--fg);
  background: var(--card-bg-start);

    /* Prevent resizing of the message box to maintain layout integrity */
    resize: none;
}
.contact-form .btn{
  align-self: flex-start;
}

/* Social links */
.social-links{
  list-style: none;
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 16px;
  padding: 0;
}
.social-links li a{
  color: var(--fg);
  font-weight: 300;
  transition: color 0.2s;
}
.social-links li a:hover{
  color: var(--accent);
}

/* Social icon images: set consistent sizing and hover effects */
.social-links img{
  width: 21px;
  height: 21px;
  display: block;
  opacity: 0.8;
  transition: opacity 0.2s, transform 0.2s;
}
.social-links a:hover img{
  opacity: 1;
  transform: translateY(-2px);
}

/* Logo styling */
.logo img{
  /* Constrain logo height so it fits neatly within the header */
  height: 48px;
  width: auto;
}

.logo{
  margin-right: 1.5rem;
}

/* Footer styling restored from the original design */
footer{
  padding: 40px 16px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.9rem;
  /* Allow footer to push to the bottom of the viewport when content is short */
  margin-top: auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero{
    padding: 80px 12px;
  }
  .hero h1{
    font-size: 1.7rem;
    margin-top: 1em;
  }

  /* Tagline smaller */
  .tagline {
    font-size: 1rem;
    letter-spacing: 0.05em;
  }

  /* Hero logo smaller under tagline */
  .hero-logo {
    width: 100px;      /* or tweak to taste */
    margin-top: 1.5em;   /* optional extra spacing */
    margin-bottom: -2em; /* keep balance if needed */
  }
}

/* Additional mobile adjustments for instrumentation lists */
@media (max-width: 600px) {
  .instrumentation-list{
    margin: 2em auto;
  }
  .instrumentation-list > li{
    flex-direction: column;
    align-items: flex-start;
  }
  .instrumentation-list > li > ul{
    margin-left: 0;
    text-align: left;
  }
}

/* Base icon (desktop hidden) */
.menu-icon{
  display: none;
  cursor: pointer;
  z-index: 1101;               /* sopra il nav overlay */
}
.menu-icon span{
  display: block;
  background: var(--fg);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.2s ease;
  transform-origin: center;    /* rotazione centrata = meno sporgenze */
}

@media (max-width: 768px){
  /* Header mobile */
  header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 12px;
    padding-right: calc(16px + env(safe-area-inset-right, 0px));
    overflow: visible;
  }

  /* Icona hamburger nel flusso, box 44×44 */
  label.menu-icon{
    position: relative;          /* box di riferimento per le barre */
    right: auto;
    margin-left: auto;           /* spinge a destra nel flex */
    margin-right: 12px;
    width: 44px;
    height: 44px;
    display: inline-block;
    color: var(--fg);
    -webkit-tap-highlight-color: transparent;
    overflow: visible;           /* no clipping */
    padding: 0;                  /* niente padding che sposta il centro */

    z-index: 1101;
    line-height: 0;}
  /* Accessible focus ring */
  label.menu-icon:focus-visible{
    outline: 2px solid currentColor;
    outline-offset: 4px;
    border-radius: 10px;
  }

  /* Barre assolute, centrate nel box */
  label.menu-icon span{
    position: absolute;
    left: 50%;
    top: 50%;
    width: 26px;                     /* refined length for balance */
    height: 1.2px;                     /* thin, crisp */
    background: currentColor;
    border-radius: 999px;
    transform-origin: 50% 50%;
    transition:
      transform 260ms cubic-bezier(.2,.7,.2,1),
      opacity 180ms linear;
    will-change: transform, opacity;
  }

/* Hamburger layout (3 lines around the center) */
  label.menu-icon span:nth-child(1){ transform: translate(-50%, -50%) translateY(-9px); }
  label.menu-icon span:nth-child(2){ transform: translate(-50%, -50%); }
  label.menu-icon span:nth-child(3){ transform: translate(-50%, -50%) translateY( 9px); }

  /* Open state → elegant X exactly centered (no horizontal drift) */
  #menu-toggle:checked + label.menu-icon span:nth-child(1){
    transform: translate(-50%, -50%) rotate(45deg);
  }
  #menu-toggle:checked + label.menu-icon span:nth-child(2){
    opacity: 0;
  }
  #menu-toggle:checked + label.menu-icon span:nth-child(3){
    transform: translate(-50%, -50%) rotate(-45deg);
  }

  /* Subtle polish on hover/active (doesn't change header height) */
  label.menu-icon:hover span{ opacity: .9; }
  @media (prefers-reduced-motion: reduce){
    label.menu-icon span{ transition: none; }
  }

  /* Overlay nav */
  header nav{
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100vh;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transform: translateY(-100%);
    transition: transform 0.3s ease-in-out;
    z-index: 1000;                /* sotto l’icona (che sta sopra) */
    pointer-events: none;
  }
  #menu-toggle:checked + label.menu-icon + nav{
    transform: translateY(0);
    pointer-events: auto;
  }

  /* Lista nav mobile */
  header nav ul.nav-list{
    flex-direction: column;
    gap: auto;
    padding: 0;
    margin: 0;
    width: 100%;
    font-size: 1.2em;
  }
  header nav ul.nav-list li{
    text-align: center;
  }
  header nav ul.nav-list li a{
    display: inline-block;
    padding: 9px 48px;
    border-width: 1px;
    width: fit-content;
    text-align: center;
  }

  header nav ul.nav-list .nav-logo{
    display: flex;
    justify-content: center;
    margin-top: 0;
    margin-bottom: 0px;
  }
  header nav ul.nav-list .nav-logo a{
    padding: 0;
    border: none;
  }
  header nav ul.nav-list .nav-logo img{
    width: 80px;
    height: auto;
  }

  /* Logo nel flusso normale */
  .logo{
    position: static;
    margin: 0;
  }

  /* Hero testo a sinistra */
  .hero{ text-align: left; }
}

/* Utility classes */
.italic{
  font-style: italic;
}
.align-center{
  text-align: center;
}
.align-right{
  text-align: right;
}
/* Uniform title styling across all pages.  Ensure titles sit at the same height
   by resetting the top margin and providing a consistent bottom margin. */
.works-title{
  font-size: 1.5rem;
  font-weight: 300;
  text-align: center;
  margin-top: 0;
  margin-bottom: 1rem;
}
.works-details{
  color: var(--accent);
  margin-left: 0.4em;
  font-weight: 300;
  font-size: 0.9em;
}
.duration{
  margin-bottom: 1em;
  font-size: 1.15em;
}

/* Global spacing for sections: add breathing room above and below each section */
section{
  /* Reduce vertical spacing between sections for a tighter, more cohesive layout */
  margin-top: 48px;
  margin-bottom: 48px;
}

/* Uniform heading spacing for sections */
section > h1, section > h2{
  text-align: center;
  margin-top: 0;
  margin-bottom: 1rem;
  font-weight: 300;
}

.instrumentation-list{
  list-style: none;
  padding: 24px;
  background: var(--card-bg-start);
  border: 1px solid var(--border);
  border-radius: 12px;
  /* Centre the instrumentation list and constrain its width for better readability */
  /* Provide generous margins around instrumentation lists and narrow the
     column width slightly so the content is more centred on wide screens. */
  margin: 2em auto;
  max-width: 580px;
  text-align: left;
}
/* Each top-level instrument becomes a row with the instrument name on the left and
   optional additional equipment on the right. A subtle divider separates rows. */
.instrumentation-list > li{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-weight: 300;
  padding: 0.5em 0;
  border-bottom: 1px solid var(--border);
}
.instrumentation-list > li:last-child{
  border-bottom: none;
}
.instrumentation-list > li > ul{
  margin: 0;
  padding: 0;
  list-style: none;
  margin-left: auto;
  /* Allow more space for auxiliary equipment */
  max-width: 55%;
  /* Align additional instrumentation to the right */
  text-align: right;
}
.instrumentation-list > li > ul li{
  font-weight: 300;
  opacity: 0.8;
  font-style: italic;
  margin: 0 0 0.3em 0;
}

/* Tag styling for instrumentation on overview pages (works & home) */
.tag{
  display: inline-block;
  background: var(--border);
  color: var(--fg);
  padding: 2px 6px;
  margin: 0 6px 6px 0;
  font-size: 0.8rem;
  border-radius: 4px;
  line-height: 1.2;
}
.gear-list, .gear-list-tight{
  list-style: none;
  padding: 0;
  font-size: 0.85rem;
}
.gear-list li, .gear-list-tight li{
  margin: 0.25em 0;
}

/* Program list styling for concert projects (e.g., Reach.Touch.) */
.program-list{
  list-style: none;
  padding: 24px;
  background: var(--card-bg-start);
  border: 1px solid var(--border);
  border-radius: 12px;
  /* Centre the program list within the page with generous margins and
     constrain its width to mirror the instrumentation lists. */
  margin: 2em auto;
  max-width: 580px;
}
.program-list > li{
  margin-bottom: 1.2em;
}
.program-list > li > strong{
  display: block;
  font-weight: 300;
  margin-bottom: 0.4em;
}
.program-list > li > ul{
  list-style: none;
  margin: 0;
  padding-left: 1.2em;
}
.program-list > li > ul > li{
  position: relative;
  margin: 0.25em 0;
  font-style: italic;
  opacity: 0.9;
  padding-left: 1em;
}
.program-list > li > ul > li::before{
  content: "–";
  position: absolute;
  left: 0;
  color: var(--accent);
}
.works-premiere{
  margin-top: 1em;
}
.gray{
  color: var(--accent);
}
.link:hover{
  color: var(--accent);
}
.regular{
  font-style: normal;
}

/* Ensure the main content stretches to fill available space for a sticky footer */
main{
  flex: 1;
/* Offset the page content so it isn't hidden beneath the fixed header */
  padding-top: 57px;
}


/* 1) Gear sempre sotto (se lo vuoi anche su desktop) */
.instrumentation-list > li{
  flex-direction: column;
  align-items: flex-start;
}
.instrumentation-list > li > ul{
  max-width: 100%;
  text-align: left;
  margin-top: .3em;
}

/* la riga copre esattamente la larghezza interna del container */
.separator{
  border: none;
  border-top: 1px solid var(--border);
  width: min(1000px, calc(100vw - 32px)); /* 1000px su desktop, su mobile = viewport - padding container */
  margin: 0 auto;
  box-sizing: border-box;
}

/* se usi anche queste varianti, uniformale */
.works-separator,
.works-separator-small{
  border: none;
  border-top: 1px solid var(--border);
  width: min(1000px, calc(100vw - 32px));
  margin: 0 auto;
  box-sizing: border-box;
}

.works-details {
  margin-right: 0.5rem; /* or whatever spacing you want */
}

html, body{ overflow-x: hidden; } /* opzionale */

/* Image preview modal */
.image-modal{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}

.image-modal img{
  /* Limit enlarged photos to the site width and the viewport */
  display: block;
  width: auto;
  height: auto;
  max-width: min(90vw, 1000px);
  max-height: 90vh;
  box-shadow: 0 0 16px rgba(0,0,0,0.5);
}

.image-modal-close{
  position: absolute;
  top: 16px;
  right: 24px;
  font-size: 2rem;
  color: var(--fg);
  cursor: pointer;
}

@keyframes fadeIn{
  from{ opacity: 0; }
  to{ opacity: 1; }
}

.form-status {
  margin: 0 auto;
  padding: 0;  
  width: 50%;
  font-size: 1rem;
  font-weight: 300;
  min-height: 1.2em; /* prevents layout shift */
  transition: color 0.5s ease;
  list-style: none;
  background: var(--card-bg-start);
  max-width: 580px;
  text-align: center; /* centers the text inside */
}

.form-status.ok {
  color: #DDDDDD;
}

.form-status.error {
  color: #888888;
}
