:root {
  --ink: #211a37;
  --ink-soft: #625b70;
  --paper: #fffcf8;
  --lavender: #f3edff;
  --violet: #7047eb;
  --violet-dark: #4d2ba4;
  --gold: #ffc857;
  --pink: #ef5da8;
  --mint: #69d4b0;
  --sky: #68b5f7;
  --line: #e4ddef;
  --shadow: 0 22px 70px rgba(44, 28, 78, .13);
  --radius: 28px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 2%, rgba(239, 93, 168, .10), transparent 24rem),
    radial-gradient(circle at 94% 17%, rgba(112, 71, 235, .12), transparent 30rem),
    var(--paper);
  font-family: ui-rounded, "SF Pro Rounded", "Avenir Next", Avenir, system-ui, -apple-system, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
a { color: inherit; }
img { display: block; }
:where(a, button, input):focus-visible {
  outline: 3px solid var(--violet);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  padding: .8rem 1rem;
  color: white;
  background: var(--ink);
  border-radius: 12px;
}
.skip-link:focus { top: 1rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1240px;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 28px 14px;
  background: rgba(255, 252, 248, .88);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(228, 221, 239, .8);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.18rem;
  font-weight: 650;
}
.brand img { border-radius: 14px; box-shadow: 0 7px 20px rgba(57, 28, 89, .18); }
.brand strong { color: var(--violet); }

nav { display: flex; gap: .25rem; }
nav a {
  padding: .72rem .9rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}
nav a:hover, nav a:focus-visible { background: var(--lavender); }

main, footer { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }

.hero {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  min-height: 620px;
  padding: clamp(3rem, 8vw, 7rem) 0;
}

.eyebrow, .kicker {
  display: inline-block;
  color: var(--violet);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 700px;
  margin: .8rem 0 1rem;
  font-size: clamp(3rem, 7vw, 6.6rem);
  line-height: .94;
  letter-spacing: -.065em;
}
.hero h1 em { color: var(--violet); font-style: normal; }
.hero-copy > p { max-width: 590px; margin: 0 0 2rem; color: var(--ink-soft); font-size: clamp(1.1rem, 2vw, 1.35rem); }

.primary-button {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  min-height: 54px;
  padding: .92rem 1.2rem;
  color: white;
  background: var(--ink);
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(33, 26, 55, .20);
  text-decoration: none;
  font-weight: 850;
}
.primary-button:hover { transform: translateY(-2px); }

