/* =========================================================
   Oltremare.css — EVA PROJECT PAGE — CLEAN FINAL
   (aligned to normalità_condizionata.css)
========================================================= */


/* =========================================================
   1) ROOT + THEME
========================================================= */
:root {
  --pad: 24px;
  --cols: 12;
  --gutter: 18px;

  --hover: #ff0000;
  --bg: #000;
  --text: #fff;
  --ball-x: 0px;

  --anchor-point: 14vh;

  --font-main: "Archivo", sans-serif;
  --font-weight-base: 350;

  --nav-ink: var(--text);

  --media-scale: 1;
  --seq-h: 1px;

  /* Reveal */
  --reveal-dur: 980ms;
  --reveal-ease: cubic-bezier(.16, 1, .3, 1);
}

html.light-mode {
  --bg: #fff;
  --text: #000;
  --ball-x: 16px;
  --nav-ink: var(--text);
}


/* =========================================================
   2) FONT
========================================================= */
@font-face {
  font-family: "Archivo";
  src: url("../../font/Archivo-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: "Archivo";
  src: url("../../font/Archivo-Light.ttf") format("truetype");
  font-style: normal;
  font-weight: 300;
}

@font-face {
  font-family: "Archivo";
  src: url("../../font/Archivo-ExtraLightItalic.ttf") format("truetype");
  font-style: italic;
  font-weight: 200;
}


/* =========================================================
   3) RESET + GLOBAL
========================================================= */
* {
  box-sizing: border-box;
  cursor: none !important;
}

html {
  scroll-behavior: auto;
  overflow-x: hidden;
  scroll-padding-top: var(--anchor-point);
  scrollbar-width: none;
}

html::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  font-family: var(--font-main);
  font-weight: var(--font-weight-base);
  transition: background 0.4s ease, color 0.4s ease;
  -webkit-font-smoothing: antialiased;
  -ms-overflow-style: none;
}


/* =========================================================
   4) CUSTOM CURSOR
========================================================= */
.custom-cursor {
  position: fixed;
  width: 24px;
  height: 24px;
  background: var(--hover);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  will-change: transform;
}

/* RIMUOVI .custom-cursor.hover { ... } */

/* =========================================================
   5) P5 OVERLAY
========================================================= */
#p5-holder {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
}

#p5-holder canvas {
  display: block;
  background: transparent !important;
}


/* =========================================================
   6) NAV
========================================================= */
.top-menu {
  position: fixed;
  top: var(--pad);
  left: var(--pad);
  right: var(--pad);
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  column-gap: var(--gutter);
  align-items: center;
  z-index: 9000;
  color: var(--nav-ink);
}

.top-menu.nav-invert {
  --nav-ink: #fff;
}

.brand {
  grid-column: 1 / span 4;
  font-size: 16px;
}

.brand-link {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
}

.brand-link:hover {
  color: var(--hover);
}

.menu-projects {
  grid-column: 9;
  position: relative;
  justify-self: start;
}

.projects-trigger {
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease;
  text-transform: none;
}

.menu-projects:hover .projects-trigger {
  color: var(--hover);
}

.projects-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: transparent;
  padding: 16px 0 8px;
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.23, 1, 0.32, 1), color 0.3s ease;
}

.menu-projects:hover .projects-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.project-link {
  display: block;
  text-decoration: none;
  color: inherit;
  font-size: 16px;
  line-height: 1.4;
  padding: 2px 0;
  transition: color 0.2s ease;
  text-transform: none;
}

.project-link:hover {
  color: var(--hover);
}

.lets-chat {
  grid-column: 10;
  justify-self: end;
  text-decoration: none;
  background: var(--hover);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  padding: 3px 10px;
  transition: opacity 0.2s ease, color 0.2s ease;
  text-transform: none !important;
}

.lets-chat:hover {
  opacity: 0.9;
  color: #000;
}

.lang-switch {
  grid-column: 11;
  justify-self: end;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 4px;
}

.lang-btn {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: color 0.2s ease, opacity 0.2s ease;
  text-transform: none;
}

.lang-btn.active {
  color: var(--hover);
}

.lang-btn:not(.active):hover {
  color: var(--hover);
}

.lang-btn:focus-visible {
  outline: 1px solid var(--hover);
  outline-offset: 3px;
}

