@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap");

:root{
  --black:#08080a;
  --black-2:#111114;
  --panel:#151518;
  --panel-2:#1c1c20;
  --line: rgba(255,255,255,.09);
  --line-strong: rgba(255,255,255,.18);
  --white:#f4f4f1;
  --white-dim:#c7c7cc;
  --grey:#84848c;
  --grey-dim:#57575e;

  --grad-panel: linear-gradient(155deg, #17171a 0%, #0b0b0d 60%, #000 100%);
  --grad-line: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  --grad-text: linear-gradient(120deg, #ffffff 0%, #9c9ca3 55%, #5c5c63 100%);
  --grad-card: linear-gradient(160deg, rgba(255,255,255,.06), rgba(255,255,255,0) 45%);

  --display: "Space Grotesk", sans-serif;
  --body: "Inter", sans-serif;
  --mono: "JetBrains Mono", monospace;

  --edge: 1px solid var(--line);
  --radius: 14px;
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
  *{ animation-duration:.001ms !important; animation-iteration-count:1 !important; transition-duration:.001ms !important; }
}

body{
  margin:0;
  background:var(--black);
  color:var(--white-dim);
  font-family:var(--body);
  font-size:16px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}

/* textura di fondo: griglia sottilissima, tema "circuito" */
body::before{
  content:"";
  position:fixed; inset:0;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size:44px 44px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  pointer-events:none;
  z-index:0;
}

a{ color:inherit; text-decoration:none; }
img{ max-width:100%; display:block; }
button{ font-family:inherit; }

h1,h2,h3{ font-family:var(--display); color:var(--white); margin:0; letter-spacing:-.01em; }

.wrap{ max-width:1180px; margin:0 auto; padding:0 32px; position:relative; z-index:1; }
@media (max-width:640px){ .wrap{ padding:0 20px; } }

.eyebrow{
  font-family:var(--mono);
  font-size:12.5px;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--grey);
  display:flex; align-items:center; gap:10px;
}
.eyebrow::before{
  content:"";
  width:16px; height:1px;
  background:var(--grey-dim);
}

section{ position:relative; padding:120px 0; z-index:1; }
@media (max-width:780px){ section{ padding:80px 0; } }

.divider{
  height:1px; width:100%;
  background:var(--grad-line);
  opacity:.6;
}

/* ---------- NAV ---------- */
header.nav{
  position:fixed; top:0; left:0; right:0; z-index:50;
  border-bottom:var(--edge);
  background:rgba(8,8,10,.72);
  backdrop-filter: blur(14px);
}
.nav-inner{
  max-width:1180px; margin:0 auto; padding:0 32px;
  height:68px; display:flex; align-items:center; justify-content:space-between;
}
.nav-brand{
  font-family:var(--mono); font-size:14px; color:var(--white);
  display:flex; align-items:center; gap:8px;
}
.nav-brand .dot{
  width:7px; height:7px; border-radius:50%;
  background:var(--white);
  box-shadow:0 0 10px 2px rgba(255,255,255,.5);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse{ 0%,100%{opacity:1;} 50%{opacity:.35;} }

.nav-links{ display:flex; gap:32px; font-size:14px; color:var(--grey); }
.nav-links a{ position:relative; transition:color .2s; }
.nav-links a:hover{ color:var(--white); }
.nav-links a::after{
  content:""; position:absolute; left:0; bottom:-6px; height:1px; width:0;
  background:var(--white); transition:width .25s;
}
.nav-links a:hover::after{ width:100%; }
@media (max-width:700px){ .nav-links{ display:none; } }

/* ---------- HERO / BOOT SEQUENCE ---------- */
.hero{
  min-height:100vh;
  display:flex; flex-direction:column; justify-content:center;
  padding-top:68px;
}
.boot{
  font-family:var(--mono);
  font-size:13px;
  color:var(--grey);
  border:var(--edge);
  border-radius:10px;
  background:var(--grad-panel);
  padding:18px 20px;
  max-width:560px;
  margin-bottom:40px;
  min-height:132px;
}
.boot .line{ opacity:0; white-space:pre-wrap; }
.boot .cursor{
  display:inline-block; width:7px; height:14px; background:var(--white);
  vertical-align:middle; margin-left:2px;
  animation: blink 1s step-end infinite;
}
@keyframes blink{ 50%{ opacity:0; } }

.hero-title{
  font-size:clamp(46px, 8.4vw, 108px);
  line-height:.96;
  font-weight:700;
  background:var(--grad-text);
  -webkit-background-clip:text; background-clip:text; color:transparent;
  opacity:0; transform:translateY(18px);
}
.hero-role{
  font-family:var(--mono);
  color:var(--white-dim);
  font-size:clamp(14px,2.1vw,18px);
  margin-top:22px;
  opacity:0; transform:translateY(12px);
}
.hero-tagline{
  color:var(--grey);
  max-width:520px;
  margin-top:16px;
  font-size:16px;
  opacity:0; transform:translateY(12px);
}
.hero-cta{
  margin-top:44px;
  display:flex; gap:16px; flex-wrap:wrap;
  opacity:0; transform:translateY(12px);
}
.hero.is-booted .hero-title,
.hero.is-booted .hero-role,
.hero.is-booted .hero-tagline,
.hero.is-booted .hero-cta{
  animation: rise .7s ease forwards;
}
.hero.is-booted .hero-role{ animation-delay:.08s; }
.hero.is-booted .hero-tagline{ animation-delay:.16s; }
.hero.is-booted .hero-cta{ animation-delay:.26s; }
@keyframes rise{ to{ opacity:1; transform:translateY(0); } }

.btn{
  font-family:var(--mono); font-size:13px;
  padding:13px 22px; border-radius:8px;
  border:var(--edge);
  color:var(--white); background:transparent;
  cursor:pointer; transition:.2s border-color, .2s transform, .2s background;
  display:inline-flex; align-items:center; gap:8px;
}
.btn:hover{ border-color:var(--line-strong); transform:translateY(-2px); }
.btn.solid{ background:var(--white); color:var(--black); font-weight:600; }
.btn.solid:hover{ background:#e4e4e0; }

/* ---------- ABOUT ---------- */
.about-grid{
  display:grid; grid-template-columns:.8fr 1.2fr; gap:64px; align-items:center;
}
@media (max-width:820px){ .about-grid{ grid-template-columns:1fr; gap:36px; } }
.about-photo{
  aspect-ratio:4/5; border-radius:var(--radius);
  border:var(--edge); background:var(--grad-panel);
  overflow:hidden; position:relative;
}
.about-photo img{ width:100%; height:100%; object-fit:cover; }
.about-photo .ph-fallback{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  font-family:var(--display); font-size:80px; color:var(--grey-dim);
}
.about h2{ font-size:clamp(30px,4vw,44px); margin-bottom:22px; }
.about p{ font-size:16.5px; color:var(--white-dim); }

/* ---------- PERCORSO ---------- */
.path-item{
  display:grid; grid-template-columns:180px 1fr; gap:28px;
  padding:28px 0; border-top:var(--edge);
}
.path-item:last-child{ border-bottom:var(--edge); }
.path-period{ font-family:var(--mono); font-size:13px; color:var(--grey); padding-top:2px; }
.path-title{ font-family:var(--display); color:var(--white); font-size:19px; margin-bottom:8px; }
.path-text{ color:var(--white-dim); font-size:15px; max-width:640px; }
@media (max-width:600px){ .path-item{ grid-template-columns:1fr; gap:8px; } }

/* ---------- COMPETENZE ---------- */
.skills-grid{
  display:grid; grid-template-columns:repeat(2,1fr); gap:14px 40px;
}
@media (max-width:640px){ .skills-grid{ grid-template-columns:1fr; } }
.skill-row{ padding:14px 0; border-bottom:var(--edge); }
.skill-top{ display:flex; justify-content:space-between; font-family:var(--mono); font-size:13px; color:var(--white-dim); margin-bottom:8px; }
.skill-bar{ height:3px; background:var(--panel-2); border-radius:2px; overflow:hidden; }
.skill-fill{ height:100%; background:linear-gradient(90deg,#5c5c63,#f4f4f1); width:0; transition:width 1.1s ease; }

/* ---------- PROGETTI ---------- */
.proj-tabs{ display:flex; gap:10px; margin-bottom:36px; flex-wrap:wrap; }
.proj-tab{
  font-family:var(--mono); font-size:12.5px; letter-spacing:.04em;
  padding:9px 16px; border-radius:999px; border:var(--edge); color:var(--grey);
  cursor:pointer; background:transparent; transition:.2s;
}
.proj-tab.active, .proj-tab:hover{ color:var(--black); background:var(--white); border-color:var(--white); }

.proj-grid{ display:grid; grid-template-columns:repeat(2,1fr); gap:24px; }
@media (max-width:780px){ .proj-grid{ grid-template-columns:1fr; } }

.proj-card{
  border:var(--edge); border-radius:var(--radius);
  background:var(--grad-card), var(--panel);
  overflow:hidden;
  transition:.25s transform, .25s border-color;
}
.proj-card:hover{ transform:translateY(-4px); border-color:var(--line-strong); }
.proj-window-bar{
  display:flex; align-items:center; gap:6px;
  padding:11px 14px; border-bottom:var(--edge);
  font-family:var(--mono); font-size:11px; color:var(--grey-dim);
}
.proj-window-bar span.dot{ width:8px; height:8px; border-radius:50%; background:var(--panel-2); border:1px solid var(--line-strong); }
.proj-media{ aspect-ratio:16/10; background:var(--black-2); border-bottom:var(--edge); overflow:hidden; }
.proj-media img, .proj-media video{ width:100%; height:100%; object-fit:cover; }
.proj-media .ph-fallback{ width:100%; height:100%; display:flex; align-items:center; justify-content:center; color:var(--grey-dim); font-family:var(--mono); font-size:12px; }
.proj-body{ padding:22px; }
.proj-tag{ font-family:var(--mono); font-size:11px; color:var(--grey); text-transform:uppercase; letter-spacing:.08em; }
.proj-title{ font-family:var(--display); color:var(--white); font-size:19px; margin:8px 0 10px; }
.proj-desc{ font-size:14.5px; color:var(--white-dim); }
.proj-link{ display:inline-flex; gap:6px; margin-top:14px; font-family:var(--mono); font-size:12.5px; color:var(--white); border-bottom:1px solid var(--line-strong); }

/* ---------- CONTATTI ---------- */
.contact-inner{
  border:var(--edge); border-radius:var(--radius);
  background:var(--grad-panel);
  padding:64px 48px;
  text-align:center;
}
@media (max-width:640px){ .contact-inner{ padding:44px 24px; } }
.contact-inner h2{ font-size:clamp(28px,5vw,48px); }
.contact-inner p{ color:var(--grey); margin-top:14px; }
.contact-links{ display:flex; justify-content:center; gap:14px; margin-top:32px; flex-wrap:wrap; }

footer{
  padding:32px 0 48px; text-align:center;
  font-family:var(--mono); font-size:12px; color:var(--grey-dim);
}

/* scroll reveal */
.reveal{ opacity:0; transform:translateY(24px); transition:opacity .7s ease, transform .7s ease; }
.reveal.in{ opacity:1; transform:translateY(0); }
