@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900;1000&family=Inter:wght@400;600;700;800&family=JetBrains+Mono:wght@400;700&display=swap');

/* Hide scrollbar globally but keep scroll functionality */
* {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}
*::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

/* ─── Design Tokens & CSS Variables ────────────────────────────────────── */
:root {
  /* Landing Page Palette */
  --lp-blue:        #0076a9;
  --lp-blue-d:      #00547d;
  --lp-blue-light:  #cfe9f7;
  --lp-black:       #0a0a0a;
  --lp-white:       #ffffff;
  --lp-gray:        #f4f4f4;
  --lp-gray-mid:    #e0e0e0;
  --lp-gray-txt:    #666666;
  --lp-red:         #e83232;

  /* Backgrounds & Surfaces */
  --background:         #eef6fc;
  --background-end:     #cfe9f7;
  --foreground:         var(--lp-black);
  --card:               var(--lp-white);
  --card-foreground:    var(--lp-black);
  --popover:            var(--lp-white);
  --popover-foreground: var(--lp-black);

  --color-bg:           #eef6fc;
  --color-surface:      var(--lp-white);
  --color-surface-2:    #e9f2f7;
  --color-border:       #b6d5e8;
  --color-ink:          var(--lp-black);
  --color-ink-2:        #333333;
  --color-ink-3:        var(--lp-gray-txt);
  --color-ink-4:        #999999;

  /* Primary Accent */
  --primary:            var(--lp-blue);
  --color-primary:      var(--lp-blue);
  --primary-shade:      var(--lp-blue-d);
  --primary-foreground: var(--lp-white);

  /* Secondary Accent */
  --secondary:          var(--lp-blue-light);
  --secondary-shade:    #a3d2ee;
  --secondary-foreground: var(--lp-blue-d);

  /* Gamification Accents */
  --accent-orange:      #9ecce0;
  --accent-orange-shade:#6db0cf;
  --accent-yellow:      #eef6fc;
  --accent-yellow-shade:#cfe9f7;
  --accent-green:       #0076a9;
  --accent-green-shade: #00547d;
  --accent-red:         #003d5c;
  --accent-red-shade:   #002941;
  --accent-purple:      #7F6500;

  /* Muted / UI Chrome */
  --muted:              #edf2f6;
  --muted-foreground:   var(--lp-gray-txt);
  --accent:             var(--lp-blue-light);
  --accent-foreground:  var(--lp-blue-d);
  --destructive:        var(--lp-red);
  --destructive-foreground: var(--lp-white);
  --border:             var(--lp-gray-mid);
  --input:              var(--lp-gray-mid);
  --ring:               var(--lp-blue);

  /* Radius */
  --radius:        14px;
  --radius-card:   18px;
  --radius-btn:    12px;
  --radius-input:  10px;
  --radius-badge:  8px;

  /* Typography */
  --font-display: 'Nunito', sans-serif;
  --font-ui:      'Nunito', sans-serif;
  --font-code:    'JetBrains Mono', monospace;

  /* Animations */
  --duration-fast: 0.12s;
  --duration-base: 0.22s;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --nav-w:    260px;
  --bottom-h: 72px;
}

/* ─── Base Reset ────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  background: 
    radial-gradient(rgba(27, 88, 122, 0.15) 1.5px, transparent 1.5px),
    linear-gradient(135deg, #eef6fc 0%, #cfe9f7 30%, #9ecce0 60%, #348ebe 85%, #0076a9 100%) fixed;
  background-size: 24px 24px, auto;
  min-height: 100vh;
  color: var(--color-ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

body::-webkit-scrollbar {
  display: none;
}

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

/* Helper styles for quick layout elements */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mb-2 { margin-bottom: 8px; }
.w-full { width: 100%; }

/* ─── Layout Shell ──────────────────────────────────────────────────────── */
.portal-shell {
  display: flex;
  min-height: 100dvh;
  background: transparent;
}

