:root {
  /* Palette mirrors www.ungerai.com so this reads as another page of that site. */
  --bg: #050712;
  --bg-2: #0b1020;
  --panel: rgba(8, 13, 31, 0.74);
  --panel-solid: #0c1227;
  --border: rgba(132, 247, 255, 0.18);
  --border-strong: rgba(132, 247, 255, 0.35);
  --text: #effbff;
  --text-dim: #9fb4c7;
  --text-faint: #6f8296;
  --cyan: #48f5ff;
  --violet: #ff3df2; /* remapped to ungerai magenta (var name kept for compat) */
  --violet-2: #ff6ff6;
  --pink: #ff3df2;
  --green: #7dff99;
  --amber: #ffcc66;
  --red: #ff4d6d;
  --grad: linear-gradient(90deg, #48f5ff, #ff3df2);
  --grad-cv: linear-gradient(90deg, #48f5ff, #ff3df2);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.45);
  --ring: 0 0 0 3px rgba(72, 245, 255, 0.25);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: var(--font);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: radial-gradient(1200px 800px at 80% -10%, #0a1a30 0%, transparent 55%),
    radial-gradient(1000px 700px at 0% 10%, #1c0a2e 0%, transparent 50%), var(--bg);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ---------- animated background ---------- */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image: linear-gradient(rgba(124, 138, 220, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 138, 220, 0.06) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 0%, #000 30%, transparent 80%);
}

.bg-glow {
  position: fixed;
  z-index: -2;
  width: 540px;
  height: 540px;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.45;
  animation: float 18s ease-in-out infinite;
}
.bg-glow--1 {
  background: #48f5ff;
  top: -160px;
  right: -120px;
}
.bg-glow--2 {
  background: #ff3df2;
  bottom: -200px;
  left: -140px;
  animation-delay: -6s;
}
.bg-glow--3 {
  background: #ff3df2;
  top: 40%;
  left: 55%;
  opacity: 0.18;
  animation-delay: -12s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-30px, 40px) scale(1.08); }
}

/* ---------- header / footer ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  background: rgba(5, 7, 18, 0.66);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(132, 247, 255, 0.15);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(20px, 5vw, 44px);
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}
.brand__mark {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 11px;
  border: 1px solid rgba(72, 245, 255, 0.5);
  background: radial-gradient(120% 120% at 30% 20%, rgba(72, 245, 255, 0.28), rgba(255, 61, 242, 0.12) 70%, transparent);
  box-shadow: 0 6px 20px -6px rgba(72, 245, 255, 0.5), inset 0 0 12px rgba(72, 245, 255, 0.25);
}
.brand__mark::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 15px;
  height: 15px;
  border-radius: 3px;
  background: linear-gradient(135deg, #48f5ff, #ff3df2);
  transform: rotate(45deg);
  box-shadow: 0 0 12px rgba(72, 245, 255, 0.8);
}
.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand__text strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.2px;
}
.brand__text small {
  font-size: 11.5px;
  color: var(--text-dim);
}

.site-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.site-nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 400;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid rgba(132, 247, 255, 0.22);
  background: rgba(255, 255, 255, 0.043);
  white-space: nowrap;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.site-nav a:hover {
  color: var(--cyan);
  border-color: rgba(72, 245, 255, 0.5);
  background: rgba(72, 245, 255, 0.08);
}
.site-nav a.is-active {
  color: var(--cyan);
  border-color: rgba(72, 245, 255, 0.45);
  background: rgba(72, 245, 255, 0.1);
}

.site-main {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px clamp(20px, 5vw, 56px) 80px;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 26px clamp(20px, 5vw, 56px);
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--text-faint);
  font-size: 13px;
}
.site-footer a {
  color: var(--text-dim);
  text-decoration: none;
}
.site-footer a:hover {
  color: var(--cyan);
}
.site-footer__credit strong {
  color: var(--text-dim);
}

/* ---------- shared bits ---------- */
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.pill {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.4px;
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
  background: rgba(124, 138, 220, 0.08);
  text-transform: uppercase;
}
.pill--accent {
  color: #d9f6ff;
  border-color: rgba(34, 211, 238, 0.4);
  background: rgba(34, 211, 238, 0.1);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(124, 138, 220, 0.08);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-dim);
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--violet-2);
  box-shadow: 0 0 10px var(--violet-2);
}
.dot--free {
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: var(--font);
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.btn--primary {
  background: var(--grad-cv);
  color: #06121b;
  box-shadow: 0 12px 30px -8px rgba(34, 211, 238, 0.5);
}
.btn--primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 18px 40px -10px rgba(124, 58, 237, 0.6);
}
.btn--primary:disabled {
  opacity: 0.65;
  cursor: progress;
  transform: none;
}

