*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; cursor: none !important; }

/* ── FONT LOCALI ── */
@font-face { font-family: 'Outfit'; src: url('./fonts/Outfit-Regular.woff2') format('woff2'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Outfit'; src: url('./fonts/Outfit-Bold.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }

@font-face { font-family: 'Plus Jakarta Sans'; src: url('./fonts/PlusJakartaSans-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Plus Jakarta Sans'; src: url('./fonts/PlusJakartaSans-ExtraBoldItalic.woff2') format('woff2'); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: 'Plus Jakarta Sans'; src: url('./fonts/PlusJakartaSans-ExtraBold.woff2') format('woff2'); font-weight: 800; font-style: normal; font-display: swap; }
:root {
  --bg: #1e1b26; --bg2: #272433; --bg3: #302d3e;
  --fg: #ede8f5; --accent: #b899ff; --muted: #7a7490; --border: #3a3550;

  /* ── DIMENSIONE TESTO GLOBALE ── */
  /* cambia solo questo valore per scalare tutto il sito */
  --base: 18px;
}
html { font-size: var(--base); }
html, body { background: var(--bg); color: var(--fg); scroll-behavior: smooth; }
body { font-family: 'Outfit', sans-serif; font-weight: 300; line-height: 1.7; overflow-x: hidden; min-height: 100vh; }
.page-wrap { max-width: 1800px; margin: 0 auto; }

/* ── CURSORE ── */
#cursor-outer {
  position: fixed; width: 44px; height: 44px;
  border: 2px solid var(--accent); border-radius: 50%; pointer-events: none;
  transform: translate(-50%, -50%); z-index: 9999;
  background: transparent;
  box-shadow: 0 0 14px rgba(184,153,255,0.55), inset 0 0 8px rgba(184,153,255,0.08);
  transition: background .3s, transform .35s cubic-bezier(.23,1,.32,1);
}
#cursor-dot {
  position: fixed; width: 6px; height: 6px;
  background: var(--accent); border-radius: 50%; pointer-events: none;
  transform: translate(-50%, -50%); z-index: 9999;
  box-shadow: 0 0 10px rgba(184,153,255,1);
  transition: width .35s cubic-bezier(.23,1,.32,1), height .35s cubic-bezier(.23,1,.32,1), background .3s, box-shadow .3s;
}
body:has(a:hover) #cursor-dot,
body:has(button:hover) #cursor-dot { width: 44px; height: 44px; background: rgba(184,153,255,0.25); box-shadow: 0 0 28px rgba(184,153,255,0.6); }
body:has(a:hover) #cursor-outer,
body:has(button:hover) #cursor-outer { transform: translate(-50%, -50%) scale(0.5); }

