:root {
  --bg: #f4ecdf;
  --bg-deep: #efe2d0;
  --paper: rgba(255, 250, 243, 0.88);
  --paper-strong: rgba(255, 253, 249, 0.96);
  --ink: #1f1b16;
  --muted: #655d52;
  --line: rgba(54, 41, 24, 0.12);
  --brand: #c95d2f;
  --brand-strong: #8e3717;
  --teal: #1c6971;
  --gold: #e6bb65;
  --shadow: 0 24px 60px rgba(78, 53, 24, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  background:
    radial-gradient(circle at 10% 10%, rgba(230, 187, 101, 0.38), transparent 24%),
    radial-gradient(circle at 85% 14%, rgba(28, 105, 113, 0.2), transparent 28%),
    linear-gradient(180deg, #fbf5eb 0%, var(--bg) 56%, var(--bg-deep) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 78%);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.page-shell {
  width: min(1240px, calc(100vw - 28px));
  margin: 18px auto 36px;
  display: grid;
  gap: 22px;
}

.hero,
.info-card,
.sidebar-card,
.player-card,
.detail-card,
.lesson-library,
.lesson-card,
.summary-card {
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
}

.hero {
  border-radius: 34px;
  padding: 30px;
  background:
    radial-gradient(circle at 80% 10%, rgba(230, 187, 101, 0.14), transparent 30%),
    linear-gradient(135deg, rgba(255, 252, 247, 0.95), rgba(250, 242, 232, 0.88));
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 24px;
  overflow: hidden;
}

.hero-copy h1,
.info-card h2,
.section-heading h2,
.player-header h2,
.lesson-card h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -0.03em;
}

.hero-copy h1 {
  font-size: clamp(2.8rem, 5vw, 4.8rem);
  line-height: 0.95;
}

.hero-text,
.info-card p,
.lesson-copy p,
.section-note,
.lesson-card p,
.chapter-item p,
.exercise-card p {
  color: var(--muted);
  line-height: 1.65;
}

.eyebrow,
.summary-label {
  display: block;
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: var(--muted);
}

.hero-actions,
.hero-badge-row,
.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.subject-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-actions {
  margin-top: 24px;
}

.primary-link,
.secondary-link,
.subject-tab,
.filter-btn,
.lesson-card button,
.answer-toggle {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.primary-link,
.lesson-card button,
.answer-toggle {
  padding: 12px 18px;
  color: white;
  background: linear-gradient(135deg, var(--brand) 0%, #e38445 100%);
  box-shadow: 0 14px 30px rgba(201, 93, 47, 0.22);
}

.secondary-link {
  padding: 12px 18px;
  background: white;
  border: 1px solid var(--line);
}

.subject-tab {
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
}

.primary-link:hover,
.secondary-link:hover,
.subject-tab:hover,
.filter-btn:hover,
.lesson-card button:hover,
.answer-toggle:hover {
  transform: translateY(-2px);
}

.subject-tab.is-active {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}

.hero-panel {
  display: grid;
  gap: 16px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(28, 105, 113, 0.1);
  color: var(--teal);
  font-size: 0.85rem;
  font-weight: 700;
}

.hero-badge.alt {
  background: rgba(201, 93, 47, 0.1);
  color: var(--brand-strong);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.summary-card {
  border-radius: 22px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 248, 240, 0.95));
}

.summary-card strong {
  display: block;
  font-size: 1.2rem;
}

.intro-strip {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
}

.curriculum-map {
  display: grid;
  gap: 18px;
}

.curriculum-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.curriculum-card {
  padding: 22px;
  border-radius: 28px;
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
}

.curriculum-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.curriculum-card-header strong {
  display: block;
  font-size: 1.45rem;
  margin-bottom: 6px;
}

.curriculum-meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(28, 105, 113, 0.09);
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 700;
}

.curriculum-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.curriculum-units {
  display: grid;
  gap: 12px;
}

.curriculum-unit {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--paper-strong);
}

.curriculum-unit strong {
  display: block;
  margin-bottom: 10px;
}

.topic-button-grid,
.content-filter-groups {
  display: grid;
  gap: 12px;
}

.content-filter-group {
  display: grid;
  gap: 10px;
}

.content-filter-group strong {
  display: block;
  font-size: 0.92rem;
}

.topic-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topic-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(31, 27, 22, 0.06);
  color: var(--ink);
  font-size: 0.82rem;
  border: 1px solid transparent;
}