.btn__spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(6, 18, 27, 0.4);
  border-top-color: #06121b;
  animation: spin 0.7s linear infinite;
  display: none;
}
.btn.is-loading .btn__spinner {
  display: inline-block;
}
.btn.is-loading .btn__label {
  opacity: 0.8;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.check {
  color: var(--cyan);
  font-weight: 700;
}

/* ---------- hero / catalog ---------- */
.hero {
  text-align: center;
  padding: 40px 0 50px;
}
.hero__title {
  font-family: var(--display);
  font-size: clamp(34px, 6vw, 60px);
  line-height: 1.05;
  margin: 20px auto 16px;
  max-width: 14ch;
  letter-spacing: -0.5px;
}
.hero__subtitle {
  color: var(--text-dim);
  font-size: clamp(16px, 2.2vw, 19px);
  max-width: 52ch;
  margin: 0 auto 26px;
  line-height: 1.6;
}
.hero__meta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.catalog__head {
  margin: 30px 0 22px;
}
.catalog__head h2 {
  font-family: var(--display);
  font-size: 26px;
  margin: 0 0 6px;
}
.catalog__head p {
  color: var(--text-dim);
  margin: 0;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}

.course-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.course-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--grad);
  opacity: 0.8;
}
.course-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-strong);
  box-shadow: 0 26px 50px -22px rgba(124, 58, 237, 0.6);
}
.course-card__top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.price-badge {
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  padding: 5px 12px;
  border-radius: 10px;
  background: rgba(34, 211, 238, 0.12);
  color: #bdf3ff;
  border: 1px solid rgba(34, 211, 238, 0.3);
}
.tag {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 8px;
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.tag--lock {
  color: #ffc7fb;
  border-color: rgba(255, 61, 242, 0.4);
  background: rgba(255, 61, 242, 0.1);
}
.tag--free {
  color: #c8ffd6;
  border-color: rgba(125, 255, 153, 0.4);
  background: rgba(125, 255, 153, 0.1);
}
.course-card__title {
  font-family: var(--display);
  font-size: 21px;
  margin: 0 0 10px;
  line-height: 1.25;
}
.course-card__summary {
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.55;
  margin: 0 0 18px;
  flex: 1;
}
.course-card__meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.course-card__meta span {
  font-size: 12.5px;
  color: var(--text-faint);
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(124, 138, 220, 0.07);
}
.course-card__cta {
  font-weight: 600;
  color: var(--cyan);
  font-size: 14.5px;
}

.empty {
  color: var(--text-dim);
  text-align: center;
  padding: 50px 0;
}

/* ---------- repo landing ---------- */
.back-link {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14.5px;
}
.back-link:hover {
  color: var(--cyan);
}

.repo-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 38px;
  align-items: start;
}

.repo-title {
  font-family: var(--display);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.1;
  margin: 16px 0 14px;
}
.repo-summary {
  font-size: 18px;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0 0 20px;
}
.repo-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.prose p {
  color: var(--text-dim);
  line-height: 1.75;
  font-size: 15.5px;
}
.outcomes {
  margin-top: 28px;
}
.outcomes h2 {
  font-family: var(--display);
  font-size: 22px;
  margin: 0 0 14px;
}
.outcomes ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}
.outcomes li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: var(--text);
  line-height: 1.55;
  font-size: 15px;
}
.outcomes .check {
  margin-top: 2px;
}

.repo-aside {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 20px;
}

.access-panel {
  padding: 24px;
}
.access-panel__price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
}
.access-panel__amount {
  font-family: var(--display);
  font-size: 36px;
  font-weight: 700;
}
.access-panel__note {
  color: var(--text-faint);
  font-size: 13.5px;
}
.free-banner {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: #b6f5dd;
  font-size: 14px;
  margin-bottom: 16px;
}
.access-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 11px;
}
.access-list li {
  display: flex;
  gap: 10px;
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.45;
}
.access-list--intro {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

/* ---------- form ---------- */
.form-panel {
  padding: 26px;
}
.form-panel__title {
  font-family: var(--display);
  font-size: 22px;
  margin: 0 0 4px;
}
.form-panel__sub {
  color: var(--text-dim);
  margin: 0 0 20px;
  font-size: 14.5px;
}

.field {
  margin-bottom: 16px;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.field label {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 7px;
  color: var(--text);
}
.optional {
  color: var(--text-faint);
  font-weight: 400;
}
.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: rgba(7, 10, 24, 0.6);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.field textarea {
  resize: vertical;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: var(--ring);
}
.field input::placeholder {
  color: #5b6285;
}
.field__hint {
  display: block;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--text-faint);
}
.field__hint.is-free {
  color: var(--green);
}

.input-prefix {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: rgba(7, 10, 24, 0.6);
  overflow: hidden;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.input-prefix:focus-within {
  border-color: var(--cyan);
  box-shadow: var(--ring);
}
.input-prefix span {
  padding: 0 4px 0 14px;
  color: var(--text-faint);
  font-size: 15px;
}
.input-prefix input {
  border: none;
  background: transparent;
  box-shadow: none;
}
.input-prefix input:focus {
  box-shadow: none;
}

.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.45;
  margin: 4px 0 18px;
  cursor: pointer;
}
.consent input {
  margin-top: 2px;
  width: 17px;
  height: 17px;
  accent-color: var(--violet);
  flex-shrink: 0;
}

#submit-btn {
  width: 100%;
}
.form-error {
  margin: 14px 0 0;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: rgba(251, 113, 133, 0.12);
  border: 1px solid rgba(251, 113, 133, 0.4);
  color: #ffc7d1;
  font-size: 13.5px;
}

