/* ==========================================================
   Attilio Ferrise · portfolio
   Stile ricalcato sul template "Julian David" (Framer):
   Neutral Sans 1000 · Switzer · Schibsted Grotesk · Chivo Mono · Inter
   ========================================================== */
@font-face { font-family: "Neutral Sans"; src: url(fonts/neutral-sans-1000.woff2) format("woff2"); font-weight: 1000; font-display: swap; }
@font-face { font-family: "Switzer"; src: url(fonts/switzer-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Switzer"; src: url(fonts/switzer-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Switzer"; src: url(fonts/switzer-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Switzer"; src: url(fonts/switzer-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
/* font Google ospitati in locale (niente richieste a terzi, niente blocco del rendering) */
/* latin-ext */
@font-face {
  font-family: 'Chivo Mono';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(fonts/chivo-mono-300-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Chivo Mono';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(fonts/chivo-mono-300-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Chivo Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/chivo-mono-400-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Chivo Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/chivo-mono-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Chivo Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/chivo-mono-500-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Chivo Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/chivo-mono-500-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/inter-600-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/inter-600-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Schibsted Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/schibsted-grotesk-700-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Schibsted Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/schibsted-grotesk-700-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #000;
  --white: #fff;
  --soft: #f0f0f0;
  --grey: #8f8f8f;
  --dim: #666;
  --line: rgba(255, 255, 255, 0.1);
  /* riflesso ambra preso dalle lenti */
  --glow-1: #ffc98a;
  --glow-2: #f0a24a;
  --glow-3: #ffe6cc;

  --display: "Neutral Sans", "Switzer", system-ui, sans-serif;
  --sans: "Switzer", system-ui, -apple-system, "Segoe UI", sans-serif;
  --grotesk: "Schibsted Grotesk", "Switzer", sans-serif;
  --mono: "Chivo Mono", ui-monospace, Consolas, monospace;
  --inter: "Inter", system-ui, sans-serif;

  --pad: 32px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--white);
  font-family: var(--sans); font-size: 16px; line-height: 1.35;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { display: block; max-width: 100%; }
picture { display: contents; }
a { color: inherit; text-decoration: none; }
h1, h2, p, figure, ul { margin: 0; padding: 0; }
ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--glow-2); color: #000; }
:focus-visible { outline: 2px solid var(--glow-2); outline-offset: 4px; }

.mono {
  font-family: var(--mono); font-weight: 300; font-size: 16px;
  letter-spacing: -0.04em; line-height: 1.2; text-transform: uppercase; color: var(--soft);
}
.title {
  font-family: var(--grotesk); font-weight: 700; font-size: 44px;
  letter-spacing: -0.04em; line-height: 1.2; text-transform: uppercase;
}
.more { font-family: var(--inter); font-weight: 600; font-size: 18px; letter-spacing: -0.04em; }

/* sottolineatura animata dei link */
.ulink { position: relative; display: inline-block; }
.ulink::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform 0.5s var(--ease);
}
.ulink:hover::after { transform: scaleX(1); transform-origin: left; }

/* ---------- NAV ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; mix-blend-mode: difference;
}
.logo { font-family: var(--sans); font-weight: 600; font-size: 38px; letter-spacing: -0.06em; line-height: 1.2; }
.logo sup { font-size: 0.5em; vertical-align: 0.85em; margin-left: 1px; letter-spacing: 0; }
.nav-links { display: flex; gap: 16px; font-weight: 500; font-size: 17px; letter-spacing: -0.03em; }

/* ---------- PILL (ritratto) ---------- */
.pill {
  position: relative; overflow: hidden; border-radius: 999px 999px 0 0;
  background: #121a24;
  -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 62%, transparent 100%);
}
.pill::before { /* alone per staccare il ritratto dal nero */
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  border-radius: inherit;
}
.pill img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }

