/* Stile condiviso da home, materiale e progetti: nero carbone, antracite e bianco. */
:root {
  color-scheme: dark;
  --blurple: #fff;
  --dark-1: #141414;
  --dark-2: #0b0b0b;
  --dark-3: #1c1c1c;
  --text-1: #f5f5f5;
  --text-2: #d4d4d4;
  --fuchsia: #fff;
  --ring: #fff;
  --border: #333333;
  --surface-muted: #171717;
  --accent-soft: #fff;
  --radius-xl: 8px;
  --radius-lg: 6px;
  --radius-md: 4px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .22);
}

body {
  isolation: isolate;
}

body::before {
  content: "";
  position: fixed;
  inset: -8%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 20% 25%, rgba(255, 255, 255, .045), transparent 60%),
    radial-gradient(ellipse at 80% 75%, rgba(255, 255, 255, .025), transparent 55%);
  animation: ambient-drift 28s ease-in-out infinite alternate;
}

@keyframes ambient-drift {
  from { transform: translate3d(-3%, -2%, 0); }
  to { transform: translate3d(3%, 2%, 0); }
}

.topnav {
  background: rgba(20, 20, 20, .96);
  border-color: var(--border);
}

.brand img {
  display: block;
  object-fit: contain;
}

aside, .profile, .hero, .card, .badge, .social a, .pill, .hamburger {
  border-color: var(--border);
}

.profile {
  background: var(--dark-3);
}

.hero {
  background: linear-gradient(135deg, #242424, var(--dark-1));
}

.hero h2 {
  width: fit-content;
  max-width: 100%;
}

.hero h2::after {
  content: "";
  display: block;
  height: 2px;
  margin-top: 12px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: var(--accent-soft);
}

.typewriter {
  display: inline-block;
  min-width: 14ch;
  margin-left: .35em;
  vertical-align: bottom;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 500;
}

.typewriter-text {
  display: inline-block;
  vertical-align: bottom;
  overflow: hidden;
  width: 13ch;
  animation: typewriter-edit 16s linear infinite;
}

.typewriter::after {
  content: "|";
  animation: caret-blink 1s step-end infinite;
}

@keyframes typewriter-edit {
  0%, 3% { width: 0; animation-timing-function: steps(6, end); }
  11%, 13% { width: 6ch; animation-timing-function: steps(2, end); }
  16%, 19% { width: 4ch; animation-timing-function: steps(5, end); }
  26%, 28% { width: 9ch; animation-timing-function: steps(2, end); }
  31%, 34% { width: 7ch; animation-timing-function: steps(6, end); }
  43%, 94% { width: 13ch; animation-timing-function: steps(13, end); }
  100% { width: 0; }
}

@keyframes caret-blink {
  50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  body::before, .typewriter-text, .typewriter::after { animation: none; }
}

.avatar {
  background: var(--border);
}

.nav-link, .hamburger, .badge, .social a, .sidebar-links a, .pill, .cta {
  border-radius: var(--radius-md);
}

.badge, .social a, .pill, .hamburger {
  background: var(--surface-muted);
  color: var(--text-2);
}

.badges {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px;
  font-size: 11px;
}

.badge i {
  font-size: 14px;
  flex-shrink: 0;
}

.app i {
  color: var(--accent-soft);
}

.nav-link:hover, .social a:hover, .sidebar-links a:hover {
  background: #2a2a2a;
}

.nav-link.active, .nav-link.login-btn, .cta {
  background: var(--blurple);
  color: var(--dark-2);
  opacity: 1;
}

.nav-link.active i, .nav-link.login-btn i, .cta i {
  color: inherit;
}

.nav-link.active:hover, .nav-link.login-btn:hover, .cta:hover {
  background: #e5e5e5;
}

.card:hover {
  border-color: var(--accent-soft);
}

#progetti .grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 600px) {
  #progetti .grid { grid-template-columns: 1fr; }
}

.card p + p {
  margin-top: 12px;
}

.card h3 {
  width: fit-content;
  max-width: 100%;
}

.card h3 .fa-lock {
  font-size: .7em;
}

.card h3 img, .hero h2 img {
  object-fit: contain;
  vertical-align: middle;
  margin-right: 4px;
}

.card h3::after {
  content: "";
  display: block;
  height: 2px;
  margin-top: 8px;
  border-radius: 999px;
  background: var(--accent-soft);
}

.footer {
  color: #a3a3a3;
  opacity: 1;
}

a:focus-visible, button:focus-visible, .card:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
}

::selection {
  background: var(--accent-soft);
  color: var(--dark-2);
}