.form-success {
  text-align: center;
  padding: 18px 8px;
}
.form-success__icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 28px;
  color: #06121b;
  background: var(--grad-cv);
  box-shadow: 0 10px 30px -8px rgba(34, 211, 238, 0.6);
}
.form-success h3 {
  font-family: var(--display);
  margin: 0 0 8px;
  font-size: 22px;
}
.form-success p {
  color: var(--text-dim);
  margin: 0;
  line-height: 1.6;
}

/* ---------- message page ---------- */
.message-wrap {
  display: grid;
  place-items: center;
  min-height: 56vh;
  padding: 40px 0;
}
.message-card {
  max-width: 540px;
  text-align: center;
  padding: 40px 36px;
}
.message-card h1 {
  font-family: var(--display);
  font-size: 28px;
  margin: 6px 0 14px;
}
.message-card__body {
  color: var(--text-dim);
  line-height: 1.65;
  font-size: 15.5px;
  margin-bottom: 26px;
}
.message-card__body p {
  margin: 0 0 12px;
}
.message-card__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 8px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 30px;
  font-weight: 700;
}
.message-card__icon--success {
  color: #06121b;
  background: var(--grad-cv);
}
.message-card__icon--error {
  color: #2a0410;
  background: linear-gradient(90deg, #fb7185, #ec4899);
}
.message-card__icon--info {
  color: #06121b;
  background: linear-gradient(90deg, #a855f7, #22d3ee);
}

/* ---------- responsive ---------- */
@media (max-width: 880px) {
  .repo-layout {
    grid-template-columns: 1fr;
  }
  .repo-aside {
    position: static;
  }
}
@media (max-width: 560px) {
  .field-row {
    grid-template-columns: 1fr;
  }
  .site-nav {
    gap: 16px;
  }
  .hero {
    padding: 20px 0 36px;
  }
}

/* ---------- admin console ---------- */
.admin__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.admin__title {
  font-family: var(--display);
  font-size: clamp(26px, 4vw, 38px);
  margin: 12px 0 4px;
}
.admin__sub {
  color: var(--text-dim);
  margin: 0;
}
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(124, 138, 220, 0.06);
}
.stat-card__num {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 700;
}
.stat-card__label {
  color: var(--text-faint);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.admin-table-wrap {
  padding: 6px;
}
.table-scroll {
  overflow-x: auto;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.admin-table th,
.admin-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-table thead th {
  color: var(--text-faint);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
  background: var(--panel-solid);
}
.admin-table tbody tr:hover {
  background: rgba(124, 138, 220, 0.06);
}
.admin-table a {
  color: var(--cyan);
  text-decoration: none;
}
.admin-table a:hover {
  text-decoration: underline;
}
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
}
.badge--free {
  color: #bdf5e2;
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.1);
}
.badge--paid {
  color: #ffd9ec;
  border-color: rgba(236, 72, 153, 0.4);
  background: rgba(236, 72, 153, 0.1);
}
.badge--ok {
  color: #bdf5e2;
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(52, 211, 153, 0.12);
}
.badge--muted {
  color: var(--text-faint);
}
@media (max-width: 720px) {
  .admin__head {
    align-items: flex-start;
  }
}

.admin-courses {
  margin-bottom: 24px;
  padding: 16px;
}
.admin-courses__title {
  font-family: var(--display);
  font-size: 18px;
  margin: 4px 4px 12px;
}
.btn-mini {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: rgba(124, 138, 220, 0.12);
  color: var(--text);
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-mini:hover {
  background: rgba(124, 138, 220, 0.22);
}

/* ---------- catalog: disabled / coming-soon cards ---------- */
.course-card--disabled {
  opacity: 0.6;
  filter: grayscale(0.65);
  pointer-events: none;
  cursor: default;
}
.course-card--disabled .course-card__cta {
  color: var(--text-faint);
}
.course-card__soon {
  position: absolute;
  top: 30px;
  right: -54px;
  z-index: 2;
  width: 200px;
  text-align: center;
  transform: rotate(45deg);
  padding: 6px 0;
  font-family: var(--display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #06121b;
  background: linear-gradient(90deg, #48f5ff, #ff3df2);
  box-shadow: 0 8px 18px -8px rgba(0, 0, 0, 0.6);
}