button.topic-chip {
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

button.topic-chip:hover {
  transform: translateY(-1px);
}

.topic-chip.is-covered {
  background: rgba(28, 105, 113, 0.1);
  color: var(--teal);
}

.topic-chip.is-empty {
  background: rgba(31, 27, 22, 0.04);
  color: var(--muted);
  border-color: var(--line);
}

.topic-chip.is-active {
  background: var(--ink);
  color: white;
}

.topic-count {
  margin-left: 8px;
  opacity: 0.8;
  font-size: 0.76rem;
}

.info-card {
  border-radius: 28px;
  padding: 24px;
}

.highlight-card {
  background: linear-gradient(135deg, rgba(28, 105, 113, 0.92), rgba(20, 50, 56, 0.94));
  color: white;
}

.highlight-card .eyebrow,
.highlight-card p,
.highlight-card li {
  color: rgba(255, 255, 255, 0.78);
}

.content-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
}

.sidebar,
.workspace,
.detail-grid {
  display: grid;
  gap: 18px;
}

.sidebar-card,
.player-card,
.detail-card,
.lesson-library {
  border-radius: 28px;
  padding: 22px;
}

.filter-btn {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
}

#yearFilters {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.95fr);
  gap: 18px 22px;
}

#yearFilters .filter-btn {
  min-height: 0;
  padding: 12px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 999px;
  font-size: 1rem;
  line-height: 1.1;
}

#yearFilters [data-year-filter="Todos"] {
  grid-column: 1;
}

#yearFilters [data-year-filter="9"] {
  grid-column: 1;
}

.filter-btn.is-active {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}

.bullet-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
}

.muted-list li {
  color: var(--muted);
}

.player-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(251, 245, 236, 0.92));
}

.player-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.subject-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(28, 105, 113, 0.12);
  color: var(--teal);
  font-weight: 700;
  font-size: 0.85rem;
}

.video-shell {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: #111;
  aspect-ratio: 16 / 9;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.video-shell iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.player-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.lesson-copy {
  margin-top: 16px;
}

.youtube-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(201, 93, 47, 0.1);
  color: var(--brand-strong);
  font-weight: 700;
}

.detail-grid {
  grid-template-columns: 1fr 1fr;
}

.area-overview {
  display: grid;
  gap: 18px;
}

.area-grid {
  display: grid;
  gap: 14px;
}

.area-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.area-card {
  padding: 18px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--paper-strong);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.area-card:hover {
  transform: translateY(-2px);
}

.area-card.is-active {
  border-color: rgba(201, 93, 47, 0.36);
  box-shadow: 0 18px 36px rgba(201, 93, 47, 0.12);
}

.area-card strong,
.related-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.1rem;
}

.area-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(28, 105, 113, 0.09);
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 700;
}

.related-card {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--paper-strong);
  display: grid;
  gap: 12px;
}

.related-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.chapter-list,
.exercise-list,
.lesson-grid {
  display: grid;
  gap: 14px;
}

.chapter-item,
.exercise-card,
.lesson-card {
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--paper-strong);
}

.chapter-item,
.exercise-card {
  padding: 16px;
}

.chapter-item strong,
.exercise-card h3,
.lesson-card h3 {
  display: block;
  margin-bottom: 6px;
}

.exercise-card h3 {
  margin-top: 0;
}

.exercise-card p,
.chapter-item p {
  margin: 0;
}

.exercise-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.exercise-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
}

.exercise-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.exercise-secondary {
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  cursor: pointer;
}

.exercise-answer {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(28, 105, 113, 0.08);
}

.exercise-answer[hidden] {
  display: none;
}

.exercise-feedback {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  line-height: 1.6;
}

.exercise-feedback.is-correct {
  background: rgba(47, 122, 86, 0.12);
  color: #21543b;
}

.exercise-feedback.is-wrong {
  background: rgba(201, 93, 47, 0.12);
  color: #7a3016;
}

.lesson-library {
  display: grid;
  gap: 18px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.lesson-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lesson-card {
  padding: 18px;
  display: grid;
  gap: 14px;
  min-height: 240px;
}

.lesson-card.is-selected {
  outline: 2px solid rgba(201, 93, 47, 0.24);
}

.lesson-thumb {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  min-height: 110px;
  aspect-ratio: 16 / 9;
  padding: 14px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  color: white;
  background: #111;
}

.lesson-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(9, 11, 16, 0.06) 0%, rgba(9, 11, 16, 0.54) 100%),
    linear-gradient(90deg, rgba(12, 16, 23, 0.42) 0%, rgba(12, 16, 23, 0.1) 44%, rgba(201, 93, 47, 0.12) 100%);
}

.lesson-thumb-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-play {
  position: relative;
  z-index: 1;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 1.2rem;
}

.thumb-duration {
  position: relative;
  z-index: 1;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.8rem;
}

.lesson-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lesson-meta span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(31, 27, 22, 0.06);
  font-size: 0.82rem;
}

@media (max-width: 1080px) {
  .hero,
  .intro-strip,
  .content-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .curriculum-grid,
  .area-grid,
  .related-grid,
  .lesson-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100vw - 18px, 1240px);
  }

  #yearFilters {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .hero {
    padding: 22px;
  }

  .hero-metrics,
  .player-summary {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .player-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
