:root {
  --bg: #000;
  --text: #fff;
  --muted: rgba(255, 255, 255, 0.28);
  --placeholder: #ccc;

  --ff-body:
    Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
    sans-serif;
  --ff-display:
    "Funnel Display", Inter, system-ui, -apple-system, Segoe UI, Roboto,
    Helvetica, Arial, sans-serif;

  /* Spacing scale */
  --pad: clamp(14px, 2.2vw, 28px);
  --gap: clamp(14px, 2.5vw, 40px);
  --hero-edge-pad: clamp(84px, 10vh, 160px);

  /* Media sizes */
  --media-radius: 0px;
  --media-aspect: 1110 / 624; /* keeps your original proportion */
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  overflow-x: hidden;
}
html {
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media (max-width: 899px) {
  html {
    scroll-snap-type: y mandatory;
  }
  .hero,
  .project,
  footer {
    scroll-snap-stop: normal;
  }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ff-body);
}

/* Small privacy notice */
.privacy-note {
  position: fixed;
  right: clamp(10px, 2vw, 24px);
  bottom: clamp(10px, 2vw, 24px);
  max-width: 320px;
  background: rgba(0, 0, 0, 0.85);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.4;
  z-index: 9999;
  backdrop-filter: blur(6px);
}
.privacy-note__actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.privacy-note__btn {
  font-size: 12px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.privacy-note__btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* ===== NAVBAR (sticky, always above) ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9999;
  background: transparent;
  border-bottom: 0;
  height: auto; /* do NOT cover the viewport */
  pointer-events: none; /* never intercept scroll/click */
}
.nav__inner {
  height: auto; /* only as tall as the title */
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0 var(--pad);
  text-align: center;
}
.nav__title {
  font-family: var(--ff-display);
  font-weight: 800;
  font-size: clamp(34px, 6vw, 96px);
  line-height: 1.15;
  letter-spacing: 0.02em;
  color: var(--text);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0;
  pointer-events: auto;
  text-decoration: none;
}

/* Reserve space for the fixed navbar so the hero doesn't sit underneath */
body {
  padding-top: 0;
}

/* ===== HERO (ABOUT) full-screen ===== */
.hero {
  min-height: 100svh; /* robusto su mobile */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  position: relative; /* contesto di stacking */
}
.hero .hero-about {
  width: 100%;
  max-width: 1240px;
  min-height: 100svh; /* riferimento reale per l’email */
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;

  /* spazio per NON finire sotto al titolo, ma senza alzare l’email */
  padding-top: var(--hero-edge-pad);
  padding-bottom: 0;

  margin: 0 auto;
}
.hero .hero-about .about__inner {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: clamp(18px, 2vw, 28px);
}
.hero .about__email {
  position: static;
  /*margin-top: clamp(18px, 3vh, 36px);*/
  width: min(62ch, 100%);
  padding: 0;
}

.arrow {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom, 0px) + clamp(34px, 5vh, 42px));
  width: min(62ch, 100%);
  text-align: center;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 3;
}

@media (max-width: 899px) {
  .arrow {
    bottom: calc(
      env(safe-area-inset-bottom, 0px) + clamp(34px, 5vh, 42px) + 12px
    );
  }
}


.arrow__label {
    color:var(--muted);
      font-size:var(--t20);
      text-transform:uppercase;
      line-height:var(--lh23);
    }


@media (max-height: 700px) {
  .hero .hero-about {
    padding-top: clamp(64px, 10vh, 120px);
  }
  .hero .about__text {
    font-size: clamp(12px, 1.1vw, 18px);
  }
}

/* ===== PAGE WRAP ===== */
.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ABOUT / EMAIL */
.about {
  margin-top: clamp(10px, 2vw, 24px);
}
.about__text {
  font-family: var(--ff-display);
  font-weight: 400;
  font-size: clamp(14px, 1.25vw, 20px);
  line-height: 1.15; /* close to your 23px on 20px */
  text-transform: uppercase;
  max-width: 62ch;
  margin-top: auto;
  margin-bottom: auto;
}
.about__email {
  font-family: var(--ff-display);
  font-weight: 400;
  font-size: clamp(14px, 1.25vw, 20px);
  line-height: 1.15;
  text-transform: lowercase;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 28px);
  text-align: left;
  
}
.about__email a {
  color: var(--text);
  text-decoration: underline;
}
.about__email a:nth-child(2) {
  justify-self: center;
}
.about__email a:nth-child(3) {
  justify-self: end;
}

/* Sticky bottom bar like project footer */
body.has-footer-bar::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: clamp(34px, 5vh, 42px);
  background: #000;
  z-index: 9990;
  pointer-events: none;
}
.footer-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: clamp(34px, 5vh, 42px);
  background: #000;
  z-index: 9990;
  pointer-events: none;
}

