@import url('https://api.fontshare.com/v2/css?f[]=satoshi@300,400,500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400&display=swap');

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

/* Custom cursor — desktop only */
@media (pointer: fine) {
  html, body, *, *::before, *::after { cursor: none !important; }

  #cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 14px;
    height: 14px;
    background: #000000;
    border-radius: 50%;
    pointer-events: none;
    transition: width 0.25s ease, height 0.25s ease, background-color 0.25s ease;
    z-index: 9999;
    will-change: transform;
  }

  #cursor.is-hover {
    width: 24px;
    height: 24px;
    background: #9B5348;
  }
}

:root {
  --bg: #fffff6;
  --text: #000000;
  --font: 'Inter', sans-serif;
  --pad-x: 48px;
  --row-gap: 200px;
}

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  text-transform: lowercase;
}

a { color: inherit; text-decoration: none; }

img { display: block; max-width: 100%; }

/* ── HEADER ────────────────────────────── */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 40px var(--pad-x) 0;
  height: 108px;
}

.site-logo {
  font-family: 'Satoshi Variable', 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -1px;
}

.site-logo--caps {
  font-family: var(--font);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0;
}

.site-nav {
  display: flex;
  gap: 32px;
}

.site-nav a,
.site-nav .lang-toggle {
  font-family: 'Satoshi Variable', 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -1px;
}

.site-nav .lang-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  padding: 0;
  font-family: inherit;
  min-width: 28px;
  text-align: right;
  text-transform: lowercase;
}

/* ── HOMEPAGE PROJECTS ───────────────────── */
.home-main {
  flex: 1;
  padding-top: 180px;
  padding-bottom: 180px;
}

/* image wrapper: enforces aspect ratio, crops */
.project-img-wrap {
  width: 100%;
  overflow: hidden;
}

.project-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s ease;
}

.project-item:hover .project-img-wrap img {
  opacity: 0.88;
}

/* radical: caption single line, identical to menu/logo */
.project-caption {
  margin-top: 12px;
  font-family: 'Satoshi Variable', 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -1px;
}

/* project 01 */
.project-item--01 {
  display: block;
  width: 45%;
  margin-left: 6.7%;
  margin-bottom: var(--row-gap);
}
.project-item--01 .project-img-wrap { aspect-ratio: 620 / 447; }

/* project 02 + 03 pair */
.projects-pair {
  display: flex;
  align-items: flex-start;
  margin-bottom: var(--row-gap);
}

.project-item--02 {
  display: block;
  flex-shrink: 0;
  width: 34.1%;
  margin-left: 11.2%;
  margin-top: 158px;
}
.project-item--02 .project-img-wrap { aspect-ratio: 470 / 361; }
.project-item--02 .project-img-wrap img { object-position: 20% center; }

.project-item--03 {
  display: block;
  flex-shrink: 0;
  width: 25.9%;
  margin-left: auto;
  margin-right: 12.4%;
}
.project-item--03 .project-img-wrap { aspect-ratio: 357 / 542; }

/* project 04 */
.project-item--04 {
  display: block;
  width: 40.2%;
  margin-left: 27.2%;
  margin-bottom: var(--row-gap);
}
.project-item--04 .project-img-wrap { aspect-ratio: 553 / 328; }

/* project 05 */
.project-item--05 {
  display: block;
  width: 24.7%;
  margin-left: 19.2%;
}
.project-item--05 .project-img-wrap { aspect-ratio: 340 / 513; }

/* ── PROJECT PAGE ────────────────────────── */
.project-nav {
  display: flex;
  justify-content: space-between;
  padding: 24px var(--pad-x) 0;
  font-family: 'Satoshi Variable', 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -1px;
}

.project-main {
  flex: 1;
  padding: 48px var(--pad-x) 0;
}

.project-intro {
  margin-bottom: 77px;
}

.project-title {
  font-size: 44px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -1.5px;
  margin-bottom: 14px;
}

.project-subtitle {
  font-family: 'Satoshi Variable', 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0;
  margin-bottom: 60px;
  text-transform: lowercase;
}

.project-description {
  font-family: 'Satoshi Variable', 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.5;
  max-width: 55.6%; /* 712/1280 */
}

.project-images {
  display: flex;
  flex-direction: column;
  gap: 100px;
  padding-bottom: 160px;
}

.project-images img {
  width: 100%;
  display: block;
}

/* ── SIZE CLASSES ── */
.project-images .img-full { width: 100%; }
.project-images .img-l    { width: 70%; display: block; }
.project-images .img-m    { width: 50%; display: block; }
.project-images .img-s    { width: 28%; display: block; }

/* legacy — kept for compatibility */
.project-images .img-left { width: 40%; display: block; }
.project-images .img-wide { width: 70%; display: block; }

