/* ==========================================================================
   credentials.css — uniform background + shared button style + mobile MENU
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root{
  --bg:#0e0e11;
  --panel:#15161a;
  --panel-2:#101114;
  --muted:#a2a6b0;
  --text:#e9ecf1;
  --accent:#3b82f6;
  --accent-2:#9b9bff;

  --radius:22px;
  --radius-sm:16px;
  --radius-lg:28px;

  --shadow:0 1px 0 rgba(255,255,255,.06) inset, 0 20px 40px rgba(0,0,0,.45);
  --border:1px solid rgba(255,255,255,.06);

  /* same as index to fix LET'S TALK button */
  --card-grad:
    radial-gradient(1200px 600px at 0% -10%, rgba(255,255,255,.06), transparent 50%),
    radial-gradient(1200px 600px at 120% 110%, rgba(255,255,255,.05), transparent 50%),
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(0,0,0,.02));

  /* Spacing scale (fluid) */
  --space-top: clamp(72px, 7vh, 120px);
  --space-between: 34px;
  --space-bottom: clamp(140px, 16vh, 240px);
  --space-footer-top: clamp(64px, 8vh, 120px);
}

/* ---------- Base / Typography ---------- */
*{box-sizing:border-box}
html,body{height:100%}
html{font-size:14px}
body{
  margin:0;
  background: var(--bg); /* uniforme */
  color:#9f9f9f;
  font-family:Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  line-height:1.37;
  letter-spacing:.2px;
}
h1,h2,h3{color:var(--text); margin:0}
.muted{color:#8b8f96; font-size:12px; text-transform:uppercase; letter-spacing:.18em}
.sub-muted{color:#b6bbc6}

/* ====================================================================== */
/* ======================= NAVBAR (come index) ========================== */
/* ====================================================================== */

.nav{
  position:sticky;
  top:0;
  z-index:40;
  background:transparent;
  border:0;
  box-shadow:none;
  transition: transform .28s ease, opacity .28s ease;
}
.nav--hidden{
  transform:translateY(-110%);
  opacity:0;
  pointer-events:none;
}

.nav-centered .nav-inner{
  max-width:1180px;
  margin:0 auto;
  padding:18px 20px;
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:22px;
}

.logo{
  font-weight:700;
  font-size:22px;
  letter-spacing:.6px;
  color:var(--text);
  text-transform:lowercase;
}

/* MENU button (mobile) */
.menu-toggle{
  display:none;              /* desktop hidden */
  border:0;
  background:none;
  color:var(--text);
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.18em;
  cursor:pointer;
}

/* navlinks base (desktop) */
.navlinks{
  display:flex;
  gap:26px;
  justify-self:center;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}
.navlinks a{
  position:relative;
  text-decoration:none;
  color:#a2a6b0;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.12em;
  white-space:nowrap;
}
.navlinks a.active,
.navlinks a:hover{
  color:var(--text);
}
.navlinks a::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:-8px;
  height:2px;
  border-radius:4px;
  background:linear-gradient(90deg, transparent, #6e7fff, transparent);
  transform:scaleX(0);
  transform-origin:center;
  transition:.28s ease;
}
.navlinks a.active::after,
.navlinks a:hover::after{
  transform:scaleX(1);
}

/* CTA aligned right */
.cta{
  justify-self:end;
}

/* Shared button (LET'S TALK) */
.btn{
  appearance:none;
  border: var(--border);
  color: var(--text);
  background-color: var(--panel);
  background-image: var(--card-grad);
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  box-shadow: var(--shadow);
  transition: filter .2s ease, transform .08s ease, box-shadow .2s ease;
}
.btn:hover{ filter: brightness(1.06); }
.btn:active{ transform: translateY(1px); }
.btn:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px rgba(59,130,246,.35), inset 0 1px 0 rgba(255,255,255,.12);
}

/* ========== MOBILE NAV: fino a 768px (come index) ========== */
@media (max-width:768px){
  .nav-centered .nav-inner{
    grid-template-columns:auto auto auto; /* logo | menu | cta */
    gap:12px;
  }

  .menu-toggle{
    display:block;
    justify-self:center;
  }

  .navlinks{
    display:none;             /* chiuso di default */
    position:absolute;
    top:100%;
    left:0;
    right:0;
    padding:12px 20px 18px;
    background:var(--panel);
    border-bottom:var(--border);
    box-shadow:0 20px 40px rgba(0,0,0,.6);
    flex-direction:column;
    gap:12px;
    z-index:39;
  }

  .navlinks.is-open{
    display:flex;
  }

  .navlinks a{
    padding:6px 0;
  }
}

/* ========== DESKTOP: da 769px (come index) ========== */
@media (min-width:769px){
  .nav-centered .nav-inner{
    grid-template-columns:auto 1fr auto; /* logo | navlinks | CTA */
    gap:22px;
  }

  .menu-toggle{
    display:none !important;
  }

  .navlinks{
    display:flex !important;
    position:static;
    padding:0;
    margin:0;
    background:transparent !important;
    border:0;
    box-shadow:none !important;
    flex-direction:row;
    gap:26px;
    justify-self:center;
  }

  .navlinks a{
    padding:0;
  }
}

/* ---------- Wrapper ---------- */
.wrap{
  max-width:1180px;
  margin: var(--space-top) auto var(--space-bottom);
  padding:0 24px;
}

/* ---------- Card base ---------- */
.card{
  position:relative;
  border:var(--border);
  border-radius:var(--radius);
  background:var(--panel);
  background-image:var(--card-grad);
  box-shadow:var(--shadow);
  overflow:hidden;
  isolation:isolate;
  transition: transform .2s ease, box-shadow .2s ease, background .3s ease;
}
.card:hover{
  transform:translateY(-2px);
  box-shadow:0 1px 0 rgba(255,255,255,.06) inset, 0 30px 60px rgba(0,0,0,.5);
}
.card .in{ padding:26px; }
.shine{
  position:absolute;
  inset:0;
  pointer-events:none;
  opacity:0;
  transition:.35s;
  background: radial-gradient(400px 200px at 50% 50%, rgba(255,255,255,.08), transparent 40%);
  mix-blend-mode: screen;
}
.card:hover .shine{ opacity:1 }

/* ---------- Credentials layout ---------- */
.cred-grid{
  display:grid;
  grid-template-columns: 360px 1fr;
  gap:28px;
  align-items:start;
}

/* Left rail (sticky profile card) */
.left-rail{
  position:sticky;
  top:86px;
  height:fit-content;
}
.rail-card .rail-in{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:16px;
}
.rail-photo{
  width:260px;
  height:260px;
  border-radius:22px;
  overflow:hidden;
}
.rail-photo img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  border-radius:inherit;
}
.rail-name{
  font:700 24px/1.2 Inter, sans-serif;
  color:var(--text);
  text-align:center;
}
.rail-handle{
  color:#b6bbc6;
  font-size:14px;
  text-align:center;
}

