/* QuantED Course — Shared Stylesheet
   Adapted layout/structure from the original training pages, retheme only. */

:root {
  --bg-primary:   #0D1B3E;
  --bg-surface:   #142248;
  --bg-elevated:  #1B2C56;
  --accent:       #2A52BE;
  --accent-muted: #3A6BC8;
  --text-primary: #F2F5FB;
  --text-secondary: #8FA8D6;
  --text-tertiary: #5D77A6;
  --border:       #263B72;
  --border-hover: #3A6BC8;
  --success:      #45D08A;
  --danger:       #EF6F63;
  --gold:         #F5C842;
  --font-pixel: 'Press Start 2P', monospace;
  --font-body:  'Space Grotesk', sans-serif;
  --font-mono:  'JetBrains Mono', monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.pixel-img {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

body {
  position: relative;
  overflow-x: hidden;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  flex: 1;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-body);
  font-weight: 700;
  margin-bottom: 1.5rem;
  margin-top: 2rem;
  line-height: 1.3;
}

h1 {
  font-size: 2.75rem;
  border-bottom: 3px solid var(--accent);
  padding-bottom: 0.5rem;
  display: inline-block;
}

h2 {
  font-size: 1.75rem;
  color: var(--text-primary);
}

h3 {
  font-size: 1.3rem;
  color: var(--text-primary);
}

h4, h5, h6 {
  font-size: 1rem;
  color: var(--text-primary);
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--accent-muted);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--gold);
}

/* Navigation */
nav {
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  font-family: var(--font-body);
  box-shadow: 0 2px 12px rgba(0,0,0,0.35);
  min-height: 80px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 1rem;
}

