:root{
  --p1: 200 165 230;
  --p2: 140 190 225;
  --p3: 145 215 195;
  --p4: 235 195 150;

  --ink: 18 18 22;

  --radius-lg: 48px;
  --edge: 18px;
  --gap: 18px;

  --glass: 255 255 255;
  --glass-alpha: .18;
  --glass-border: .28;
  --glass-shadow: 0 26px 80px rgba(0,0,0,.22);
}

*{ box-sizing: border-box; }

html, body{ height: 100%; }

body{
  margin: 0;
  color: rgb(var(--ink));
  font-family: ui-sans-serif, system-ui, -apple-system,
               "SF Pro Display", "SF Pro Text",
               Segoe UI, Roboto, Helvetica, Arial, sans-serif;

  background: linear-gradient(
    135deg,
    rgb(var(--p2) / .55),
    rgb(var(--p3) / .55),
    rgb(var(--p4) / .55),
    rgb(var(--p1) / .55)
  );
  background-attachment: fixed;
  background-size: 220% 220%;
  animation: pastelMove 22s ease-in-out infinite;

  overflow-x: hidden;
  position: relative;
}

body::before{
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1200px 700px at 20% 15%, rgba(255,255,255,.14), transparent 60%),
    radial-gradient(1100px 650px at 85% 20%, rgba(255,255,255,.10), transparent 55%),
    radial-gradient(1200px 900px at 50% 80%, rgba(0,0,0,.20), transparent 60%),
    linear-gradient(rgba(0,0,0,.18), rgba(0,0,0,.18));
}

@keyframes pastelMove {
  0%   { background-position: 0% 45%; }
  50%  { background-position: 100% 55%; }
  100% { background-position: 0% 45%; }
}

/* Layout */
.page{
  display: flex;
  justify-content: center;
  padding: var(--edge);
}

.stack{
  width: 100%;
  max-width: 680px;
  display: grid;
  gap: var(--gap);
}

/* ===================== */
/* FOTO AGGIORNATA */
/* ===================== */

.photo-wrapper{
  display: flex;
  justify-content: center;
}

.photo-square{
  width: 150px;
  aspect-ratio: 1 / 1;
  border-radius: 24px;
  overflow: hidden;

  background: rgba(var(--glass), .28);
  border: 1px solid rgba(255,255,255,.32);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(14px);

  transition: transform .25s ease;
}

.photo-square:hover{
  transform: scale(1.03);
}

.photo-square img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  pointer-events: none;
}

/* Card base */
.card{
  border-radius: var(--radius-lg);
  background: rgba(var(--glass), var(--glass-alpha));
  border: 1px solid rgba(255,255,255,var(--glass-border));
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(18px) saturate(125%);
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card::after{
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(800px 420px at 25% 15%, rgba(255,255,255,.18), transparent 55%);
}

.card:hover{
  transform: translateY(-6px);
  box-shadow: 0 34px 95px rgba(0,0,0,.28);
}

/* BIO */
.bio-card{
  padding: 42px;
}

.bio-header{
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bio-title{
  margin: 0;
  font-size: 20px;
}

.bio-text{
  margin-top: 18px;
  line-height: 1.6;
  font-size: 15px;
  opacity: .95;
}

.lang-flag{
  width: 28px;
  cursor: pointer;
  border-radius: 6px;
  transition: transform .2s ease, opacity .2s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

.lang-flag:hover{
  transform: scale(1.08);
  opacity: .85;
}

/* Bottom Grid */
.bottom-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}

/* Projects */
.projects-card{
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 18px;
  text-align: center;
  padding: 22px;
}

.projects-link{
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  width: 100%;
  height: 100%;
}

.projects-icon{
  width: 90%;
}

.projects-label{
  font-size: 28px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: rgba(255,255,255,.92);
  text-shadow: 0 10px 28px rgba(0,0,0,.35);
}

/* Social */
.social-column{
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  gap: var(--gap);
}

.social-card{
  display: flex;
  align-items: center;
  padding: 20px 20px 20px 48px;
}

.linkedin{
  background: linear-gradient(135deg, rgba(0,119,181,.16), rgba(255,255,255,.08));
}

.instagram{
  background: linear-gradient(135deg, rgba(225,48,108,.16), rgba(255,255,255,.08));
}

.tiktok{
  background: linear-gradient(135deg, rgba(0,242,234,.16), rgba(255,255,255,.08));
}

.social-box{
  display: flex;
  align-items: center;
  gap: 20px;
  text-decoration: none;
  color: rgba(255,255,255,.88);
  font-size: 22px;
  font-weight: 700;
}

.social-box img{
  width: 40px;
  height: 40px;
  object-fit: contain;
}

/* Footer */
.footer-card{
  border-radius: var(--radius-lg);
  background: rgba(var(--glass), var(--glass-alpha));
  border: 1px solid rgba(255,255,255,var(--glass-border));
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(18px) saturate(125%);
  padding: 18px 22px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,.85);
}

/* Responsive */
@media (max-width: 699px){
  .bottom-grid{
    grid-template-columns: 2fr 1fr;
  }

  .social-card{
    padding: 16px;
  }

  .bio-card{
    padding: 32px;
  }
}

@media (max-width: 420px){
  .bio-card{
    padding: 26px;
  }

  .social-box span{
    display: none;
  }
}