:root {
  color-scheme: dark;

  --bg: #070a0f;
  --panel: rgba(15, 21, 31, .84);
  --panel-strong: rgba(18, 25, 38, .96);
  --line: rgba(255,255,255,.1);

  --text: #f3f6fb;
  --muted: #98a4b7;

  --blue: #31a8ff;
  --red: #ff455d;

  --radius: 18px;
  --shadow: 0 24px 70px rgba(0,0,0,.32);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(
      circle at 20% 10%,
      rgba(49,168,255,.11),
      transparent 28%
    ),
    radial-gradient(
      circle at 80% 25%,
      rgba(255,69,93,.09),
      transparent 30%
    ),
    #070a0f;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.background-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .18;
  background-image:
    linear-gradient(
      rgba(255,255,255,.035) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(255,255,255,.035) 1px,
      transparent 1px
    );
  background-size: 46px 46px;
  mask-image:
    linear-gradient(
      to bottom,
      black,
      transparent 85%
    );
}

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

  min-height: 72px;
  padding: 0 5vw;

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

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

  background:
    rgba(7,10,15,.84);

  backdrop-filter: blur(18px);
}

.brand {
  color: inherit;
  text-decoration: none;

  display: flex;
  align-items: center;
  gap: 12px;
}

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

  display: grid;
  place-items: center;

  border:
    1px solid rgba(255,255,255,.16);

  border-radius: 12px;

  background:
    linear-gradient(
      135deg,
      rgba(255,69,93,.9),
      rgba(49,168,255,.9)
    );

  color: white;
  font-weight: 900;
  letter-spacing: -.04em;

  box-shadow:
    0 0 28px rgba(49,168,255,.14);
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  letter-spacing: .08em;
  font-size: .92rem;
}

.brand-copy small {
  color: var(--muted);
  font-size: .72rem;
}

.account-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.account-identity {
  color: var(--muted);
  font-size: .82rem;
}

.page-shell {
  width: min(1380px, 92vw);
  margin: 0 auto;
  padding: 70px 0 90px;
}

.hero {
  max-width: 900px;
  padding: 48px 0 72px;
}

.eyebrow,
.section-kicker {
  color: var(--blue);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .17em;
}

.hero h1 {
  margin: 16px 0 20px;
  font-size:
    clamp(2.8rem, 6vw, 5.7rem);
  line-height: .96;
  letter-spacing: -.055em;
}

.hero h1 span {
  display: block;
  color: var(--muted);
}

.hero p {
  max-width: 720px;
  margin: 0;
  color: #b1bbca;
  line-height: 1.7;
  font-size: 1.05rem;
}