.nav-logo-img {
  height: 32px;
  width: auto;
  flex-shrink: 0;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.nav-name {
  font-family: var(--font-pixel);
  font-size: 11px;
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: 0.05em;
}

.nav-divider {
  color: var(--border);
  margin: 0 0.8rem;
}

.nav-section {
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 400;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  font-size: 1rem;
  flex-wrap: nowrap;
  align-items: center;
}

.nav-links a {
  color: var(--text-secondary);
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active { color: var(--accent-muted); }

/* Main container */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.page-header { margin-bottom: 3rem; }

.page-header h1 {
  font-size: 3.3rem;
  border: none;
  margin-bottom: 1rem;
  margin-top: 0;
  display: block;
}

.page-week {
  font-family: var(--font-pixel);
  color: var(--accent-muted);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.page-phase {
  font-family: var(--font-mono);
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.page-objective {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-style: italic;
}

/* IP Anchor */
.ip-anchor {
  background: linear-gradient(135deg, rgba(42,82,190,0.14) 0%, rgba(42,82,190,0.04) 100%);
  border: 1px solid rgba(42,82,190,0.35);
  border-left: 4px solid var(--accent-muted);
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ip-anchor-label {
  font-family: var(--font-pixel);
  color: var(--accent-muted);
  font-weight: 400;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.ip-anchor-section {
  font-family: var(--font-body);
  color: var(--text-primary);
  font-size: 1.15rem;
  font-weight: 700;
}

.ip-anchor-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Content sections */
.section { margin: 3.5rem 0; }

.section-title {
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--accent-muted);
  padding-left: 1rem;
  font-size: 1.4rem;
}

/* Cards and callouts */
.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2rem;
  margin: 2rem 0;
  transition: all 0.2s;
}

.card:hover {
  border-color: var(--accent-muted);
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
}

.callout {
  background-color: rgba(42,82,190,0.08);
  border-left: 4px solid var(--accent-muted);
  padding: 1.5rem;
  margin: 1.5rem 0;
  border-radius: 6px;
}

.callout-title {
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--accent-muted);
  margin-bottom: 0.5rem;
}

/* Code blocks */
pre {
  background-color: #081025;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  color: #D6E1F5;
  font-family: var(--font-mono);
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

pre code {
  color: inherit;
  font-size: inherit;
  background: none;
  padding: 0;
  border-radius: 0;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

thead {
  background-color: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

th {
  padding: 1.2rem 1rem;
  text-align: left;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.95rem;
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

tbody tr:hover { background-color: rgba(255,255,255,0.03); }

/* Lists */
ul, ol { margin: 1.5rem 0 1.5rem 2rem; }
li { margin-bottom: 0.5rem; }

/* Hero section (hub pages) */
.hero {
  text-align: center;
  padding: 4rem 2rem;
  margin-bottom: 3rem;
}

.hero-logo {
  max-width: 220px;
  height: auto;
  margin: 1rem auto 2rem auto;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.hero h1 {
  font-size: 3.3rem;
  border: none;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.3rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.hero-meta {
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

/* Grid layouts */
.grid { display: grid; gap: 2rem; margin: 2rem 0; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Phase cards */
.phase-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.phase-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-muted), transparent);
}

.phase-card:hover {
  border-color: var(--accent-muted);
  box-shadow: 0 8px 28px rgba(0,0,0,0.4);
  transform: translateY(-2px);
}

.phase-number {
  font-family: var(--font-pixel);
  color: var(--accent-muted);
  font-size: 0.6rem;
  text-transform: uppercase;
  font-weight: 400;
  letter-spacing: 0.1em;
  margin-bottom: 0.8rem;
}

.phase-title {
  font-family: var(--font-body);
  font-size: 1.35rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.phase-week {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* Week cards */
.week-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
  overflow: hidden;
}

.week-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent-muted);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.week-card:hover {
  border-color: var(--accent-muted);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  transform: translateY(-2px);
}

.week-card:hover::before { transform: scaleX(1); }

.week-number {
  font-family: var(--font-pixel);
  color: var(--accent-muted);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
  display: block;
}

.week-title {
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-weight: 600;
}

.week-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.tag {
  background-color: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.8rem;
  padding: 0.3rem 0.6rem;
  border-radius: 2px;
  border: 1px solid var(--border);
}

.week-shared {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-muted);
  background: rgba(42,82,190,0.1);
  border: 1px solid rgba(42,82,190,0.3);
  padding: 0.2rem 0.55rem;
  border-radius: 2px;
  margin-top: 0.6rem;
}

.mentor-line {
  font-family: var(--font-mono);
  color: var(--accent-muted);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.mentor-line::before {
  content: '';
  display: block;
  width: 22px;
  height: 1px;
  background: var(--accent-muted);
  flex-shrink: 0;
}

/* Outcomes section */
.outcomes-list { display: grid; gap: 1rem; margin: 2rem 0; }

.outcome-item {
  background-color: var(--bg-surface);
  border-left: 3px solid var(--success);
  padding: 1.5rem;
  border-radius: 4px;
}

.outcome-item::before {
  content: '✓';
  color: var(--success);
  font-weight: 700;
  margin-right: 0.8rem;
}

/* Comparison table */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--bg-surface);
  border-radius: 4px;
  overflow: hidden;
  margin: 2rem 0;
}
.comparison-table th { background-color: var(--bg-elevated); border: none; padding: 1rem; }
.comparison-table td { border: 1px solid var(--border); padding: 1rem; }

/* Charts container */
.chart-container {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2rem;
  margin: 2rem 0;
  position: relative;
  height: 400px;
}

/* Common mistakes section */
.mistakes-list {
  background-color: var(--bg-elevated);
  border-left: 4px solid var(--danger);
  padding: 2rem;
  margin: 2rem 0;
  border-radius: 4px;
}
.mistakes-list h4 { color: var(--danger); margin-top: 0; margin-bottom: 1rem; }
.mistakes-list ul { margin-left: 1.5rem; }
.mistakes-list li { color: var(--text-secondary); }

/* Checklist / setup callouts (course-specific pages) */
.checklist-section {
  background: rgba(42,82,190,0.06);
  border-left: 4px solid var(--accent-muted);
  padding: 2rem;
  margin: 2rem 0;
  border-radius: 6px;
}
.checklist-section h3 {
  color: var(--accent-muted);
  font-size: 1.1rem;
  margin-top: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.checklist-section p { color: var(--text-secondary); font-weight: 500; }
.checklist-items { list-style: none; padding: 0; margin: 1.5rem 0; }
.checklist-items li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
  font-weight: 500;
}
.checklist-items li:last-child { border-bottom: none; }
.checklist-items li::before {
  content: "✓";
  color: var(--accent-muted);
  font-weight: 700;
  margin-right: 1rem;
  font-size: 1.1rem;
}
.welcome-box {
  background: linear-gradient(135deg, rgba(42,82,190,0.12) 0%, rgba(42,82,190,0.04) 100%);
  border: 1px solid rgba(42,82,190,0.3);
  border-radius: 8px;
  padding: 2rem;
  margin: 2rem 0;
}
.welcome-box p { margin: 1rem 0; line-height: 1.8; color: var(--text-secondary); font-weight: 500; }
.timeline-badge {
  display: inline-block;
  background: var(--accent-muted);
  color: var(--bg-primary);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* Data-pipeline style flow diagrams */
.flow-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2rem;
  margin: 2rem 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  overflow-x: auto;
  white-space: pre;
  color: var(--text-secondary);
  line-height: 1.85;
}
.flow-box .hl  { color: var(--text-primary); font-weight: 700; }
.flow-box .acc { color: var(--accent-muted); }
.repo-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--accent-muted);
  background: rgba(42,82,190,0.1);
  border: 1px solid rgba(42,82,190,0.3);
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
}

/* Navigation between weeks */
.week-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.week-nav-button {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s;
}
.week-nav-button:hover { border-color: var(--accent-muted); color: var(--accent-muted); }
.week-nav-disabled { opacity: 0.3; cursor: not-allowed; }
.week-nav-disabled:hover { border-color: var(--border); color: var(--text-secondary); }

/* Footer */
footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 2.5rem 2rem;
  text-align: center;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  margin-top: 4rem;
}
footer a { color: var(--text-secondary); }
footer a:hover { color: var(--gold); }

/* MathJax styling */
.mjx-container { text-align: center; margin: 1.5rem 0; }
.mjx-container, .mjx-container * { color: var(--text-primary) !important; }

/* Responsive */
@media (max-width: 768px) {
  .container { padding: 2rem 1rem; }
  h1 { font-size: 1.98rem; }
  h2 { font-size: 1.4rem; }
  nav { flex-direction: column; gap: 1rem; padding: 1rem; }
  .nav-links { flex-wrap: wrap; justify-content: center; gap: 1rem; }
  .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .week-nav { flex-direction: column; gap: 1rem; }
  .week-nav-button { width: 100%; text-align: center; }
}

/* ── Week page hero (shared across all week pages) ──────────── */
.week-hero {
  position: relative;
  overflow: hidden;
  background: #081025;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 3.8rem 0 3.2rem;
  margin-bottom: 0;
}
.week-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--accent-muted);
  z-index: 2;
}
.week-hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 10px;
  background: linear-gradient(
    to bottom,
    var(--accent-muted) 0px, var(--accent-muted) 1px,
    var(--bg-primary) 1px, var(--bg-primary) 9px,
    #000000 9px, #000000 10px
  );
  z-index: 2;
}
.week-hero-canvas { position: absolute; inset: 0; display: block; z-index: 0; }
.week-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 0 2rem;
}
.week-hero-badge {
  font-family: var(--font-pixel);
  color: var(--accent-muted);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.week-hero-badge::before {
  content: '';
  display: block;
  width: 28px;
  height: 1px;
  background: var(--accent-muted);
  flex-shrink: 0;
}
.week-hero h1 {
  font-size: 3.6rem;
  color: var(--text-primary);
  border: none;
  margin: 0 0 1.4rem;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
  display: block;
}
.week-hero-pill {
  display: inline-flex;
  align-items: center;
  background: rgba(42,82,190,0.14);
  border: 1px solid rgba(42,82,190,0.4);
  color: var(--accent-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 0.38rem 0.9rem;
  border-radius: 2px;
  margin-bottom: 1.4rem;
}
.week-hero-objective {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.7;
  margin: 0;
  font-style: italic;
}
@media (max-width: 768px) {
  .week-hero { padding: 2.8rem 0 2.4rem; }
  .week-hero h1 { font-size: 2.3rem; }
}

/* Print styles */
@media print {
  nav, footer, .week-nav { display: none; }
  body { background-color: white; color: black; }
}