/* ---------- testo con riflesso ambra ---------- */
.glow {
  background:
    radial-gradient(28% 42% at var(--gx, 30%) 30%, var(--glow-2) 0%, rgba(240, 162, 74, 0) 100%),
    radial-gradient(24% 40% at calc(var(--gx, 30%) + 34%) 22%, var(--glow-1) 0%, rgba(255, 201, 138, 0) 100%),
    linear-gradient(180deg, var(--glow-3) 0%, #fff 38%, #fff 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: glow 9s ease-in-out infinite alternate;
}
@keyframes glow { from { --gx: 12%; } to { --gx: 58%; } }
@property --gx { syntax: "<percentage>"; inherits: true; initial-value: 30%; }

/* ---------- HERO ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding: 118px var(--pad) 40px; text-align: center;
}
.hero-pill {
  position: absolute; top: 118px; left: 50%;
  width: min(390px, 27vw); height: calc(100svh - 118px - 230px); min-height: 380px;
  transform: translateX(-50%) translateY(calc(var(--p, 0) * 60px)) scale(calc(1 - var(--p, 0) * 0.06));
  clip-path: inset(100% 0 0 0 round 999px 999px 0 0);
  transition: clip-path 1.5s var(--ease) 0.15s;
}
.is-loaded .hero-pill { clip-path: inset(0 0 0 0 round 999px 999px 0 0); }
.hero-pill img { transform: scale(1.15); transition: transform 2.2s var(--ease) 0.15s; }
.is-loaded .hero-pill img { transform: scale(1); }

.hero-name {
  position: relative; z-index: 2;
  font-family: var(--display); font-weight: 1000;
  font-size: clamp(76px, 11.5vw, 165px); line-height: 0.7; letter-spacing: -0.06em;
  display: flex; flex-direction: column; align-items: center;
  margin-bottom: 26px;
}
.hero-name .line { display: block; overflow: hidden; padding: 0.26em 0.06em 0.16em; margin: -0.24em 0 -0.1em; }
.hero-name .line > span {
  display: block; transform: translateY(110%);
  transition: transform 1.2s var(--ease);
  /* con line-height 0.7 i glifi escono dal box: il background-clip:text dipinge solo
     dentro il box, quindi il puntino della i veniva tagliato. Allarghiamo il box
     con padding e lo compensiamo con margini negativi (layout invariato). */
  padding: 0.24em 0.06em 0.14em; margin: -0.24em -0.06em -0.14em;
  /* il gradiente va su ogni riga, quindi lo ereditiamo */
  background: inherit; -webkit-background-clip: text; background-clip: text;
}
.hero-name .line:nth-child(2) > span { transition-delay: 0.1s; }
.is-loaded .hero-name .line > span { transform: none; }

.hero-sub { position: relative; z-index: 2; font-size: 16px; line-height: 1.9; font-weight: 400; }
.hero-corner { position: absolute; bottom: 40px; z-index: 2; }
.hero-corner--l { left: var(--pad); }
.hero-corner--r { right: var(--pad); }
.fade { opacity: 0; transform: translateY(10px); transition: opacity 1s var(--ease) 0.8s, transform 1s var(--ease) 0.8s; }
.is-loaded .fade { opacity: 1; transform: none; }

/* ---------- INTRO ---------- */
.intro { padding: 140px var(--pad) 120px; }
.label { display: block; margin-bottom: 14px; }
.intro-text {
  max-width: 980px;
  font-family: var(--sans); font-weight: 700; font-size: clamp(30px, 3.7vw, 53px);
  line-height: 1.075; letter-spacing: -0.04em; color: var(--dim);
}
.intro-text .w { transition: color 0.3s linear; }
.intro-text .w.on { color: var(--white); }