.portal-main {
  flex: 1;
  min-height: 100dvh;
  padding: 16px 16px calc(var(--bottom-h) + 24px); /* space for mobile bottom nav */
}

@media (min-width: 1024px) {
  .portal-main {
    margin-left: calc(var(--nav-w) + 32px); /* space for desktop sidebar */
    padding: 32px 40px 32px 16px;
  }
}

.fullscreen-scroll {
  position: fixed;
  inset: 0;
  background: #f5f5f0;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
}

/* ─── Sidebar Navigation (Desktop) ───────────────────────────────────────── */
.sidebar {
  display: none;
  flex-direction: column;
  width: var(--nav-w);
  min-height: calc(100dvh - 32px);
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: 24px;
  padding: 24px 16px;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 40;
  box-shadow: 0 4px 0 var(--color-border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 20px;
  border-bottom: 2px dashed var(--color-border);
  margin-bottom: 24px;
}

.logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--color-primary);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 16px;
  border-radius: 12px;
  flex-shrink: 0;
  border: 2.5px solid var(--primary-shade);
  box-shadow: 0 3px 0 var(--primary-shade);
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 18px;
  color: var(--color-ink);
  letter-spacing: -0.01em;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-ink-2);
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 2px solid transparent;
  transition: transform var(--duration-fast) var(--ease-out-expo),
              background var(--duration-fast) var(--ease-out-expo),
              border-color var(--duration-fast) var(--ease-out-expo);
}

.sidebar-item:hover {
  background: var(--color-surface-2);
  color: var(--color-ink);
  transform: translateX(4px);
}

.sidebar-item-active {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-primary);
  box-shadow: 0 4px 0 var(--color-border);
}

.sidebar-item-active:hover {
  background: var(--color-surface);
  transform: none;
}

/* ─── Bottom Navigation (Mobile) ─────────────────────────────────────────── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  height: 64px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 2px solid var(--color-border);
  border-radius: 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  z-index: 50;
  padding: 0 10px;
  align-items: center;
  justify-content: space-around;
}

.nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1;
  padding: 6px 0;
  border-radius: 12px;
  transition: background var(--duration-fast) var(--ease-out-expo),
              transform var(--duration-fast) var(--ease-out-back);
}

.nav-item:active {
  transform: scale(0.92);
}

.nav-indicator {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 4px;
  background: var(--color-primary);
  border-radius: 99px;
}

.icon-active  {
  color: var(--color-primary);
  transform: scale(1.1);
  transition: transform var(--duration-base) var(--ease-out-back);
}
.icon-idle    { color: var(--color-ink-3); }
.label-active { font-size: 10px; font-weight: 800; color: var(--color-primary); font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.03em; }
.label-idle   { font-size: 10px; font-weight: 600; color: var(--color-ink-3); font-family: var(--font-display); }

@media (max-width: 1023px) {
  .bottom-nav { display: flex; }
}
@media (min-width: 1024px) {
  .sidebar { display: flex; }
}

/* ─── Miro Dot Canvas ────────────────────────────────────────────────── */
.miro-canvas {
  background: 
    radial-gradient(rgba(27, 88, 122, 0.15) 1.5px, transparent 1.5px),
    linear-gradient(135deg, #eef6fc 0%, #cfe9f7 30%, #9ecce0 60%, #348ebe 85%, #0076a9 100%) fixed;
  background-size: 24px 24px, auto;
}

/* ─── 3D Chunky Buttons (Duolingo Style) ────────────────────────────────── */
.btn-3d {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: var(--radius-btn);
  border: 2px solid var(--btn-border, var(--color-ink));
  background: var(--btn-bg, var(--color-surface));
  color: var(--btn-color, var(--color-ink));
  box-shadow: 0 4px 0 var(--btn-shadow, var(--color-border));
  cursor: pointer;
  user-select: none;
  transition: transform var(--duration-fast) var(--ease-out-expo),
              box-shadow var(--duration-fast) var(--ease-out-expo);
}

.btn-3d:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--btn-shadow, var(--color-border));
}

