/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  line-height: 1.7;
  min-height: 100vh;
}
a { color: #38bdf8; text-decoration: none; transition: color .2s; }
a:hover { color: #7dd3fc; }
img, svg { max-width: 100%; display: block; }
code, pre {
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  background: #1e293b;
  border-radius: 6px;
}
code { padding: 2px 6px; font-size: .9em; color: #7dd3fc; }
pre {
  padding: 1.2rem;
  overflow-x: auto;
  border: 1px solid #334155;
  margin: 1rem 0;
  font-size: .88rem;
  line-height: 1.6;
  position: relative;
}
pre .lang-label {
  position: absolute; top: 0; right: 0;
  background: #334155; color: #94a3b8;
  padding: 2px 10px; font-size: .75rem;
  border-radius: 0 6px 0 6px;
}

/* ===== LAYOUT ===== */
.container { max-width: 960px; margin: 0 auto; padding: 2rem 1.5rem; }

/* ===== NAVBAR ===== */
.navbar {
  background: #1e293b;
  border-bottom: 1px solid #334155;
  padding: .8rem 1.5rem;
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 1rem;
  backdrop-filter: blur(12px);
}
.navbar a { color: #94a3b8; font-size: .9rem; }
.navbar a:hover, .navbar a.active { color: #38bdf8; }
.navbar .brand { color: #f1f5f9; font-weight: 700; font-size: 1.1rem; margin-right: auto; }

/* ===== HERO (INDEX) ===== */
.hero {
  text-align: center;
  padding: 4rem 1rem 2rem;
}
.hero h1 {
  font-size: 2.4rem;
  background: linear-gradient(135deg, #38bdf8, #818cf8, #c084fc);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: .5rem;
}
.hero .subtitle { color: #94a3b8; font-size: 1.15rem; margin-bottom: 2rem; }

/* ===== PHASE CARDS ===== */
.phase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}
.phase-card {
  background: linear-gradient(145deg, #1e293b, #0f172a);
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 1.5rem;
  transition: transform .2s, border-color .2s;
}
.phase-card:hover {
  transform: translateY(-4px);
  border-color: #38bdf8;
}
.phase-card .fase-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  margin-bottom: .6rem;
}
.fase-1 .fase-tag { background: #164e63; color: #67e8f9; }
.fase-2 .fase-tag { background: #365314; color: #a3e635; }
.fase-3 .fase-tag { background: #4a1d96; color: #c4b5fd; }
.fase-4 .fase-tag { background: #92400e; color: #fbbf24; }
.fase-5 .fase-tag { background: #9f1239; color: #fda4af; }
.phase-card h3 { font-size: 1.1rem; margin-bottom: .4rem; }
.phase-card p { color: #94a3b8; font-size: .9rem; }
.phase-card .week-link {
  display: inline-block;
  margin-top: .8rem;
  padding: 6px 16px;
  border: 1px solid #475569;
  border-radius: 8px;
  font-size: .85rem;
  transition: background .2s;
}
.phase-card .week-link:hover { background: #1e293b; }

/* ===== WEEK PAGE ===== */
.week-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #334155;
}
.week-header .tag {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  margin-bottom: .8rem;
}
.week-header h1 { font-size: 1.8rem; margin-bottom: .3rem; }
.week-header .desc { color: #94a3b8; }

/* ===== STEP SECTIONS ===== */
.step {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 1.5rem 1.5rem 1.2rem;
  margin-bottom: 1.5rem;
  position: relative;
}
.step::before {
  content: attr(data-step);
  position: absolute; top: -12px; left: 20px;
  background: #38bdf8; color: #0f172a;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-weight: 700; font-size: .85rem;
}
.step h2 { font-size: 1.15rem; margin-bottom: .6rem; padding-left: .2rem; }
.step h3 { font-size: 1rem; color: #7dd3fc; margin: 1rem 0 .5rem; }
.step p, .step li { color: #cbd5e1; font-size: .95rem; }
.step ul, .step ol { padding-left: 1.3rem; margin: .5rem 0; }
.step li { margin-bottom: .3rem; }

/* ===== DIAGRAM / SVG BOX ===== */
.diagram-box {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 1.2rem;
  margin: 1rem 0;
  text-align: center;
}
.diagram-box svg { margin: 0 auto; }
.diagram-box .caption {
  color: #64748b;
  font-size: .8rem;
  margin-top: .6rem;
  font-style: italic;
}

/* ===== INFO / TIP / WARNING BOXES ===== */
.info-box, .tip-box, .warn-box {
  border-radius: 8px;
  padding: 1rem 1.2rem;
  margin: 1rem 0;
  font-size: .92rem;
}
.info-box { background: #0c4a6e20; border-left: 4px solid #0ea5e9; }
.tip-box  { background: #16532420; border-left: 4px solid #22c55e; }
.warn-box { background: #92400e20; border-left: 4px solid #f59e0b; }
.info-box strong { color: #38bdf8; }
.tip-box strong  { color: #4ade80; }
.warn-box strong { color: #fbbf24; }

/* ===== TABLE ===== */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: .9rem;
}
th, td {
  padding: .6rem .8rem;
  border: 1px solid #334155;
  text-align: left;
}
th { background: #1e293b; color: #94a3b8; font-weight: 600; }
td { color: #cbd5e1; }

/* ===== NAV BUTTONS ===== */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #334155;
}
.nav-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .6rem 1.2rem;
  border: 1px solid #475569;
  border-radius: 8px;
  color: #94a3b8;
  transition: all .2s;
}
.nav-btn:hover { border-color: #38bdf8; color: #38bdf8; }

/* ===== CHECKLIST ===== */
.checklist { list-style: none; padding: 0; }
.checklist li {
  padding: .4rem 0 .4rem 2rem;
  position: relative;
  color: #cbd5e1;
}
.checklist li::before {
  content: '☐';
  position: absolute; left: 0;
  color: #475569;
  font-size: 1.1rem;
}

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  padding: 2rem;
  color: #475569;
  font-size: .8rem;
  border-top: 1px solid #1e293b;
  margin-top: 3rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .hero h1 { font-size: 1.6rem; }
  .container { padding: 1rem; }
  .phase-grid { grid-template-columns: 1fr; }
  .nav-buttons { flex-direction: column; gap: .8rem; }
}
