:root {
  --bg: #05050a;
  --bg-panel: #0b0b13;
  --bg-row-hover: rgba(167, 139, 250, 0.07);
  --grid-line: rgba(139, 92, 246, 0.06);
  --border: rgba(139, 92, 246, 0.28);
  --border-strong: rgba(167, 139, 250, 0.55);
  --text: #f5f5f7;
  --text-muted: #9c9ca8;
  --text-dim: #6b6b78;
  --accent: #a78bfa;
  --accent-strong: #c9b8ff;
  --on-accent: #0a0a10;
  --status-color: #22c55e;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-mono);
  color: var(--text);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 34px 34px;
  line-height: 1.5;
}

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

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

img { max-width: 100%; display: block; }

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 1.4rem 1.25rem 4rem;
}

/* ---------------------------------------------------------
   Top bar: logo + bottone pieno stile brutalist
   --------------------------------------------------------- */
.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-strong);
}

.topbar-brand {
  display: block;
}

.brand-logo {
  display: inline-block;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  transition: color 0.15s ease;
}

.brand-logo:hover,
.brand-logo:focus-visible {
  color: var(--accent-strong);
}

.brand-dot { color: var(--accent); }

.brand-tag {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--status-color);
}

.btn-solid {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: var(--on-accent);
  border: 1px solid var(--accent);
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.7rem 1.2rem;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn-solid:hover,
.btn-solid:focus-visible {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  transform: translateY(-1px);
}

/* ---------------------------------------------------------
   Status bar: locale/clock + stato online, riquadro netto
   --------------------------------------------------------- */
.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 1rem;
  margin-bottom: 2.6rem;
  border: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 0.03em;
}

.statusbar-clock {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status-color);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
  animation: statusPulse 2.4s ease-out infinite;
}

@keyframes statusPulse {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
  70%  { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ---------------------------------------------------------
   Hero
   --------------------------------------------------------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.55rem;
}

.avatar-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  margin-bottom: 0.6rem;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
}

.avatar-status {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--status-color);
  border: 3px solid var(--bg);
}

.name {
  font-size: clamp(1.8rem, 4.5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0;
}

.meta {
  font-size: 0.82rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0;
}

.bio {
  max-width: 46ch;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0.5rem 0 0.2rem;
}

.stat-line {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--status-color);
  margin: 0.5rem 0 0;
}

.stat-line .status-dot { animation: none; }
.stat-line strong { color: var(--text); font-weight: 800; white-space: nowrap; }
.stat-label { color: var(--status-color); white-space: nowrap; }

/* ---------------------------------------------------------
   Bento: pannelli brutalist, angoli netti, bordi visibili
   --------------------------------------------------------- */
.bento {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
  margin-top: 2.6rem;
}

.panel {
  min-width: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border-strong);
}

.panel-title {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
}

.panel-line {
  flex: 1;
  height: 1px;
  background: var(--border-strong);
}

.list {
  display: flex;
  flex-direction: column;
}

.row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  border-top: 1px solid var(--border);
  position: relative;
  transition: background 0.15s ease;
}

.row::before {
  content: '';
  position: absolute;
  left: 0;
  top: -1px;
  bottom: 0;
  width: 3px;
  background: transparent;
  transition: background 0.15s ease;
}

.row:hover,
.row:focus-visible {
  background: var(--bg-row-hover);
}

.row:hover::before,
.row:focus-visible::before {
  background: var(--accent);
}

.row-icon {
  display: inline-flex;
  color: var(--text-muted);
  flex-shrink: 0;
}

.row-icon svg { width: 17px; height: 17px; }

.row:hover .row-icon,
.row:focus-visible .row-icon {
  color: var(--accent);
}

.row-body {
  flex-grow: 1;
  min-width: 0;
}

.row-title {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text);
}

.row-desc {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: none;
}

.row-arrow {
  color: var(--text-dim);
  flex-shrink: 0;
  transition: color 0.15s ease, transform 0.15s ease;
}

.row-arrow svg { width: 15px; height: 15px; }

.row:hover .row-arrow,
.row:focus-visible .row-arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}

/* ---------------------------------------------------------
   Entrance animation (una tantum al load, nessun loop pesante)
   --------------------------------------------------------- */
.topbar,
.statusbar,
.hero > *,
.panel {
  opacity: 0;
  transform: translateY(14px);
  animation: fadeIn 0.55s ease forwards;
}

.topbar { animation-delay: 0s; }
.statusbar { animation-delay: 0.06s; }
.hero > *:nth-child(1) { animation-delay: 0.14s; }
.hero > *:nth-child(2) { animation-delay: 0.22s; }
.hero > *:nth-child(3) { animation-delay: 0.3s; }
.hero > *:nth-child(4) { animation-delay: 0.38s; }
.hero > *:nth-child(5) { animation-delay: 0.46s; }
.bento .panel:nth-child(1) { animation-delay: 0.52s; }
.bento .panel:nth-child(2) { animation-delay: 0.6s; }
.bento .panel:nth-child(3) { animation-delay: 0.68s; }

/* ---------------------------------------------------------
   Panel a larghezza piena (es. Fede)
   --------------------------------------------------------- */
.panel-wide {
  grid-column: 1 / -1;
}

.faith-content {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.4rem 1.1rem 1.6rem;
}

.faith-icon {
  flex-shrink: 0;
  color: var(--accent);
}

.faith-icon svg { width: 26px; height: 26px; }

.faith-text {
  display: block;
}

.faith-quote {
  margin: 0;
  font-size: 1rem;
  font-style: italic;
  color: var(--text);
  line-height: 1.6;
}

.faith-ref {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.faith-note {
  margin: 0.9rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

@keyframes fadeIn {
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */
@media (max-width: 640px) {
  .bento { grid-template-columns: 1fr; }
  .wrap { padding: 1.1rem 1rem 3rem; }
  .stat-line {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  #boot-screen { display: none !important; }
}

/* ---------------------------------------------------------
   Boot screen: finto log di avvio, una tantum per sessione
   --------------------------------------------------------- */
#boot-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--bg);
  transition: opacity 0.4s ease;
}

#boot-screen.boot-done {
  opacity: 0;
  pointer-events: none;
}

#boot-log {
  width: 100%;
  max-width: 480px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--text-muted);
  white-space: pre-wrap;
}

#boot-log .boot-cmd { color: var(--accent); }
#boot-log .boot-ok { color: var(--status-color); }

#boot-cursor {
  display: inline-block;
  width: 0.55em;
  background: var(--accent);
  animation: bootBlink 1s steps(1) infinite;
}

@keyframes bootBlink {
  50% { opacity: 0; }
}