.btn-3d:active {
  transform: translateY(4px);
  box-shadow: 0 0px 0 transparent;
}

.btn-3d-navy {
  --btn-bg: var(--lp-blue);
  --btn-border: var(--lp-blue-d);
  --btn-color: #FFFFFF;
  --btn-shadow: var(--lp-blue-d);
}

.btn-3d-dark {
  --btn-bg: var(--lp-black);
  --btn-border: #222222;
  --btn-color: #FFFFFF;
  --btn-shadow: #222222;
}

.btn-3d-orange {
  --btn-bg: var(--accent-orange);
  --btn-border: var(--accent-orange-shade);
  --btn-color: #FFFFFF;
  --btn-shadow: var(--accent-orange-shade);
}

.btn-3d-green {
  --btn-bg: var(--accent-green);
  --btn-border: var(--accent-green-shade);
  --btn-color: #FFFFFF;
  --btn-shadow: var(--accent-green-shade);
}

.btn-3d-yellow {
  --btn-bg: var(--accent-yellow);
  --btn-border: var(--accent-yellow-shade);
  --btn-color: var(--lp-black);
  --btn-shadow: var(--accent-yellow-shade);
}

.btn-3d-gray {
  --btn-bg: var(--color-surface-2);
  --btn-border: var(--color-border);
  --btn-color: var(--color-ink-2);
  --btn-shadow: var(--color-border);
}

.btn-3d svg, .btn-3d i {
  flex-shrink: 0;
}

/* ─── 3D Cards (Duolingo/Miro style) ────────────────────────────────────── */
.card-3d {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: 0 6px 0 var(--color-surface-2);
  transition: transform var(--duration-base) var(--ease-out-back),
              box-shadow var(--duration-base) var(--ease-out-back);
}

.card-3d:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 0 var(--color-surface-2);
}

/* ─── Dashboard Specifics ────────────────────────────────────────────────── */
.dashboard-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 16px 4px 40px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.greeting-section {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 32px;
  color: var(--color-ink);
  display: flex;
  flex-direction: column;
  gap: 24px;
  box-shadow: 0 8px 0 var(--color-surface-2);
  position: relative;
  overflow: hidden;
}

.greeting-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  z-index: 2;
}

.greeting-label {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

.greeting-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 6vw, 2.5rem);
  font-weight: 900;
  line-height: 1.1;
  color: var(--color-ink);
}

.greeting-title .name {
  color: var(--primary);
}

.greeting-subtext {
  font-size: 15px;
  color: var(--color-ink-2);
  max-width: 50ch;
  line-height: 1.6;
}

.stats-row {
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
  z-index: 2;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--color-surface-2);
  padding: 8px 16px;
  border-radius: 14px;
  border: 2px solid var(--color-border);
}

.stat-num {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  color: var(--color-ink);
}

.stat-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-ink-3);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Sections */
.section-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  color: var(--color-ink);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.see-all-link {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 900;
  color: var(--color-primary);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transition: color var(--duration-fast);
}

.see-all-link:hover {
  color: var(--primary-shade);
}

/* Weekly Challenge Card */
.challenge-card {
  background: var(--color-surface);
  border: 2.5px solid var(--accent-orange-shade);
  border-radius: var(--radius-card);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 8px 0 var(--accent-orange-shade);
  position: relative;
  overflow: hidden;
}

.challenge-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--lp-blue-light);
  color: var(--lp-blue-d);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 900;
  padding: 6px 12px;
  border-radius: 99px;
  width: fit-content;
  border: 1.5px solid #b6d5e8;
  text-transform: uppercase;
}

.challenge-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  color: var(--color-ink);
}

.challenge-desc {
  font-size: 14px;
  color: var(--color-ink-2);
  line-height: 1.6;
  max-width: 60ch;
}