.lang-separator {
  color: inherit;
  pointer-events: none;
}

.theme-switch {
  grid-column: 12;
  justify-self: end;
  width: 36px;
  height: 20px;
  position: relative;
  background: transparent;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.theme-switch:hover {
  background: rgba(128, 128, 128, 0.15);
  border-color: var(--hover);
}

.switch-ball {
  width: 14px;
  height: 14px;
  background: var(--nav-ink);
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transform: translateX(var(--ball-x));
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1), background 0.2s ease;
}

.theme-switch:hover .switch-ball {
  background: var(--hover);
}


/* =========================================================
   7) CONTENT
========================================================= */
.content {
  position: relative;
  z-index: 1;
  padding-bottom: 0;
}


/* =========================================================
   8) HERO
========================================================= */
.hero {
  position: absolute;
  top: 10vh;
  left: 0;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  column-gap: var(--gutter);
  padding: 0 var(--pad);
  align-items: baseline;
  z-index: 5;
  pointer-events: none;
  color: #fff;
}

.intro {
  margin: 0;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.1;
  font-weight: 400;
  color: #fff;
  text-transform: none;
}

.intro:first-of-type {
  grid-column: 1 / span 8;
  text-align: left;
}

.intro.intro-num {
  grid-column: 9 / -1;
  text-align: right;
}


/* =========================================================
   9) HERO IMAGE
========================================================= */
.hero-image-section {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  position: relative;
  z-index: 1;
}

.hero-image-section img {
  display: block;
  width: 100%;
  height: 100vh;
  object-fit: cover;
}


/* =========================================================
   10) PROJECT INTRO
========================================================= */
.project-intro {
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  column-gap: var(--gutter);
  padding: 0 var(--pad);
  margin-top: 48px;
}

.project-intro-text {
  grid-column: 1 / span 6;
  font-size: 32pt;
  line-height: 1.15;
  font-weight: 300;
  margin: 0;
}


/* =========================================================
   11) PROJECT META HEADER
========================================================= */
.project-meta {
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  column-gap: var(--gutter);
  padding: 0 var(--pad);
  margin-top: 96px;
  align-items: baseline;
}

.project-meta-label {
  grid-column: 1 / span 2;
  font-size: 16px;
  line-height: 1.3;
  margin: 0;
  font-style: italic;
  font-weight: 300;
}

.project-meta-content {
  grid-column: 3 / span 4;
  font-size: 16px;
  line-height: 1.3;
  margin: 0;
  font-style: italic;
  font-weight: 300;
}

.project-meta-header-right {
  grid-column: 10 / span 3;
  justify-self: end;
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 16px;
  pointer-events: auto;
  color: var(--text);
  transition: color 0.2s ease;
}

.project-meta-header-right:hover {
  color: var(--hover);
}

.discover-more {
  font-size: 16px;
  font-weight: 400;
  font-style: normal;
  line-height: 1;
  color: inherit;
  white-space: nowrap;
}

.project-meta-toggle {
  font-size: 48px;
  line-height: 0.75;
  font-weight: 300;
  background: transparent;
  border: 0;
  padding: 0;
  user-select: none;
  color: inherit;
  transition: transform 0.25s ease;
  position: relative;
  transform: translateY(8px);
}

.project-meta.is-open .project-meta-toggle {
  transform: translateY(8px) rotate(45deg);
}


/* =========================================================
   12) META BODY GRID
========================================================= */
.project-meta-body {
  grid-column: 1 / -1;
  grid-row: 2;
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  column-gap: var(--gutter);
  position: relative;
  align-items: stretch;
}


/* =========================================================
   12A) MEDIA (LEFT)
========================================================= */
.project-media {
  grid-column: 1 / -1;
  width: 100%;
  position: relative;
  align-self: stretch;
  overflow: visible;
}