.hero-stage {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  background: linear-gradient(145deg, #201630 0%, #3a2368 55%, #6e44d8 100%);
  border: 10px solid white;
  border-radius: 42px;
  box-shadow: var(--shadow);
}
.stage-curtain { position: absolute; inset-block: 0; width: 25%; background: repeating-linear-gradient(90deg, #8a164f 0 18px, #bd2d70 18px 38px); box-shadow: inset -20px 0 30px rgba(35, 6, 30, .35); }
.stage-curtain.left { left: 0; clip-path: polygon(0 0, 100% 0, 65% 100%, 0 100%); }
.stage-curtain.right { right: 0; transform: scaleX(-1); clip-path: polygon(0 0, 100% 0, 65% 100%, 0 100%); }
.stage-star { position: absolute; left: 50%; top: 29%; translate: -50% -50%; color: var(--gold); font-size: 7.5rem; filter: drop-shadow(0 0 28px rgba(255, 200, 87, .42)); }
.stage-card { position: absolute; z-index: 2; padding: .72rem 1rem; background: rgba(255,255,255,.94); border-radius: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.22); font-weight: 900; }
.card-one { left: 16%; top: 62%; rotate: -7deg; }
.card-two { right: 12%; top: 69%; rotate: 6deg; }
.stage-floor { position: absolute; inset: auto 0 0; height: 31%; background: repeating-linear-gradient(90deg, #c18a56 0 55px, #d9a874 55px 110px); clip-path: polygon(12% 0, 88% 0, 100% 100%, 0 100%); }

.finder, .courses { scroll-margin-top: 95px; }
.finder {
  padding: clamp(2rem, 5vw, 4rem);
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 16px 50px rgba(48, 34, 75, .08);
}

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 1.6rem; }
.section-heading.compact { margin-bottom: 1rem; }
.section-heading h2 { margin: .3rem 0 0; font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.05; letter-spacing: -.04em; }
.result-count { margin: 0; color: var(--ink-soft); font-weight: 750; }

.search-box { position: relative; display: flex; align-items: center; }
.search-icon { position: absolute; left: 1.1rem; color: var(--violet); font-size: 1.8rem; font-weight: 900; transform: rotate(-18deg); }
.search-box input {
  width: 100%;
  min-height: 64px;
  padding: 1rem 3.3rem;
  color: var(--ink);
  background: var(--lavender);
  border: 2px solid transparent;
  border-radius: 18px;
  outline: none;
  font-size: 1.05rem;
}
.search-box input:focus { border-color: var(--violet); box-shadow: 0 0 0 5px rgba(112, 71, 235, .12); }
.clear-search { position: absolute; right: .7rem; width: 44px; height: 44px; border: 0; border-radius: 50%; background: white; color: var(--ink); font-size: 1.5rem; cursor: pointer; }

.subject-filters { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.2rem; }
.filter-button {
  min-height: 46px;
  padding: .65rem .95rem;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
}
.filter-button:hover, .filter-button:focus-visible { border-color: var(--violet); }
.filter-button.active { color: white; background: var(--ink); border-color: var(--ink); }
.filter-button span { opacity: .66; margin-left: .3rem; }

.courses { padding: clamp(5rem, 10vw, 8rem) 0; }
.subject-section { margin-top: 3rem; }
.subject-title { display: flex; align-items: center; gap: .75rem; margin: 0 0 1rem; font-size: 1.45rem; }
.subject-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--subject-bg, var(--lavender)); }
.course-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.course-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 300px;
  overflow: hidden;
  padding: 1.45rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 12px 38px rgba(49, 32, 76, .07);
}
.course-card.available { border-color: color-mix(in srgb, var(--course-color) 48%, white); }
.course-card::after { content: ""; position: absolute; width: 170px; height: 170px; right: -70px; top: -80px; border-radius: 50%; background: color-mix(in srgb, var(--course-color) 18%, transparent); }
.course-card-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.course-emoji { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 17px; background: color-mix(in srgb, var(--course-color) 15%, white); font-size: 1.7rem; }
.status { padding: .42rem .68rem; border-radius: 999px; color: #625b70; background: #f5f2f7; font-size: .76rem; font-weight: 900; }
.available .status { color: #205d47; background: #dff8ee; }
.course-card h3 { margin: 1.4rem 0 .45rem; font-size: 1.55rem; line-height: 1.1; letter-spacing: -.025em; }
.course-card p { margin: 0; color: var(--ink-soft); }
.course-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }
.course-tags span { padding: .3rem .55rem; background: #f7f4fa; border-radius: 8px; color: #686071; font-size: .75rem; font-weight: 800; }
.course-action { margin-top: auto; padding-top: 1.4rem; }
.course-link, .course-soon { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .75rem 1rem; border-radius: 14px; font-weight: 900; }
.course-link { color: white; background: var(--ink); text-decoration: none; }
.course-link:hover { background: var(--violet-dark); }
.course-soon { color: #625b70; background: #f5f2f7; }

.empty-state { max-width: 560px; margin: 4rem auto; padding: 3rem; text-align: center; background: var(--lavender); border-radius: 24px; }
.empty-state > span { font-size: 3rem; }
.empty-state h3 { margin: .6rem 0 .2rem; font-size: 1.6rem; }
.empty-state p { margin: 0 0 1.1rem; color: var(--ink-soft); }
.empty-state button { min-height: 46px; padding: .7rem 1rem; border: 0; border-radius: 13px; color: white; background: var(--ink); font-weight: 850; cursor: pointer; }

.install-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: center;
  margin: 0 0 6rem;
  padding: clamp(2rem, 5vw, 3.5rem);
  color: white;
  background: linear-gradient(130deg, #211a37, #6134c6);
  border-radius: 30px;
  box-shadow: var(--shadow);
  scroll-margin-top: 100px;
}
.install-card img { border-radius: 24px; box-shadow: 0 14px 38px rgba(0,0,0,.25); }
.kicker.light { color: #f9cf6e; }
.install-card h2 { margin: .35rem 0 .35rem; font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.05; }
.install-card p { margin: 0; color: #e8e1f9; font-size: 1.08rem; }

footer { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 2rem 0 max(2.5rem, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--ink-soft); }
.footer-brand { flex: 0 0 auto; }
footer p { margin: 0; text-align: right; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 820px) {
  .site-header { padding-inline: 18px; }
  nav a { padding-inline: .65rem; }
  main, footer { width: min(100% - 28px, 720px); }
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 4.5rem; }
  .hero-stage { min-height: 380px; }
  .course-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .site-header { flex-wrap: wrap; }
  .site-header nav {
    order: 2;
    width: 100%;
    overflow-x: auto;
    padding-block: 2px;
    scrollbar-width: thin;
  }
  .site-header nav a {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    min-height: 44px;
  }
  .finder, .courses, .install-card { scroll-margin-top: 150px; }
  .hero h1 { font-size: clamp(3.15rem, 16vw, 5rem); }
  .hero-stage { min-height: 310px; border-width: 7px; }
  .stage-star { font-size: 5.5rem; }
  .finder { padding: 1.4rem; }
  .section-heading { display: block; }
  .result-count { margin-top: .6rem; }
  .search-box input { min-height: 58px; font-size: .95rem; }
  .install-card { grid-template-columns: 1fr; }
  .install-card img { width: 84px; height: 84px; }
  footer { display: block; }
  footer p { margin-top: 1rem; text-align: left; }
}

@media (prefers-reduced-transparency: reduce) {
  .site-header {
    background: var(--paper);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .course-card, .primary-button { transition: transform .2s ease, box-shadow .2s ease, background .2s ease; }
  .course-card:hover { transform: translateY(-4px); box-shadow: 0 18px 48px rgba(49, 32, 76, .12); }
}