/* Tracks Grid */
.tracks-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.track-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--color-surface);
  border: 2.5px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 20px;
  box-shadow: 0 6px 0 var(--color-border);
  transition: transform var(--duration-fast) var(--ease-out-back),
              box-shadow var(--duration-fast) var(--ease-out-back),
              border-color var(--duration-fast) var(--ease-out-back);
  position: relative;
}

.track-card:hover {
  transform: translateY(-4px);
  border-color: var(--track-color, var(--color-primary));
  box-shadow: 0 10px 0 var(--track-color, var(--color-primary));
}

.track-card:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--track-color, var(--color-primary));
}

.track-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--track-bg, var(--color-surface-2));
  flex-shrink: 0;
  border: 2px solid var(--color-border);
  font-size: 24px;
}

.track-card-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.track-card-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  color: var(--color-ink);
}

.track-card-modules {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--color-ink-3);
  text-transform: uppercase;
}

/* Competitions */
.comps-section {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: 0 6px 0 var(--color-surface-2);
}

.comps-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comp-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: 14px;
  padding: 14px 20px;
  box-shadow: 0 4px 0 var(--color-border);
  cursor: pointer;
  user-select: none;
  transition: transform var(--duration-fast) var(--ease-out-expo),
              box-shadow var(--duration-fast) var(--ease-out-expo),
              border-color var(--duration-fast) var(--ease-out-expo),
              background-color var(--duration-fast) var(--ease-out-expo);
}

.comp-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--color-border);
  border-color: var(--comp-color, var(--color-primary));
  background-color: var(--lp-gray);
}

.comp-item:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--color-border);
}

.comp-dot {
  width: 12px;
  height: 12px;
  border-radius: 99px;
  background: var(--comp-color, var(--color-primary));
  flex-shrink: 0;
  border: 2px solid var(--color-surface);
  box-shadow: 0 0 0 2px var(--comp-color, var(--color-primary));
}

.comp-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 900;
  color: var(--color-ink);
}

.comp-org {
  font-size: 12px;
  color: var(--color-ink-3);
  margin-top: 1px;
  font-weight: 600;
}

/* ─── Tracks Catalog Page Specifics ──────────────────────────────────────── */
.catalog-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px 4px 60px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.catalog-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.catalog-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 900;
  color: var(--color-ink);
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.catalog-subtitle {
  font-size: 16px;
  color: var(--color-ink-3);
  line-height: 1.6;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  position: relative;
}

.catalog-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  background: var(--color-surface);
  border: 2.5px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 24px;
  text-decoration: none;
  box-shadow: 0 6px 0 var(--color-border);
  transition: transform var(--duration-fast) var(--ease-out-back),
              box-shadow var(--duration-fast) var(--ease-out-back),
              border-color var(--duration-fast) var(--ease-out-back);
  position: relative;
  overflow: hidden;
}

.catalog-card:hover {
  transform: translateY(-6px) rotate(1deg);
  border-color: var(--c, var(--color-primary));
  box-shadow: 0 12px 0 var(--c, var(--color-primary));
}

.catalog-card:active {
  transform: translateY(4px) rotate(0deg);
  box-shadow: 0 0px 0 transparent;
}

.catalog-grid > div:nth-child(even) .catalog-card {
  transform: rotate(-0.5deg);
}
.catalog-grid > div:nth-child(even) .catalog-card:hover {
  transform: translateY(-6px) rotate(-1.5deg);
}

.catalog-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.catalog-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--cbg, var(--color-surface-2));
  border: 2px solid var(--color-border);
  box-shadow: 0 4px 0 var(--color-border);
  transition: transform var(--duration-base) var(--ease-out-back);
  font-size: 28px;
}

.catalog-card:hover .catalog-card-icon {
  transform: scale(1.1) rotate(-5deg);
  border-color: var(--c, var(--color-primary));
  box-shadow: 0 4px 0 var(--c, var(--color-primary));
}