.hero-actions {
  margin-top: 30px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.button {
  min-height: 42px;
  padding: 0 18px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

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

  text-decoration: none;
  cursor: pointer;

  font: inherit;
  font-size: .82rem;
  font-weight: 800;

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

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

.button.primary {
  color: white;

  background:
    linear-gradient(
      110deg,
      #cf3048,
      #147dc7
    );

  box-shadow:
    0 12px 34px rgba(18,107,177,.18);
}

.button.secondary {
  color: var(--text);

  background:
    rgba(255,255,255,.045);

  border-color:
    rgba(255,255,255,.11);
}

.button.disabled {
  color: #6f7a8c;
  background: rgba(255,255,255,.025);
  border-color: rgba(255,255,255,.06);
  cursor: default;
}

.section-block {
  margin-top: 54px;
}

.section-heading {
  margin-bottom: 18px;

  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
}

.section-heading h2 {
  margin: 6px 0 0;
  font-size: 1.65rem;
}

.section-note {
  color: var(--muted);
  font-size: .8rem;
}

.module-grid {
  display: grid;

  grid-template-columns:
    repeat(
      auto-fit,
      minmax(280px, 1fr)
    );

  gap: 16px;
}

.module-card,
.continue-card,
.stat-card,
.activity-card,
.dashboard-card,
.loading-card {
  border:
    1px solid rgba(255,255,255,.09);

  border-radius: var(--radius);

  background:
    linear-gradient(
      155deg,
      rgba(20,28,41,.93),
      rgba(10,15,23,.9)
    );

  box-shadow: var(--shadow);
}

.module-card {
  min-height: 280px;
  padding: 24px;

  display: flex;
  flex-direction: column;

  transition:
    transform .2s ease,
    border-color .2s ease;
}

.module-card:hover {
  transform: translateY(-3px);

  border-color:
    rgba(49,168,255,.3);
}

.module-card::before {
  content: "";
  width: 54px;
  height: 3px;
  margin-bottom: 24px;

  border-radius: 99px;

  background:
    linear-gradient(
      to right,
      var(--red),
      var(--blue)
    );
}

.module-card h3 {
  margin: 0;
  font-size: 1.35rem;
}

.module-status {
  margin-top: 6px;
  color: var(--muted);
  font-size: .76rem;
}

.progress-row {
  margin: 25px 0 8px;

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

.progress-row strong {
  font-size: 1.9rem;
}

.progress-track {
  width: 100%;
  height: 7px;
  overflow: hidden;

  border-radius: 999px;
  background: rgba(255,255,255,.065);
}

.progress-fill {
  height: 100%;

  background:
    linear-gradient(
      to right,
      var(--red),
      var(--blue)
    );
}

.metric-list {
  margin: 22px 0;

  display: grid;
  gap: 8px;
}

.metric {
  display: flex;
  justify-content: space-between;
  gap: 12px;

  color: var(--muted);
  font-size: .78rem;
}

.metric strong {
  color: #dce4ef;
}

.module-card .button {
  margin-top: auto;
}

.continue-card {
  padding: 26px;

  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
}

.continue-card h3 {
  margin: 4px 0 8px;
}

.continue-card p {
  margin: 0;
  color: var(--muted);
}

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

.stat-card {
  padding: 22px;
}

.stat-card span {
  color: var(--muted);
  font-size: .78rem;
}

.stat-card strong {
  display: block;
  margin-top: 9px;

  font-size: 1.75rem;
}

.activity-card {
  padding: 24px;

  display: grid;
  grid-template-columns:
    1fr 1fr;
  gap: 20px;
}

.activity-label {
  display: block;
  margin-bottom: 7px;

  color: var(--muted);
  font-size: .76rem;
}

.dashboard-links {
  margin-top: 54px;

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

  gap: 16px;
}

.dashboard-card {
  padding: 28px;
}

.dashboard-card h3 {
  margin: 8px 0;
}

.dashboard-card p {
  min-height: 46px;

  color: var(--muted);
  line-height: 1.55;
}

.loading-card {
  padding: 28px;
  color: var(--muted);
}

footer {
  min-height: 90px;
  padding: 0 5vw;

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

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

  color: #687386;
  font-size: .72rem;
}

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

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

@media (max-width: 650px) {
  .topbar {
    padding: 12px 4vw;
  }

  .brand-copy small,
  .account-identity {
    display: none;
  }

  .page-shell {
    width: 92vw;
    padding-top: 40px;
  }

  .hero {
    padding-top: 25px;
  }

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

  .continue-card,
  .activity-card {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  footer {
    flex-direction: column;
    justify-content: center;
    gap: 6px;
  }
}


/* =========================================================
   HEADER POLISH
   ========================================================= */

.topbar {
  min-height: 76px;
}

.account-name {
  min-height: 34px;
  padding: 0 12px;

  display: inline-flex;
  align-items: center;

  border:
    1px solid rgba(
      255,
      255,
      255,
      .07
    );

  border-radius: 999px;

  color: #aeb9c9;

  background:
    rgba(
      255,
      255,
      255,
      .025
    );

  white-space: nowrap;
}

.button[hidden],
a[hidden],
button[hidden] {
  display: none !important;
}


/* Make authentication controls read as
   part of the site instead of separate UI */

#signInBtn,
#signOutBtn {
  min-width: 96px;
}

#signInBtn {
  color: #fff;

  border:
    1px solid rgba(
      49,
      168,
      255,
      .30
    );

  background:
    linear-gradient(
      110deg,
      rgba(
        207,
        48,
        72,
        .88
      ),
      rgba(
        20,
        125,
        199,
        .88
      )
    );
}

#signOutBtn {
  color: #d9e1eb;

  border:
    1px solid rgba(
      255,
      255,
      255,
      .11
    );

  background:
    rgba(
      255,
      255,
      255,
      .035
    );
}


/* =========================================================
   BRAND
   ========================================================= */

.brand-mark {
  position: relative;

  overflow: hidden;

  box-shadow:
    0 8px 26px
    rgba(
      0,
      0,
      0,
      .32
    );
}

.brand-mark::after {
  content: "";

  position: absolute;

  inset: 1px;

  border-radius: 10px;

  border:
    1px solid rgba(
      255,
      255,
      255,
      .12
    );

  pointer-events: none;
}

.brand-copy strong {
  letter-spacing: .10em;
}

.brand-copy small {
  color: #778397;
}


/* =========================================================
   MAIN PAGE POLISH
   ========================================================= */

.page-shell {
  position: relative;
}

.content-section {
  position: relative;
}

.section-heading {
  padding-bottom: 4px;
}

.section-heading h2 {
  letter-spacing: -.025em;
}


/* Module cards */

.module-card,
.study-center-card {
  position: relative;

  overflow: hidden;

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

.module-card::before,
.study-center-card::before {
  content: "";

  position: absolute;

  left: 0;
  top: 0;
  bottom: 0;

  width: 2px;

  background:
    linear-gradient(
      to bottom,
      #ff455d,
      #31a8ff
    );

  opacity: .55;
}

.module-card:hover,
.study-center-card:hover {
  transform:
    translateY(-2px);

  border-color:
    rgba(
      49,
      168,
      255,
      .20
    );

  box-shadow:
    0 28px 75px
    rgba(
      0,
      0,
      0,
      .36
    );
}


/* Cleaner footer */

footer {
  background:
    rgba(
      5,
      8,
      13,
      .58
    );
}


/* =========================================================
   MOBILE HEADER
   ========================================================= */

@media (max-width: 650px) {

  .topbar {
    min-height: 66px;

    gap: 10px;
  }

  .topnav {
    gap: 7px;
  }

  .account-name {
    display: none;
  }

  #signInBtn,
  #signOutBtn {
    min-width: auto;

    padding:
      0 14px;
  }

}


/* =========================================================
   DASHBOARD NAVIGATION
   ========================================================= */

a[href="/learner/"],
a[href="/supervisor/"] {
  position: relative;

  padding-right: 38px;
}

a[href="/learner/"]::after,
a[href="/supervisor/"]::after {
  content: "→";

  position: absolute;
  right: 16px;

  opacity: .68;

  transition:
    transform .16s ease,
    opacity .16s ease;
}

a[href="/learner/"]:hover::after,
a[href="/supervisor/"]:hover::after {
  transform:
    translateX(3px);

  opacity: 1;
}


/* =========================================================
   ADHOC-CODEX SYMBOL
   ========================================================= */

.brand-mark {
  width: 50px !important;
  height: 50px !important;

  flex:
    0 0 50px;

  padding: 0 !important;

  display: grid;
  place-items: center;

  overflow: visible !important;

  border: 0 !important;
  border-radius: 0 !important;

  background:
    transparent !important;

  box-shadow:
    none !important;
}

.brand-mark::after {
  content:
    none !important;

  display:
    none !important;
}

.brand-mark img {
  width: 100%;
  height: 100%;

  display: block;

  object-fit:
    contain;

  filter:
    drop-shadow(
      0 4px 10px
      rgba(0,0,0,.45)
    );
}

@media (max-width: 650px) {

  .brand-mark {
    width: 43px !important;
    height: 43px !important;

    flex-basis:
      43px;
  }

}
