:root {
  --bg: #f5efe4;
  --bg-strong: #fff9ef;
  --surface: rgba(255, 250, 242, 0.88);
  --surface-strong: #ffffff;
  --line: rgba(65, 94, 88, 0.14);
  --text: #17322f;
  --muted: #5d746f;
  --accent: #ef7d57;
  --accent-dark: #d05b35;
  --accent-soft: #ffe0d4;
  --green: #6ea384;
  --green-soft: #d8ead7;
  --shadow: 0 24px 60px rgba(38, 52, 48, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Candara, 'Trebuchet MS', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(239, 125, 87, 0.18), transparent 32%),
    radial-gradient(circle at bottom right, rgba(110, 163, 132, 0.18), transparent 28%),
    linear-gradient(160deg, #f8f1e6 0%, #f3ede2 50%, #efe7da 100%);
}

body.no-scroll {
  overflow: hidden;
}

.hidden {
  display: none !important;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.hero-panel,
.module-banner,
.feedback,
.study-card,
.module-card,
.viewer__dialog {
  backdrop-filter: blur(14px);
}

.hero-panel {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 248, 238, 0.96), rgba(248, 242, 230, 0.86)),
    var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
}

.hero-panel::after {
  content: '';
  position: absolute;
  inset: auto -60px -70px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(239, 125, 87, 0.24), rgba(239, 125, 87, 0));
}

.hero-panel__eyebrow,
.section-heading__eyebrow,
.module-banner__eyebrow,
.module-card__count {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-dark);
}

.hero-panel h1,
.section-heading h2,
.module-banner h2 {
  margin: 0;
  line-height: 1;
}

.hero-panel h1 {
  margin-top: 10px;
  font-size: clamp(2.2rem, 5vw, 4.1rem);
}

.hero-panel__copy {
  width: min(640px, 100%);
  margin: 16px 0 0;
  font-size: 1.08rem;
  line-height: 1.65;
  color: var(--muted);
}

.feedback {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 240, 233, 0.82);
  border: 1px solid rgba(239, 125, 87, 0.2);
  color: var(--accent-dark);
}

.view {
  margin-top: 26px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin-top: 8px;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.section-heading--split {
  flex-wrap: wrap;
}

.module-grid,
.cards-grid {
  display: grid;
  gap: 18px;
}

.module-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.module-card {
  display: grid;
  gap: 16px;
  width: 100%;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 250, 243, 0.96), rgba(255, 247, 236, 0.84));
  box-shadow: var(--shadow);
  cursor: pointer;
  text-align: left;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.module-card:hover,
.module-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 26px 56px rgba(26, 45, 42, 0.17);
  border-color: rgba(239, 125, 87, 0.35);
  outline: none;
}

.module-card__media {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 180px;
  overflow: hidden;
  border-radius: 20px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.2)),
    linear-gradient(135deg, var(--green-soft), rgba(255, 224, 212, 0.7));
}

.module-card__image {
  width: min(78%, 230px);
  max-height: 180px;
  object-fit: contain;
}

.module-card__placeholder {
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  color: var(--accent-dark);
  font-size: 2.4rem;
  font-weight: 700;
}

.module-card__content {
  display: grid;
  gap: 10px;
}

.module-card__title {
  margin: 0;
  font-size: 1.45rem;
}

.module-card__description,
.module-banner__copy,
.empty-state {
  margin: 0;
  line-height: 1.65;
  color: var(--muted);
}

.back-button,
.progress-chip,
.viewer__close {
  border: none;
  font: inherit;
}

.back-button {
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--text);
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.back-button:hover,
.back-button:focus-visible {
  transform: translateY(-1px);
  background: #244640;
  outline: none;
}

.progress-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 700;
}

.module-banner {
  display: grid;
  gap: 10px;
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(24, 50, 47, 0.94), rgba(56, 92, 84, 0.86));
  box-shadow: var(--shadow);
}

.module-banner__eyebrow,
.module-banner h2,
.module-banner__copy {
  color: #f6f3ea;
}

.module-banner__eyebrow {
  opacity: 0.8;
}

.module-banner h2 {
  font-size: clamp(1.9rem, 4vw, 3rem);
}

.module-banner__copy {
  width: min(760px, 100%);
  opacity: 0.92;
}

.empty-state {
  margin-top: 18px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px dashed rgba(93, 116, 111, 0.32);
}

.cards-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-top: 18px;
}

.study-card {
  display: grid;
  gap: 14px;
  padding: 14px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(253, 247, 238, 0.84));
  box-shadow: 0 18px 36px rgba(36, 48, 45, 0.1);
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.study-card:hover,
.study-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 22px 42px rgba(30, 43, 40, 0.16);
  border-color: rgba(110, 163, 132, 0.5);
  outline: none;
}

.study-card__frame {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 12px;
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(240, 248, 238, 0.92), rgba(255, 239, 231, 0.88)),
    var(--surface-strong);
}

.study-card__image {
  width: 100%;
  max-height: 156px;
  object-fit: contain;
}

.study-card__label {
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--text);
}

.viewer {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(18, 32, 30, 0.56);
  z-index: 20;
}

.viewer__dialog {
  position: relative;
  width: min(680px, 100%);
  padding: 26px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(255, 246, 235, 0.92));
  box-shadow: 0 34px 70px rgba(0, 0, 0, 0.28);
}

.viewer__stage {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 54px;
  align-items: center;
  gap: 14px;
}

.viewer__nav {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  font-size: 2rem;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(34, 47, 44, 0.14);
  transition: transform 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.viewer__nav:hover,
.viewer__nav:focus-visible {
  transform: translateY(-2px);
  background: #ffffff;
  outline: none;
}

.viewer__nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.viewer__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(23, 50, 47, 0.08);
  color: var(--text);
  font-size: 1.8rem;
  cursor: pointer;
}

.viewer__media {
  display: grid;
  place-items: center;
  min-height: 340px;
  padding: 18px;
  border-radius: 22px;
  touch-action: pan-y;
  user-select: none;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.28)),
    linear-gradient(135deg, rgba(216, 234, 215, 0.92), rgba(255, 224, 212, 0.92));
}

.viewer__image {
  width: 100%;
  max-height: 380px;
  object-fit: contain;
}

.viewer__label {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.viewer__meta {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  text-align: center;
}

.viewer__counter {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-dark);
}

.viewer__hint {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 20px, 1120px);
    padding-top: 20px;
  }

  .hero-panel,
  .module-banner,
  .viewer__dialog {
    padding: 20px;
  }

  .module-card__media,
  .study-card__frame {
    min-height: 148px;
  }

  .viewer {
    padding: 14px;
  }

  .viewer__stage {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 10px;
  }

  .viewer__nav {
    width: 44px;
    height: 44px;
    font-size: 1.6rem;
  }

  .viewer__media {
    min-height: 240px;
  }
}
