:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #667085;
  --line: #d9e1ea;
  --surface: #ffffff;
  --soft: #f6f8fb;
  --navy: #182033;
  --teal: #14b8a6;
  --green: #7bbf3a;
  --coral: #ff7a59;
  --yellow: #f7c948;
  --blue: #3b82f6;
  --shadow: 0 18px 50px rgba(24, 32, 51, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
}

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

img {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
}

.skip-link {
  background: var(--ink);
  color: white;
  left: 16px;
  padding: 10px 14px;
  position: fixed;
  top: -60px;
  z-index: 10;
}

.skip-link:focus {
  top: 16px;
}

.site-header,
.site-footer,
main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.home-page main {
  padding-bottom: clamp(48px, 8vw, 96px);
}

.site-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding: 18px 0;
}

.brand,
.top-nav {
  align-items: center;
  display: flex;
  gap: 12px;
}

.brand {
  font-size: 18px;
  font-weight: 850;
}

.brand-mark {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  height: 38px;
  justify-content: center;
  overflow: hidden;
  width: 38px;
}

.brand-mark img {
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.top-nav {
  color: var(--muted);
  font-size: 15px;
  font-weight: 720;
}

.top-nav a {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 12px;
  position: relative;
  overflow: hidden;
}

.top-nav a:hover {
  background: white;
  border-color: var(--line);
}

.hero {
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(320px, 0.84fr);
  margin-top: 10px;
  min-height: 470px;
  overflow: hidden;
}

.hero-copy {
  align-content: center;
  display: grid;
  min-width: 0;
  padding: clamp(18px, 2.8vw, 38px);
  position: relative;
  z-index: 1;
}

.hero h1,
.page-hero h1,
.subject-hero h1 {
  line-height: 1;
  margin: 0;
}

.hero h1 {
  font-size: clamp(42px, 5vw, 66px);
  max-width: 700px;
}

.revision-loader {
  align-content: center;
  display: grid;
  gap: 10px;
  max-width: 690px;
  min-height: 108px;
  min-width: 0;
}

.loader-title {
  color: var(--ink);
  font-size: clamp(24px, 2.8vw, 38px);
  font-weight: 900;
  letter-spacing: 0;
  margin: 0;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 360ms ease, transform 360ms ease;
  text-transform: uppercase;
}

.hero .loader-title {
  color: var(--ink);
}

.loader-progress {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 360ms ease 60ms, transform 360ms ease 60ms;
}

.loader-track {
  background: #e8edf2;
  border: 1px solid #cfd8e3;
  border-radius: 7px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  display: block;
  height: 22px;
  overflow: hidden;
  position: relative;
}

.loader-fill {
  background: var(--green);
  display: block;
  height: 100%;
  transition: width 120ms linear;
  width: 0%;
}

.loader-percent {
  color: var(--ink);
  font-size: clamp(18px, 1.6vw, 22px);
  font-weight: 900;
  min-width: 4ch;
  text-align: right;
}

.loader-status {
  color: var(--muted);
  font-size: clamp(16px, 1.5vw, 19px);
  font-weight: 780;
  margin: 0;
  min-height: 1.4em;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 360ms ease 120ms, transform 360ms ease 120ms;
}

.hero .loader-ready {
  display: none;
  font-size: clamp(22px, 4.7vw, 54px);
  max-width: 100%;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.revision-loader.is-flashing {
  animation: none;
}

.revision-loader.is-flashing .loader-title,
.revision-loader.is-flashing .loader-progress,
.revision-loader.is-flashing .loader-status {
  opacity: 0;
  transform: translateY(-6px);
}

.revision-loader.is-flashing .loader-track {
  box-shadow: 0 0 0 6px rgba(123, 191, 58, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.65);
  transition: box-shadow 420ms ease;
}

.revision-loader.is-ready .loader-title,
.revision-loader.is-ready .loader-progress,
.revision-loader.is-ready .loader-status {
  display: none;
}

.revision-loader.is-ready .loader-ready {
  display: block;
  animation: ready-pop 520ms ease-out;
}

@keyframes ready-pop {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero p {
  color: var(--muted);
  font-size: clamp(17px, 1.7vw, 20px);
  line-height: 1.55;
  max-width: 660px;
}

.hero-kicker {
  color: var(--ink) !important;
  font-size: clamp(20px, 2.1vw, 28px) !important;
  font-weight: 880;
  line-height: 1.18 !important;
  margin: 10px 0 0;
}

.hero-identity {
  color: var(--muted) !important;
  font-size: clamp(16px, 1.5vw, 18px) !important;
  font-weight: 760;
  margin: 5px 0 0;
}

.eyebrow {
  color: #0f766e;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0;
  margin: 0 0 12px;
  text-transform: uppercase;
}

.hero-media {
  min-height: 420px;
  position: relative;
}

.hero-media img {
  height: 100%;
  object-fit: cover;
  object-position: center right;
  width: 100%;
}

.search-panel {
  background: #fdfefe;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(24, 32, 51, 0.08);
  margin-top: 12px;
  padding: 12px;
}

.search-panel label {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 750;
  margin: 0 0 8px;
}

.search-row {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto;
}

.search-row input {
  border: 1px solid var(--line);
  border-radius: 7px;
  min-width: 0;
  padding: 14px 15px;
}

.search-row button,
.button {
  align-items: center;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 820;
  justify-content: center;
  min-height: 45px;
  overflow: hidden;
  padding: 12px 16px;
  position: relative;
}

.search-row button,
.button.primary {
  background: var(--ink);
  color: white;
}

.button.ghost {
  background: #eef4f7;
  color: var(--ink);
}

.route-section,
.two-column,
.page-hero,
.subject-hero,
.content-layout,
.ad-slot {
  margin-top: 22px;
}

.section-heading {
  align-items: end;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-heading h2 {
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.05;
  margin: 0;
}

.section-heading p {
  color: var(--muted);
  margin: 0;
}

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

.route-card,
.compact-list a,
.resource-card,
.filters,
.trust-panel,
.notice {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.route-card {
  min-height: 112px;
  overflow: hidden;
  padding: 16px;
  position: relative;
}

.route-card::before {
  background: linear-gradient(90deg, var(--teal), var(--green), var(--yellow), var(--coral));
  content: "";
  height: 5px;
  inset: 0 0 auto;
  position: absolute;
}

.route-card h3,
.route-card span {
  display: block;
  font-size: 24px;
  font-weight: 880;
  margin-top: 8px;
}

.route-card h3 {
  line-height: 1.15;
  margin: 8px 0 0;
}

.route-card p {
  margin-bottom: 0;
}

.route-card p,
.compact-list span,
.resource-card p,
.trust-panel p,
.site-footer p {
  color: var(--muted);
  line-height: 1.5;
}

.two-column {
  display: grid;
  gap: 28px;
  grid-template-columns: 1fr 1fr;
}

.compact-list {
  display: grid;
  gap: 10px;
}

.compact-list a {
  display: grid;
  gap: 4px;
  padding: 16px;
}

.breadcrumbs {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 14px;
  gap: 8px;
  margin-top: 18px;
}

.breadcrumbs a {
  color: var(--ink);
  font-weight: 720;
}

.page-hero {
  background: linear-gradient(135deg, #ffffff 0%, #eef8f6 46%, #fff4ea 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(24px, 4vw, 48px);
}

.page-hero h1,
.subject-dashboard h1 {
  font-size: clamp(38px, 6vw, 68px);
}

.page-hero p,
.subject-dashboard p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
  max-width: 760px;
}

.subject-dashboard {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(241, 250, 247, 0.94)),
    linear-gradient(90deg, rgba(20, 184, 166, 0.1), rgba(247, 201, 72, 0.1), rgba(255, 122, 89, 0.08));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
  margin-top: 28px;
  padding: clamp(18px, 3vw, 30px);
}

.dashboard-hero {
  align-items: end;
  display: grid;
  gap: 22px;
  grid-template-columns: 1fr auto;
}

.subject-dashboard h1 {
  line-height: 1;
  margin: 0;
}

.dashboard-stats {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  min-width: 390px;
}

.dashboard-stats div {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.dashboard-stats strong {
  display: block;
  font-size: 36px;
  line-height: 1;
}

.dashboard-stats span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 820;
  margin-top: 6px;
  text-transform: uppercase;
}

.topic-row,
.label-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topic-row span,
.label-row span {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 820;
  padding: 7px 10px;
}

.topic-row span {
  background: white;
  border: 1px solid var(--line);
}

.dashboard-tabs {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

.category-tab {
  align-items: center;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr) minmax(2.5ch, auto);
  min-height: 70px;
  overflow: hidden;
  padding: 12px 18px 12px 12px;
  position: relative;
  text-align: left;
}

.category-tab strong {
  font-size: 13px;
  line-height: 1.15;
  min-width: 0;
}

.category-tab small {
  color: var(--muted);
  font-weight: 850;
  justify-self: end;
  min-width: 2.5ch;
  text-align: right;
}

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

.category-tab.active small {
  color: rgba(255, 255, 255, 0.72);
}

.tab-mark {
  align-items: center;
  border-radius: 8px;
  color: white;
  display: flex;
  font-size: 11px;
  font-weight: 900;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.tab-mark.all {
  background: var(--ink);
}

.tab-mark.blue {
  background: #8fb5ff;
}

.tab-mark.green {
  background: #7ecf9a;
}

.tab-mark.violet {
  background: #b899ff;
}

.tab-mark.yellow {
  background: #f6c45f;
}

.tab-mark.coral {
  background: #ff9a76;
}

.tab-mark.rose {
  background: #ff8fa3;
}

.category-tab.active .tab-mark {
  background: rgba(255, 255, 255, 0.18);
  color: white;
}

.dashboard-toolbar {
  align-items: end;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.syllabus-panel {
  display: grid;
  gap: 8px;
}

.syllabus-panel strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.quick-filters label {
  align-items: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  font-weight: 780;
  gap: 7px;
  min-height: 38px;
  padding: 8px 11px;
}

.recommend-panel {
  align-items: center;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(150px, 0.6fr) minmax(0, 1.4fr);
  margin-top: 18px;
  padding: 14px;
}

.recommend-panel + .ad-slot {
  margin-top: 18px;
}

.recommend-panel h2 {
  font-size: 18px;
  line-height: 1.1;
  margin: 0;
}

.recommend-form {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr) auto;
}

.recommend-form label {
  display: grid;
  gap: 5px;
}

.recommend-form label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.recommend-form small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: none;
}

.recommend-form input,
.recommend-form select {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  min-height: 38px;
  min-width: 0;
  padding: 9px 10px;
}

.recommend-form select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 16px, calc(100% - 12px) 16px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  padding-right: 32px;
}

.recommend-form button {
  background: var(--ink);
  border: 0;
  border-radius: 999px;
  color: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  min-height: 38px;
  overflow: hidden;
  padding: 8px 16px;
  position: relative;
}

.recommend-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  grid-column: 1 / -1;
  margin: 0;
  min-height: 1.2em;
}

.recommend-trap {
  display: none;
}

.dashboard-content {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.resource-sections,
.resource-group {
  display: grid;
  gap: 14px;
}

.resource-sections {
  align-items: start;
  grid-template-columns: 1fr;
}

.dashboard-column {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  padding: 9px;
}

.dashboard-column .section-heading {
  align-items: center;
  margin-bottom: 0;
}

.dashboard-column .section-heading h2 {
  align-items: center;
  display: flex;
  font-size: 18px;
  gap: 9px;
}

.dashboard-column .section-heading .tab-mark {
  height: 32px;
  width: 32px;
}

.resource-grid {
  display: grid;
  gap: 6px;
}

.resource-card {
  padding: 8px 10px;
}

.resource-card[hidden] {
  display: none;
}

.resource-meta {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.provider {
  color: var(--ink) !important;
  font-size: 14px;
  font-weight: 860;
  line-height: 1.2;
  margin: 0;
}

.resource-kind {
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
  line-height: 1.2;
}

.resource-kind::before {
  content: "/";
  margin-right: 6px;
}

.label-row span {
  font-size: 11px;
  padding: 3px 7px;
}

.label-official {
  background: #fef9c3;
  color: #854d0e;
}

.label-free {
  background: #ecfdf5;
  color: #065f46;
}

.label-freemium {
  background: #fff7ed;
  color: #9a3412;
}

.label-no-account {
  background: #eff6ff;
  color: #1d4ed8;
}

.label-account {
  background: #f3e8ff;
  color: #6d28d9;
}

.quick-link,
.report-link {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  min-height: 24px;
  overflow: hidden;
  padding: 6px 10px;
  position: relative;
}

.top-nav a::after,
.search-row button::after,
.button::after,
.route-card::after,
.category-tab::after,
.quick-link::after,
.report-link::after,
.recommend-form button::after {
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.18) 38%, rgba(255, 255, 255, 0.72) 50%, rgba(255, 255, 255, 0.18) 62%, transparent 100%);
  content: "";
  inset: -40% auto -40% -75%;
  pointer-events: none;
  position: absolute;
  transform: skewX(-18deg);
  width: 52%;
}

.top-nav a:hover::after,
.search-row button:hover::after,
.button:hover::after,
.route-card:hover::after,
.category-tab:hover::after,
.quick-link:hover::after,
.report-link:hover::after,
.recommend-form button:hover::after {
  animation: button-shimmer 780ms ease;
}

@keyframes button-shimmer {
  from {
    left: -75%;
  }

  to {
    left: 125%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .top-nav a:hover::after,
  .search-row button:hover::after,
  .button:hover::after,
  .route-card:hover::after,
  .category-tab:hover::after,
  .quick-link:hover::after,
  .report-link:hover::after,
  .recommend-form button:hover::after,
  .revision-loader.is-flashing,
  .revision-loader.is-ready .loader-ready {
    animation: none;
  }
}

.quick-link {
  background: var(--ink);
  color: white;
  margin-left: auto;
}

.report-link {
  background: #eef4f7;
  color: var(--muted);
}

.ad-slot {
  align-items: center;
  background: repeating-linear-gradient(135deg, #f8fafc, #f8fafc 12px, #eef4f7 12px, #eef4f7 24px);
  border: 1px dashed #b8c4cf;
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  min-height: 88px;
  padding: 18px;
  grid-column: 1 / -1;
}

.ad-slot strong {
  color: var(--ink);
}

.notice {
  color: var(--muted);
  padding: 16px;
}

.site-footer {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-top: 48px;
  padding: 26px 0 34px;
}

.site-footer p {
  margin: 6px 0 0;
}

@media (max-width: 900px) {
  .site-header {
    align-items: flex-start;
    gap: 14px;
    flex-direction: column;
  }

  .top-nav {
    overflow-x: auto;
    padding-bottom: 4px;
    width: 100%;
  }

  .hero,
  .dashboard-hero,
  .two-column {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 0;
  }

  .hero-media {
    min-height: 270px;
    order: -1;
  }

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

  .dashboard-stats {
    grid-template-columns: 1fr 1fr;
    min-width: 0;
  }

  .dashboard-tabs {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-toolbar {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .recommend-panel,
  .recommend-form {
    grid-template-columns: 1fr;
  }

  .quick-filters {
    justify-content: flex-start;
  }

  .resource-sections {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .site-header,
  .site-footer,
  main {
    width: min(100% - 20px, 1180px);
  }

  .home-page main {
    padding-bottom: 52px;
  }

  .hero-copy,
  .page-hero,
  .subject-dashboard {
    padding: 22px;
  }

  .hero h1 {
    font-size: 42px;
  }

  .loader-progress {
    gap: 8px;
  }

  .loader-track {
    height: 20px;
  }

  .search-row,
  .route-grid,
  .dashboard-tabs,
  .dashboard-stats {
    grid-template-columns: 1fr;
  }

  .site-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .button,
  .search-row button,
  .recommend-form button {
    width: 100%;
  }

  .resource-meta {
    align-items: flex-start;
  }

  .quick-link {
    margin-left: 0;
  }
}
