:root {
  color-scheme: dark;

  /* =========================================================
     Nelara Brand
     ========================================================= */

  --bg: #050914;
  --bg-2: #07101f;

  --panel: #0b1220;
  --panel-2: #111a2b;

  --ink: #f4f7ff;
  --muted: #9aa8bd;
  --muted-strong: #c7d2e3;

  --line: rgba(148, 163, 184, 0.16);
  --line-strong: rgba(56, 189, 248, 0.28);

  --blue: #2563eb;
  --cyan: #38bdf8;

  --blue-soft: rgba(37, 99, 235, 0.12);
  --cyan-soft: rgba(56, 189, 248, 0.10);

  --success: #38bdf8;
  --gold: #60a5fa;

  --radius: 14px;
  --radius-sm: 10px;
}


/* =========================================================
   Base
   ========================================================= */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;

  /* Prevent sticky header from covering anchor targets */
  scroll-padding-top: 120px;
}

body {
  margin: 0;
  min-height: 100vh;

  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  color: var(--ink);

  background:
    radial-gradient(
      circle at 12% 8%,
      rgba(37, 99, 235, 0.16),
      transparent 24rem
    ),
    radial-gradient(
      circle at 88% 6%,
      rgba(56, 189, 248, 0.12),
      transparent 20rem
    ),
    radial-gradient(
      circle at 50% 100%,
      rgba(37, 99, 235, 0.08),
      transparent 30rem
    ),
    linear-gradient(
      180deg,
      #050914 0%,
      #07101f 48%,
      #050914 100%
    );
}

a {
  color: inherit;
}

::selection {
  background: rgba(56, 189, 248, 0.28);
  color: #ffffff;
}


/* =========================================================
   Anchor Navigation
   ========================================================= */

#foundation,
#advanced,
#projects,
#code-library,
[id^="foundation"],
[id^="advanced"],
[id^="projects"],
[id^="code-library"] {
  scroll-margin-top: 120px;
}


/* =========================================================
   Typography
   ========================================================= */

h1,
h2,
h3,
h4 {
  color: var(--ink);
}

h1 {
  max-width: 880px;
  margin: 0;

  font-size: clamp(2.6rem, 7vw, 5.3rem);
  line-height: 0.96;
  letter-spacing: -0.045em;
}

h2 {
  margin: 0 0 12px;

  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

h3 {
  margin: 0 0 10px;

  font-size: 1.15rem;
  line-height: 1.25;
}

p,
li {
  color: var(--muted);
  line-height: 1.65;
}

.lede {
  max-width: 780px;
  margin: 20px 0 0;

  color: rgba(239, 246, 255, 0.84);
  font-size: 1.12rem;
  line-height: 1.7;
}


/* =========================================================
   Code
   ========================================================= */

code,
pre {
  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    "Liberation Mono",
    monospace;
}

code {
  border-radius: 6px;
  padding: 3px 6px;

  background: rgba(255, 255, 255, 0.07);
  color: #bae6fd;

  font-size: 0.92em;
}

pre {
  overflow-x: auto;

  margin: 0;

  border: 1px solid rgba(56, 189, 248, 0.14);
  border-radius: var(--radius-sm);

  padding: 18px;

  background:
    linear-gradient(
      135deg,
      rgba(37, 99, 235, 0.08),
      rgba(56, 189, 248, 0.03)
    ),
    #050b16;

  color: #bae6fd;

  line-height: 1.6;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.025),
    0 12px 30px rgba(0, 0, 0, 0.18);
}

pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}


/* =========================================================
   Top Navigation
   ========================================================= */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 24px;

  padding: 15px clamp(18px, 4vw, 52px);

  border-bottom: 1px solid rgba(148, 163, 184, 0.14);

  background: rgba(5, 9, 20, 0.86);

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.16);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;

  color: var(--ink);

  font-weight: 900;
  letter-spacing: -0.02em;

  text-decoration: none;

  white-space: nowrap;
}

.brand:hover {
  color: #ffffff;
}

.brand-mark {
  width: 36px;
  height: 36px;

  display: grid;
  place-items: center;

  border-radius: 10px;

  background:
    linear-gradient(
      135deg,
      var(--blue),
      var(--cyan)
    );

  color: #ffffff;

  font-weight: 950;

  box-shadow:
    0 8px 26px rgba(37, 99, 235, 0.28);
}

.brand-sub {
  margin-left: 5px;

  color: #94a3b8;

  font-size: 0.72em;
  font-weight: 600;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;

  gap: 6px;

  color: var(--muted);

  font-size: 0.9rem;
  font-weight: 700;
}