/* ── HEADER ── */
header { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: rgba(22,20,26,.92); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.header-inner { max-width: 1800px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 1.5rem 2.5rem; gap: 1rem; flex-wrap: wrap; }
.logo { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 1.1rem; color: var(--fg); text-decoration: none; white-space: nowrap; }
.logo span { color: var(--accent); }
nav { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
nav a { color: var(--muted); text-decoration: none; letter-spacing: .1em; text-transform: uppercase; transition: color .2s; padding: .6rem .8rem; margin: -.6rem -.8rem; white-space: nowrap; }
nav a:hover { color: var(--fg); }

/* ── THEME TOGGLE ── */
.theme-btn { color: var(--muted); line-height: 1; transition: color .2s; user-select: none; cursor: none !important; }
.theme-btn:hover { color: var(--fg); }
.theme-icon { display: none; }
.dark-icon { display: inline; }
#theme-toggle:checked ~ header .dark-icon { display: none; }
#theme-toggle:checked ~ header .light-icon { display: inline; }
#theme-toggle:checked ~ header { background: rgba(245,243,255,.92); }
:root:has(#theme-toggle:checked) { --bg: #f5f3ff; --bg2: #ede9fb; --bg3: #e2ddf7; --fg: #1a1625; --accent: #7044cc; --muted: #8878aa; --border: #cfc9e8; }
body:has(#theme-toggle:checked) { background: var(--bg); }

/* ── FOOTER ── */
footer { border-top: 1px solid var(--border); padding: 2rem 2.5rem; display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; color: var(--muted); }
footer a { color: var(--muted); text-decoration: none; transition: color .2s; }
footer a:hover { color: var(--fg); }

/* ── FADE UP ── */
.fade-up { opacity: 0; transform: translateY(24px); animation: fadeUp .8s cubic-bezier(.23,1,.32,1) forwards; }
.fade-up:nth-child(1) { animation-delay: .1s; }
.fade-up:nth-child(2) { animation-delay: .25s; }
.fade-up:nth-child(3) { animation-delay: .4s; }
.fade-up:nth-child(4) { animation-delay: .55s; }
@keyframes fadeUp { to { opacity: 1; transform: none; } }

/* ── SEZIONI COMUNI ── */
section { padding: 3rem 2.5rem; border-top: 1px solid var(--border); }
.section-label { font-size: 2rem; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; }
.section-sub { color: var(--muted); line-height: 1.7; margin-bottom: 3rem; }

/* ── INDEX: HERO ── */
.hero { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; padding: 10rem 2.5rem 4rem; position: relative; }
.hero-tag { letter-spacing: .15em; text-transform: uppercase; color: var(--accent); margin-bottom: 1.2rem; }
.hero h1 { font-family: 'Plus Jakarta Sans', sans-serif; font-size: clamp(4rem, 9vw, 8rem); line-height: 1.0; font-weight: 800; max-width: 14ch; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero-sub { margin-top: 2rem; max-width: 80ch; color: var(--muted); line-height: 1.8; }

/* ── INDEX: CHI SONO ── */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; }
.about-grid h2 { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 2rem; font-weight: 400; line-height: 1.15; margin-bottom: 1.5rem; }
.about-desc { color: var(--muted); line-height: 1.9; }
.skills-list { list-style: none; display: flex; flex-direction: column; gap: 1rem; }
.skill-item { border-bottom: 1px solid var(--border); padding-bottom: 1rem; }
.skill-name { font-size: 1.3rem; color: var(--fg); margin-bottom: .1rem; }
.skill-desc { color: var(--muted); letter-spacing: .04em; }
.software-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); margin-top: 3rem; }
.software-item { background: var(--bg2); padding: 1.5rem; transition: background .2s; }
.software-item:hover { background: var(--bg3); }
.software-name { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 1.3rem; font-weight: 400; margin-bottom: .2rem; }
.software-use { color: var(--muted); letter-spacing: .04em; margin-bottom: .8rem; }
.software-level { display: inline-block; font-size: 0.6rem; letter-spacing: .1em; text-transform: uppercase; padding: 3px 8px; border: 1px solid var(--border); color: var(--muted); }
.software-level.advanced { border-color: var(--accent); color: var(--accent); }

/* ── INDEX: PORTFOLIO GRID ── */
.portfolio-big { display: grid; grid-template-columns: repeat(auto-fill, minmax(max(50% - 3px, 300px), 1fr)); gap: 5px; margin-bottom: 5px; }
.portfolio-big .pcard::before { padding-bottom: 56.25%; }
.portfolio-small { display: grid; grid-template-columns: repeat(auto-fill, minmax(max(200px, 24% - 3px), 1fr)); gap: 5px; }
.pcard { position: relative; overflow: hidden; background: var(--bg2); display: block; text-decoration: none; color: inherit; }
.pcard::before { content: ''; display: block; padding-bottom: 100%; }
.pcard img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s cubic-bezier(.23,1,.32,1), filter .4s; filter: brightness(.9); }
.pcard:hover img { transform: scale(1.07); filter: brightness(1.15); }
.pcard-info { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 1rem 1.1rem; background: linear-gradient(to top, rgba(18,14,28,.6) 0%, transparent 60%); }
.pcard-title { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 400; line-height: 1.15; color: var(--fg); font-size: 1.5rem; }
.pcard-desc { color: rgba(237,232,245,.55); margin-top: .3rem; max-height: 0; overflow: hidden; opacity: 0; transition: max-height .4s cubic-bezier(.23,1,.32,1), opacity .35s; }
.pcard:hover .pcard-desc { max-height: 50px; opacity: 1; }
.pcard-tag { display: inline-block; font-size: 0.6rem; letter-spacing: .1em; text-transform: uppercase; padding: 2px 7px; border: 1px solid rgba(255,255,255,.18); color: rgba(255,255,255,.45); margin-top: .5rem; width: fit-content; }
.pcard.static { pointer-events: none; }

/* ── INDEX: CONTATTI ── */
.contact-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; }
.contact-inner h2 { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 2rem; font-weight: 400; line-height: 1.1; margin-bottom: 1rem; }
.contact-inner p { color: var(--muted); line-height: 1.9; }
.contact-links { list-style: none; display: flex; flex-direction: column; gap: .8rem; margin-top: 1.5rem; }
.contact-links a { display: flex; align-items: center; gap: 10px; color: var(--muted); text-decoration: none; letter-spacing: .05em; transition: color .2s; }
.contact-links a:hover { color: var(--fg); }
.arrow { color: var(--accent); transition: transform .2s; display: inline-block; }
.contact-links a:hover .arrow { transform: translateX(4px); }

