/* ---------- Tema ---------- */
:root {
  --bg: linear-gradient(115deg, #FAF5FF 0%, #EFF6FF 100%);
  --bg-solid: #F4F5FF;
  --text: #0E101B;
  --text-muted: #4F6771;
  --text-subtle: #4F5F68;
  --card-bg: #FFFFFF;
  --card-border: #FFFFFF;
  --card-border-website: rgba(14, 16, 27, 0.1);
  --icon-bg: #0E101B;
  --icon-bg-muted: rgba(131, 152, 162, 0.16);
  --icon-muted: #8398A2;
  --website-subtitle: #0E101B;
  --social-bg: #FFFFFF;
  --social-icon: #8398A2;
  --social-shadow: 0 4px 4px rgba(0, 0, 0, 0.11);
  --primary: linear-gradient(90deg, #9810FA 0%, #155DFC 100%);
  --primary-icon-bg: #0E101B;
  --shadow-lg: 0 4px 6px -4px rgba(0, 0, 0, 0.1), 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: linear-gradient(180deg, #0E101B 0%, #000521 100%);
    --bg-solid: #070A1E;
    --text: #FFFFFF;
    --text-muted: #798996;
    --text-subtle: #505E6A;
    --card-bg: #13172A;
    --card-border: rgba(255, 255, 255, 0.1);
    --card-border-website: rgba(255, 255, 255, 0.1);
    --icon-bg: #252B3D;
    --icon-muted: #505E6A;
    --website-subtitle: #505E6A;
    --social-bg: #13172A;
    --social-icon: #505E6A;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: linear-gradient(180deg, #0E101B 0%, #000521 100%);
  --bg-solid: #070A1E;
  --text: #FFFFFF;
  --text-muted: #798996;
  --text-subtle: #505E6A;
  --card-bg: #13172A;
  --card-border: rgba(255, 255, 255, 0.1);
  --card-border-website: rgba(255, 255, 255, 0.1);
  --icon-bg: #252B3D;
  --icon-muted: #505E6A;
  --website-subtitle: #505E6A;
  --social-bg: #13172A;
  --social-icon: #505E6A;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-solid);
  background-image: var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 24px calc(24px + env(safe-area-inset-bottom));
}

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

[hidden] { display: none !important; }

/* ---------- Toggle tema ---------- */
.theme-toggle {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top));
  right: 16px;
  z-index: 10;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--social-bg);
  color: var(--social-icon);
  box-shadow: var(--social-shadow);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.theme-toggle:hover { transform: scale(1.06); }
.theme-toggle svg { width: 20px; height: 20px; }
/* Mostra il sole in dark (per passare a light) e la luna in light. */
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

/* ---------- Card ---------- */
.card {
  width: 100%;
  max-width: 345px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 3.25px solid #FFFFFF;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  background: var(--icon-bg-muted);
  display: grid;
  place-items: center;
  font-family: "Outfit", sans-serif;
  font-size: 32px;
  font-weight: 500;
  color: var(--icon-muted);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.name {
  margin: 22px 0 0;
  font-family: "Outfit", sans-serif;
  font-weight: 500;
  font-size: 30px;
  line-height: 38px;
  letter-spacing: -0.01em;
  text-align: center;
}

.description {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 24px;
  color: var(--text-muted);
  text-align: center;
}

/* ---------- Link ---------- */
.links {
  width: 100%;
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.link {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 82px;
  padding: 18px 20px;
  border-radius: 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.link:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.link:active { transform: translateY(0); }
.link:focus-visible { outline: 2px solid #155DFC; outline-offset: 2px; }

.link-icon {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--icon-bg);
  color: #FFFFFF;
  display: grid;
  place-items: center;
}
.link-icon svg { width: 44px; height: 44px; }

.link-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.link-title {
  font-family: "Outfit", sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 22px;
}
.link-subtitle {
  font-size: 13px;
  line-height: 18px;
  color: var(--text-subtle);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Contatto (primario) */
.link--contact {
  min-height: 96px;
  padding: 24px;
  background: var(--primary);
  border: none;
  color: #FFFFFF;
  box-shadow: var(--shadow-lg);
  margin-bottom: 2px;
}
.link--contact .link-icon { background: var(--primary-icon-bg); }
.link--contact .link-title { font-size: 17px; line-height: 24px; }
.link--contact .link-subtitle { color: rgba(255, 255, 255, 0.9); font-size: 14px; }

/* Sito web */
.link--website { border-color: var(--card-border-website); }
.link--website .link-icon { background: var(--icon-bg-muted); color: var(--icon-muted); }
.link--website .link-subtitle { color: var(--website-subtitle); }
.link-arrow { flex: none; width: 16px; height: 16px; opacity: 0.6; }

/* ---------- Social ---------- */
.socials {
  margin-top: 32px;
  display: flex;
  gap: 8px;
  justify-content: center;
}
.socials:empty { display: none; }
.social {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--social-bg);
  color: var(--social-icon);
  box-shadow: var(--social-shadow);
  display: grid;
  place-items: center;
  transition: transform 0.15s ease;
}
.social:hover { transform: scale(1.06); }
.social svg { width: 16px; height: 16px; }

/* ---------- Footer ---------- */
.footer { margin-top: 44px; color: var(--text); }
.brand-logo { display: block; width: 103px; height: 41px; }

.not-found { margin-top: 30vh; }
