:root {
  --bg:        #0a0a0f;
  --bg2:       #0f0f18;
  --surface:   #13131f;
  --surface2:  #1a1a2e;
  --border:    rgba(255,255,255,0.06);
  --border2:   rgba(255,255,255,0.12);
  --red:       #c8102e;
  --red2:      #e8183a;
  --red-glow:  rgba(200,16,46,0.18);
  --text:      #f0f0f5;
  --muted:     #6b7280;
  --muted2:    #9ca3af;
  --accent:    #00d4ff;
  --green:     #22c55e;
  --yellow:    #f59e0b;
  --mono:      'JetBrains Mono', monospace;
  --sans:      'DM Sans', sans-serif;
  --display:   'Bebas Neue', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── ANIMATED BG ── */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(200,16,46,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(200,16,46,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}
.bg-blob1 {
  position: fixed;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200,16,46,0.08) 0%, transparent 70%);
  top: -200px; right: -150px;
  pointer-events: none;
  z-index: 0;
  animation: float1 8s ease-in-out infinite;
}
.bg-blob2 {
  position: fixed;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,212,255,0.05) 0%, transparent 70%);
  bottom: -100px; left: -100px;
  pointer-events: none;
  z-index: 0;
  animation: float2 10s ease-in-out infinite;
}
@keyframes float1 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-30px,40px)} }
@keyframes float2 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(20px,-30px)} }

/* ── LAYOUT ── */
.wrap {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ── HEADER ── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 40px 0 48px;
  gap: 28px;
}

/* LEFT: logo */
.logo-wrap {
  position: relative;
  flex-shrink: 0;
}
.logo-img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  display: block;
  border-radius: 14px;
  filter: drop-shadow(0 0 18px rgba(200,16,46,0.35));
  animation: logo-pulse 3s ease-in-out infinite;
}
@keyframes logo-pulse {
  0%,100% { filter: drop-shadow(0 0 14px rgba(200,16,46,0.3)); }
  50%      { filter: drop-shadow(0 0 30px rgba(200,16,46,0.55)); }
}
.logo-svg { width: 72px; height: 72px; }
.logo-badge {
  position: absolute;
  top: -7px; right: -7px;
  background: var(--red);
  color: #fff;
  font-family: var(--mono);
  font-size: 0.48rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  letter-spacing: 0.06em;
}

/* CENTER: branding */
.header-brand {
  flex: 1;
}
.site-title {
  font-family: var(--display);
  font-size: clamp(2.6rem, 5vw, 4rem);
  letter-spacing: 0.06em;
  line-height: 0.95;
  color: var(--text);
  margin-bottom: 4px;
}
.site-title span { color: var(--red2); }

.site-tagline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.site-tagline-text {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.site-tagline-sep {
  width: 1px; height: 12px;
  background: var(--border2);
}
.site-tagline-uni {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--red);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.8;
}

/* RIGHT: stats */
.header-stats {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-end;
  flex-shrink: 0;
}
.hstat {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 6px;
  padding: 4px 11px;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted2);
  white-space: nowrap;
}
.hstat strong { color: var(--text); }

/* ── SECTION TITLE ── */
.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.section-label::before,
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── EXAM GRID ── */
.exams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}

/* ── EXAM CARD ── */
.exam-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
  display: block;
  animation: card-in 0.4s ease both;
}
.exam-card:nth-child(1) { animation-delay: 0.05s; }
.exam-card:nth-child(2) { animation-delay: 0.10s; }
.exam-card:nth-child(3) { animation-delay: 0.15s; }
.exam-card:nth-child(4) { animation-delay: 0.20s; }
.exam-card:nth-child(5) { animation-delay: 0.25s; }
.exam-card:nth-child(6) { animation-delay: 0.30s; }
@keyframes card-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.exam-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255,255,255,0.03), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}
.exam-card:hover {
  border-color: var(--border2);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.06);
}
.exam-card:hover::before { opacity: 1; }

/* Color accent per ogni card */
.exam-card[data-color="red"]:hover    { box-shadow: 0 12px 40px rgba(200,16,46,0.2), 0 0 0 1px rgba(200,16,46,0.25); border-color: rgba(200,16,46,0.4); }
.exam-card[data-color="cyan"]:hover   { box-shadow: 0 12px 40px rgba(0,212,255,0.15), 0 0 0 1px rgba(0,212,255,0.25); border-color: rgba(0,212,255,0.3); }
.exam-card[data-color="purple"]:hover { box-shadow: 0 12px 40px rgba(168,85,247,0.2), 0 0 0 1px rgba(168,85,247,0.25); border-color: rgba(168,85,247,0.35); }
.exam-card[data-color="green"]:hover  { box-shadow: 0 12px 40px rgba(34,197,94,0.15), 0 0 0 1px rgba(34,197,94,0.25); border-color: rgba(34,197,94,0.3); }
.exam-card[data-color="orange"]:hover { box-shadow: 0 12px 40px rgba(245,158,11,0.15), 0 0 0 1px rgba(245,158,11,0.25); border-color: rgba(245,158,11,0.3); }

