/* ==========================================================================
   Patrizia Gaia Canziani — portfolio
   style.css — black background, white text, one gallery page
   ========================================================================== */

:root {
  --bg:      #000000;
  --surface: #0d0d0d;
  --line:    #232323;
  --text:    #ffffff;
  --soft:    #a3a3a3;
  --dim:     #6e6e6e;
  --accent:  #d8c9a8;
  --radius:  2px;
  --maxw:    1400px;
  --pad:     clamp(1.25rem, 4vw, 4rem);
  --ease:    cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }

img, picture, video, iframe { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; transition: color .3s var(--ease); }
a:hover { color: var(--accent); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

h1, h2, h3 { font-weight: 400; line-height: 1.12; letter-spacing: -.015em; margin: 0; }
h1 { font-size: clamp(1.9rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.3rem, 3vw, 2rem); }
p  { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

::selection { background: var(--accent); color: #000; }

/* --- utility -------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--accent); color: #000; padding: .8rem 1.2rem;
}
.skip-link:focus { left: 0; }

/* --- header / nav --------------------------------------------------------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: background .4s var(--ease), border-color .4s var(--ease);
}
.site-header.is-solid { background: color-mix(in srgb, var(--bg) 95%, transparent); border-bottom-color: var(--line); }
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; min-height: 70px;
}
.brand { font-size: .92rem; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
.brand span { color: var(--accent); }

.nav { display: flex; align-items: center; gap: clamp(.9rem, 2.4vw, 2.1rem); }
.nav a {
  font-size: .76rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--soft); position: relative; padding-block: .4rem;
}
.nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 0;
  background: var(--accent); transition: width .35s var(--ease);
}
.nav a:hover::after, .nav a[aria-current="page"]::after { width: 100%; }
.nav a[aria-current="page"] { color: var(--text); }
.nav a.nav__cv { color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); padding: .45rem .85rem; }
.nav a.nav__cv::after { display: none; }
.nav a.nav__cv:hover { background: var(--accent); color: #000; }

.burger { display: none; width: 42px; height: 42px; margin-right: -8px; align-items: center; justify-content: center; }
.burger span { display: block; width: 22px; height: 1px; background: var(--text); position: relative; }
.burger span::before, .burger span::after {
  content: ""; position: absolute; left: 0; width: 22px; height: 1px;
  background: var(--text); transition: transform .3s var(--ease);
}
.burger span::before { top: -7px; }
.burger span::after  { top:  7px; }
.burger[aria-expanded="true"] span { background: transparent; }
.burger[aria-expanded="true"] span::before { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span::after  { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .burger { display: flex; }
  .nav {
    position: fixed; inset: 70px 0 auto 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 1rem var(--pad) 2rem;
    transform: translateY(-120%); transition: transform .45s var(--ease);
    max-height: calc(100vh - 70px); overflow-y: auto;
  }
  .nav.is-open { transform: translateY(0); }
  .nav a { font-size: 1rem; letter-spacing: .1em; padding-block: .9rem; width: 100%; }
  .nav a::after { display: none; }
  .nav a.nav__cv { border: 0; padding-inline: 0; }
}

/* --- page ---------------------------------------------------------------- */
.page-head { padding-block: clamp(6.5rem, 12vw, 9rem) clamp(1.5rem, 3vw, 2.5rem); }
.page-head h1 { max-width: 24ch; }
.page-head p {
  margin: clamp(1rem, 2vw, 1.4rem) 0 0;
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  color: var(--soft);
  max-width: 68ch;
}
.page-head p.lead-en { color: var(--text); }

/* --- gallery ------------------------------------------------------------- */
.gallery { padding-block: clamp(1.5rem, 4vw, 3rem) clamp(4rem, 8vw, 7rem);
  columns: 1; column-gap: clamp(.5rem, 1.4vw, 1rem);
}
@media (min-width: 640px)  { .gallery { columns: 2; } }
@media (min-width: 1000px) { .gallery { columns: 3; } }
@media (min-width: 1400px) { .gallery { columns: 4; } }

.tile {
  position: relative; display: block; break-inside: avoid;
  margin-bottom: clamp(.5rem, 1.4vw, 1rem);
  overflow: hidden; background: var(--surface); border-radius: var(--radius);
  cursor: pointer;
}
.tile img {
  width: 100%; height: auto; display: block;
  opacity: .95; transition: transform .9s var(--ease), opacity .4s var(--ease);
}
.tile:hover img, .tile:focus-visible img { transform: scale(1.045); opacity: 1; }
.tile:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }

/* empty state while photos are not uploaded yet */
.tile--pending { aspect-ratio: 4 / 3; }
.tile--pending img { width: 100%; height: 100%; object-fit: cover; }
.tile__missing {
  position: absolute; inset: 0;
  display: grid; place-items: center; text-align: center;
  padding: 1rem; color: var(--dim); font-size: .74rem; letter-spacing: .08em;
}

/* video tile */
.tile--video img { aspect-ratio: 16 / 9; object-fit: cover; }
.tile__play {
  position: absolute; inset: 0; margin: auto; width: 60px; height: 60px;
  border: 1px solid rgba(255,255,255,.7); border-radius: 50%;
  display: grid; place-items: center; pointer-events: none;
  background: rgba(0,0,0,.35); backdrop-filter: blur(4px);
  transition: background .3s var(--ease), transform .3s var(--ease);
}
.tile__play svg { width: 20px; height: 20px; fill: #fff; transition: fill .3s var(--ease); }
.tile--video:hover .tile__play { background: var(--accent); transform: scale(1.06); }
.tile--video:hover .tile__play svg { fill: #000; }
.tile[data-playing="1"] { cursor: default; }
.tile[data-playing="1"]:hover img { transform: none; }

/* --- lightbox ------------------------------------------------------------ */
.lb {
  position: fixed; inset: 0; z-index: 200; display: none;
  background: rgba(0,0,0,.97); backdrop-filter: blur(6px);
  padding: clamp(1rem, 4vw, 3rem);
  align-items: center; justify-content: center;
}
.lb.is-open { display: flex; animation: fade .3s var(--ease); }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.lb__figure { margin: 0; max-width: min(1500px, 100%); max-height: 100%; display: flex; flex-direction: column; gap: 1rem; }
.lb__img { max-height: 82svh; width: auto; margin-inline: auto; object-fit: contain; }
.lb__close, .lb__nav {
  position: fixed; z-index: 2; width: 52px; height: 52px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%; background: rgba(20,20,20,.75);
  transition: border-color .3s var(--ease), background .3s var(--ease), color .3s var(--ease);
}
.lb__close { top: clamp(1rem, 3vw, 2rem); right: clamp(1rem, 3vw, 2rem); }
.lb__nav[data-lb="prev"] { left: clamp(.4rem, 2vw, 2rem); top: 50%; transform: translateY(-50%); }
.lb__nav[data-lb="next"] { right: clamp(.4rem, 2vw, 2rem); top: 50%; transform: translateY(-50%); }
.lb__close:hover, .lb__nav:hover { border-color: var(--accent); background: var(--accent); color: #000; }
.lb svg { width: 18px; height: 18px; fill: currentColor; }
.lb__count {
  position: fixed; bottom: clamp(1rem, 3vw, 2rem); left: 50%; transform: translateX(-50%);
  font-size: .75rem; letter-spacing: .16em; color: var(--dim);
}

/* --- embeds -------------------------------------------------------------- */
.embed { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; }
.embed iframe, .embed video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed--inline { margin: 0; }

/* --- contact / cv pages -------------------------------------------------- */
.doc { padding-block: 0 clamp(4rem, 8vw, 7rem); }

.contact-grid { display: grid; gap: clamp(2rem, 5vw, 4rem); }
@media (min-width: 880px) { .contact-grid { grid-template-columns: 1fr 1fr; } }

.contact-mail {
  display: inline-block; font-size: clamp(1.1rem, 2.4vw, 1.6rem);
  border-bottom: 1px solid var(--line); padding-bottom: .3rem; word-break: break-word;
}
.contact-mail:hover { border-color: var(--accent); }

.list { list-style: none; padding: 0; margin: 2rem 0 0; border-top: 1px solid var(--line); }
.list li { border-bottom: 1px solid var(--line); }
.list a { display: flex; justify-content: space-between; align-items: center; padding: 1.05rem 0; font-size: .95rem; }
.list a span:last-child { color: var(--dim); font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; }

.cv-block { margin-top: 3rem; border-top: 1px solid var(--line); }
.cv-block section { padding-block: 2rem; border-bottom: 1px solid var(--line); }
.cv-row { display: grid; gap: .25rem 2rem; padding-block: 1.05rem; border-top: 1px solid #1a1a1a; }
.cv-row:first-of-type { border-top: 0; }
@media (min-width: 700px) { .cv-row { grid-template-columns: 150px 1fr; align-items: baseline; } }
.cv-year { font-size: .74rem; letter-spacing: .14em; color: var(--accent); }
.cv-what strong { font-weight: 500; display: block; }
.cv-what span { font-size: .88rem; color: var(--soft); }
.eyebrow { font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); margin: 0 0 1rem; }

.download-bar {
  display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: center;
  margin-top: 2.5rem; padding: 1.5rem 1.75rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.download-bar p { margin: 0; font-size: .92rem; color: var(--soft); }

.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  font-size: .76rem; letter-spacing: .16em; text-transform: uppercase;
  padding: .95rem 1.6rem; border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .3s var(--ease), background .3s var(--ease), color .3s var(--ease);
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn--solid { background: var(--accent); border-color: var(--accent); color: #000; }
.btn--solid:hover { background: transparent; color: var(--accent); }

/* --- footer -------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); padding-block: clamp(2.25rem, 5vw, 3.5rem) 2rem; }
.site-footer__inner { display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; justify-content: space-between; align-items: flex-end; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: .6rem 1.5rem; }
.site-footer a { font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: var(--soft); }
.site-footer__legal { font-size: .72rem; color: var(--dim); margin-top: 2.25rem; }

/* --- reveal -------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

@media print {
  .site-header, .lb, .burger { display: none !important; }
  body { background: #fff; color: #000; }
}


/* ==========================================================================
   CREDITS — programmes list
   ========================================================================== */

.credits { padding-block: clamp(2rem, 5vw, 4rem) clamp(4rem, 8vw, 7rem); }
.credits__heading {
  font-size: clamp(1.2rem, 2.6vw, 1.8rem);
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
}

.credits__list {
  list-style: none; padding: 0; margin: 0;
  border-top: 1px solid var(--line);
}
.credits__list li {
  display: flex; flex-wrap: wrap; align-items: baseline;
  justify-content: space-between; gap: .35rem 1.5rem;
  padding-block: 1.05rem;
  border-bottom: 1px solid var(--line);
}
.credits__title { font-size: clamp(1rem, 1.5vw, 1.15rem); }
.credits__meta {
  font-size: .74rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent);
}


/* ==========================================================================
   MARQUEE — company names scrolling left to right
   ========================================================================== */

.marquee {
  padding-block: clamp(1.5rem, 3.5vw, 2.75rem);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.marquee__viewport {
  overflow: hidden;
  width: 100%;
  /* soft fade at both ends so names appear and disappear */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}

.marquee__track {
  display: flex;
  width: max-content;
  /* left → right */
  animation: marquee-ltr 46s linear infinite;
  will-change: transform;
}

.marquee__group {
  display: flex;
  align-items: center;
  flex: none;
}

.marquee__item {
  display: inline-block;
  white-space: nowrap;
  padding-inline: clamp(1.1rem, 2.6vw, 2.2rem);
  font-size: clamp(.9rem, 1.5vw, 1.15rem);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--soft);
  transition: color .3s var(--ease);
}

/* thin separator between names */
.marquee__item::after {
  content: "";
  display: inline-block;
  width: 4px; height: 4px;
  margin-left: clamp(1.1rem, 2.6vw, 2.2rem);
  border-radius: 50%;
  background: var(--accent);
  opacity: .55;
  vertical-align: middle;
}

.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee:hover .marquee__item { color: var(--text); }

/* two identical groups; moving 0 → -50% would run right-to-left,
   so we start shifted and travel right */
@keyframes marquee-ltr {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none; transform: none; }
  .marquee__viewport { overflow-x: auto; }
  .marquee__group[aria-hidden="true"] { display: none; }
}