.project-meta.is-open .project-media {
  grid-column: 1 / span 6;
  width: 100%;
  margin-left: 0;
  height: auto;
  min-height: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.project-meta.is-open .project-media::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.project-media-viewport {
  width: 100%;
  height: auto;
  overflow: visible;
  border: 0;
  outline: 0;
  background: transparent;
}

.project-meta.is-open .project-media-viewport {
  position: relative;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  z-index: 1;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.project-meta.is-open .project-media-viewport::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.project-meta.is-open:not(.panel-ready) .project-media {
  overflow: visible !important;
}

.project-meta.is-open:not(.panel-ready) .project-media-viewport {
  height: auto !important;
  overflow: visible !important;
}


/* =========================================================
   12B) SEQUENCE (SCALE)
========================================================= */
.media-sequence {
  width: 100%;
  height: calc(var(--seq-h) * var(--media-scale));
  overflow: visible;
}

.media-sequence-inner {
  width: 100%;
  transform: scale(var(--media-scale));
  transform-origin: top left;
  display: block;
  will-change: transform;
}


/* =========================================================
   12C) MEDIA BLOCKS
========================================================= */
.media-block {
  width: 100%;
  margin-bottom: var(--gutter);
}

.media-block:last-child {
  margin-bottom: 0;
}

.media-block img,
.media-block video {
  width: 100%;
  height: auto;
  display: block;
}

.media-block.media-full>img,
.media-block.media-full>video {
  width: 100%;
  height: auto;
  display: block;
}

.media-block.media-two {
  display: flex;
  gap: var(--gutter);
  width: 100%;
}

.media-block.media-two>img,
.media-block.media-two>video {
  flex: 1 1 0%;
  min-width: 0;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center;
  display: block;
}


/* =========================================================
   12D) HORIZONTAL SLIDER
========================================================= */
.horizontal-slider {
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  background: rgba(128, 128, 128, 0.25);
}

.horizontal-slider img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: none;
}

.horizontal-slider img.active {
  opacity: 1;
  z-index: 1;
}


/* =========================================================
   12E) SCROLL PROGRESS BAR
========================================================= */
.media-progress {
  grid-column: 7 / span 1;
  justify-self: start;
  align-self: stretch;
  opacity: 0;
  pointer-events: none;
  z-index: 20;
  transition: opacity 0.3s ease;
  display: flex;
  justify-content: flex-start;
  margin-left: -8px;
}

.project-meta.is-open.panel-ready .media-progress {
  opacity: 1;
}

.media-progress-track {
  width: 2px;
  height: 100%;
  background: #fff;
  position: relative;
  overflow: hidden;
}

html.light-mode .media-progress-track {
  background: #999;
}

.media-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 25%;
  min-height: 30px;
  background: #ff0000;
  transition: height 0.05s linear;
}


/* =========================================================
   12F) TEXT PANEL (RIGHT)
========================================================= */
.project-meta-panel {
  grid-column: 8 / -1;
  position: relative;
  align-self: start;
  font-size: 16px;
  line-height: 1.3;
  z-index: 10;
  display: none;
  pointer-events: auto;
  padding-top: 0;
  margin: 0;
}

.project-meta.is-open.panel-ready .project-meta-panel {
  display: block;
}

.project-meta-panel-inner {
  margin: 0;
  padding: 0;
  user-select: text;
}

.project-meta-panel p {
  margin: 0;
}

.meta-section {
  margin: 48px 0 0 0;
}

.meta-section:first-child {
  margin-top: 0;
}

.meta-title {
  display: block;
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  margin: 0 0 10px 0;
}


/* =========================================================
   13) PREV / NEXT PROJECT
========================================================= */
.next-project-section {
  margin-top: 80px;
  padding: 0 var(--pad) 48px var(--pad);
}

.next-project-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  column-gap: var(--gutter);
  align-items: center;
}

.prev-project-link,
.next-project-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
  transition: color 0.2s ease;
  text-transform: none;
}

.prev-project-link:hover,
.next-project-link:hover {
  color: var(--hover);
}

.prev-project-link {
  grid-column: 1 / span 4;
  justify-self: start;
}

.next-project-link {
  grid-column: 9 / -1;
  justify-self: end;
}

.nav-project-arrow {
  display: inline-flex;
  width: 16px;
  height: 22px;
  flex-shrink: 0;
}

.nav-project-arrow svg {
  width: 100%;
  height: 100%;
  display: block;
  transform: rotate(-90deg);
  transform-origin: center;
}

.nav-project-arrow--left svg {
  transform: rotate(90deg);
}


/* =========================================================
   14) CONTACT
========================================================= */
#contact {
  scroll-margin-top: var(--anchor-point);
}

.contact-section {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--gutter);
  padding: 0 var(--pad);
  margin-top: 12vh;
  color: var(--text);
  align-items: baseline;
}