.card-icon {
  font-size: 2rem;
  margin-bottom: 14px;
  display: block;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
}

.card-name {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  flex: 1;
  margin-right: 8px;
}

.card-status {
  flex-shrink: 0;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-top: 5px;
}
.card-status.ready  { background: var(--green); box-shadow: 0 0 8px rgba(34,197,94,0.5); }
.card-status.wip    { background: var(--yellow); box-shadow: 0 0 8px rgba(245,158,11,0.5); }
.card-status.soon   { background: var(--muted); }

.card-code {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.card-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.meta-chip {
  font-family: var(--mono);
  font-size: 0.62rem;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--muted2);
}
.meta-chip.q   { color: var(--accent); border-color: rgba(0,212,255,0.2); background: rgba(0,212,255,0.05); }
.meta-chip.mod { color: #a78bfa; border-color: rgba(167,139,250,0.2); background: rgba(167,139,250,0.05); }
.meta-chip.ai  { color: #34d399; border-color: rgba(52,211,153,0.2); background: rgba(52,211,153,0.05); }

/* Progress bar inside card */
.card-progress {
  margin-top: 4px;
}
.card-prog-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  font-family: var(--mono);
  color: var(--muted);
  margin-bottom: 5px;
}
.card-prog-bar {
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 99px;
  overflow: hidden;
}
.card-prog-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.8s cubic-bezier(.4,0,.2,1);
}

/* ── COMING SOON CARD ── */
.exam-card.coming-soon {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}
.coming-soon-overlay {
  position: absolute;
  top: 14px; right: 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 3px 8px;
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

/* ── CTA ARROW ── */
.card-arrow {
  position: absolute;
  bottom: 20px; right: 20px;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  transition: all 0.2s;
  color: var(--muted);
}
.exam-card:hover .card-arrow {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  transform: translate(2px, -2px);
}

/* ── INFO BAR ── */
.info-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 48px;
}
.info-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.info-icon { font-size: 1.4rem; flex-shrink: 0; }
.info-text { font-size: 0.78rem; line-height: 1.5; color: var(--muted2); }
.info-text strong { color: var(--text); display: block; margin-bottom: 1px; font-size: 0.82rem; }

/* ── FOOTER ── */
footer {
  text-align: center;
  padding: 32px 0 0;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  font-family: var(--mono);
  color: var(--muted);
  letter-spacing: 0.05em;
}
footer span { color: var(--red2); }

/* ── RESPONSIVE ── */

/* Tablet (≤768px) */
@media (max-width: 768px) {
  header { padding: 28px 0 32px; gap: 16px; }
  .logo-img, .logo-svg { width: 58px; height: 58px; }
  .site-title { font-size: 2.6rem; }
  .header-stats { gap: 4px; }
  .hstat { font-size: 0.64rem; padding: 3px 8px; }
  .exams-grid { grid-template-columns: 1fr; gap: 12px; }
  .exam-card { padding: 20px; }
  .info-bar { grid-template-columns: 1fr 1fr; gap: 10px; }
}

/* Mobile (≤540px) — stack header vertically */
@media (max-width: 540px) {
  .wrap { padding: 0 14px 60px; }

  header {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px 0 28px;
    gap: 14px;
  }

  .logo-wrap { display: flex; align-items: center; gap: 12px; }
  .logo-img, .logo-svg { width: 48px; height: 48px; }

  /* Logo + titolo sulla stessa riga su mobile */
  header {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .header-brand { min-width: 0; }
  .site-title { font-size: 2rem; }
  .site-tagline-text { font-size: 0.6rem; }
  .site-tagline-uni { font-size: 0.56rem; }

  .header-stats {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    gap: 4px;
  }
  .hstat { font-size: 0.62rem; padding: 3px 8px; }

  .exams-grid { grid-template-columns: 1fr; gap: 10px; }
  .exam-card { padding: 16px 16px 46px; border-radius: 12px; }
  .card-icon { font-size: 1.5rem; margin-bottom: 8px; }
  .card-name { font-size: 0.9rem; }

  .info-bar { grid-template-columns: 1fr; gap: 8px; }
  .info-item { padding: 11px 13px; }

  footer { font-size: 0.64rem; }
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 99px; }