:root {
  --bg: #0f1115;
  --card: #171a21;
  --text: #e6e8eb;
  --muted: #9aa0aa;
  --accent: #4f8cff;
  --border: #242834;
}

[data-theme="light"] {
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1c1f26;
  --muted: #5f6b7a;
  --accent: #2563eb;
  --border: #e2e8f0;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, Ubuntu, Cantarell, sans-serif;
  transition: background 0.3s ease, color 0.3s ease;
}

.container {
  max-width: 960px;
  padding: 3rem 1.5rem;
  margin: 0 auto;
}

/* ===== HEADER ===== */

.header-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
}

.header-text {
  text-align: center;
}

h1 {
  font-size: 2.6rem;
  margin: 0 0 0.4rem 0;
}

.subtitle {
  color: var(--muted);
  font-size: 1.1rem;
}

/* ===== THEME TOGGLE ===== */

#theme-toggle {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color 0.2s ease;
}

#theme-toggle:hover {
  border-color: var(--accent);
}

#theme-toggle svg {
  width: 20px;
  height: 20px;
  stroke: var(--text);
  stroke-width: 1.6;
  fill: none;
}

/* ===== GRID ===== */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 3.5rem;
}

/* ===== CARD ===== */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.6rem;
  text-decoration: none;
  color: inherit;

  transform: translateY(8px);
  opacity: 0;
  animation: fadeUp 0.6s ease forwards;

  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.card:nth-child(2) { animation-delay: 0.05s; }
.card:nth-child(3) { animation-delay: 0.1s; }

.card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: 0 12px 28px rgba(0,0,0,0.25);
}

/* ===== ICON ===== */

.icon {
  width: 28px;
  height: 28px;
  margin-bottom: 1.1rem;
  color: var(--accent);
}

.icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* ===== TEXT ===== */

.card h2 {
  margin: 0 0 0.4rem 0;
  font-size: 1.4rem;
}

.card p {
  margin: 0 0 1rem 0;
  color: var(--muted);
  line-height: 1.5;
}

.link {
  font-size: 0.9rem;
  color: var(--accent);
}

/* ===== FOOTER ===== */

footer {
  margin-top: 4rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ===== ANIMATION ===== */

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