/* ===========================
   BASE
   =========================== */
* {
  margin: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  line-height: 1.6;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* ===========================
   TYPOGRAPHY
   =========================== */
h1 {
  font-size: 42px;
  text-align: center;
  margin-bottom: 8px;
  background: linear-gradient(90deg, #38bdf8, #a78bfa, #fb923c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  text-align: center;
  color: #94a3b8;
  margin-bottom: 50px;
  font-size: 18px;
}

h2 {
  font-size: 24px;
  color: #38bdf8;
  margin: 50px 0 20px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid #1e3a5f;
}
h2 span {
  margin-right: 10px;
}

/* ===========================
   CARDS
   =========================== */
.card {
  background: #1e293b;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #334155;
  margin-bottom: 16px;
}

.card-title {
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 10px;
  font-size: 16px;
}

.grid .card {
  margin-bottom: 0;
}

/* ===========================
   HERO (index)
   =========================== */
.hero {
  position: relative;
  min-height: 55vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 0%, #1e3a5f 0%, #0f172a 70%);
}

/* Subtle grid overlay */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.04) 1px, transparent 1px);
  background-size: 50px 50px;
  -webkit-mask-image: radial-gradient(
    ellipse at 50% 50%,
    black 20%,
    transparent 70%
  );
  mask-image: radial-gradient(ellipse at 50% 50%, black 20%, transparent 70%);
}

/* Pulsing glow */
.hero-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(
    circle,
    rgba(167, 139, 250, 0.12) 0%,
    rgba(56, 189, 248, 0.06) 40%,
    transparent 70%
  );
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: pulse 5s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.6;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.3);
    opacity: 1;
  }
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 700px;
}

.hero h1 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 12px;
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: #94a3b8;
  letter-spacing: -0.5px;
}

.hero-title {
  font-size: 56px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #38bdf8, #a78bfa, #fb923c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -1.5px;
}

.hero .subtitle {
  font-size: 18px;
  margin-bottom: 0;
  color: #64748b;
}

/* Floating HTML tags */
.hero-tag {
  position: absolute;
  font-family: "Space Mono", "Courier New", monospace;
  font-size: 14px;
  color: #cad5e7;
  user-select: none;
  pointer-events: none;
  animation: float 6s ease-in-out infinite;
}

.hero-tag:nth-child(1) {
  top: 12%;
  left: 8%;
  animation-delay: 0s;
}
.hero-tag:nth-child(2) {
  top: 22%;
  right: 10%;
  animation-delay: -1.2s;
}
.hero-tag:nth-child(3) {
  bottom: 18%;
  left: 10%;
  animation-delay: -2.4s;
}
.hero-tag:nth-child(4) {
  bottom: 28%;
  right: 7%;
  animation-delay: -3.6s;
}
.hero-tag:nth-child(5) {
  top: 55%;
  left: 4%;
  animation-delay: -0.8s;
}
.hero-tag:nth-child(6) {
  top: 45%;
  right: 4%;
  animation-delay: -4.5s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  50% {
    transform: translateY(-12px);
    opacity: 0.7;
  }
}

/* ===========================
   INDEX — GRIDS & LINKS
   =========================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.card-link {
  text-decoration: none;
  color: inherit;
}

.grid .card {
  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
}
.grid .card:hover {
  transform: translateY(-3px);
  border-color: #a78bfa;
}

.card-icon {
  font-size: 24px;
  margin-bottom: 8px;
  display: block;
}

.card-desc {
  color: #94a3b8;
  font-size: 14px;
}

/* Student cards */
.student-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
}
.student-emoji {
  font-size: 28px;
}
.student-name {
  font-weight: 600;
  font-size: 18px;
  color: #f8fafc;
}

.empty-msg {
  color: #64748b;
  font-style: italic;
  text-align: center;
  padding: 30px;
}

/* ===========================
   FICHE TRICHE
   =========================== */
pre {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 14px 18px;
  overflow-x: auto;
  font-family: "Space Mono", monospace;
  font-size: 13px;
  line-height: 1.7;
  color: #e2e8f0;
  margin: 8px 0;
}

.tag {
  color: #f472b6;
}
.prop {
  color: #38bdf8;
}
.val {
  color: #a78bfa;
}
.comment {
  color: #64748b;
}
.str {
  color: #4ade80;
}

.palette {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0;
}
.swatch {
  width: 60px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  font-size: 10px;
  font-family: "Space Mono", monospace;
  padding-bottom: 3px;
  color: white;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  border: 1px solid #334155;
}

.tip {
  background: #1a2e1a;
  border: 1px solid #22c55e33;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 10px 0;
  font-size: 14px;
  color: #86efac;
}
.tip::before {
  content: "\1F4A1 ";
}

.emoji-list {
  font-size: 28px;
  letter-spacing: 8px;
  margin: 10px 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.img-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0;
}
.img-row code {
  background: #0f172a;
  padding: 6px 10px;
  border-radius: 6px;
  font-family: "Space Mono", monospace;
  font-size: 12px;
  border: 1px solid #334155;
  color: #a78bfa;
}

/* ===========================
   FOOTER
   =========================== */
.footer {
  text-align: center;
  margin-top: 60px;
  color: #64748b;
  font-size: 14px;
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 700px) {
  h1 {
    font-size: 28px;
  }
  .hero h1 {
    font-size: 22px;
  }
  .hero-title {
    font-size: 36px;
  }
  .hero {
    min-height: 40vh;
    padding: 50px 20px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .hero-tag {
    display: none;
  }
}