.contact-title {
  grid-column: 1 / span 4;
  font-size: 48px;
  font-weight: 300;
  line-height: 1;
  margin: 0;
  text-transform: none;
}

.contact-intro {
  grid-column: 1 / span 7;
  font-size: 34px;
  font-weight: 300;
  line-height: 1.1;
  margin-top: 60px;
}

.contact-email {
  color: #9b9b9b;
  text-decoration: none;
  transition: color 0.3s ease;
}

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


/* =========================================================
   15) DOWNLOAD
========================================================= */
.download-section {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--gutter);
  padding: 0 var(--pad);
  margin-top: 20px;
  margin-bottom: 20vh;
}

.download-link {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  text-decoration: none;
  color: #9b9b9b;
  font-size: 34px;
  font-weight: 300;
  transition: color 0.3s ease;
  white-space: nowrap;
  text-transform: none;
}

.download-link:hover {
  color: var(--hover);
}

.download-arrow {
  display: inline-flex;
  width: 22px;
  height: 22px;
}

.download-arrow svg {
  width: 100%;
  height: auto;
  display: block;
  stroke: currentColor;
}


/* =========================================================
   16) SCROLL REVEAL
========================================================= */
.reveal-item {
  opacity: 0;
  transform: translateY(30px) scale(0.985);


  transition:
    opacity var(--reveal-dur) var(--reveal-ease),
    transform var(--reveal-dur) var(--reveal-ease),
    filter var(--reveal-dur) var(--reveal-ease);

  transition-delay: var(--delay, 0ms);
  will-change: opacity, transform, filter;
}

.reveal-item.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);

}

