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

:root {
  --ink:     #1a1814;
  --ink-mid: #4a4640;
  --ink-low: #8a837a;
  --paper:   #f7f4ef;
  --warm:    #ede8e0;
  --accent:  #8b5e3c;
  --line:    #d8d0c4;
  --serif:   'Playfair Display', Georgia, serif;
  --sans:    'DM Sans', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  font-weight: 300;
}

/* ── NAV ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 3rem;
  background: rgba(247, 244, 239, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav-name {
  font-family: var(--serif);
  font-size: 1rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mid);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--accent); }

/* ── HERO ── */
#hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 0 3rem;
  padding-top: 80px;
  gap: 4rem;
  max-width: 1100px;
  margin: 0 auto;
}

.hero-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.2rem;
  font-weight: 500;
}

.hero-name {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 5vw, 4.2rem);
  font-weight: 400;
  line-height: 1.1;
  margin-bottom: 1.4rem;
  color: var(--ink);
}

.hero-name em {
  font-style: italic;
  color: var(--accent);
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--ink-mid);
  max-width: 44ch;
  margin-bottom: 2.2rem;
  line-height: 1.8;
}

.hero-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  font-size: 0.82rem;
  font-weight: 500;
  font-family: var(--sans);
  letter-spacing: 0.04em;
  border-radius: 2px;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover { background: var(--accent); }

.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* ── HERO PHOTO ── */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-photo-wrapper {
  position: relative;
  width: 100%;
  max-width: 340px;
}

.hero-photo-wrapper::before {
  content: '';
  position: absolute;
  top: 12px; left: 12px;
  width: 100%; height: 100%;
  border: 1px solid var(--line);
  z-index: 0;
}

.hero-photo {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  border: 1px solid var(--line);
}

.hero-photo-caption {
  position: absolute;
  bottom: -1.8rem;
  left: 0;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-low);
  font-weight: 500;
}

/* ── SECTIONS ── */
section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 6rem 3rem;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 1.2rem;
  margin-bottom: 3.5rem;
}

.section-num {
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  font-weight: 500;
}

.section-title {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 400;
}

.section-line {
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ── ABOUT ── */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 5rem;
  align-items: start;
}

.about-text p {
  margin-bottom: 1.2rem;
  color: var(--ink-mid);
  font-size: 1.02rem;
}

.about-text p:first-child {
  font-size: 1.12rem;
  color: var(--ink);
}

.meta-block { margin-bottom: 2rem; }

.meta-label {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-low);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.meta-value {
  font-size: 0.95rem;
  color: var(--ink-mid);
}

/* ── RESEARCH ── */
#research { background: var(--warm); max-width: 100%; padding: 6rem 0; }
#research .inner { max-width: 1100px; margin: 0 auto; padding: 0 3rem; }

.research-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.research-item {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 2rem;
  transition: border-color 0.2s;
}

.research-item:hover { border-color: var(--accent); }

.research-item::after {
  content: '';
  display: block;
  width: 2rem;
  height: 2px;
  background: var(--accent);
  margin-top: 1.2rem;
}

.research-num {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.8rem;
}

.research-title {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.7rem;
  line-height: 1.4;
}

.research-desc {
  font-size: 0.88rem;
  color: var(--ink-mid);
  line-height: 1.7;
}

/* ── PROJECTS ── */
.projects-list {
  display: flex;
  flex-direction: column;
}

.project-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}

.project-item:first-child { border-top: 1px solid var(--line); }

.project-item:hover .project-arrow { transform: translate(4px, -4px); color: var(--accent); }
.project-item:hover .project-name { color: var(--accent); }

.project-lang {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-low);
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.project-name {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  transition: color 0.2s;
}

.project-desc {
  font-size: 0.88rem;
  color: var(--ink-mid);
  max-width: 60ch;
}

.project-arrow {
  font-size: 1.2rem;
  color: var(--ink-low);
  transition: all 0.2s;
}

/* ── PUBLICATIONS ── */
.publications-note {
  font-style: italic;
  color: var(--ink-low);
  font-size: 0.95rem;
  padding: 2rem;
  border: 1px dashed var(--line);
  text-align: center;
  font-family: var(--serif);
}