.catalog-card-badge {
  background: var(--color-surface-2);
  color: var(--color-ink-3);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 99px;
  border: 1.5px solid var(--color-border);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.catalog-card-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  color: var(--color-ink);
  line-height: 1.2;
}

.catalog-card-tagline {
  font-size: 14px;
  color: var(--color-ink-3);
  margin-top: 8px;
  margin-bottom: 24px;
  line-height: 1.5;
  flex-grow: 1;
}

.catalog-card-footer {
  border-top: 2px dashed var(--color-border);
  padding-top: 16px;
  margin-top: auto;
}

.progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-bar {
  width: 100%;
  height: 10px;
  background: var(--color-surface-2);
  border: 2px solid var(--color-border);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--c, var(--color-primary));
  border-radius: 99px;
  transition: width 0.4s var(--ease-out-expo);
}

.progress-text {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  color: var(--color-ink-2);
  text-transform: uppercase;
}

/* ─── Track Detail Page Specifics ───────────────────────────────────────── */
.detail-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 16px 4px 64px;
}

.detail-header {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  background: var(--cbg, var(--color-surface));
  border: 2.5px solid var(--c, var(--color-border));
  border-radius: var(--radius-card);
  padding: 28px;
  margin-bottom: 32px;
  box-shadow: 0 8px 0 var(--cbg, var(--color-surface-2));
}

.detail-header-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: var(--color-surface);
  border: 2.5px solid var(--c, var(--color-border));
  box-shadow: 0 4px 0 var(--color-border);
  flex-shrink: 0;
  font-size: 36px;
}

.detail-header-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.detail-header-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  font-weight: 900;
  color: var(--color-ink);
  line-height: 1.1;
}

.detail-header-tagline {
  font-size: 14px;
  color: var(--color-ink-2);
  max-width: 50ch;
  line-height: 1.5;
}

.detail-header-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.detail-header-bar {
  flex: 1;
  height: 10px;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: 99px;
  overflow: hidden;
  min-width: 100px;
}

.detail-header-fill {
  height: 100%;
  background: var(--c, var(--color-primary));
  border-radius: 99px;
  transition: width 0.5s var(--ease-out-expo);
}

.detail-header-pct {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 900;
  color: var(--color-ink-3);
  text-transform: uppercase;
  white-space: nowrap;
}

/* Modules Pathway */
.detail-modules {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
}

.detail-module-card {
  background: var(--color-surface);
  border: 2.5px solid var(--color-border);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: 0 6px 0 var(--color-surface-2);
}

.detail-module-header {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  background: var(--color-surface-2);
  border-bottom: 2px solid var(--color-border);
}

.detail-module-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  color: var(--color-ink);
}

.detail-module-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.detail-module-desc {
  font-size: 14.5px;
  color: var(--color-ink-2);
  line-height: 1.6;
}

.detail-resources-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.detail-resource-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.detail-resource-link:hover {
  text-decoration: underline;
}

.detail-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-ink-3);
  font-size: 16px;
  font-weight: 600;
  background: var(--color-surface);
  border-radius: var(--radius-card);
  border: 2.5px dashed var(--color-border);
}

.detail-video-wrap {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 12px;
  border: 2px solid var(--color-border);
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.detail-video {
  width: 100%;
  height: 100%;
  border: none;
}

/* Modal Overlay & Box */
.modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(10,10,10,0.85);
}
.modal-box {
  max-width: 800px; width: 100%; max-height: 85vh; overflow-y: auto;
  background: var(--color-surface);
  border: 3px solid var(--color-border);
  border-radius: 16px;
  box-shadow: 0 12px 0 var(--color-border);
  padding: 32px;
  position: relative;
}
.modal-box::-webkit-scrollbar {
  display: block;
  width: 8px;
}
.modal-box::-webkit-scrollbar-track {
  background: var(--color-surface-2);
}
.modal-box::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}
.modal-close {
  position: absolute; top: 16px; right: 20px;
  background: none; border: none; font-size: 32px; cursor: pointer;
  color: var(--color-ink); opacity: 0.5; transition: opacity 0.2s;
  line-height: 1;
}
.modal-close:hover { opacity: 1; }

