:root {
  --bg: #ffffff;
  --text: #1f3a5f;
  --card: #f5f7fa;
  --accent: #1f3a5f;
}

body.dark {
  --bg: #0f172a;
  --text: #e5e7eb;
  --card: #1e293b;
  --accent: #38bdf8;
}

* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: var(--card);
}

.logo {
  font-size: 1.3rem;
  font-weight: 700;
}

nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
}

nav a:hover {
  text-decoration: underline;
}

nav button {
  background: none;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
}

.hero {
  text-align: center;
  padding: 70px 20px;
}

.hero h1 {
  font-size: 2.4rem;
  margin-bottom: 10px;
}

.tagline {
  font-size: 1.2rem;
  font-weight: 500;
}

.subtitle {
  max-width: 620px;
  margin: 20px auto;
  line-height: 1.6;
}

/* Flashcards */
.flashcards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.flashcard {
  perspective: 1000px;
  cursor: pointer;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 140px;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.flashcard.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-face {
  position: absolute;
  width: 100%;
  height: 100%;
  padding: 16px;
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  backface-visibility: hidden;
  font-weight: 500;
}

.flashcard-back {
  transform: rotateY(180deg);
  background: var(--accent);
  color: white;
}

/* Quiz */
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.quiz-options button {
  padding: 10px;
  font-size: 1rem;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}

.quiz-options button:hover {
  background: var(--accent);
  color: white;
}