.roles {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px;
  max-width: 980px; margin-top: 64px;
}
.role { display: block; padding-top: 18px; border-top: 1px solid var(--line); }
.role .mono { display: block; color: #a3a3a3; font-size: 14px; margin-bottom: 14px; }
.role strong {
  display: block; font-family: var(--display); font-weight: 1000;
  font-size: clamp(44px, 5.4vw, 78px); line-height: 0.85; letter-spacing: -0.06em;
}
.role strong span { color: var(--dim); }
.role strong i { font-style: normal; font-family: var(--sans); font-weight: 500; font-size: 0.4em; vertical-align: 0.9em; display: inline-block; transition: transform 0.5s var(--ease); }
a.role:hover strong i { transform: rotate(45deg); }
a.role:hover strong span { color: var(--glow-2); }
.role p { margin-top: 14px; color: var(--grey); font-size: 16px; }
@media (max-width: 640px) { .roles { grid-template-columns: 1fr; gap: 32px; margin-top: 48px; } }

.clients {
  margin: 56px 0 34px; max-width: 520px; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.clients-track { display: flex; gap: 44px; width: max-content; animation: marquee 28s linear infinite; }
.clients-track span {
  font-family: var(--grotesk); font-weight: 700; font-size: 17px; letter-spacing: -0.04em;
  color: #9a9a9a; white-space: nowrap;
}
.clients-track span:nth-child(3n+2) { font-family: var(--mono); font-weight: 300; font-size: 15px; text-transform: uppercase; }
.clients-track span:nth-child(3n) { font-family: var(--display); font-weight: 1000; letter-spacing: -0.06em; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- PROGETTI ---------- */
.cases { padding: 60px 0 160px; }
.cases-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 var(--pad); margin-bottom: 90px; position: relative; z-index: 2;
}
.cases-field { position: relative; padding: 0 16px; }
.case {
  position: relative; display: block;
  width: var(--w, 30%); margin-left: var(--x, 0%); margin-top: var(--mt, 0%);
  will-change: transform;
}
.case + .case { margin-top: 8vw; }
.case-img {
  position: relative; overflow: hidden; border-radius: 6px; aspect-ratio: 16 / 10.4; background: #111;
}
.case-img img {
  width: 100%; height: 100%; object-fit: cover; object-position: top center;
  transform: scale(1.06); transition: transform 1s var(--ease);
}
.case:hover .case-img img { transform: scale(1); }
.case-meta { display: flex; justify-content: space-between; align-items: baseline; padding-top: 10px; }
.case-name { font-weight: 500; font-size: 18px; letter-spacing: -0.03em; line-height: 1.3; }
.case-meta .mono { color: var(--white); }

/* ---------- SERVIZI (accordion) ---------- */
.practice {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr); gap: 40px;
  padding: 120px var(--pad) 140px;
}
.practice-head { align-self: start; position: sticky; top: 110px; }
.practice-head .mono { display: block; margin-bottom: 10px; font-size: 14px; }
.acc-item { border-bottom: 1px solid var(--line); }
.acc-btn {
  width: 100%; display: grid; grid-template-columns: 20px 1fr 24px; align-items: start; gap: 10px;
  padding: 26px 0; text-align: left;
}
.acc-btn sup { font-size: 12px; color: #a3a3a3; padding-top: 6px; }
.acc-btn span {
  font-family: var(--grotesk); font-weight: 700; font-size: clamp(28px, 3.1vw, 44px);
  letter-spacing: -0.045em; line-height: 1.1; text-transform: uppercase;
  color: #3d3d3d; transition: color 0.45s var(--ease);
}
.acc-btn:hover span, .acc-item.open .acc-btn span { color: #e5e5e5; }
.acc-btn i { position: relative; width: 14px; height: 14px; margin-top: 10px; justify-self: end; }
.acc-btn i::before, .acc-btn i::after {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1.5px; background: #e5e5e5;
  transition: transform 0.45s var(--ease);
}
.acc-btn i::after { transform: rotate(90deg); }
.acc-item.open .acc-btn i::after { transform: rotate(0deg); }
.acc-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.55s var(--ease); }
.acc-item.open .acc-body { grid-template-rows: 1fr; }
.acc-body > p {
  overflow: hidden; padding-left: 30px; max-width: 60ch;
  color: var(--grey); font-size: 17px; line-height: 1.5;
}
.acc-item.open .acc-body > p { padding-bottom: 26px; }

/* ---------- CTA ---------- */
.cta {
  position: relative; min-height: 100svh;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 80px var(--pad) 9svh; overflow: hidden;
}
/* mail: piccola e sobria come il sottotitolo dell'hero, non sposta il titolo */
.cta-mail {
  position: absolute; z-index: 2; left: 50%; bottom: 3.4svh; transform: translateX(-50%);
  font-size: 16px; font-weight: 400; letter-spacing: -0.01em; color: var(--white); white-space: nowrap;
}
.cta-pill {
  position: absolute; left: 50%; top: 8svh;
  width: min(410px, 30vw); height: min(600px, 70svh);
  transform: translateX(-50%) scale(calc(0.9 + var(--c, 0) * 0.1));
  transform-origin: 50% 100%;
}
.cta-title {
  position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center;
  font-family: var(--sans); font-weight: 600; text-transform: uppercase;
  font-size: clamp(64px, 11.5vw, 165px); line-height: 0.7; letter-spacing: -0.06em;
  padding-top: 0.1em;
}
.cta-title span { display: block; padding: 0.06em 0; transition: transform 0.8s var(--ease); }
.cta-title:hover span:first-child { transform: translateX(-0.12em); }
.cta-title:hover span:last-child { transform: translateX(0.12em); }

/* ---------- FOOTER ---------- */
.footer {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 24px;
  padding: 20px 24px 28px;
}
.footer-left p { color: var(--grey); font-size: 16px; margin-top: 2px; }
.footer-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.footer-row { display: flex; gap: 16px; font-weight: 500; font-size: 17px; letter-spacing: -0.03em; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(50px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.case.reveal.in { transform: translateY(var(--py, 0px)); transition: opacity 1.1s var(--ease), transform 0.2s linear; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .practice { grid-template-columns: 1fr; }
  .practice-head { position: static; }
  .case { --w: 40% !important; }
  .case:nth-child(odd) { margin-left: 0 !important; }
  .case:nth-child(even) { margin-left: 60% !important; }
  .case + .case { margin-top: 6vw; }
}
@media (max-width: 640px) {
  :root { --pad: 16px; }
  .nav { padding: 14px 16px; }
  .logo { font-size: 28px; }
  .nav-links { gap: 12px; font-size: 15px; }
  .hero { padding-bottom: 30px; }
  .hero-pill { width: 64vw; top: 96px; height: calc(100svh - 96px - 250px); min-height: 300px; }
  .hero-name { font-size: 21vw; }
  .hero-sub { font-size: 14px; line-height: 1.6; margin-bottom: 44px; }
  .hero-corner { bottom: 28px; font-size: 13px; }
  .intro { padding: 100px var(--pad) 90px; }
  .clients { margin: 40px 0 28px; }
  .title { font-size: 30px; }
  .cases-head { margin-bottom: 40px; }
  .more { font-size: 16px; }
  .cases-field { padding: 0 var(--pad); }
  .case, .case:nth-child(even), .case:nth-child(odd) { --w: 100% !important; margin-left: 0 !important; }
  .case + .case, .case:nth-child(odd) + .case, .case:nth-child(even) + .case { margin-top: 56px; }
  .case:nth-child(even) { width: 78% !important; margin-left: 22% !important; }
  .case:nth-child(odd) { width: 78% !important; }
  .practice { padding: 90px var(--pad) 100px; gap: 24px; }
  .acc-btn span { font-size: 26px; }
  .cta { min-height: 80svh; }
  .cta-pill { width: 62vw; height: 56svh; top: 6svh; }
  .cta-title { font-size: 16.5vw; }
  .footer { flex-direction: column; align-items: flex-start; }
  .footer-right { align-items: flex-start; }
  .logo { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
  html { scroll-behavior: auto; }
  .hero-name .line > span, .fade, .reveal { transform: none !important; opacity: 1 !important; }
  .hero-pill { clip-path: none !important; }
  .intro-text .w { color: var(--white); }
}


/* ---------- SCROLLBAR ---------- */
/* Firefox: solo la regola standard (in Chrome disattiverebbe lo stile qui sotto) */
@supports not selector(::-webkit-scrollbar) {
  html { scrollbar-width: thin; scrollbar-color: #3a3a3a #000; }
}
/* Chrome, Edge, Safari */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb {
  background: #2e2e2e; border-radius: 999px;
  border: 3px solid #000; /* il bordo nero rende il cursore sottile e "galleggiante" */
}
::-webkit-scrollbar-thumb:hover { background: #f0a24a; }
::-webkit-scrollbar-thumb:active { background: #ffc98a; }
::-webkit-scrollbar-corner { background: #000; }
::-webkit-scrollbar-button { display: none; }
