:root {
  --primary-color: #009dc5;
  --secondary-color: #00b3e6;

  --background-color: #f5f7fb;
  --card-background-color: #ffffff;

  --text-color: #333333;
  --text-light-color: #6b7280;

  --success-color: #16a34a;
  --warning-color: #d97706;
  --error-color: #dc2626;

  --border-color: #e5e7eb;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--background-color);
  color: var(--text-color);
  line-height: 1.7;
}

.container {
  width: min(90rem, 92%);
  margin: auto;
}

/* -------------------------------------------------- */
/* Hero                                                */
/* -------------------------------------------------- */

.hero {
  padding: 5rem 0 4rem;
  text-align: center;
}

.hero h1 {
  margin-bottom: 1rem;

  color: var(--primary-color);

  font-size: 2.6rem;
}

.hero p {
  max-width: 700px;
  margin: auto;

  color: var(--text-light-color);
  font-size: 1.1rem;
}

.hero-cards {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;

  margin-top: 2.5rem;
}

.hero-card {
  min-width: 200px;

  padding: 1rem;

  background: white;

  border-radius: 1rem;

  box-shadow: 0 4px 12px rgb(0 0 0 / 8%);
}

.hero-card strong {
  display: block;

  margin-bottom: 0.4rem;

  color: var(--primary-color);
}

/* -------------------------------------------------- */
/* Table of contents                                   */
/* -------------------------------------------------- */

.table-of-contents {
  margin-bottom: 4rem;

  padding: 2rem;

  background: white;

  border-radius: 1rem;

  box-shadow: 0 4px 12px rgb(0 0 0 / 8%);
}

.table-of-contents h2 {
  margin-bottom: 1rem;

  color: var(--primary-color);
}

.table-of-contents p {
  color: var(--text-light-color);
}

/* -------------------------------------------------- */
/* Grammar sections                                    */
/* -------------------------------------------------- */

.grammar-sections {
  display: flex;
  flex-direction: column;
  gap: 5rem;

  padding-bottom: 5rem;
}

/* -------------------------------------------------- */
/* Lesson                                             */
/* -------------------------------------------------- */

.lesson {
  background: var(--card-background-color);
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 8px 30px rgb(0 0 0 / 8%);
  scroll-margin-top: 2rem;
  display: none;
  animation: fadeIn 0.3s ease;
}

.lesson--active {
  display: block;
}

.toc-group a.active {
  background: var(--secondary-background-color);

  color: var(--primary-color);

  font-weight: 700;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
  }

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

.lesson-header {
  padding: 3rem;

  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );

  color: white;
  position: relative;
}

.lesson-level {
  position: absolute;
  top: 1rem;
  right: 1rem;

  display: inline-flex;
  align-items: center;

  padding: 0.4rem 0.9rem;

  border: 1px solid rgb(255 255 255 / 30%);
  border-radius: 999px;

  background: rgb(255 255 255 / 18%);
  backdrop-filter: blur(8px);

  font-size: 0.85rem;
  font-weight: 700;

  color: white;
}

.lesson-header h2 {
  margin-bottom: 1rem;

  font-size: 2.25rem;
}

.lesson-header p {
  max-width: 700px;

  opacity: 0.95;

  font-size: 1.05rem;
}

.card {
  padding: 2.5rem 3rem;

  border-bottom: 1px solid var(--border-color);
}

.card:last-child {
  border-bottom: none;
}

.card h3 {
  margin-bottom: 1.25rem;

  color: var(--primary-color);

  font-size: 1.5rem;
}

.card ul {
  padding-left: 1.4rem;
}

.card li + li {
  margin-top: 0.6rem;
}

.example {
  margin-top: 1rem;
  padding: 1rem 1.25rem;

  border-left: 5px solid transparent;

  border-radius: 0.75rem;

  font-weight: 500;
}

.example.success {
  border-color: var(--success-color);

  background: rgb(22 163 74 / 8%);
}

.example.error {
  border-color: var(--error-color);

  background: rgb(220 38 38 / 8%);
}

table {
  width: 100%;

  margin-top: 1rem;

  border-collapse: collapse;
}

th {
  padding: 1rem;

  background: #eef8fb;

  text-align: left;
}

td {
  padding: 1rem;

  border-bottom: 1px solid var(--border-color);
}

@media (max-width: 768px) {
  .lesson-header,
  .card {
    padding: 2rem;
  }

  .lesson-header h2 {
    font-size: 1.8rem;
  }
}

.table-of-contents {
  margin: 4rem 0;
  padding: 3rem;

  background: white;

  border-radius: 1.5rem;
  box-shadow: 0 10px 30px rgb(0 0 0 / 8%);
}

.table-of-contents__header {
  margin-bottom: 3rem;
  text-align: center;
}

.table-of-contents__badge {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  background: var(--secondary-background-color);
  color: var(--primary-color);
  font-size: 0.875rem;
  font-weight: 700;
}

.table-of-contents__header h2 {
  margin-bottom: 1rem;

  font-size: clamp(2rem, 4vw, 2.75rem);
}

.table-of-contents__header p {
  max-width: 42rem;

  margin: auto;

  color: #666;
  line-height: 1.7;
}

.table-of-contents__grid {
  display: grid;

  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));

  gap: 2rem;
}

.toc-group {
  padding: 2rem;

  border: 1px solid #e9ecef;
  border-radius: 1rem;

  transition: 0.25s;
}

.toc-group:hover {
  transform: translateY(-4px);

  box-shadow: 0 12px 25px rgb(0 0 0 / 8%);
}

.toc-group h3 {
  margin-bottom: 1.5rem;

  color: var(--primary-color);

  font-size: 1.25rem;
}

.toc-group ul {
  display: flex;
  flex-direction: column;

  gap: 0.75rem;

  list-style: none;
}

.toc-group li {
  margin: 0;
}

.toc-group a {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0.85rem 1rem;

  border-radius: 0.75rem;

  color: var(--text-color-of-background);
  text-decoration: none;

  transition: 0.2s;
}

.toc-group a::before {
  content: "📖";

  margin-right: 0.75rem;
}

.toc-group a::after {
  content: "→";

  opacity: 0;

  transition: 0.2s;
}

.toc-group a:hover {
  padding-left: 1.25rem;

  background: var(--secondary-background-color);
  color: var(--primary-color);
}

.toc-group a:hover::after {
  opacity: 1;
}
