/* ============================================================
   MIRKO ROVRO · PORTFOLIO
   Concept: Atelier
   Palette: crema calda · nero morbido · rosso vino
   Font: Fraunces (display) + Inter (testo)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,500;1,9..144,300;1,9..144,400;1,9..144,500&family=Inter:wght@300;400;500;600&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:        #f5f0e8;
  --bg-soft:   #efe8dc;
  --surface:   #fbf8f2;
  --ink:       #1a1815;
  --ink-soft:  #4a443c;
  --muted:     #8a8075;
  --rule:      #e3dccf;
  --rule-soft: #ece6da;
  --accent:    #b91c1c;
  --accent-soft: #f3e0dc;

  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Fraunces', Georgia, serif;

  --pad: clamp(1.4rem, 4vw, 4rem);
  --max: 1280px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

::selection { background: var(--accent); color: #fff; }

/* Utility */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--muted);
  font-weight: 500;
}
.eyebrow::before {
  content: '';
  width: 22px;
  height: 1px;
  background: var(--accent);
}

.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: middle;
  margin: 0 0.15em;
}

/* ============ NAV ============ */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.4rem var(--pad);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(245, 240, 232, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, padding 0.3s;
}
nav.scrolled { border-bottom-color: var(--rule); }

.nav-name {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1;
}
.nav-name .accent { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.nav-links a {
  position: relative;
  color: var(--ink-soft);
  transition: color 0.25s;
  padding-bottom: 3px;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); transform-origin: left; }
.nav-links a.active { color: var(--accent); }

/* ============ HOME — HERO ============ */
.hero {
  min-height: 100vh;
  padding: 9rem var(--pad) 5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 5.5rem;
  right: var(--pad);
  width: 70px;
  height: 70px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  opacity: 0.7;
  animation: fadeIn 1.4s 0.6s both;
}
.hero::after {
  content: '';
  position: absolute;
  top: 6.6rem;
  right: calc(var(--pad) + 11px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: fadeIn 1.4s 0.9s both;
}
.hero-inner { max-width: var(--max); width: 100%; margin: 0 auto; }
.hero-eyebrow { margin-bottom: 2.5rem; opacity: 0; animation: fadeUp 1s 0.2s forwards; }

.hero-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(3rem, 9.5vw, 8rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
  color: var(--ink);
  margin-bottom: 3rem;
  opacity: 0;
  animation: fadeUp 1.1s 0.35s forwards;
}
.hero-title em { font-style: italic; font-weight: 300; color: var(--accent); }

.hero-body {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 4rem;
  align-items: start;
  max-width: 1000px;
  opacity: 0;
  animation: fadeUp 1.1s 0.55s forwards;
}
.hero-lede {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 44ch;
}
.hero-lede strong { color: var(--ink); font-weight: 600; }
.hero-lede + .hero-lede { margin-top: 1.2rem; }

.hero-meta { border-left: 1px solid var(--rule); padding-left: 2rem; }
.hero-meta .row + .row { margin-top: 1.8rem; }
.hero-meta dt {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--muted);
  margin-bottom: 0.5rem;
  font-weight: 500;
}
.hero-meta dd {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.15rem;
  color: var(--ink);
  line-height: 1.3;
}

.hero-scroll {
  position: absolute;
  bottom: 2.5rem;
  left: var(--pad);
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.25s;
}
.hero-scroll:hover { color: var(--accent); }
.hero-scroll .arrow { display: inline-block; transition: transform 0.35s ease; }
.hero-scroll:hover .arrow { transform: translateX(6px); }

/* ============ MANIFESTO (home) ============ */
.manifesto {
  padding: 6rem var(--pad);
  border-top: 1px solid var(--rule);
}
.manifesto-inner { max-width: var(--max); margin: 0 auto; }
.manifesto h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: 22ch;
  margin-bottom: 3rem;
}
.manifesto h2 em { font-style: italic; color: var(--accent); }
.manifesto-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--rule);
}
.manifesto-item .num {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.6rem;
  color: var(--accent);
  display: block;
  margin-bottom: 1rem;
}
.manifesto-item h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.25rem;
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}
.manifesto-item p { color: var(--ink-soft); font-size: 0.95rem; line-height: 1.65; }

/* ============ HEADER INTERNO ============ */
.page-head {
  padding: 9rem var(--pad) 4rem;
  border-bottom: 1px solid var(--rule);
}
.page-head-inner { max-width: var(--max); margin: 0 auto; }
.page-head .eyebrow { margin-bottom: 2rem; }
.page-head h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.8rem, 8vw, 6.5rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  max-width: 15ch;
}
.page-head h1 em { font-style: italic; color: var(--accent); }
.page-head .intro {
  margin-top: 2.5rem;
  max-width: 48ch;
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.7;
}