.syllabus-level {
  margin-bottom: 28px;
}
.syllabus-level-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--c, var(--color-primary));
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 6px;
  margin-bottom: 16px;
}
.chapter-list {
  display: flex; flex-direction: column; gap: 16px;
}
.chapter-item {
  display: flex; gap: 16px; padding: 14px;
  border-radius: 12px; border: 2px solid var(--color-border);
  background: var(--color-surface-2);
  transition: transform 0.2s var(--ease-out-expo), background 0.2s;
}
.chapter-item:hover {
  background: var(--color-surface);
  transform: translateX(4px);
}
.chapter-num {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
  color: var(--c, var(--color-primary));
  opacity: 0.8;
  min-width: 24px;
}
.chapter-body {
  display: flex; flex-direction: column; gap: 4px;
}
.chapter-title {
  font-size: 14px; font-weight: 800; color: var(--color-ink);
}
.chapter-desc {
  font-size: 13px; color: var(--color-ink-2); line-height: 1.45;
}
.pustaka-list {
  list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px;
}
.pustaka-item a {
  font-size: 13px; color: var(--c, var(--color-primary)); text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px; font-weight: 700;
  transition: opacity 0.2s;
}
.pustaka-item a:hover {
  text-decoration: underline; opacity: 0.85;
}

@media (max-width: 640px) {
  .detail-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .detail-header-icon {
    margin: 0 auto;
  }
  .detail-header-progress {
    width: 100%;
  }
}

/* ─── Profile Page Specifics ────────────────────────────────────────────── */
.profile-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 16px 4px 64px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--color-surface);
  border: 2.5px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 28px;
  box-shadow: 0 8px 0 var(--color-surface-2);
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 99px;
  background: var(--accent-yellow);
  color: var(--color-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 900;
  flex-shrink: 0;
  border: 2.5px solid var(--accent-yellow-shade);
  box-shadow: 0 4px 0 var(--accent-yellow-shade);
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  color: var(--color-ink);
}

.profile-sub {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  color: var(--color-ink-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.profile-edit-btn {
  background: var(--color-surface-2);
  border: 2px solid var(--color-border);
  color: var(--color-ink-2);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 900;
  padding: 6px 14px;
  border-radius: 99px;
  cursor: pointer;
  text-transform: uppercase;
  box-shadow: 0 2px 0 var(--color-border);
  transition: transform var(--duration-fast);
}

.profile-edit-btn:hover {
  transform: translateY(-1px);
}
.profile-edit-btn:active {
  transform: translateY(2px);
  box-shadow: none;
}

.profile-edit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-name-input {
  background: var(--color-surface-2);
  border: 2.5px solid var(--color-border);
  color: var(--color-ink);
  border-radius: var(--radius-input);
  padding: 8px 16px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  outline: none;
}

.profile-save-btn {
  background: var(--primary);
  color: #fff;
  border: 2px solid var(--primary-shade);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 900;
  padding: 8px 16px;
  border-radius: 99px;
  cursor: pointer;
  text-transform: uppercase;
  box-shadow: 0 2px 0 var(--primary-shade);
}

.profile-cancel-btn {
  background: transparent;
  color: var(--color-ink-3);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  padding: 8px;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
}

/* Stats Dashboard on Profile */
.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.profile-stat-card {
  background: var(--color-surface);
  border: 2.5px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: 0 6px 0 var(--color-surface-2);
  text-align: center;
}

.profile-stat-value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 900;
  color: var(--primary);
}

.profile-stat-card:nth-child(2) .profile-stat-value {
  color: #6db0cf;
}

.profile-stat-card:nth-child(3) .profile-stat-value {
  color: #B25E00;
}

.profile-stat-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  color: var(--color-ink-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Tracks Rows */
.profile-track-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-track-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--color-surface);
  border: 2.5px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 16px 20px;
  box-shadow: 0 4px 0 var(--color-surface-2);
}