/* ── CONTACT ── */
#contact { background: var(--ink); max-width: 100%; padding: 6rem 0; }
#contact .inner { max-width: 1100px; margin: 0 auto; padding: 0 3rem; }
#contact .section-title { color: var(--paper); }
#contact .section-num { color: #8b7a6a; }
#contact .section-line { background: #3a3530; }

.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 5rem;
  align-items: start;
}

.contact-text {
  font-size: 1.1rem;
  color: #c8bfb4;
  line-height: 1.8;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid #3a3530;
  color: #c8bfb4;
  text-decoration: none;
  font-size: 0.88rem;
  transition: all 0.2s;
}

.contact-link:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--accent);
  color: var(--paper);
}

.contact-link-icon { font-size: 1rem; opacity: 0.6; }

.contact-link-label {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #5a5048;
  display: block;
  margin-bottom: 0.1rem;
  font-weight: 500;
}

/* ── FOOTER ── */
footer {
  background: var(--ink);
  border-top: 1px solid #2a2520;
  padding: 1.5rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-copy { font-size: 0.75rem; color: #5a5048; }
.footer-city { font-size: 0.75rem; color: #5a5048; font-family: var(--serif); font-style: italic; }

/* ── FADE IN ── */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}


/* ================================================================
   MENU MOBILE OVERLAY
================================================================ */
 
/* Hamburger button — nascosto su desktop */
.menu-toggle {
  position: absolute;
  right: 2rem;
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: 1rem;
  flex-shrink: 0;
}
 
.burger-line {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--ink);
  transform-origin: center;
  transition: transform 0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              opacity   0.28s ease,
              width     0.38s ease;
}
 
/* Linee hamburger → X quando attivo */
.menu-toggle.active .burger-line:nth-child(1) {
  transform: translateY(3.5px) rotate(45deg);
}
.menu-toggle.active .burger-line:nth-child(2) {
  transform: translateY(-3.5px) rotate(-45deg);
}
 
 
/* ── Overlay ── */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 1400;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 8vw, 4rem);
  overflow: hidden;
 
  /* Stato chiuso */
  opacity: 0;
  visibility: hidden;
  transition:
    opacity    0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    visibility 0.45s;
}
 
.mobile-menu.open {
  opacity: 1;
  visibility: visible;
}
 
/* Blocca lo scroll del body quando il menu è aperto */
body.menu-open { overflow: hidden; }
 
 
/* ── Pulsante chiudi ── */
.menu-close {
  position: absolute;
  top: 1.75rem;
  right: clamp(1.5rem, 5vw, 4.5rem);
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}
 
.menu-close span {
  position: absolute;
  width: 22px;
  height: 1px;
  background: var(--ink);
  transition: background var(--tr-fast);
}
.menu-close span:nth-child(1) { transform: rotate(45deg);  }
.menu-close span:nth-child(2) { transform: rotate(-45deg); }
.menu-close:hover span { background: var(--white); }
 
/* ── Link navigazione ── */
.menu-nav {
  margin-top: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  position: absolute;
  top: 4.2rem;
  left: 2.4rem;
  z-index: 2;
  background-color: var(--paper);
  align-items: flex-start;
  border-bottom: none;
}
 
.menu-link {
  display: flex;
  align-items: baseline;
  text-decoration: none;
  padding: 0.6rem 0;
  margin-top: 0.6rem;
  overflow: hidden;
}
 
/* Stagger tramite delay inline (impostato via JS con data-index) */
.mobile-menu.open .menu-link {
  transform: translateY(0);
  opacity: 1;
}
 
.menu-link-text {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  font-weight: 400;
  color: var(--ink);
  line-height: 1.1;
}
 
.mobile-menu.open  {
  transform: translateY(0);
  opacity: 1;
}
 

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  nav { padding: 1rem 1.5rem; }
  .nav-links { display: none; }
  .menu-toggle  {display: flex;}

  #hero { grid-template-columns: 1fr; padding: 6rem 1.5rem 3rem; min-height: auto; gap: 2.5rem; margin-top: 2rem;}
  .hero-photo-wrapper {padding-top: 1.2rem;}

  section { padding: 4rem 1.5rem; }
  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .research-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; gap: 2.5rem; }

  #research .inner, #contact .inner { padding: 0 1.5rem; }
  footer { padding: 1.5rem; flex-direction: column; gap: 0.5rem; text-align: center; }
}