:root {
  color-scheme: dark;
  --bg: #090e16;
  --panel: #111b28;
  --line: #2a3b4d;
  --text: #f0f5fa;
  --dim: #aebed0;
  --cyan: #77e7f1;
  --amber: #ffc47d;
  font-family: system-ui,sans-serif;
  color: var(--text);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow-wrap: anywhere;
  line-height: 1.5;
  background: radial-gradient(ellipse at 70% 0,#132538,transparent 55%);
}

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

button,input {
  font: inherit;
}

button {
  cursor: pointer;
}

:is(a,button,input):focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}

.card:focus-visible {
  outline-offset: 2px;
}

h1,h2,h3,p {
  margin: 0;
}

h1,h2,h3 {
  line-height: 1.09;
}

h1 {
  font-size: clamp(2rem,4.6vw,4.35rem);
  letter-spacing: -.045em;
}

h2 {
  font-size: clamp(1.5rem,3vw,2.5rem);
  letter-spacing: -.035em;
}

small,.muted {
  color: var(--dim);
}

.shell {
  width: min(1240px,calc(100% - 40px));
  margin-inline: auto;
}

.mast {
  border-bottom: 1px solid var(--line);
  background: #0b121c;
}

.mast .shell,.brand,.mast nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mast .shell {
  justify-content: space-between;
  min-height: 68px;
  flex-wrap: wrap;
  padding-block: 10px;
}

.brand {
  font-weight: 700;
  line-height: 1.2;
}

.brand small {
  display: block;
  margin-top: 4px;
  font-size: .75rem;
  font-weight: 400;
}

.site-footer {
  padding-block: 14px;
  border-top: 1px solid var(--line);
  background: #0b121c;
  color: var(--dim);
  font-size: .8125rem;
}

.mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border: 1px solid #4e8393;
  border-radius: 6px;
  color: var(--cyan);
  background: #102a37;
}

.mast nav {
  flex-wrap: wrap;
}

.mast nav a,.crumbs a,.mast .link {
  color: var(--dim);
}

.mast nav a:hover,.crumbs a:hover,.mast .link:hover {
  color: var(--cyan);
}

main.shell {
  min-width: 0;
  padding-block: 36px 64px;
}

.eyebrow {
  color: var(--cyan);
  font: 700 .75rem/1.5 ui-monospace,monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.intro {
  margin-bottom: 24px;
}

.greeting {
  font-size: clamp(1.5rem,3vw,2.5rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.035em;
  margin: 5px 0 8px;
}

.hero,.frame,.card,.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.hero {
  isolation: isolate;
  min-height: 430px;
  display: grid;
  align-items: end;
}

.hero-motion,.art,.shade {
  position: absolute;
  inset: 0;
}

.hero-motion {
  transform: translate(var(--x,0px),var(--y,0px)) scale(1.045);
  transition: transform .2s ease-out;
}

.art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: drift 25s ease-in-out infinite alternate;
}

.shade {
  background: linear-gradient(90deg,#080e17 0%,#080e17ee 22%,#080e17d9 56%,transparent 92%),linear-gradient(0deg,#080e17bc,transparent 56%);
}

.hero-content {
  position: relative;
  padding: clamp(22px,4.5vw,62px);
  max-width: 630px;
}

.hero h1 {
  margin: 10px 0 14px;
}

.hero-progress {
  margin: 24px 0 18px;
  max-width: 330px;
}

.hero-progress strong {
  color: var(--amber);
}

progress {
  appearance: none;
  display: block;
  width: 100%;
  height: 5px;
  border: 0;
  border-radius: 20px;
  background: #344455;
  overflow: hidden;
  margin-top: 9px;
}

progress::-webkit-progress-bar {
  background: #344455;
}

progress::-webkit-progress-value {
  background: var(--fill,var(--cyan));
}

progress::-moz-progress-bar {
  background: var(--fill,var(--cyan));
}

.hero-progress progress {
  --fill: var(--amber);
}

.button,.admin button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 17px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #172535;
  color: var(--text);
  font-weight: 700;
  text-align: center;
}

.button:hover,.admin button:hover {
  border-color: var(--cyan);
  background: #20374b;
}

.primary {
  background: var(--amber);
  color: #241609;
  border-color: var(--amber);
}

.primary:hover {
  background: #ffdaab;
  border-color: #ffdaab;
}

.section-heading {
  margin: 36px 0 16px;
}

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

.card {
  display: flex;
  flex-direction: column;
}

a.card:hover {
  border-color: var(--cyan);
}

.card.active {
  border-color: #4f99a8;
  box-shadow: 0 0 24px #44ddeb20;
}

.card.done {
  border-color: #8d683e;
  --fill: var(--amber);
}

.card-media,.module-media,.video {
  position: relative;
  overflow: hidden;
  background: #101e2d;
}

.card-media {
  aspect-ratio: 2/1;
}

.card.locked .art {
  filter: brightness(.62) saturate(.46);
}

.card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg,transparent 38%,#98f4ff28 50%,transparent 62%);
  transform: translateX(-100%);
  animation: sweep 7s ease-in-out infinite;
  pointer-events: none;
}

.locked .card-media::after {
  opacity: .3;
}

.card-content {
  padding: 16px;
  display: grid;
  gap: 8px;
  flex: 1;
}

.card-content h3 {
  font-size: 1.35rem;
}

.card-status {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0b1420eF;
  border: 1px solid #476075;
  position: absolute;
  z-index: 1;
  left: 12px;
  top: 12px;
  border-radius: 5px;
  padding: 4px 8px;
  color: var(--text);
  font-size: .75rem;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #aebed0;
}