/* ===== PROJECT LIST ===== */
.projects {
  /* full-bleed, no extra whitespace between projects */
  width: 100%;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.project {
  /* Each project is a full-screen "slide" */
  min-height: 100svh;
  display: grid;
  align-items: center;
  gap: clamp(18px, 3vw, 40px);
  padding: clamp(110px, 20vh, 260px) var(--pad) var(--hero-edge-pad);
  position: relative;

  scroll-snap-align: start;
  scroll-snap-stop: always;
}
@supports (height: 100dvh) {
  .hero {
    min-height: 100dvh;
  }
  .hero .hero-about {
    min-height: 100dvh;
  }
  .project {
    min-height: 100dvh;
  }
}

/*
      Desktop: left meta | media | right meta
      Mobile: meta stacked, then media
    */
@media (min-width: 900px) {
  .project {
    grid-template-columns: minmax(120px, 1fr) minmax(0, 1110px) minmax(
        180px,
        1fr
      );
    grid-template-rows: 1fr auto;
    gap: clamp(18px, 2.2vw, 30px);
    padding: clamp(140px, 22vh, 300px) var(--pad) var(--hero-edge-pad);
  }
  .project__meta--left {
    grid-column: 1;
    grid-row: 1;
  }
  .project__media {
    grid-column: 2;
    grid-row: 1;
  }
  .project__meta--right {
    grid-column: 3;
    grid-row: 1;
  }
  .project__arrow {
    grid-column: 2;
    grid-row: 2;
    justify-self: center;
  }
}
@media (max-width: 899px) {
  .project {
    grid-template-rows: auto auto auto 1fr auto;
  }
  .project__meta--left {
    grid-row: 1;
  }
  .project__media {
    grid-row: 2;
  }
  .project__hint {
    display: none;
  }
  .project__meta--right {
    grid-row: 3;
  }
  .project__arrow {
    grid-row: 5;
    justify-self: center;
  }
}

.meta {
  display: grid;
  gap: 10px;
  font-family: var(--ff-display);
  font-weight: 400;
  font-size: clamp(14px, 1.25vw, 20px);
  line-height: 1.15;
  text-transform: uppercase;
}

.meta__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

/* left meta aligns like “001” on the left and name on the right */
.project__meta--left .meta__row {
  justify-content: space-between;
}
.meta__num {
  min-width: 3ch;
}
.meta__name {
  text-align: right;
  flex: 1;
}

/* right meta: category left, year right */
.project__meta--right .meta__row {
  justify-content: space-between;
}
.meta__cat {
  text-align: left;
  white-space: pre-line; /* allows line break like “speculative\ndesign” */
}
.meta__year {
  text-align: right;
  min-width: 4ch;
}

/* Make sure side labels stay vertically centered like in the reference */
.project__meta {
  align-self: center;
}

/* Media */
.project__media {
  width: 100%;
  max-width: 1110px;
  justify-self: center;
  align-self: center;
  border-radius: var(--media-radius);
  overflow: hidden;
  position: relative;
}
.project__hint {
  display: none;
  width: min(1110px, 100%);
  margin: clamp(8px, 2vh, 16px) auto 0;
  font-family: var(--ff-display);
  font-size: clamp(12px, 1.1vw, 16px);
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  text-decoration: none;
}
.project__arrow {
  width: min(1110px, 100%);
  margin: 0;
  display: flex;
  justify-content: center;
  justify-self: center;
  color: var(--text);
  text-decoration: none;
}
.project--006 .project__arrow {
  visibility: hidden;
  pointer-events: none;
}
.project__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.16);
  opacity: 0;
  transition: opacity 600ms ease;
  pointer-events: none;
}
.project__media:hover::after {
  opacity: 1;
}
.media {
  width: 100%;
  aspect-ratio: var(--media-aspect);
  display: block;
  object-fit: cover;
  background: var(--placeholder);
  transition: filter 400ms ease, transform 180ms ease;
}
/* Blur di default, nitido al passaggio del mouse (solo desktop/dispositivi con hover) */
@media (hover: hover) and (pointer: fine) and (min-width: 900px) {
  .media {
    filter: blur(2px);
  }
  .project__media:hover .media {
    filter: blur(0);
  }
}

@media (max-width: 899px) {
  .project__media::before {
    content: "tap to open";
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 7px 12px;
    font-family: var(--ff-display);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #fff;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    pointer-events: none;
    animation: tapHintPulse 2.6s ease-in-out infinite;
  }
  .project__media:active .media {
    transform: scale(0.98);
  }
}

@keyframes tapHintPulse {
  0% {
    transform: translateY(0);
    opacity: 0.9;
  }
  50% {
    transform: translateY(-2px);
    opacity: 1;
  }
  100% {
    transform: translateY(0);
    opacity: 0.9;
  }
}

/* Special: 005 has an extra vertical image overlay */
.project--005 .project__media {
  position: relative;
  background: var(--placeholder);
  aspect-ratio: var(--media-aspect);
}
.project--005 .media {
  /* base panel already grey via bg; keep image optional */
  opacity: 0; /* hide the wide placeholder image, like your grey panel */
}
.project--005 .media--detail {
  position: absolute;
  top: clamp(12px, 2vw, 36px);
  left: 50%;
  transform: translateX(-50%);
  width: min(356px, 40%);
  aspect-ratio: 356 / 553;
  opacity: 1;
  background: var(--placeholder);
}

