/* ==========================================================================
   Doogma Labs v2
   Un solo canvas 3D dietro tutta la pagina. Tema dark lock, accento volt.
   Raggi: cornici 24px (shell) / 18px (core), bottoni pill.
   ========================================================================== */

@font-face {
  font-family: 'Clash Display';
  src: url('../fonts/ClashDisplay-Semibold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Clash Display';
  src: url('../fonts/ClashDisplay-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Satoshi';
  src: url('../fonts/Satoshi-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Satoshi';
  src: url('../fonts/Satoshi-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Satoshi';
  src: url('../fonts/Satoshi-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #050507;
  --surface: rgba(19, 19, 27, 0.6);
  --line: rgba(240, 240, 250, 0.1);
  --text: #f4f4f8;
  --muted: #a2a2b3;
  --volt: #c9f24e;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Satoshi', 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
h1, h2, h3 {
  font-family: 'Clash Display', 'Arial Black', sans-serif;
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
}
h2 { font-size: clamp(2.4rem, 5.5vw, 4.2rem); }
a { color: inherit; }
::selection { background: var(--volt); color: var(--bg); }
:focus-visible { outline: 2px solid var(--volt); outline-offset: 3px; border-radius: 4px; }

/* ============ Livelli fissi ============ */

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(130% 100% at 50% 50%, transparent 40%, rgba(5, 5, 7, 0.8) 100%),
    linear-gradient(rgba(5, 5, 7, 0.25), rgba(5, 5, 7, 0.25));
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  opacity: 0.55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.03 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

main { position: relative; z-index: 2; }

/* ============ Bottoni ============ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.8em;
  white-space: nowrap;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.55em 0.6em 0.55em 1.5em;
  transition: transform 0.6s var(--ease), background-color 0.4s var(--ease), border-color 0.4s var(--ease);
}
.btn:active { transform: scale(0.97); }

.btn__disc {
  width: 2.1em;
  height: 2.1em;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95em;
  transition: transform 0.6s var(--ease);
}
.btn:hover .btn__disc { transform: translate(2px, -2px); }

.btn--solid { background: var(--volt); color: #0e1206; }
.btn--solid:hover { background: #d9fa6d; }
.btn--solid .btn__disc { background: rgba(5, 5, 7, 0.14); }

.btn--line {
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}
.btn--line:hover { border-color: rgba(240, 240, 250, 0.35); }
.btn--line .btn__disc { background: rgba(255, 255, 255, 0.08); }

.btn--big { font-size: 1.25rem; }

/* ============ Nav a pillola ============ */

.nav {
  position: fixed;
  top: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: clamp(1.2rem, 3vw, 2.4rem);
  padding: 0.55rem 0.6rem 0.55rem 1.4rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(10, 10, 14, 0.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.nav__logo {
  font-family: 'Clash Display', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
}
.nav__logo span { color: var(--volt); }

.nav__links { display: flex; gap: clamp(1rem, 2vw, 1.8rem); }
.nav__links a {
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--muted);
  transition: color 0.3s var(--ease);
}
.nav__links a:hover { color: var(--text); }

.nav__cta {
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  background: var(--volt);
  color: #0e1206;
  border-radius: 999px;
  padding: 0.5em 1.25em;
  transition: background-color 0.4s var(--ease);
}
.nav__cta:hover { background: #d9fa6d; }

.nav__burger {
  display: none;
  background: none;
  border: 0;
  width: 42px;
  height: 42px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
}
.nav__burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: transform 0.5s var(--ease);
}

/* Menu mobile a schermo intero */
.menu {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: flex;
  align-items: center;
  background: rgba(5, 5, 7, 0.82);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s var(--ease), visibility 0s 0.5s;
}
.menu.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s var(--ease);
}
.menu__links {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0 clamp(1.5rem, 8vw, 4rem);
}
.menu__links a {
  font-family: 'Clash Display', sans-serif;
  font-weight: 700;
  font-size: clamp(2.4rem, 10vw, 4rem);
  text-decoration: none;
  line-height: 1.15;
  transform: translateY(40px);
  opacity: 0;
  transition: transform 0.7s var(--ease), opacity 0.7s var(--ease);
}
.menu.is-open .menu__links a { transform: translateY(0); opacity: 1; }
.menu.is-open .menu__links a:nth-child(1) { transition-delay: 0.06s; }
.menu.is-open .menu__links a:nth-child(2) { transition-delay: 0.12s; }
.menu.is-open .menu__links a:nth-child(3) { transition-delay: 0.18s; }
.menu.is-open .menu__links a:nth-child(4) { transition-delay: 0.24s; }
.menu__links a:hover { color: var(--volt); }

@media (max-width: 820px) {
  .nav__links, .nav__cta { display: none; }
  .nav__burger { display: flex; }
  .nav { gap: 0.8rem; padding: 0.4rem 0.5rem 0.4rem 1.2rem; }
  .nav.is-open .nav__burger span:first-child { transform: translateY(4px) rotate(45deg); }
  .nav.is-open .nav__burger span:last-child { transform: translateY(-4px) rotate(-45deg); }
}

/* ============ Hero ============ */

.hero {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem clamp(1.25rem, 4vw, 3rem) 4rem;
}

.hero__word {
  font-size: clamp(4.2rem, 15.5vw, 15rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
  user-select: none;
}
.hero__row { display: block; overflow: hidden; }
.hero__row .char { display: inline-block; will-change: transform; }
.hero__row--outline {
  color: transparent;
  -webkit-text-stroke: 2px var(--volt);
}

.hero__tag {
  margin: 2rem auto 0;
  max-width: 44ch;
  font-size: clamp(1.02rem, 1.5vw, 1.2rem);
  color: var(--muted);
}

.hero__cta {
  margin-top: 2.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

/* ============ Manifesto ============ */

.manifesto {
  min-height: 100dvh;
  display: flex;
  align-items: center;
}
.manifesto__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
}
.manifesto__text {
  font-family: 'Clash Display', sans-serif;
  font-weight: 600;
  font-size: clamp(1.7rem, 4.2vw, 3.4rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.manifesto__text .w { opacity: 1; }

/* ============ Progetti (orizzontale) ============ */

.works { position: relative; }

.works__pin {
  padding: clamp(5rem, 9vw, 7rem) 0 clamp(4rem, 8vw, 6rem);
}

.works__head {
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.works__track {
  display: flex;
  flex-direction: column;
  gap: clamp(4rem, 9vw, 7rem);
  padding: 0 clamp(1.25rem, 4vw, 3rem);
}

.work {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

/* Card orizzontale per screenshot landscape: immagine + testo affiancati */
.work:not(.work--phone) {
  flex-direction: row;
  align-items: center;
  gap: clamp(1rem, 2.2vw, 2rem);
  padding: clamp(0.65rem, 1.2vw, 0.9rem);
  border-radius: 28px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.work:not(.work--phone) .work__frame {
  flex: 1 1 auto;
  min-width: 0;
}
@media (min-width: 1024px) {
  .work:not(.work--phone) .work__info {
    flex: 0 1 18rem;
    max-width: 24ch;
  }
}
.work:not(.work--phone) .work__info p { max-width: none; }

@media (max-width: 1023px) {
  .work {
    flex-direction: row;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.025);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
    max-width: 100%;
  }
  .work .work__frame {
    flex: 0 0 35%;
    max-width: 35%;
    min-width: 0;
  }
  .work--phone .work__frame {
    flex: 0 0 34%;
    max-width: 34%;
  }
  .work .work__info {
    flex: 1 1 0;
    max-width: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
    padding-right: 0.15rem;
  }
  .work:not(.work--phone) .work__info {
    max-width: none;
    flex: 1 1 0;
  }
  .work .work__info h3 {
    font-size: clamp(0.95rem, 3.8vw, 1.25rem);
    line-height: 1.2;
    overflow-wrap: normal;
    word-break: normal;
  }
  .work .work__info p {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    line-height: 1.4;
    max-width: none;
    overflow-wrap: normal;
    word-break: normal;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .work .work__meta {
    margin-top: 0.4rem;
    font-size: 0.72rem;
    line-height: 1.3;
  }
  .work .work__shell {
    padding: 0.3rem;
    border-radius: 14px;
    height: auto;
  }
  .work:not(.work--phone) .work__shell img {
    border-radius: 10px;
    width: 100%;
    height: auto;
    min-height: unset;
    aspect-ratio: var(--ar, 1280 / 800);
    object-fit: cover;
  }
  .work--phone .work__shell {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 6.5rem;
  }
  .work--phone .work__shell img {
    object-fit: contain;
    aspect-ratio: var(--ar, 379 / 812);
    width: auto;
    max-width: 100%;
    max-height: 6.5rem;
    height: auto;
    background: rgba(0, 0, 0, 0.35);
  }
}

.work__frame {
  display: block;
  text-decoration: none;
}
/* Cornice doppia: guscio esterno + immagine interna con raggi concentrici */
.work__shell {
  display: block;
  padding: 0.5rem;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.work__shell img {
  border-radius: 18px;
  width: 100%;
  aspect-ratio: var(--ar, 16 / 10);
  object-fit: cover;
  object-position: top center;
  transition: transform 0.9s var(--ease), filter 0.9s var(--ease);
  filter: saturate(0.94);
}
.work__frame:hover img { transform: scale(1.04); filter: saturate(1.08); }

/* screenshot in formato telefono: stessa larghezza degli altri progetti */
.work--phone .work__shell img {
  object-fit: contain;
  background: rgba(0, 0, 0, 0.35);
}

.work__info h3 { font-size: clamp(1.5rem, 2.2vw, 2rem); font-weight: 600; }
.work__info h3 a { text-decoration: none; }
.work__info h3 a:hover { color: var(--volt); }
.work__info p {
  margin-top: 0.5rem;
  color: var(--muted);
  max-width: 46ch;
}
.work__meta {
  display: inline-block;
  margin-top: 0.7rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--volt);
}

/* Layout orizzontale attivo solo da desktop, via JS */
.works.is-h .works__pin {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: 4.5rem 0 0;
}
.works.is-h .works__head { margin-bottom: 2rem; }
.works.is-h .works__head h2 { font-size: clamp(2rem, 3.6vw, 3rem); }
.works.is-h .works__track {
  flex-direction: row;
  align-items: flex-start;
  gap: clamp(3rem, 5vw, 5rem);
  padding-right: 14vw;
  will-change: transform;
}
.works.is-h .work {
  flex: 0 0 auto;
  width: auto;
}
.works.is-h .work:not(.work--phone) {
  align-items: center;
  gap: clamp(1.25rem, 2vw, 2.25rem);
  padding: clamp(0.75rem, 1.1vw, 1rem);
}
.works.is-h .work--phone {
  flex-direction: column;
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
}
/* la proporzione arriva dall'attributo --ar inline: larghezza stabile anche prima del caricamento */
.works.is-h .work__shell img {
  aspect-ratio: var(--ar, 1280 / 800);
  width: auto;
  height: min(46dvh, 520px);
}
.works.is-h .work--phone .work__shell img {
  width: calc(min(46dvh, 520px) * 1280 / 800);
  height: auto;
}
.works.is-h .work:not(.work--phone) .work__info {
  flex: 0 0 auto;
  max-width: 24ch;
}
.works.is-h .work--phone .work__info { max-width: 52ch; }

/* ============ Due anime ============ */

.souls { padding: clamp(7rem, 13vw, 11rem) clamp(1.25rem, 4vw, 3rem); }
.souls__inner {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: clamp(3rem, 6vw, 6rem);
  align-items: start;
}
.souls__text p {
  margin-top: 2rem;
  color: var(--muted);
  max-width: 56ch;
}
.souls__links {
  margin-top: 2.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.souls__nums { display: grid; border-top: 1px solid var(--line); }
.num {
  padding: 1.7rem 0.2rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.num__v {
  font-family: 'Clash Display', sans-serif;
  font-weight: 700;
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  color: var(--volt);
  line-height: 1;
}
.num__l { color: var(--muted); }

@media (max-width: 900px) { .souls__inner { grid-template-columns: 1fr; } }

/* ============ Contatti ============ */

.contact {
  min-height: 90dvh;
  display: flex;
  align-items: center;
  padding: clamp(7rem, 12vw, 10rem) clamp(1.25rem, 4vw, 3rem);
}
.contact__inner {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.contact__inner h2 {
  font-size: clamp(3rem, 10vw, 8.5rem);
  letter-spacing: -0.03em;
}
.contact__inner h2 span { display: inline-block; overflow: hidden; vertical-align: bottom; }
.contact__inner h2 .char { display: inline-block; }
.contact__inner p {
  margin-top: 1.6rem;
  color: var(--muted);
  font-size: 1.12rem;
  max-width: 44ch;
}
.contact__inner .btn { margin-top: 2.8rem; }

/* ============ Footer ============ */

.footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line);
  padding: 2rem clamp(1.25rem, 4vw, 3rem);
  background: rgba(5, 5, 7, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.footer__inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
}
.footer__brand { font-family: 'Clash Display', sans-serif; font-weight: 700; }
.footer__brand span { color: var(--volt); }
.footer__links { display: flex; flex-wrap: wrap; gap: 1.6rem; }
.footer__links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
  transition: color 0.3s var(--ease);
}
.footer__links a:hover { color: var(--text); }
.footer__copy { color: var(--muted); font-size: 0.9rem; }
