@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;600;700&display=swap');

/* Global font (aligned with contatti) */
*{ font-family:'Cormorant Garamond', serif !important; }
:root{
      --bg: #000000;
      --panel: #0b0b10;
      --text: #f2f2f2;
      --muted: #a9a9b3;
      --line: #1b1b24;
      --soft: #11111a;
      --btn: #6d28d9;
      --btnText: #ffffff;
      --accent: #8b5cf6;

      --container: 1240px;
      --padX: 28px;

      /* Sidebar */
      --sidebarW: 320px;
    }

    *{ box-sizing:border-box; }

    body{
      margin:0;
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      background: var(--bg);
      color: var(--text);
    }

    .wrap{
      width: min(var(--container), calc(100% - (var(--padX) * 2)));
      margin: 0 auto;
    }

    /* blocco scroll più robusto su iOS */
    body.menu-open{
      overflow: hidden;
      touch-action: none;
    }

    /* ====== TOP BAR ====== */
    .topbar{
      position: sticky;
      top:0;
      z-index: 60;
      background: var(--panel);
      border-bottom: 1px solid var(--line);
    }

    .navrow{
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:16px;
      padding: 16px 0;
    }

    .brand{
      display:flex;
      align-items:center;
      gap:10px;
      font-weight:700;
      text-decoration:none;
      color: var(--text);
      white-space:nowrap;
    }
    .brand .dot{
      width:8px; height:8px;
      border-radius:999px;
      background: var(--text);
      display:inline-block;
    }

    .leftControls{
      display:flex;
      align-items:center;
      gap:12px;
      min-width: 0;
    }

    .menuBtn{
      display:inline-flex;
      align-items:center;
      justify-content:center;
      width:44px;
      height:44px;
      border-radius:999px;
      border:1px solid var(--line);
      background: transparent;
      cursor:pointer;
      user-select:none;
    }
    .menuBtn:hover{ background: rgba(255,255,255,.04); }
    .menuBtn:focus{ outline: 3px solid rgba(43,43,43,.12); outline-offset: 2px; }

    .menuIcon{
      width:18px; height:18px;
      position:relative;
    }
    .menuIcon span{
      position:absolute;
      left:0; right:0;
      height:2px;
      background: var(--text);
      border-radius: 2px;
      opacity: .85;
    }
    .menuIcon span:nth-child(1){ top:3px; }
    .menuIcon span:nth-child(2){ top:8px; }
    .menuIcon span:nth-child(3){ top:13px; }

    .navActions{
      display:flex;
      align-items:center;
      gap:10px;
      white-space:nowrap;
    }

    .pill{
      display:inline-block;
      padding:10px 14px;
      border-radius:999px;
      border:1px solid var(--line);
      background: transparent;
      color: var(--text);
      text-decoration:none;
      font-size:14px;
      font-weight:600;
    }

    .pill.primary{
      background: var(--btn);
      color: var(--btnText);
      border-color: var(--btn);
    }

    .langPill{
      cursor:pointer;
      user-select:none;
    }

    /* ====== SIDEBAR + OVERLAY ====== */
    .overlay{
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,.35);
      z-index: 80;
      opacity: 0;
      pointer-events: none;
      transition: opacity .22s ease;
    }
    .overlay.open{
      opacity: 1;
      pointer-events: auto;
    }

    .sidebar{
      position: fixed;
      top: 0;
      left: 0;
      height: 100vh;
      height: 100dvh; /* iPhone/iPad safe */
      width: min(var(--sidebarW), calc(100vw - 56px));
      background: var(--panel);
      border-right: 1px solid var(--line);
      z-index: 90;
      transform: translateX(-102%);
      transition: transform .26s ease;
      display:flex;
      flex-direction:column;
      padding: 18px;
      overflow:auto;
      -webkit-overflow-scrolling: touch;
    }
    .sidebar.open{ transform: translateX(0); }

    .sideTop{
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:12px;
      padding-bottom: 14px;
      border-bottom: 1px solid var(--line);
      margin-bottom: 14px;
    }

    .sideTitle{
      display:flex;
      align-items:center;
      gap:10px;
      font-weight:800;
    }

    .closeBtn{
      display:inline-flex;
      align-items:center;
      justify-content:center;
      width:40px;
      height:40px;
      border-radius:999px;
      border:1px solid var(--line);
      background: transparent;
      cursor:pointer;
    }
    .closeBtn:hover{ background:#f1f1ef; }
    .closeX{
      font-size:18px;
      line-height:1;
      opacity:.8;
    }

    .sideNav{
      display:flex;
      flex-direction:column;
      gap:8px;
      padding: 6px 0 14px 0;
    }

    .sideNav a{
      text-decoration:none;
      color: var(--text);
      font-weight:600;
      font-size:15px;
      padding: 12px 12px;
      border-radius: 14px;
      border: 1px solid transparent;
    }
    .sideNav a:hover{
      background: #f1f1ef;
    }
    .sideNav a.activeLink{
  background: rgba(255,255,255,.06);

      border-color: var(--line);
      background: var(--soft);
      text-decoration: none;
    }

    .sideMeta{
      margin-top: auto;
      padding-top: 14px;
      border-top: 1px solid var(--line);
      color: var(--muted);
      font-size: 13px;
      line-height: 1.7;
    }

    /* ====== HERO ====== */
    .hero{
      background-color: var(--panel);
      background-image:
        linear-gradient(rgba(12,8,20,.72), rgba(12,8,20,.72));
      background-size: cover;
      background-position: center;
      background-repeat: no-repeat;
      position:relative;
      overflow:hidden;
    }
    .hero::before{
      content:"";
      position:absolute;
      width:420px; height:420px;
      border-radius:50%;
      background: #0f0f18;
      left:-180px; top:-180px;
    }
    .hero::after{
      content:"";
      position:absolute;
      width:300px; height:300px;
      border-radius:50%;
      background: #141425;
      right:-140px; bottom:-160px;
    }

    .heroInner{
      padding: 56px 0 46px 0;
      text-align:center;
      position:relative;
      z-index:1;
    }

        .heroInner > *{ position:relative; z-index:1; }


    
    /* ====== AVATAR BACKGROUND (index) ====== */
    .avatarWrap{
      position: relative;
      display: inline-block;
      margin: 0 auto 18px auto;
    }
    .avatarWrap::before{
      content:"";
      position:absolute;
      inset:-14px;
      border-radius:999px;
      background-size: cover;
      background-position: center;
      background-repeat: no-repeat;
      z-index:0;
      /* slight dark overlay for readability */
      filter: saturate(1.05) contrast(1.05);
      opacity: .95;
    }
    .avatarWrap::after{
      content:"";
      position:absolute;
      inset:-14px;
      border-radius:999px;
      background: rgba(12,8,20,.45);
      z-index:0;
    }
    .avatar{
      position:relative;
      z-index:1;
    }

.avatar{
      width:160px; height:160px;
      border-radius:50%;
      object-fit:cover;
      border: 6px solid #fff;
      display:block;
      margin: 0;
      display:block;
      }

    .kicker{
      font-size:12px;
      letter-spacing: .14em;
      text-transform: uppercase;
      color: #777;
      margin: 0 0 8px 0;
    }

    .hero h1{
      font-size: 44px;
      line-height: 1.05;
      margin: 0 0 12px 0;
      font-weight: 800;
    }

    .hero p{
      max-width: 44ch;
      margin: 0 auto;
      font-size: 18px;
      line-height: 1.65;
      color: #E6E3F0;
    
      text-shadow: 0 2px 10px rgba(0,0,0,.65);}

    .heroMeta{
      margin-top: 18px;
      font-size: 12px;
      letter-spacing: .12em;
      text-transform: uppercase;
      color: #6b6b6b;
    }

    .heroCtas{
      margin-top: 22px;
      display:flex;
      justify-content:center;
      gap:12px;
      flex-wrap:wrap;
    }

    .btn{
      display:inline-block;
      padding: 12px 18px;
      border-radius:999px;
      text-decoration:none;
      font-size:14px;
      font-weight:700;
      border:1px solid var(--line);
      background: transparent;
      color: var(--text);
    }
    .btn.dark{
      background: var(--btn);
      color: var(--btnText);
      border-color: var(--btn);
    }

    /* ====== SECTIONS ====== */
    .section{
      padding: 70px 0;
    }
    .section.alt{background: #000000;border-top: 1px solid var(--line);border-bottom: 1px solid var(--line);}

    .grid2{
      display:grid;
      grid-template-columns: 1.15fr .85fr;
      gap: 34px;
      align-items:start;
    }

    h2{
      font-size: 28px;
      margin: 0 0 14px 0;
    }

    .lead{font-size: 16px;line-height: 1.8;color: var(--muted);
      margin: 0 0 14px 0;
    }

    .mini{
      color: var(--muted);
      font-size: 14px;
      line-height: 1.8;
      margin: 0;
    }

    /* ====== CARDS ====== */
    .cardsHead{
      display:flex;
      align-items:baseline;
      justify-content:space-between;
      gap:16px;
      margin-bottom: 18px;
    }

    .cards{
      display:grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 18px;
    }

    .card{
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 18px;
      padding: 22px;
      min-height: 170px;
    }

    .cardTop{
      display:flex;
      align-items:center;
      gap:12px;
      margin-bottom: 12px;
    }

    .iconDot{
      width:42px; height:42px;
      border-radius: 999px;
      background: #ffffff;
      opacity: .12;
    }

    .card strong{
      display:block;
      font-size: 16px;
      margin: 0;
    }

    .card p{
      margin: 8px 0 0 0;
      color:var(--muted);
      line-height: 1.7;
      font-size: 14px;
    }

    /* ====== FOOTER ====== */
    footer{
      background: var(--panel);
      border-top: 1px solid var(--line);
      padding: 36px 0;
      text-align:center;
      font-size: 14px;
      color: var(--muted);
    }

    /* Responsive */
    @media (max-width: 980px){
      .grid2{ grid-template-columns: 1fr; }
      .cards{ grid-template-columns: 1fr; }
      .pill.primary{ padding:10px 12px; }
    }

    /* Riduci animazioni se preferito */
    
    /* Mobile topbar fix: evita sovrapposizioni tra brand e CTA */
    @media (max-width: 520px){
      .navrow{
        flex-wrap: wrap;
        gap: 10px;
      }
      .leftControls{
        flex: 1 1 auto;
        min-width: 0;
      }
      .brand{
        min-width: 0;
      }
      .brand span:last-child{
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 52vw;
      }
      .navActions{
        flex: 0 0 auto;
        width: 100%;
        justify-content: flex-end;
      }
      .pill{
        padding: 9px 11px;
        font-size: 13px;
      }

      /* Micro-ottimizzazione CTA mobile: meno “pesante” ma sempre cliccabile */
      .navActions .pill.primary{
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 8px 10px;
        font-size: 12px;
        font-weight: 700;
        border-radius: 12px;
        background: #fff;
        color: var(--btn);
        border-color: var(--btn);
        min-height: 36px;
      }
      .navActions{
        gap: 8px;
      }
    }

@media (prefers-reduced-motion: reduce){
      .sidebar, .overlay{ transition: none; }
    }
  
    /* ====== COLOR TUNE (more colorful, still clean) ====== */
    :root{
      --accent: #6D28D9;      /* violet */
      --accent2:#06B6D4;      /* cyan */
      --accentSoft: rgba(109,40,217,.10);
      --btn: var(--accent);
      --btnText:#ffffff;
    }

    /* links (excluding buttons/brand) */
    a:not(.btn):not(.brand):not(.pill){
      color: var(--accent);
    }
    a:not(.btn):not(.brand):not(.pill):hover{
      text-decoration: underline;
    }

    /* brand dot */
    .brand .dot{
      background: var(--accent);
    }

    /* subtle colorful hero blobs */
    .hero::before{
      background: radial-gradient(circle at 30% 30%, rgba(109,40,217,.22), rgba(109,40,217,0) 62%);
    }
    .hero::after{
      background: radial-gradient(circle at 70% 70%, rgba(6,182,212,.18), rgba(6,182,212,0) 60%);
    }

    /* primary pills + dark buttons become accent */
    .pill.primary,
    .btn.dark{
      background: linear-gradient(135deg, var(--accent), var(--accent2));
      border-color: transparent;
      color: #fff;
    }
    .pill.primary:hover,
    .btn.dark:hover{
      filter: brightness(0.98);
    }

    /* add a small accent underline to section titles */
    h2{
      position: relative;
      display: inline-block;
    }
    h2::after{
      content:"";
      position:absolute;
      left:0;
      bottom:-8px;
      width:60%;
      height:6px;
      border-radius:999px;
      background: linear-gradient(90deg, var(--accent), rgba(6,182,212,0));
      opacity:.22;
      pointer-events:none;
    }

    /* cards: tiny accent hover */
    .card{
      transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
    }
    .card:hover{
      transform: translateY(-1px);
      border-color: rgba(109,40,217,.25);
      box-shadow: 0 10px 28px rgba(0,0,0,.06);
    }

    /* keep the mobile topbar micro-optimization: smaller/outline CTA */
    @media (max-width: 520px){
      .pill.primary{
        background: transparent !important;
        color: var(--accent) !important;
        border-color: rgba(109,40,217,.35) !important;
      }
    }

/* ===== Page-specific styles ===== */
/* s*LAYOUT\s */
.grid2{
      display:grid;
      grid-template-columns: 1.1fr .9fr;
      gap:22px;
      align-items:start;
      margin-top:22px;
    }

    /* PANELS */
    .panel{
      background:var(--panel);
      border:1px solid var(--line);
      border-radius:18px;
      padding:26px;
    }
    .panel.soft{
      background: var(--soft);
      border-color:#ededed;
    }

    /* FORM */
    label{
      display:block;
      font-size:14px;
      margin-top:12px;
    }
    input, textarea{
      width:100%;
      padding:12px 14px;
      border:1px solid var(--line);
      border-radius:12px;
      font-size:15px;
      background: var(--soft);
      margin-top:6px;
      font-family:inherit;
    }
    input:focus, textarea:focus{outline:none;border-color:var(--accent);}
    textarea{resize:vertical}

    .btn{
      display:inline-block;
      padding:12px 18px;
      border-radius:999px;
      text-decoration:none;
      font-size:14px;
      font-weight:700;
      border:1px solid var(--line);
      background: transparent;
      color:var(--text);
      cursor:pointer;
    }
    .btn.dark{
      background:var(--btn);
      color:var(--btnText);
      border-color:var(--btn);
    }

/* ===== Common patch: sidebar dot (keeps UI aligned with index) ===== */
.sideTitle .dot{
  width:8px;
  height:8px;
  border-radius:999px;
  background: var(--accent);
  display:inline-block;
}



/* ===== Mobile fixes (generated) ===== */
@media (max-width: 980px){
  /* Page-specific override was forcing 2 columns on mobile */
  .grid2{ grid-template-columns: 1fr !important; gap: 16px !important; }
}

/* Improve form layout on small screens */
@media (max-width: 520px){
  .panel{ padding: 20px !important; }
  form > div[style*="display:flex"]{
    flex-direction: column !important;
    align-items: stretch !important;
  }
  form > div[style*="display:flex"] .btn{
    width: 100% !important;
    text-align: center;
  }
}

/* ===== Page-specific styles (FAQ) ===== */
.faqList{ margin-top:22px; }
details{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:18px;
  padding:18px 20px;
  margin-bottom:14px;
}
summary{
  cursor:pointer;
  font-weight:800;
  font-size:15px;
  list-style:none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
summary::-webkit-details-marker{display:none}
.chev{
  width:34px; height:34px;
  border-radius:999px;
  border:1px solid var(--line);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:14px;
  color: var(--muted);
  flex:0 0 auto;
  transition: transform .18s ease, color .18s ease, border-color .18s ease;
}
details[open] .chev{ transform: rotate(180deg); color: var(--text); border-color: rgba(139,92,246,.35); }
details p{
  margin:12px 0 0 0;
  line-height:1.75;
  color: var(--muted);
  font-size:14px;
}

/* FIX: X close button always visible on dark sidebar */
.closeBtn{
  color:#ffffff !important;
  border-color: rgba(255,255,255,.25) !important;
}
.closeX{
  color:#ffffff !important;
  opacity:1 !important;
  text-shadow: 0 0 12px rgba(0,0,0,.65);
}
.closeBtn:hover{
  background: rgba(255,255,255,.06) !important;
}
/* Ensure close stays above */
.sidebar .closeBtn{
  position: relative;
  z-index: 9999;
}

/* ===== Page-specific: services scroller + process grid ===== */

/* Services: horizontal scroller with arrows (keeps card design) */
.servicesHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-bottom: 18px;
}
.servicesControls{
  display:flex;
  align-items:center;
  gap:10px;
}
.iconPill{
  width:40px;
  height:40px;
  border-radius:999px;
  border:1px solid var(--line);
  background: var(--soft);
  color: var(--text);
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.iconPill:hover{
  border-color: rgba(109,40,217,.35);
}

.cardsScroll{
  display:flex;
  gap:18px;
  overflow-x:auto;
  scroll-snap-type:x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
}
.cardsScroll::-webkit-scrollbar{ height:10px; }
.cardsScroll::-webkit-scrollbar-thumb{ background: rgba(255,255,255,.08); border-radius:999px; }
.cardsScroll .card{
  scroll-snap-align:start;
  min-width: 280px;
}

/* Process */
.process{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 22px;
}

/* Responsive tweaks */
@media (max-width: 980px){
  .cardsScroll .card{ min-width: 100%; }
  .process{ grid-template-columns: 1fr; }
}
@media (min-width: 600px) and (max-width: 980px){
  .cardsScroll .card{ min-width: calc(50% - 9px); }
  .process{ grid-template-columns: repeat(2, 1fr); }
}

  
    .carouselViewport{
      overflow: hidden;
      border-radius: 18px;
    }
    .carouselTrack{
      display: flex;
      gap: 18px;
      will-change: transform;
      transition: transform .32s ease;
    }
    .carouselTrack.noAnim{ transition: none; }

    /* 3 cards visible (2 gaps = 36px) */
    .carouselTrack .card{
      flex: 0 0 calc((100% - 36px) / 3);
      min-height: 170px;
    }

    /* Arrow buttons: same style as menu buttons */
    .carouselBtn{
      display:inline-flex;
      align-items:center;
      justify-content:center;
      width:44px;
      height:44px;
      border-radius:999px;
      border:1px solid var(--line);
      background: rgba(255,255,255,.02);
      color: var(--text);
      cursor:pointer;
      user-select:none;
    }
    .carouselBtn:hover{ background: rgba(255,255,255,.04); }
    .carouselBtn:focus{ outline: 3px solid rgba(109,40,217,.20); outline-offset: 2px; }

    @media (max-width: 980px){
      .carouselTrack .card{ flex-basis: 100%; }
    }
    @media (min-width: 600px) and (max-width: 980px){
      .carouselTrack .card{ flex-basis: calc((100% - 18px) / 2); }
    }


  
/* === FIX: sidebar link color identical to portfolio === */
.sideNav a{
  color: var(--text) !important;
}
.sideNav a:hover{
  color: var(--text) !important;
}
.sideNav a.activeLink{
  color: var(--text) !important;
}


/* === FIX: sidebar hover/active translucency identical to portfolio.html === */
.sideNav a{
  background: transparent !important;
  border: 1px solid transparent !important;
  color: var(--text) !important;
}
.sideNav a:hover{
  background: rgba(255,255,255,.035) !important; /* portfolio hover */
  color: var(--text) !important;
}
.sideNav a.activeLink{
  border-color: var(--line) !important;
  background: rgba(255,255,255,.06) !important;  /* portfolio active */
  color: var(--text) !important;
}


/* === FIX: remove underline on sidebar links (match portfolio.html) === */
.sideNav a,
.sideNav a:hover,
.sideNav a:focus,
.sideNav a:active,
.sideNav a.activeLink{
  text-decoration: none !important;
}


/* === FIX: remove residual gap in sidebar title (dot was 0x0) === */
.sideTitle{
  gap: 0 !important;
}


/* === AVATAR: unified ring exactly like portfolio reference === */
.avatar{
  width:160px;
  height:160px;
  border-radius:50%;
  object-fit:cover;
  display:block;
  margin: 0 auto 18px auto;
  border: 6px solid var(--panel);          /* dark inner separation */
  box-shadow: 0 0 0 4px #ffffff;            /* white outer ring */
}

/* Subtle italic tuning */
body {
  font-family: 'Cormorant Garamond', serif;
  font-style: normal;
}
h1, h2, h3 {
  font-style: italic;
}
button, input, textarea {
  font-style: normal;
}


/* --- Hero readability micro-fix --- */
/* (Keep UI/colors intact; improves text clarity on detailed backgrounds) */
.hero p{
  color: #E6E3F0;
  text-shadow: 0 2px 10px rgba(0,0,0,.65);
  max-width: 44ch;
  margin: 0 auto;
  line-height: 1.65;
}

/* --- Hero background image override --- */
.hero{
  background-color: var(--panel);
  background-image:
    linear-gradient(rgba(12,8,20,.72), rgba(12,8,20,.72)),
    url("../assets/backgrounds/background_index.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* ===== Services cards: no grey dots + title centered at top ===== */
.section.services .iconDot{
  display: none;
}

.section.services .cardTop{
  display: block;          /* remove icon+title row layout */
  margin-bottom: 12px;
  text-align: center;
}

.section.services .cardTop strong{
  display: block;
  width: 100%;
  text-align: center;
  margin: 0;
}

/* ===== Process (How we work): title centered at top ===== */
.process .cardTop{
  text-align: center;
  margin-bottom: 12px;
}

.process .cardTop strong{
  display: block;
  width: 100%;
  text-align: center;
}





/* ===== Process (How we work): micro hover (no numbers) ===== */
.process .card{
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}

.process .card:hover{
  transform: translateY(-1px);
  border-color: rgba(109,40,217,.25);
  box-shadow: 0 10px 28px rgba(0,0,0,.06);
}

.process .cardTop strong{
  transition: transform .14s ease;
}

.process .card:hover .cardTop strong{
  transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce){
  .process .card,
  .process .cardTop strong{
    transition: none !important;
  }
}

/* ===== Typography scale patch (desktop-first) ===== */
@media (min-width: 981px){
  body{ font-size: 17px; line-height: 1.75; }
  /* Headings */
  .hero h1{ font-size: 52px; }
  h1{ font-size: 52px; }
  h2{ font-size: 32px; }
  h3{ font-size: 22px; }

  /* Text blocks */
  p{ font-size: 17px; }
  .lead{ font-size: 18px; }
  .mini{ font-size: 15px; }

  /* UI */
  .pill{ font-size: 15px; }
  .btn{ font-size: 15px; }

  /* Cards / FAQ */
  .card strong{ font-size: 18px; }
  .card p{ font-size: 16px; }
  summary{ font-size: 17px; }
  details p{ font-size: 16px; }

  /* Forms */
  label{ font-size: 16px; }
  input, textarea{ font-size: 16px; }
}

@media (max-width: 520px){
  body{ font-size: 15px; line-height: 1.7; }
  .hero h1{ font-size: 36px; }
  h1{ font-size: 36px; }
  h2{ font-size: 26px; }
  h3{ font-size: 20px; }
  p{ font-size: 15px; }
  .lead{ font-size: 16px; }
  .mini{ font-size: 14px; }
  input, textarea{ font-size: 15px; }
}

/* Font override (aligned with contatti) */
*{ font-family:'Cormorant Garamond', serif !important; }
body{ font-family:'Cormorant Garamond', serif !important; }

/* ===== Typography sync (match portfolio.css sizes) ===== */
.mini{ font-size: 15px; }
.card strong{ font-size: 18px; }
.card p{ font-size: 15px; }
summary{ font-size: 17px; }
details p{ font-size: 16px; }
label{ font-size: 16px; }
input, textarea{ font-size: 16px; }
/* index had a larger hero paragraph; align to portfolio */
.hero p{ font-size: 16px; }

/* =========================
   SAFE REM + AUTO SCALING
   - Keeps existing layout intact
   - Typography scales automatically via rem
   ========================= */

html{
  /* Auto scaling: mobile -> desktop */
  font-size: clamp(14px, 0.9vw + 0.4rem, 17px);
}

body{
  font-size: 1rem;       /* scales with html */
  line-height: 1.7;
}

/* Headings */
.hero h1, h1{ font-size: 3.25rem; }   /* ~52px at 16px base */
h2{ font-size: 2rem; }                /* ~32px */
h3{ font-size: 1.375rem; }            /* ~22px */

/* Text blocks */
p{ font-size: 1rem; }
.hero p{ font-size: 1rem; }
.lead{ font-size: 1.125rem; }         /* ~18px */
.mini{ font-size: 0.9375rem; }        /* ~15px */

/* UI */
.pill{ font-size: 0.9375rem; }        /* ~15px */
.btn{ font-size: 0.9375rem; }         /* ~15px */

/* Cards / Quotes */
.card strong{ font-size: 1.125rem; }  /* ~18px */
.card p{ font-size: 0.9375rem; }      /* ~15px */
.quote p{ font-size: 0.9375rem; }     /* ~15px */
.quote .by{ font-size: 0.875rem; }    /* ~14px */

/* Forms (in case present) */
label{ font-size: 1rem; }
input, textarea{ font-size: 1rem; }

/* Footer */
footer{ font-size: 0.9375rem; }       /* ~15px */

/* =========================================================
   FIX: Avatar ring + dark background circle (mobile-safe)
   - Forces mathematically perfect circle and concentric alignment
   - Overrides any earlier .avatar/.avatarWrap rules in this file
   ========================================================= */

.avatarWrap{
  position: relative;
  display: inline-block;
  margin: 0 auto 18px auto;
  width: 160px;
  height: 160px;
}

/* Remove old background pseudo (if any) */
.avatarWrap::before{
  content: none !important;
}

/* Dark overlay circle: explicit size + centered transform => no ellipse */
.avatarWrap::after{
  content:"" !important;
  position: absolute !important;
  width: 188px !important;               /* 160 + (14*2) */
  height: 188px !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  border-radius: 50% !important;
  background: rgba(12,8,20,.45) !important;
  z-index: 0 !important;
  pointer-events: none;
}

/* Avatar image + rings */
.avatar{
  position: relative;
  z-index: 1;
  width:160px;
  height:160px;
  border-radius:50%;
  object-fit:cover;
  display:block;
  margin: 0 auto 18px auto;
  border: 6px solid var(--panel);         /* dark inner separation */
  box-shadow: 0 0 0 4px #ffffff;           /* white outer ring */
}

/* === Index cards: testo più grande (come portfolio) === */
.section .card strong{
  font-size: 1.35rem;   /* titolo riquadro */
}

.section .card p{
  font-size: 1.05rem;   /* testo descrittivo */
  line-height: 1.75;
}

@media (max-width: 520px){
  .section .card strong{
    font-size: 1.25rem;
  }

  .section .card p{
    font-size: 1rem;
  }
}

@media (max-width: 520px){
  .hero{
    background-image:
      linear-gradient(rgba(12,8,20,.78), rgba(12,8,20,.78)),
      url("../assets/backgrounds/background_index_mobile.png");
    background-position: center top;
  }
}

/* =========================
   Easter egg modal (index)
   Opens after 5 clicks on the profile photo
   ========================= */
.eeModal{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}
.eeModal.is-open{ display:block; }

.eeModal__backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.55);
}

.eeModal__panel{
  position:relative;
  width: min(720px, calc(100% - 32px));
  margin: 10vh auto;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 22px 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}

.eeModal__close{
  position:absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text);
  cursor: pointer;
}
.eeModal__close:hover{ background: rgba(255,255,255,.08); }

.eeModal__title{
  margin: 0 44px 10px 0;
  font-size: 1.75rem;
}
.eeModal__text{
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
  font-size: 1.05rem;
}

@media (max-width: 520px){
  .eeModal__panel{ margin: 12vh auto; }
  .eeModal__title{ font-size: 1.5rem; }
  .eeModal__text{ font-size: 1rem; }
}


/* ===== FIX CTA gradient borders (Request a quote) ===== */
.pill.primary{
  position: relative;
  overflow: hidden;
  border: none;              /* evita interferenze con il gradiente */
  background: transparent;  /* il gradiente passa al layer interno */
}

.pill.primary::before{
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    var(--accent),
    var(--accent2)
  );
  z-index: -1;
}

/* hover leggero e pulito */
.pill.primary:hover::before{
  filter: brightness(1.03);
}

/* === CTA: fix mobile readability + stable layering === */
.pill.primary{
  z-index: 0;          /* crea stacking context */
  isolation: isolate;  /* evita che ::before finisca dietro ad altri layer */
  color: #fff !important;
}

/* su mobile annulla il vecchio override che cambiava il colore */
@media (max-width: 520px){
  .pill.primary{
    color: #fff !important;
    border-color: transparent !important; /* opzionale: più pulito */
  }
}
