/* ========================================================
   ILIAN ROCCHI — Mobile Stylesheet
   Caricato solo su max-width: 768px
   ======================================================== */

/* ── iOS Safari base ── */
*, *::before, *::after {
  -webkit-tap-highlight-color: transparent;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  overscroll-behavior-y: none;
}

/* ── Variables override ── */
:root {
  --pad-x: 20px;
  --section-y: 60px;
  --nav-h: 60px;
}

/* ── Safe area padding ── */
.nav {
  padding-left:  max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}
.footer {
  padding-left:  max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
  padding-bottom: max(28px, calc(env(safe-area-inset-bottom) + 14px));
}

/* ── Nav ── */
.nav__logo-img  { height: 22px; }
.nav__logo-sep  { height: 14px; margin: 0 8px; }
.nav__logo-name { font-size: 11px; }
.nav__lang      { gap: 3px; }
.lang-sep       { font-size: 9px; }
.lang-btn       { font-size: 9px; }
.mode-toggle    { width: 34px; height: 18px; }
.mode-toggle__pill { width: 11px; height: 11px; }
body.light-mode .mode-toggle__pill { transform: translateX(15px); }

/* ── Mobile Menu ── */
.mobile-menu {
  padding-top: calc(var(--nav-h) + env(safe-area-inset-top, 0px));
  padding-bottom: max(40px, env(safe-area-inset-bottom, 0px));
  gap: 0;
  justify-content: center;
}
.mobile-menu__link {
  font-size: clamp(34px, 9vw, 52px);
  padding: 14px 0;
  width: 100%;
  text-align: center;
  border-bottom: 1px solid var(--fg-05);
  transition: color .2s, border-color .2s;
}
.mobile-menu__link:last-of-type { border-bottom: none; }
.mobile-menu__link:active { color: var(--fg-60); }
.mobile-menu__footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--fg-10);
  width: 100%;
}

/* ── Hero: fix iOS 100vh + address bar ── */
.hero {
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  padding: calc(var(--nav-h) + 24px) 20px 80px;
  justify-content: flex-end;
}
.hero__bg-text {
  font-size: 52vw;
  bottom: -2vw;
  opacity: 0.04;
}
.hero__logo-mark { height: 16px; }
.hero__label {
  font-size: 9px;
  gap: 10px;
  margin-bottom: 14px;
}
.hero__label-line { width: 20px; }
.hero__title {
  font-size: clamp(60px, 20vw, 100px);
  margin-bottom: 0;
  letter-spacing: -2px;
  line-height: .88;
}
.hero__meta {
  gap: 18px;
  padding-top: 20px;
  margin-top: 24px;
  flex-wrap: wrap;
  border-top: 1px solid var(--fg-10);
}
.hero__meta-item:nth-child(3) { display: none; }
.meta-label { font-size: 9px; }
.meta-val   { font-size: 12px; }
.hero__year { display: none; }
.hero__scroll {
  right: 20px;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: auto;
  font-size: 9px;
  gap: 8px;
}
.hero__scroll-circle { width: 36px; height: 36px; }

/* ── Work ── */
.project-row { cursor: pointer; }
.work { padding: 56px 0; }
.work .section-header  { padding: 0 20px; margin-bottom: 28px; }
.section-tag { font-size: 9px; letter-spacing: .18em; }
.section-title {
  font-size: clamp(38px, 10vw, 60px);
  letter-spacing: -1px;
  line-height: .92;
}
.project-row {
  padding: 18px 20px;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  min-height: 64px;
}
.pr-num   { font-size: 10px; padding-top: 4px; }
.pr-title { font-size: clamp(18px, 5vw, 24px); letter-spacing: -.3px; }
.pr-desc  { font-size: 10px; margin-top: 3px; }

/* ── About ── */
.about { padding: 56px 0; }

/* Foto: nascosta su mobile */
.about__photo-col { display: none; }
.photo-caption    { display: none; }

/* Titolo "CHI SONO" su una riga */
.about__title {
  font-size: clamp(36px, 10vw, 64px);
  margin-bottom: 16px;
  white-space: nowrap;
}
.about__title br { display: none; }
.about__title span { display: inline; }
.about__bio p { font-size: 13px; line-height: 1.72; }

/* Competenze e Software: due colonne affiancate su mobile */
.about__cols {
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 28px;
}
.block-label  { font-size: 9px; }
.skill-list   { gap: 0; }
.skill-list li { font-size: 11px; padding: 6px 0; }
.about__exp   { margin-top: 28px; }
.exp-year     { font-size: 10px; }
.exp-detail strong { font-size: 13px; }
.exp-detail span   { font-size: 11px; }

