/* ─── nav.css — Top navigation + page layout ─────────────────────────────── */

/* ─── Page Shell ─────────────────────────────────────────────────────────── */

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#page-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ─── Top Nav ────────────────────────────────────────────────────────────── */

#top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 var(--space-8);
  gap: var(--space-6);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  flex-shrink: 0;
}

.nav-brand-icon {
  width: 32px;
  height: 32px;
  background: var(--color-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.nav-brand-name {
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--color-text);
}

/* Level nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex: 1;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
}

.nav-link:hover {
  background: var(--color-surface-alt);
  color: var(--color-text);
}

.nav-link.active {
  background: var(--color-primary-subtle);
  color: var(--color-primary);
  font-weight: 600;
}

.nav-link.coming-soon {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

.nav-link .level-badge {
  font-size: var(--text-xs);
  background: var(--color-surface-alt);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-weight: 700;
  line-height: 1.5;
}

.nav-link.active .level-badge {
  background: var(--color-primary);
  color: white;
}

/* Nav right side */
.nav-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.nav-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--color-text-muted);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
  border: none;
  background: none;
}

.nav-icon-btn:hover {
  background: var(--color-surface-alt);
  color: var(--color-text);
}

/* ─── Page Content ───────────────────────────────────────────────────────── */

.page-content {
  flex: 1;
  padding: var(--space-10) var(--space-8);
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

.page-content.wide {
  max-width: 1400px;
}

.page-content.narrow {
  max-width: 680px;
}

/* ─── Page Header ────────────────────────────────────────────────────────── */

.page-header {
  margin-bottom: var(--space-8);
}

.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.page-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

.page-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.page-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* ─── Breadcrumb ─────────────────────────────────────────────────────────── */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumb a:hover { color: var(--color-primary); }

.breadcrumb-sep { color: var(--color-text-faint); }

.breadcrumb-current {
  color: var(--color-text);
  font-weight: 500;
}

/* ─── Landing Page ───────────────────────────────────────────────────────── */

.landing-hero {
  text-align: center;
  padding: var(--space-12) var(--space-8) var(--space-10);
}

.landing-hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: var(--space-4);
}

.landing-hero h1 em {
  font-style: normal;
  color: var(--color-primary);
  font-family: var(--font-serif);
}

.landing-hero p {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 520px;
  margin: 0 auto var(--space-8);
  line-height: 1.6;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-4);
  max-width: 900px;
  margin: 0 auto;
}

.level-card {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  text-align: center;
  text-decoration: none;
  transition: box-shadow var(--transition-base), transform var(--transition-base),
              border-color var(--transition-base);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  position: relative;
  overflow: hidden;
}

.level-card.active {
  border-color: var(--color-primary);
  cursor: pointer;
}

.level-card.active:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.level-card.inactive {
  opacity: 0.55;
  cursor: default;
}

.level-tag {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--color-text);
  line-height: 1;
}

.level-card.active .level-tag { color: var(--color-primary); }

.level-name {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: 500;
}

.level-desc {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  line-height: 1.5;
}

.level-coming-soon {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-faint);
  background: var(--color-surface-alt);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.level-ready {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-correct);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ─── Feature cards on C1 hub ────────────────────────────────────────────── */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-4);
}

.feature-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
  padding: var(--space-6) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  text-decoration: none;
  color: var(--color-text);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.feature-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.feature-card-icon {
  font-size: 36px;
  line-height: 1;
}

.feature-card-title {
  font-weight: 700;
  font-size: var(--text-base);
}

.feature-card-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* ─── Toast (global) ─────────────────────────────────────────────────────── */

#toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: 9999;
  pointer-events: none;
}

.toast {
  background: var(--color-text);
  color: white;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.3s ease forwards;
  pointer-events: auto;
  max-width: 320px;
}

.toast.success { background: var(--color-correct); }
.toast.error   { background: var(--color-wrong); }
.toast.warning { background: var(--color-close); }

.toast.toast-out {
  animation: toast-out 0.3s ease forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(12px); }
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 700px) {
  #top-nav { padding: 0 var(--space-4); gap: var(--space-3); }
  .nav-brand-name { display: none; }
  .page-content { padding: var(--space-6) var(--space-4); }
  .landing-hero { padding: var(--space-8) var(--space-4) var(--space-6); }
}