/* Special: 006 is just a grey panel */
.project--006 .media {
  background: var(--placeholder);
}

/* Footer */
footer {
  margin-top: clamp(50px, 7vw, 120px);
  padding: clamp(24px, 4vw, 60px) 0;
  text-align: center;
  font-family: var(--ff-body);
  font-weight: 400;
  font-size: clamp(14px, 1.6vw, 24px);
  color: var(--text);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
footer a {
  color: var(--text);
  text-decoration: none;
  text-transform: uppercase;
}
footer a:hover {
  text-decoration: underline;
}

/* Corner nav on index */
.corner-nav {
  position: fixed;
  right: clamp(10px, 2vw, 24px);
  bottom: clamp(10px, 2vw, 24px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--ff-display);
  font-weight: 400;
  font-size: clamp(12px, 1.1vw, 16px);
  line-height: 1.1;
  text-transform: uppercase;
  color: var(--text);
  z-index: 9998;
}
.corner-nav a {
  color: var(--text);
  text-decoration: none;
}
.corner-nav a:hover {
  text-decoration: underline;
}
.corner-nav span {
  color: var(--muted);
}

@media (max-width: 899px) {
  .corner-nav {
    bottom: calc(clamp(10px, 2vw, 24px) + 14px);
  }
}

@media (max-width: 899px) {
  footer {
    padding-bottom: calc(clamp(24px, 4vw, 60px) + 24px);
  }
}

/* ===== INFO PAGE =====
   Il contenuto è più lungo della home: testo leggermente più piccolo e
   spaziature più compatte, così il footer non finisce sotto la barra
   fissa in basso (works / info). */
body.info-page .about__text,
body.info-page .about__email {
  /* scala anche sull'altezza: su schermi bassi il testo si riduce da solo */
  font-size: clamp(11px, min(1vw, 1.6vh), 16px);
}
body.info-page footer {
  font-size: clamp(11px, min(1.15vw, 1.9vh), 18px);
}
body.info-page .hero .hero-about {
  padding-top: clamp(44px, 7vh, 120px);
}
body.info-page .hero .hero-about .about__inner {
  gap: clamp(8px, 1.3vh, 20px);
}
/* Su mobile il testo è già al minimo: recupero spazio da interlinea e
   padding, così anche con le toolbar del browser visibili il footer resta
   sopra la barra fissa. */
@media (max-width: 899px) {
  body.info-page .about__text {
    line-height: 1.1;
  }
  body.info-page .hero .hero-about {
    padding-top: clamp(36px, 5vh, 80px);
  }
}

/* Cookie policy overrides (copy of current about__text values for easy tweaks) */
body.cookie-policy .about__text {
  font-family: var(--ff-display);
  font-weight: 400;
  font-size: clamp(12px, 1.1vw, 20px);
  line-height: 1.15;
  text-transform: uppercase;
  max-width: 62ch;
}
/* === DPI-safe layout for projects === 

.projects {
  width: 100%;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
}

@media (min-width: 900px) {
  .project {
    grid-template-columns:
      clamp(160px, 18vw, 260px)
      minmax(0, 1110px)
      clamp(180px, 18vw, 280px);
  }

  .project__meta {
    max-width: 280px;
  }
}

.meta__row { min-width: 0; }

.meta__name,
.meta__cat {
  min-width: 0;
  overflow-wrap: break-word;
}*/

/* === Windows 125% only: no layout changes on mac === */
html.win125 {
  scrollbar-gutter: stable; /* evita shift quando cambia scrollbar/zoom */
}

html.win125 .project {
  /* colonne laterali più stabili -> evita che il meta “invada” la media */
  grid-template-columns:
    clamp(160px, 18vw, 260px)
    minmax(0, 1110px)
    clamp(180px, 18vw, 280px);
}

html.win125 .project__meta {
  max-width: 280px;
  position: relative;
  z-index: 2;
}

html.win125 .project__media {
  position: relative;
  z-index: 1;
}

/* evita overflow/pressioni del testo nei flex row (DPI rounding) */
html.win125 .meta__row { min-width: 0; }
html.win125 .meta__name,
html.win125 .meta__cat {
  min-width: 0;
  overflow-wrap: break-word;
}

/* ===== ACCESSIBILITÀ / SEO =====
   Heading presenti nel markup per crawler e screen reader ma fuori dal
   layout visivo (position:absolute li esclude anche dal grid flow). */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
/* L'h1 avvolge il titolo del sito senza alterarne la resa */
.nav__h1 {
  margin: 0;
  font: inherit;
  min-width: 0;
}
/* Titolo visibile della cookie policy, allineato al resto del testo */
.cookie-h1 {
  font: inherit;
  margin: 0 0 2em;
  text-transform: uppercase;
}