.nav a {
  padding: 8px 11px;

  border: 1px solid transparent;
  border-radius: 8px;

  text-decoration: none;

  transition:
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.nav a:hover {
  color: #ffffff;

  background: rgba(37, 99, 235, 0.10);

  border-color: rgba(56, 189, 248, 0.16);

  transform: translateY(-1px);
}


/* =========================================================
   Main Page
   ========================================================= */

.page {
  width: min(1040px, calc(100% - 36px));

  margin: 0 auto;

  padding: 58px 0 80px;
}


/* =========================================================
   Eyebrow
   ========================================================= */

.eyebrow {
  width: fit-content;

  margin: 0 0 16px;

  border: 1px solid rgba(56, 189, 248, 0.28);

  border-radius: 999px;

  padding: 8px 13px;

  background:
    linear-gradient(
      135deg,
      rgba(37, 99, 235, 0.12),
      rgba(56, 189, 248, 0.07)
    );

  color: #bae6fd;

  font-size: 0.76rem;
  font-weight: 850;

  letter-spacing: 0.08em;

  text-transform: uppercase;

  box-shadow:
    0 8px 24px rgba(37, 99, 235, 0.08);
}


/* =========================================================
   Content Grid
   ========================================================= */

.grid {
  display: grid;

  grid-template-columns: repeat(2, minmax(0, 1fr));

  gap: 16px;

  margin-top: 28px;
}


/* =========================================================
   Panels / Cards
   ========================================================= */

.panel {
  position: relative;

  overflow: hidden;

  border: 1px solid var(--line);

  border-radius: var(--radius);

  padding: 22px;

  background:
    linear-gradient(
      145deg,
      rgba(17, 26, 43, 0.94),
      rgba(11, 18, 32, 0.96)
    );

  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.025);

  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.panel::before {
  content: "";

  position: absolute;

  top: 0;
  left: 0;
  right: 0;

  height: 1px;

  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(56, 189, 248, 0.24),
      transparent
    );

  opacity: 0.7;
}

.panel:hover {
  border-color: rgba(56, 189, 248, 0.22);

  transform: translateY(-2px);

  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.24),
    0 0 30px rgba(37, 99, 235, 0.05);
}

.panel.accent {
  border-color: rgba(56, 189, 248, 0.30);

  background:
    linear-gradient(
      145deg,
      rgba(37, 99, 235, 0.12),
      rgba(56, 189, 248, 0.06)
    );
}


/* =========================================================
   Callouts
   ========================================================= */

.callout {
  margin-top: 24px;

  border: 1px solid rgba(96, 165, 250, 0.28);

  border-radius: var(--radius);

  padding: 20px;

  background:
    linear-gradient(
      135deg,
      rgba(37, 99, 235, 0.10),
      rgba(96, 165, 250, 0.05)
    );
}


/* =========================================================
   Metadata
   ========================================================= */

.meta-list {
  display: grid;

  grid-template-columns: repeat(3, minmax(0, 1fr));

  gap: 12px;

  margin-top: 26px;
}

.meta {
  border: 1px solid var(--line);

  border-radius: var(--radius-sm);

  padding: 16px;

  background:
    rgba(255, 255, 255, 0.035);

  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}

.meta:hover {
  border-color: rgba(56, 189, 248, 0.20);

  background:
    rgba(37, 99, 235, 0.06);
}

.meta strong {
  display: block;

  margin-bottom: 5px;

  color: #7dd3fc;

  font-size: 1.08rem;
  font-weight: 850;
}

.meta span {
  color: var(--muted);
}


/* =========================================================
   Lists
   ========================================================= */

.checklist {
  padding-left: 20px;
}

.checklist li {
  margin-bottom: 8px;
}

.checklist li::marker {
  color: var(--cyan);
}


/* =========================================================
   Buttons
   ========================================================= */