/* ============ PROGETTI — CARD ALTERNATE ============ */
.works { padding: 5rem var(--pad) 6rem; }
.works-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 5rem;
}

.work-card {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 4rem;
  align-items: center;
  opacity: 0;
  animation: fadeUp 0.9s forwards;
  cursor: default;
}
.work-card:nth-child(even) {
  grid-template-columns: 1fr 1.15fr;
  direction: rtl;
}
.work-card:nth-child(even) > * { direction: ltr; }

.work-card:nth-child(1)  { animation-delay: 0.05s; }
.work-card:nth-child(2)  { animation-delay: 0.10s; }
.work-card:nth-child(3)  { animation-delay: 0.15s; }
.work-card:nth-child(4)  { animation-delay: 0.20s; }
.work-card:nth-child(5)  { animation-delay: 0.25s; }
.work-card:nth-child(6)  { animation-delay: 0.30s; }
.work-card:nth-child(7)  { animation-delay: 0.35s; }
.work-card:nth-child(8)  { animation-delay: 0.40s; }
.work-card:nth-child(9)  { animation-delay: 0.45s; }
.work-card:nth-child(10) { animation-delay: 0.50s; }

/* --- Quadrato immagine --- */
.work-media {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: clamp(1.5rem, 5%, 3.5rem);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform 0.7s cubic-bezier(.2,.9,.25,1),
    background 0.5s ease,
    border-color 0.5s ease,
    box-shadow 0.7s cubic-bezier(.2,.9,.25,1);
}

/* --- IMMAGINE + OMBRA DIFFUSA (X 0 · Y 0) --- */
.work-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 2px;
  box-shadow:
    0 0 32px rgba(26, 24, 21, 0.16),
    0 0 10px rgba(26, 24, 21, 0.08);
  transition:
    transform 0.7s cubic-bezier(.2,.9,.25,1),
    box-shadow 0.7s cubic-bezier(.2,.9,.25,1);
}

/* Linea rossa in alto che appare al hover sull'immagine */
.work-media::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  z-index: 2;
  transition: width 0.6s cubic-bezier(.2,.9,.25,1);
}

/* --- HOVER: parte SOLO dall'immagine --- */
.work-media:hover {
  transform: translateY(-6px) scale(1.015);
  border-color: transparent;
  box-shadow:
    0 30px 60px -30px rgba(26, 24, 21, 0.18),
    0 10px 30px -20px rgba(185, 28, 28, 0.08);
  background: var(--surface);
}
.work-media:hover::before { width: 100%; }
.work-media:hover img {
  transform: scale(1.04);
  box-shadow:
    0 0 55px rgba(26, 24, 21, 0.22),
    0 0 18px rgba(26, 24, 21, 0.12);
}

/* --- Info card --- */
.work-info { display: flex; flex-direction: column; gap: 1.2rem; }

.work-info .cat {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}
.work-info .cat::before {
  content: '';
  width: 20px;
  height: 1px;
  background: var(--accent);
  transition: width 0.5s cubic-bezier(.2,.9,.25,1);
}

.work-info h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
  transition: color 0.35s ease, letter-spacing 0.5s cubic-bezier(.2,.9,.25,1);
}

.work-info .desc {
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.65;
  max-width: 42ch;
}

.work-info .more {
  margin-top: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink);
  width: fit-content;
  cursor: pointer;
  transition: color 0.25s, gap 0.3s;
}
.work-info .more .arrow {
  display: inline-block;
  transition: transform 0.5s cubic-bezier(.2,.9,.25,1);
}

/* Titolo rosso quando passi sull'immagine o su "vedi il progetto" */
.work-media:hover ~ .work-info h3,
.work-info .more:hover ~ h3 {
  color: var(--accent);
  letter-spacing: -0.005em;
}
.work-media:hover ~ .work-info .cat::before {
  width: 32px;
}
.work-media:hover ~ .work-info .cat {
  color: var(--ink);
}

/* "Vedi il progetto" al hover */
.work-info .more:hover {
  color: var(--accent);
  gap: 1rem;
}
.work-info .more:hover .arrow {
  transform: translateX(8px);
}

/* ============ DETTAGLIO PROGETTO ============ */
.detail { padding: 9rem var(--pad) 5rem; }
.detail-inner { max-width: var(--max); margin: 0 auto; }

.detail-head {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 4rem;
  align-items: end;
  margin-bottom: 3.5rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--rule);
}
.detail-head .cat {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 1.5rem;
}
.detail-head .cat::before {
  content: '';
  width: 20px;
  height: 1px;
  background: var(--accent);
}
.detail-head h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.4rem, 6vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
}
.detail-head h1 em { font-style: italic; color: var(--accent); }
.detail-head .intro {
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.7;
  max-width: 44ch;
}