/* ── Process ── */
.process { padding: 56px 0; }

/* Titolo "Il Mio Processo": vai a capo invece che inline */
.process .section-title {
  flex-direction: column;
  gap: 0;
  line-height: .88;
}
/* Card process steps: padding interno per non toccare i bordi */
.process__step { padding: 24px 20px; }
.step-num { font-size: 32px; margin-bottom: 12px; }
.process__step h3 { font-size: 12px; }
.process__step p  { font-size: 12px; }

/* ── Contact ── */
.contact { padding: 56px 0; }
.contact__title {
  font-size: clamp(36px, 9vw, 56px);
  letter-spacing: -1px;
  margin-bottom: 28px;
  line-height: .92;
}
.contact__tagline  { font-size: 13px; line-height: 1.7; }
.contact__left     { margin-bottom: 36px; }
.cl-label          { font-size: 9px; }
.cl-val            { font-size: 13px; }
.contact__link     { padding: 14px 0; }
.contact__location { padding: 14px 0; }
.contact__location-cities { font-size: 12px; line-height: 1.6; }
.contact__location-remote { font-size: 10px; }
.form-label   { font-size: 9px; }
.form-input   { font-size: 14px; padding: 12px 14px; }
.form-submit  { padding: 14px 20px; font-size: 11px; }

/* ── Footer ── */
.footer__inner { gap: 10px; }
.footer__logo-img { height: 16px; }
.footer__copy  { font-size: 10px; }
.footer__slink { font-size: 10px; }
.footer__legal { gap: 10px; margin-top: 10px; }
.footer__legal-link { font-size: 9px; }

/* ── Case Study Hero ── */
.cs-hero {
  min-height: 80svh;
  padding: calc(var(--nav-h) + 36px) 20px 44px;
  position: relative;
}
.cs-hero__back-link { top: calc(var(--nav-h) + 10px); font-size: 9px; }
.cs-hero__num { display: none; }
.cs-hero__tag { font-size: 9px; margin-bottom: 14px; }
.cs-hero__title {
  font-size: clamp(48px, 13vw, 80px);
  margin-bottom: 20px;
  letter-spacing: -1.5px;
}
.cs-hero__meta { gap: 18px; flex-wrap: wrap; }
.cs-hero__meta-item:nth-child(4) { display: none; }

/* ── Case Study Sections ── */
.cs-section { padding: 40px 20px; }
.cs-grid-2  { gap: 28px; }
.cs-label   { font-size: 9px; margin-bottom: 16px; }
.cs-body-text { font-size: 13px; line-height: 1.8; }
.cs-big-quote { font-size: clamp(20px, 6vw, 32px); }

/* ── Validation callout ── */
[style*="border: 1px solid var(--fg-30)"] {
  padding: 24px 20px !important;
}
[style*="border: 1px solid var(--fg-30)"] p:first-of-type {
  font-size: clamp(18px, 5vw, 28px) !important;
}

/* ── Palette / Swatches ── */
.palette  { gap: 2px; flex-wrap: wrap; }
.swatch   { flex: 1 1 80px; min-height: 56px; padding: 8px; }
.swatch__name { font-size: 8px; }
.swatch__hex  { font-size: 9px; }

/* ── Typography showcase ── */
.typo-showcase { padding: 18px; }
.typo-showcase__sample { font-size: clamp(20px, 6vw, 40px); }
.typo-showcase__name   { font-size: 9px; }

/* ── Next project ── */
.next-project { padding: 40px 20px; }
.np-label { font-size: 9px; }
.np-title { font-size: clamp(28px, 8vw, 48px); letter-spacing: -.5px; }
.np-arrow { font-size: clamp(24px, 6vw, 36px); }

/* ── Legal pages ── */
.legal-page {
  padding: calc(var(--nav-h) + 32px) 20px 80px;
}
.legal-page h1     { font-size: clamp(32px, 9vw, 48px); }
.legal-page h2     { font-size: 11px; }
.legal-page p,
.legal-page ul li  { font-size: 13px; }
.cookie-table      { font-size: 11px; }
.cookie-table th,
.cookie-table td   { padding: 8px 6px; }
.cookie-table th:last-child,
.cookie-table td:last-child { display: none; }

/* ── Scroll to top ── */
.scroll-top {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom, 0px));
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--fg);
  color: var(--bg);
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
  z-index: 200;
  cursor: pointer;
  border: none;
}
.scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ── Reveal: animazione più veloce su mobile ── */
.reveal         { transition-duration: 0.45s !important; }
.reveal.in-view { opacity: 1 !important; transform: none !important; }