.button {
  min-height: 46px;

  display: inline-flex;

  align-items: center;
  justify-content: center;

  gap: 8px;

  border: 1px solid rgba(148, 163, 184, 0.20);

  border-radius: 10px;

  padding: 0 18px;

  background:
    rgba(255, 255, 255, 0.055);

  color: #ffffff;

  font-weight: 800;

  text-decoration: none;

  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.button:hover {
  transform: translateY(-1px);

  border-color: rgba(56, 189, 248, 0.28);

  background:
    rgba(37, 99, 235, 0.10);

  box-shadow:
    0 10px 25px rgba(0, 0, 0, 0.18);
}

.button.primary {
  border-color: transparent;

  background:
    linear-gradient(
      135deg,
      var(--blue),
      var(--cyan)
    );

  color: #ffffff;

  box-shadow:
    0 10px 30px rgba(37, 99, 235, 0.22);
}

.button.primary:hover {
  background:
    linear-gradient(
      135deg,
      #1d4ed8,
      #22b3ee
    );

  box-shadow:
    0 14px 34px rgba(37, 99, 235, 0.30);
}


/* =========================================================
   Course Progress
   ========================================================= */

.progress-card {
  margin-top: 28px;

  border: 1px solid rgba(56, 189, 248, 0.22);

  border-radius: var(--radius);

  padding: 20px;

  background:
    linear-gradient(
      145deg,
      rgba(37, 99, 235, 0.10),
      rgba(11, 18, 32, 0.96)
    );

  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.progress-header {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 12px;

  margin-bottom: 14px;
}

.progress-title {
  margin: 0;

  color: #ffffff;

  font-size: 1rem;

  font-weight: 850;
}

.progress-count {
  color: #7dd3fc;

  font-size: 0.88rem;

  font-weight: 800;

  white-space: nowrap;
}

.progress-track {
  width: 100%;

  height: 9px;

  overflow: hidden;

  border-radius: 999px;

  background:
    rgba(148, 163, 184, 0.14);

  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, 0.24);
}

.progress-bar {
  width: 0%;

  height: 100%;

  border-radius: inherit;

  background:
    linear-gradient(
      90deg,
      var(--blue),
      var(--cyan)
    );

  box-shadow:
    0 0 14px rgba(56, 189, 248, 0.24);

  transition:
    width 0.35s ease;
}

.progress-actions {
  display: flex;

  flex-wrap: wrap;

  gap: 10px;

  margin-top: 16px;
}

.button.completed {
  border-color: rgba(56, 189, 248, 0.30);

  background:
    rgba(56, 189, 248, 0.10);

  color: #bae6fd;

  cursor: default;

  box-shadow:
    0 8px 22px rgba(37, 99, 235, 0.10);
}

.button.completed:hover {
  transform: none;

  border-color: rgba(56, 189, 248, 0.30);

  background:
    rgba(56, 189, 248, 0.10);

  box-shadow:
    0 8px 22px rgba(37, 99, 235, 0.10);
}

.button:disabled {
  opacity: 1;
}


/* =========================================================
   Pager
   ========================================================= */

.pager {
  display: flex;

  flex-wrap: wrap;

  justify-content: space-between;

  gap: 12px;

  margin-top: 32px;

  padding-top: 24px;

  border-top: 1px solid var(--line);
}


/* =========================================================
   Locked / Open Content Compatibility
   ========================================================= */

.locked-box {
  max-width: 760px;

  border: 1px solid rgba(56, 189, 248, 0.22);

  border-radius: var(--radius);

  padding: 24px;

  background:
    rgba(37, 99, 235, 0.06);
}


/* =========================================================
   Focus / Accessibility
   ========================================================= */

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--cyan);

  outline-offset: 3px;
}


/* =========================================================
   Scrollbar
   ========================================================= */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #050914;
}

::-webkit-scrollbar-thumb {
  border-radius: 999px;

  background:
    linear-gradient(
      180deg,
      #2563eb,
      #38bdf8
    );

  border: 2px solid #050914;
}


/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 780px) {

  html {
    scroll-padding-top: 150px;
  }

  #foundation,
  #advanced,
  #projects,
  #code-library,
  [id^="foundation"],
  [id^="advanced"],
  [id^="projects"],
  [id^="code-library"] {
    scroll-margin-top: 150px;
  }

  .topbar {
    align-items: flex-start;

    flex-direction: column;

    gap: 12px;

    padding-top: 13px;
    padding-bottom: 13px;
  }

  .nav {
    width: 100%;

    overflow-x: auto;

    flex-wrap: nowrap;

    padding-bottom: 2px;
  }

  .nav a {
    white-space: nowrap;
  }

  .page {
    width: min(100% - 28px, 1040px);

    padding-top: 42px;
  }

  h1 {
    font-size: clamp(2.35rem, 13vw, 4rem);
  }

  .grid,
  .meta-list {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 20px;
  }

  .pager {
    flex-direction: column;
  }

  .pager .button {
    width: 100%;
  }

  .progress-header {
    align-items: flex-start;

    flex-direction: column;
  }

  .progress-count {
    white-space: normal;
  }

  .progress-actions {
    flex-direction: column;
  }

  .progress-actions .button {
    width: 100%;
  }
}


@media (max-width: 480px) {

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .page {
    width: min(100% - 22px, 1040px);

    padding-top: 34px;
    padding-bottom: 56px;
  }

  .eyebrow {
    font-size: 0.70rem;
  }

  .lede {
    font-size: 1rem;
  }

  .progress-card {
    padding: 17px;
  }

  .progress-title {
    font-size: 0.95rem;
  }

  pre {
    padding: 14px;

    font-size: 0.82rem;
  }
}