@media (prefers-reduced-motion: reduce) {
  .reveal-item {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
}

/* Contact + Download children reveal */
.contact-section>*,
.download-section>* {
  opacity: 0;
  transform: translateY(30px) scale(0.985);

  transition:
    opacity 980ms cubic-bezier(.16, 1, .3, 1),
    transform 980ms cubic-bezier(.16, 1, .3, 1);
  transition-delay: var(--delay, 0ms);
}

.contact-section.is-visible>*,
.download-section.is-visible>* {
  opacity: 1;
  transform: translateY(0) scale(1);

}


/* =========================================================
   17) RESPONSIVE
========================================================= */
/* =========================================================
   17) RESPONSIVE — TABLET (≤ 1024px)
========================================================= */
@media (max-width: 1024px) {
  :root {
    --pad: 20px;
    --gutter: 14px;
  }

  /* Nav → flex */
  .top-menu {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
  }

  .brand {
    flex: 1;
    font-size: 15px;
  }

  .menu-projects {
    order: 2;
  }

  .projects-trigger {
    font-size: 15px;
  }

  .lets-chat {
    order: 3;
    font-size: 14px;
    padding: 3px 8px;
  }

  .lang-switch {
    order: 4;
    font-size: 14px;
  }

  .theme-switch {
    order: 5;
  }

  /* Hero */
  .hero {
    top: 8vh;
  }

  .intro {
    font-size: clamp(28px, 4.5vw, 42px);
  }

  /* Hero image */
  .hero-image-section img {
    height: 80vh;
  }

  /* Project intro */
  .project-intro-text {
    grid-column: 1 / span 8;
    font-size: 26pt;
  }

  /* Project meta */
  .project-meta {
    margin-top: 64px;
  }

  .project-meta-label {
    grid-column: 1 / span 3;
  }

  .project-meta-content {
    grid-column: 4 / -1;
  }

  .project-meta-header-right {
    grid-column: 9 / -1;
  }

  .discover-more {
    font-size: 14px;
  }

  .project-meta-toggle {
    font-size: 40px;
  }

  /* Contact */
  .contact-title {
    font-size: 38px;
  }

  .contact-intro {
    font-size: 28px;
    margin-top: 40px;
  }

  /* Download */
  .download-link {
    font-size: 28px;
  }

  /* Prev / Next */
  .prev-project-link,
  .next-project-link {
    font-size: 20px;
  }
}


/* =========================================================
   17B) RESPONSIVE — SMALL TABLET (≤ 768px)
========================================================= */
@media (max-width: 768px) {
  :root {
    --pad: 16px;
    --gutter: 12px;
  }

  /* Nav */
  .top-menu {
    gap: 10px;
  }

  .brand {
    font-size: 14px;
  }

  .projects-trigger {
    font-size: 14px;
  }

  .lets-chat {
    font-size: 13px;
  }

  .lang-switch {
    font-size: 13px;
  }

  /* Hero */
  .hero {
    top: 7vh;
  }

  .intro {
    font-size: clamp(24px, 4vw, 34px);
  }

  /* Hero image */
  .hero-image-section img {
    height: 65vh;
  }

  /* Project intro */
  .project-intro-text {
    grid-column: 1 / -1;
    font-size: 22pt;
  }

  /* Project meta → stacked */
  .project-meta {
    margin-top: 48px;
  }

  .project-meta-label {
    grid-column: 1 / span 4;
  }

  .project-meta-content {
    grid-column: 1 / -1;
    margin-top: 10px;
  }

  .project-meta-header-right {
    grid-column: 8 / -1;
  }

  /* Panel → full width stacked */
  .project-meta.is-open .project-media {
    grid-column: 1 / -1;
    height: auto;
    min-height: 0;
  }

  .project-meta.is-open .project-media::before {
    display: none;
  }

  .project-meta-panel {
    grid-column: 1 / -1;
    margin-top: 24px;
  }

  .project-meta.is-open .project-media-viewport {
    height: auto;
    overflow: visible;
  }

  /* Media blocks */
  .media-block.media-two {
    flex-direction: column;
  }

  /* Contact */
  .contact-title {
    font-size: 32px;
    grid-column: 1 / -1;
  }

  .contact-intro {
    grid-column: 1 / -1;
    font-size: 24px;
    margin-top: 30px;
  }

  /* Download */
  .download-link {
    font-size: 24px;
  }

  /* Prev / Next */
  .prev-project-link {
    grid-column: 1 / span 6;
  }

  .next-project-link {
    grid-column: 7 / -1;
  }

  .prev-project-link,
  .next-project-link {
    font-size: 18px;
  }
}


/* =========================================================
   17C) RESPONSIVE — MOBILE (≤ 480px)
========================================================= */
@media (max-width: 480px) {
  :root {
    --pad: 14px;
    --gutter: 10px;
  }

  /* Nav */
  .top-menu {
    gap: 8px;
  }

  .brand {
    font-size: 13px;
  }

  .projects-trigger {
    font-size: 13px;
  }

  .lets-chat {
    font-size: 12px;
    padding: 2px 6px;
  }

  .lang-switch {
    font-size: 12px;
  }

  .theme-switch {
    width: 30px;
    height: 17px;
  }

  .switch-ball {
    width: 11px;
    height: 11px;
  }

  /* Hero */
  .hero {
    top: 6vh;
  }

  .intro {
    font-size: clamp(20px, 5.5vw, 26px);
  }

  /* Hero image */
  .hero-image-section img {
    height: 50vh;
  }

  /* Project intro */
  .project-intro {
    margin-top: 32px;
  }

  .project-intro-text {
    grid-column: 1 / -1;
    font-size: 18pt;
  }

  /* Project meta */
  .project-meta {
    margin-top: 36px;
  }

  .project-meta-label {
    grid-column: 1 / -1;
    font-size: 14px;
  }

  .project-meta-content {
    grid-column: 1 / -1;
    margin-top: 6px;
    font-size: 14px;
  }

  .project-meta-header-right {
    grid-column: 1 / -1;
    margin-top: 16px;
    justify-self: start;
  }

  .discover-more {
    font-size: 13px;
  }

  .project-meta-toggle {
    font-size: 32px;
  }

  /* Contact */
  .contact-title {
    font-size: 26px;
  }

  .contact-intro {
    font-size: 20px;
    margin-top: 20px;
  }

  /* Download */
  .download-link {
    font-size: 20px;
  }

  /* Prev / Next */
  .next-project-section {
    margin-top: 48px;
    padding-bottom: 32px;
  }

  .prev-project-link,
  .next-project-link {
    font-size: 16px;
  }
}


/* =========================================================
   18) TOUCH DEVICES
========================================================= */
@media (hover: none),
(pointer: coarse) {
  * {
    cursor: auto !important;
  }

  .custom-cursor {
    display: none !important;
  }
}