/* ── PROJECT PAGE ── */
.project-wrap { max-width: 1800px; margin: 0 auto; padding-top: 80px; }

.project-header {
  position: relative;
  min-height: 50vh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 3rem 2.5rem 3rem;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.project-header::before {
  content: '';
  position: absolute; inset: -20%;
  background-image: var(--project-img);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  filter: brightness(.3);
  z-index: 0;
}
.project-header::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, var(--bg) 0%, rgba(0,0,0,0) 60%);
  z-index: 1;
}
.project-header > * { position: relative; z-index: 2; }

.project-back { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); text-decoration: none; font-size: 0.7rem; letter-spacing: .1em; text-transform: uppercase; transition: color .2s; margin-bottom: 2.5rem; }
.project-back:hover { color: var(--fg); }
.project-back svg { width: 12px; height: 12px; }
.project-tag { letter-spacing: .15em; text-transform: uppercase; color: var(--accent); margin-bottom: 1rem; }
.project-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: clamp(2.5rem, 7vw, 6rem); line-height: 1.0; font-weight: 400; max-width: 50ch; }
.project-title em { font-style: italic; color: var(--accent); }
.project-meta { display: flex; gap: 3rem; margin-top: 2rem; flex-wrap: wrap; padding-top: 2rem; border-top: 1px solid var(--border); }
.project-meta-item {  color: var(--muted); letter-spacing: .05em; }
.project-meta-item strong { display: block; color: var(--fg); font-weight: 400; margin-bottom: .3rem; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }

.project-content { display: grid; grid-template-columns: 1fr 2fr; border-bottom: 1px solid var(--border); }
.project-desc { padding: 4rem 2.5rem; border-right: 1px solid var(--border); position: sticky; top: 80px; align-self: start; max-height: calc(100vh - 80px); overflow-y: auto; }
.project-desc p { color: var(--muted); line-height: 1.9; margin-bottom: 1.2rem; }
.project-desc p:last-child { margin-bottom: 0; }
.project-tools { list-style: none; margin-top: 2.5rem; border-top: 1px solid var(--border); padding-top: 1.5rem; display: flex; flex-direction: column; }
.project-tools li {color: var(--muted); letter-spacing: .04em; padding: .7rem 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; }
.project-tools li span { color: var(--accent); }
.project-images { display: flex; flex-direction: column; gap: 3px; padding: 4rem 2.5rem; }
.project-img-wrap { position: relative; overflow: hidden; background: var(--bg2); }
.project-img-wrap a { display: block; }
.project-img-wrap img { width: 100%; height: auto; display: block; transition: filter .4s, transform .4s; }
.project-img-wrap a:hover img { filter: brightness(1.1); transform: scale(1.02); }
.project-img-wrap video { width: 100%; height: auto; display: block; }
.project-img-caption { padding: 1rem 0;  color: var(--muted); letter-spacing: .05em; border-bottom: 1px solid var(--border); }

/* griglia video 2 per riga */
.video-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
}
@media (max-width: 600px) {
  .video-grid { grid-template-columns: 1fr; }
}

.project-nav { display: grid; grid-template-columns: 1fr 1fr; }
.project-nav a { display: flex; flex-direction: column; gap: .4rem; text-decoration: none; color: var(--muted); padding: 2.5rem; transition: background .2s; border-right: 1px solid var(--border); }
.project-nav a:last-child { border-right: none; align-items: flex-end; }
.project-nav a:hover { background: var(--bg2); color: var(--fg); }
.nav-label { font-size: 0.75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.nav-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 1.3rem; font-weight: 400; line-height: 1.2; color: var(--fg); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .about-grid, .contact-inner { grid-template-columns: 1fr; gap: 2rem; }
  .project-content { grid-template-columns: 1fr; }
  .project-desc { position: static; border-right: none; border-bottom: 1px solid var(--border); max-height: none; }
}
@media (max-width: 600px) {
  nav { gap: 1rem; }
  .project-nav a:last-child { align-items: flex-start; }
  .header-inner { padding: 1rem 1.2rem; }
  nav a { font-size: 0.65rem; letter-spacing: .05em; }
}

/* ── TOUCH / MOBILE: nascondi cursore custom ── */
@media (pointer: coarse) {
  *, *::before, *::after { cursor: auto !important; }
  #cursor-outer, #cursor-dot { display: none !important; }
}