/* Social icons row inside rail */
.rail-social{
  display:flex;
  gap:12px;
  justify-content:center;
}
.rail-social .icon-w{
  width:44px;
  height:44px;
  border-radius:50%;
  display:grid;
  place-items:center;
  color:#ffffff;
  background:linear-gradient(180deg,#1b1c21,#0f1013);
  border:1px solid rgba(255,255,255,.08);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.08);
  transition:transform .18s ease, box-shadow .18s ease, opacity .18s ease;
  aspect-ratio:1/1;
}
.rail-social .icon-w:hover{
  transform:translateY(-1px);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.12), 0 8px 22px rgba(0,0,0,.35);
  opacity:1;
}
.rail-social .icon-w svg{
  width:22px;
  height:22px;
}
.rail-btn{
  width:100%;
  text-align:center;
  margin-top:4px;
}

/* Right rail (scrollable content area) */
.right-rail{ min-height:60vh; }
.cv-section{
  margin-bottom: var(--space-between);
  scroll-margin-top: 110px;
}
.cv-section .muted{
  margin-bottom:10px;
  display:block;
}

/* Experience list */
.xp-list{
  display:grid;
  gap:20px;
}
.xp-item{
  padding-bottom:8px;
  border-bottom:1px solid rgba(255,255,255,.06);
}
.xp-time{
  color:#b6bbc6;
  font-size:13px;
  margin-bottom:4px;
}
.xp-role{
  color:#7aa2ff;
  text-decoration:none;
  font-weight:600;
}
.xp-role:hover{
  text-decoration:underline;
}
.xp-company{
  font-size:13px;
  margin-top:2px;
}
.xp-desc{
  margin:8px 0 0;
  color:#c7ccd6;
}

/* ---------- Skills ---------- */
.skills-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  column-gap:64px;
  row-gap:22px;
  margin-top:10px;
}
.skill-card{
  display:flex;
  flex-direction:column;
  gap:4px;
  padding:6px 0 14px;
  border-bottom:1px solid rgba(255,255,255,.06);
}
.skill-name{
  font-weight:600;
  color:var(--text);
}
.skill-sub{
  font-size:13px;
  color:#9aa0ac;
}

@media (max-width:700px){
  .skills-grid{
    grid-template-columns:1fr;
  }
}

/* ---------- Footer ---------- */
footer{
  max-width:1180px;
  margin: var(--space-footer-top) auto 88px;
  padding:0 24px;
  color:#9aa0ac;
  background: var(--bg);
}
.footer-inner{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:14px;
  text-align:center;
  padding-bottom:100px;
}
.links{
  display:flex;
  gap:34px;
  justify-content:center;
}
.links a{
  text-decoration:none;
  color:#9aa0ac;
  text-transform:uppercase;
  font-weight:400;
  letter-spacing:.12em;
}
.links a:hover{ color:var(--text) }

/* ---------- Utilities ---------- */
.stretched-link{ position:absolute; inset:0; z-index:10; }

/* ---------- Responsive ---------- */
@media (max-width:1024px){
  .cred-grid{
    grid-template-columns: 320px 1fr;
    gap:22px;
  }
  .rail-photo{
    width:240px;
    height:240px;
  }
}
@media (max-width:860px){
  .cred-grid{
    grid-template-columns:1fr;
  }
  .left-rail{
    position:static;
  }
}
@media (max-width:360px){
  .btn{padding:8px 14px}
}