.active .dot {
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

.done .dot {
  background: var(--amber);
  animation: pulse 2s ease-in-out infinite;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 22px;
  font-size: .875rem;
}

.module-layout {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  gap: 24px;
  align-items: start;
}

.module-media {
  aspect-ratio: 3/2;
}

.panel-content {
  padding: clamp(18px,3vw,32px);
}

.panel-content h1 {
  font-size: clamp(2rem,4vw,3.5rem);
  margin: 8px 0 18px;
}

.lesson-list {
  display: grid;
  gap: 10px;
  padding: 0;
  list-style: none;
}

.lesson-list a {
  display: grid;
  grid-template-columns: clamp(64px,14vw,96px) minmax(0,1fr);
  align-items: start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 15px;
}

.lesson-thumb {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
}

.lesson-list a {
  font-weight: 650;
}

.lesson-preview {
  aspect-ratio: 16/9;
  background: #101e2d;
  border-radius: 4px;
}

.lesson-list small {
  display: block;
}

.lesson-list a:hover {
  color: var(--cyan);
  border-color: var(--cyan);
}

.lesson-shell {
  max-width: 1000px;
  margin-inline: auto;
}

.lesson-shell h1 {
  font-size: clamp(2rem,4vw,3.65rem);
  margin: 10px 0 22px;
}

.video {
  aspect-ratio: 16/9;
  display: grid;
  place-items: center;
}

.video .art {
  filter: brightness(.52);
}

.video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #080e17;
}

.placeholder {
  position: relative;
  margin: 12px;
  padding: 12px 19px;
  border-radius: 9px;
  background: #0a1421;
  color: var(--text);
  text-align: center;
  font-weight: 700;
}

.text {
  margin-block: 24px;
}

.text p + p {
  margin-top: 1em;
}

.materials {
  margin: 16px 0;
}

.materials h2 {
  font-size: 1.35rem;
  margin-bottom: 14px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
}

.materials .button {
  margin: 0 6px 6px 0;
}

.login-page {
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.login {
  display: grid;
  align-items: center;
  position: relative;
  isolation: isolate;
  padding: 20px;
}

.login>.art,.login>.shade {
  z-index: -1;
}

.login>.art {
  animation: none;
}

.login-box {
  width: min(100%,460px);
  margin-left: max(0px,calc((100vw - 1240px)/2 - 20px));
  background: #101b29f7;
}

.login-box form {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.login-box input,.admin input:not([type="file"]) {
  width: 100%;
  min-height: 46px;
  border: 1px solid #536579;
  border-radius: 6px;
  background: #0a1320;
  padding: 8px 12px;
  color: var(--text);
  margin-top: 4px;
}

.login-box .mark {
  margin-bottom: 14px;
}

.files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.files li {
  min-width: 0;
}

.file-icon {
  flex: none;
}

.lesson-actions,.mark-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.badge {
  color: var(--cyan);
  background: #102a37;
  border-radius: 6px;
  padding: 6px 10px;
}

.link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: .2em;
}

.notice,.error {
  margin-block: 12px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.notice + p a {
  color: var(--cyan);
  text-decoration: underline;
}

.error,.admin button.danger {
  color: #ffd3cf;
  background: #43232a;
}

.admin h2 {
  margin: 32px 0 16px;
}

.admin h3 {
  margin: 20px 0 10px;
}

.scroll {
  overflow-x: auto;
}

.admin table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
}

.admin th,.admin td {
  padding: 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.admin th {
  background: #172535;
}

.inline,.addform {
  display: flex;
  align-items: end;
  gap: 8px;
}

.addform {
  flex-wrap: wrap;
}

.addform label {
  flex: 1 1 180px;
}

.admin .inline input {
  width: 140px;
  margin: 0;
}

.admin .small-btn {
  padding-inline: 12px;
  font-size: .875rem;
}

.admin .row {
  margin-block: 8px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.row p {
  margin-bottom: 8px;
}

.row input[type="file"] {
  max-width: 100%;
  margin: 0 8px 8px 0;
}

.row .inline {
  display: inline-flex;
  margin: 4px;
}

.row ul:empty {
  display: none;
}

.st,.pr {
  color: var(--dim);
  font-size: .875rem;
}

@keyframes drift {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.08);
  }
}

@keyframes sweep {
  0%,62% {
    transform: translateX(-100%);
  }
  90%,100% {
    transform: translateX(100%);
  }
}

@keyframes pulse {
  50% {
    box-shadow: 0 0 12px 3px #ffc47d80;
  }
}

@media(max-width:900px) {
  .grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
}

@media(max-width:650px) {
  .shell {
    width: calc(100% - 32px);
  }
  main.shell {
    padding-block: 24px 44px;
  }
  .mast .shell {
    min-height: 62px;
  }
  .mast nav {
    gap: 10px;
    font-size: .875rem;
  }
  .mast .brand {
    font-size: .875rem;
  }
  .mast .map-link {
    display: none;
  }
  .hero {
    min-height: 440px;
  }
  .hero .art {
    object-position: 60% center;
  }
  .hero .shade {
    background: linear-gradient(0deg,#080e17 12%,#080e17f2 40%,#080e17ca 78%,#080e1740);
  }
  .grid,.module-layout {
    grid-template-columns: 1fr;
  }
  .actions > .button,.lesson-actions,.mark-form,.mark-form .primary {
    width: 100%;
  }
  .video {
    min-height: 190px;
  }
  .login-box {
    margin-inline: auto;
  }
}

@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after {
    animation: none!important;
    transition: none!important;
  }
  .hero-motion {
    transform: none;
  }
}