.profile-track-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--color-surface-2);
  border: 2px solid var(--color-border);
  flex-shrink: 0;
  font-size: 20px;
}

.profile-track-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.profile-track-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 900;
  color: var(--color-ink);
}

.profile-track-bar {
  height: 8px;
  background: var(--color-surface-2);
  border: 1.5px solid var(--color-border);
  border-radius: 99px;
  overflow: hidden;
}

.profile-track-fill {
  height: 100%;
  background: var(--c, var(--color-primary));
  border-radius: 99px;
  transition: width 0.5s var(--ease-out-expo);
}

.profile-track-pct {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 900;
  color: var(--color-ink-2);
  flex-shrink: 0;
  width: 44px;
  text-align: right;
}

/* Badges section */
.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}

.badge-card {
  border-radius: var(--radius-card);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  border: 2.5px solid var(--color-border);
  box-shadow: 0 6px 0 var(--color-surface-2);
}

.badge-unlocked {
  background: var(--color-surface);
  border-color: var(--accent-yellow-shade);
  box-shadow: 0 6px 0 var(--accent-yellow-shade);
}

.badge-locked {
  background: var(--color-surface);
  opacity: 0.6;
}

.badge-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 99px;
  background: var(--color-surface-2);
  border: 2px solid var(--color-border);
  font-size: 28px;
  transition: transform var(--duration-base) var(--ease-out-back);
}

.badge-unlocked .badge-icon {
  background: #FFFCE8;
  border-color: var(--accent-yellow-shade);
  box-shadow: 0 4px 0 var(--accent-yellow-shade);
  transform: scale(1.05);
}

.badge-card:hover .badge-icon {
  transform: scale(1.1) rotate(5deg);
}

.badge-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 900;
  color: var(--color-ink);
  margin-top: 4px;
}

.badge-desc {
  font-size: 11px;
  color: var(--color-ink-3);
  line-height: 1.4;
  font-weight: 600;
}

@media (max-width: 640px) {
  .profile-card {
    flex-direction: column;
    text-align: center;
  }
  .profile-name-row {
    justify-content: center;
  }
  .profile-stats-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── Creative IDE Specifics ────────────────────────────────────────────── */
.ide-container {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 32px);
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: 0 6px 0 var(--color-border);
}

.ide-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--color-surface);
  border-bottom: 2px solid var(--color-border);
  flex-shrink: 0;
}

.ide-tabs {
  display: flex;
  gap: 6px;
  background: var(--color-surface-2);
  padding: 4px;
  border-radius: 12px;
  border: 1.5px solid var(--color-border);
}

.ide-tab {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  background: none;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  color: var(--color-ink-2);
  cursor: pointer;
  transition: background var(--duration-fast), color var(--duration-fast);
}

.ide-tab:hover {
  color: var(--color-ink);
}