/* ── POSITION CLASSES ── */
.pos-l { margin-left: 3.75%; }
.pos-c { margin-left: auto; margin-right: auto; }
.pos-r { margin-left: auto; margin-right: 3.75%; }

/* ── GRID GROUPS (kept for legacy use) ── */
.project-images .img-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.project-images .img-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0;
}

.project-images .img-trio {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5rem;
}

/* ── LIGHTBOX ────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 20, 0.94);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox--light {
  background: #ffffff;
}

.lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  width: auto;
  height: auto;
  display: block;
}

/* ── READ MORE TOGGLE (mobile only) ──────── */
.desc-toggle { display: none; }

/* ── ABOUT PAGE ──────────────────────────── */
.about-main {
  flex: 1;
  padding: 120px var(--pad-x) 100px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  column-gap: 8%;
  row-gap: 24px;
}

.about-text {
  grid-column: 1;
  grid-row: 1;
  max-width: 560px;
  font-family: 'Satoshi Variable', 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
}

.about-text p + p {
  margin-top: 1.5em;
}

.about-contacts {
  margin-top: 2em;
  display: flex;
  flex-direction: column;
  gap: 0.4em;
}

.about-contacts a {
  width: fit-content;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.about-photo {
  grid-column: 2;
  grid-row: 1;
  width: 70%;
  max-width: 480px;
  aspect-ratio: 1;
  margin-top: 150px; /* allinea il top alla 6a riga di testo (5 × line-height) */
  margin-left: 0;
  background: #d8d6d2;
  overflow: hidden;
}

.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── FOOTER ──────────────────────────────── */
.site-footer {
  padding: 0 var(--pad-x);
}

.footer-meta-row {
  display: flex;
  justify-content: space-between;
  padding-bottom: 48px;
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0;
}

/* home footer: just copyright */
.site-footer--home .footer-meta-row {
  padding-top: 48px;
}

/* ── RESPONSIVE ──────────────────────────── */
@media (max-width: 900px) {
  :root { --pad-x: 24px; --row-gap: 100px; }

  .home-main { padding-top: 80px; }

  .project-item--01,
  .project-item--02,
  .project-item--03,
  .project-item--04,
  .project-item--05 {
    width: 90%;
    margin-left: 5%;
    margin-right: 5%;
  }

  .projects-pair { flex-direction: column; gap: 60px; }
  .project-item--02 { margin-top: 0; }
  .project-item--03 { margin-left: 5%; }

  .project-title { font-size: clamp(2rem, 6vw, 2.75rem); letter-spacing: -1px; }
  .project-description { max-width: 100%; font-size: 18px; }

  .project-images .img-s,
  .project-images .img-m,
  .project-images .img-l,
  .project-images .img-left,
  .project-images .img-wide {
    width: 80%;
  }

  .about-main {
    column-gap: 5%;
    padding: 80px var(--pad-x) 120px;
    row-gap: 80px;
  }

  .about-photo { width: 90%; }
}

@media (max-width: 600px) {
  :root { --pad-x: 20px; --row-gap: 60px; }

  .site-header { height: auto; padding: 24px var(--pad-x); }
  .site-nav { gap: 20px; }

  .project-nav { font-size: 18px; font-weight: 400; letter-spacing: 0; }

  .project-description {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .project-description.is-expanded {
    display: block;
    overflow: visible;
  }

  .desc-toggle {
    display: inline-block;
    margin-top: 14px;
    background: none;
    border: none;
    padding: 0;
    font-family: 'Satoshi Variable', 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: lowercase;
    text-decoration: underline;
    color: inherit;
    cursor: pointer;
  }

  .project-item--01 .project-img-wrap,
  .project-item--02 .project-img-wrap,
  .project-item--03 .project-img-wrap,
  .project-item--04 .project-img-wrap,
  .project-item--05 .project-img-wrap { aspect-ratio: 1; }

  .project-title { font-size: 2rem; }

  /* project pages: scatter scompare, immagini quasi a tutto schermo */
  .project-images { gap: 24px; padding-bottom: 80px; }

  .project-images img,
  .project-images .img-s,
  .project-images .img-m,
  .project-images .img-l,
  .project-images .img-left,
  .project-images .img-wide {
    width: 92% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    aspect-ratio: 1;
    object-fit: cover;
  }

  .project-images .img-full {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    aspect-ratio: 1;
    object-fit: cover;
  }

  .project-images .img-pair {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .project-images .img-row {
    flex-direction: column;
    gap: 24px;
    padding: 0;
  }

  .about-main {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    padding: 60px var(--pad-x) 100px;
    row-gap: 60px;
  }

  .about-text {
    grid-column: 1;
    grid-row: 1;
    font-size: 18px;
  }

  .about-photo {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    margin-left: 0;
  }
}