.detail-image {
  display: block;
  width: 100%;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  margin-bottom: 3.5rem;
  cursor: zoom-in;
  transition: transform 0.5s, box-shadow 0.5s;
  box-shadow:
    0 0 32px rgba(26, 24, 21, 0.16),
    0 0 10px rgba(26, 24, 21, 0.08);
}
.detail-image:hover {
  transform: scale(1.005);
  box-shadow:
    0 0 55px rgba(26, 24, 21, 0.22),
    0 0 18px rgba(26, 24, 21, 0.12);
}
.detail-image img {
  width: 100%;
  height: auto;
  max-height: 78vh;
  object-fit: contain;
  background: #fafaf7;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
  padding: 2.5rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 3.5rem;
}
.detail-meta .item dt {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.6rem;
  font-weight: 500;
}
.detail-meta .item dd {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.2rem;
  color: var(--ink);
  line-height: 1.3;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink);
  padding: 0.9rem 1.6rem;
  border: 1px solid var(--ink);
  border-radius: 100px;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}
.back-link .arrow { display: inline-block; transition: transform 0.35s; }
.back-link:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.back-link:hover .arrow { transform: translateX(-4px); }

/* ============ CONTATTI ============ */
.contacts { padding: 5rem var(--pad) 6rem; }
.contacts-inner { max-width: var(--max); margin: 0 auto; }

.contact-line {
  display: block;
  padding: 2.2rem 0;
  border-bottom: 1px solid var(--rule);
  transition: padding 0.4s cubic-bezier(.2,.8,.2,1);
  position: relative;
}
.contact-line:first-child { border-top: 1px solid var(--rule); }

.contact-line .row {
  display: grid;
  grid-template-columns: 200px 1fr auto;
  align-items: center;
  gap: 2.5rem;
}
.contact-line .label {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.contact-line .value {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.6rem, 4.5vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
  transition: color 0.3s, transform 0.4s cubic-bezier(.2,.8,.2,1);
}
.contact-line .icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: all 0.35s;
  font-size: 1rem;
}
.contact-line:hover { padding-left: 1rem; padding-right: 1rem; }
.contact-line:hover .value { color: var(--accent); }
.contact-line:hover .icon {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: rotate(-45deg);
}

/* ============ FIRMA / FOOTER ============ */
.signature {
  padding: 5rem var(--pad) 4rem;
  border-top: 1px solid var(--rule);
}
.signature-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: end;
}
.signature .big {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.signature .big em { color: var(--accent); font-style: italic; }
.signature .info {
  text-align: right;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.7;
}
.signature .info .strong { color: var(--ink); font-weight: 500; }

/* ============ ANIMAZIONI ============ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ============ CURSORE PERSONALIZZATO ============ */
html,
body,
body * {
  cursor: none;
}

.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.25s ease, height 0.25s ease, opacity 0.3s ease;
}

.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition:
    width 0.35s cubic-bezier(.2,.9,.25,1),
    height 0.35s cubic-bezier(.2,.9,.25,1),
    border-color 0.3s ease,
    background 0.3s ease,
    opacity 0.3s ease;
  opacity: 0.6;
}

.cursor-ring.is-hover {
  width: 60px;
  height: 60px;
  border-color: var(--accent);
  background: rgba(185, 28, 28, 0.08);
  opacity: 1;
}

.cursor-dot.is-hover {
  width: 0;
  height: 0;
  opacity: 0;
}

.cursor-ring.is-down {
  width: 26px;
  height: 26px;
  background: rgba(185, 28, 28, 0.15);
}

body.cursor-out .cursor-dot,
body.cursor-out .cursor-ring {
  opacity: 0;
}

/* ============ RESPONSIVE ============ */
@media (hover: none) {
  html, body, body * { cursor: auto; }
  .cursor-dot, .cursor-ring { display: none; }
}

@media (max-width: 960px) {
  .hero-body { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero-meta {
    border-left: none;
    border-top: 1px solid var(--rule);
    padding-left: 0;
    padding-top: 2rem;
  }
  .manifesto-grid { grid-template-columns: 1fr; gap: 2rem; }

  .work-card,
  .work-card:nth-child(even) {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    direction: ltr;
  }
  .work-media { padding: clamp(1rem, 5%, 2rem); }

  .detail-head { grid-template-columns: 1fr; gap: 2rem; align-items: start; }
  .detail-meta { grid-template-columns: 1fr 1fr; gap: 2rem; }

  .contact-line .row { grid-template-columns: 1fr auto; }
  .contact-line .label { grid-column: 1 / -1; margin-bottom: 0.6rem; }

  .signature-inner { grid-template-columns: 1fr; }
  .signature .info { text-align: left; }
}

@media (max-width: 560px) {
  .nav-name { font-size: 1.1rem; }
  .nav-links { gap: 1.2rem; font-size: 0.78rem; }
  .hero::before, .hero::after { display: none; }
  .detail-meta { grid-template-columns: 1fr; }
}