.ide-tab-active {
  background: var(--color-surface) !important;
  color: var(--color-primary) !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.ide-actions {
  display: flex;
  gap: 10px;
}

.ide-workspace {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  flex: 1;
  overflow: hidden;
  background-color: var(--color-bg);
  background-image: radial-gradient(var(--color-border) 1px, transparent 1px);
  background-size: 20px 20px;
  padding: 16px;
  gap: 16px;
}

.ide-workspace-maximized {
  grid-template-columns: 1fr !important;
}
.ide-workspace-maximized .ide-editor-pane {
  display: none !important;
}

.ide-editor-pane {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 2.5px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: 0 4px 0 var(--color-surface-2);
  overflow: hidden;
}

.ide-editor-header {
  padding: 12px 18px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 900;
  color: var(--color-ink-3);
  background: var(--color-surface);
  border-bottom: 2px dashed var(--color-border);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ide-editor {
  flex: 1;
  padding: 20px;
  font-family: var(--font-code);
  font-size: 14px;
  line-height: 1.6;
  background: #1E1E2E;
  color: #CDD6F4;
  border: none;
  resize: none;
  outline: none;
  width: 100%;
  tab-size: 2;
}

.ide-preview-pane {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 2.5px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: 0 4px 0 var(--color-surface-2);
  overflow: hidden;
}

.ide-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 900;
  color: var(--color-ink-3);
  background: var(--color-surface);
  border-bottom: 2px dashed var(--color-border);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ide-preview {
  flex: 1;
  border: none;
  width: 100%;
  background: #ffffff;
}

.ide-console {
  max-height: 140px;
  overflow-y: auto;
  background: #181825;
  border-top: 2.5px solid var(--color-border);
  padding: 12px 18px;
}

.ide-log-line {
  font-family: var(--font-code);
  font-size: 13px;
  color: #9ecce0;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .ide-container {
    height: auto;
    min-height: calc(100dvh - 32px);
  }
  .ide-workspace {
    grid-template-columns: 1fr;
    grid-template-rows: 400px 400px;
    overflow-y: auto;
  }
}

/* ─── Projects Specifics ────────────────────────────────────────────────── */
.projects-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px 4px 64px;
}

.projects-header {
  margin-bottom: 36px;
  text-align: center;
}

.projects-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 900;
  color: var(--color-ink);
  text-transform: uppercase;
}

.projects-subtitle {
  font-size: 15px;
  color: var(--color-ink-3);
  margin-top: 8px;
  max-width: 60ch;
  margin-left: auto;
  margin-right: auto;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.projects-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  text-decoration: none;
  min-height: 200px;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.02);
  transition: transform var(--duration-base) var(--ease-out-back),
              box-shadow var(--duration-base) var(--ease-out-back);
  position: relative;
  overflow: hidden;
}

.projects-grid > a:nth-child(4n+1) { background: #FFEB9C; border: 2.5px solid #E6D080; color: #7F6500; --c-accent: #7F6500; }
.projects-grid > a:nth-child(4n+2) { background: #D2F4FF; border: 2.5px solid #B0E4F5; color: #186885; --c-accent: #186885; }
.projects-grid > a:nth-child(4n+3) { background: #FFD2EB; border: 2.5px solid #F5B0D8; color: #8F185F; --c-accent: #8F185F; }
.projects-grid > a:nth-child(4n+4) { background: #D5FFD2; border: 2.5px solid #BAF0B5; color: #1B6E14; --c-accent: #1B6E14; }

.projects-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 14px;
  background: rgba(255, 255, 255, 0.4);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  z-index: 2;
}

.projects-grid > a:nth-child(odd) {
  transform: rotate(-1deg);
}
.projects-grid > a:nth-child(even) {
  transform: rotate(1deg);
}

.projects-card:hover {
  transform: translateY(-8px) scale(1.02) rotate(0.5deg) !important;
  box-shadow: 0 15px 24px rgba(0, 0, 0, 0.08), 0 4px 6px rgba(0, 0, 0, 0.04);
}

.projects-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.projects-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.5);
  border: 1.5px solid rgba(0, 0, 0, 0.05);
  font-size: 20px;
}

.projects-ext-icon {
  color: inherit;
  opacity: 0.6;
  margin-top: 4px;
  flex-shrink: 0;
  transition: opacity var(--duration-fast);
}

.projects-card:hover .projects-ext-icon {
  opacity: 1;
}

.projects-card-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  color: var(--color-ink);
  line-height: 1.2;
}

.projects-card-meta {
  font-size: 12px;
  opacity: 0.8;
  font-weight: 600;
}

.projects-card-track {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  margin-top: auto;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--c-accent);
}

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

/* ─── Reduced Motion ─────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
