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

:root {
  --bg:           #08090c;
  --surface:      #0d1017;
  --card:         #111520;
  --card-hover:   #141924;
  --border:       #1a2038;
  --border-hi:    #2a3558;
  --purple:       #a855f7;
  --purple-dim:   #7c3aed;
  --purple-glow:  rgba(168, 85, 247, 0.15);
  --cyan:         #22d3ee;
  --green:        #4ade80;
  --red:          #f87171;
  --yellow:       #fbbf24;
  --text:         #e2e8f0;
  --text-dim:     #94a3b8;
  --text-muted:   #475569;
  --code-bg:      #0a0c13;
  --mono:         'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --sans:         'Space Grotesk', system-ui, -apple-system, sans-serif;
  --radius:       8px;
  --radius-lg:    12px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple-dim); }

/* ── Layout ───────────────────────────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Nav ──────────────────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 9, 12, 0.88);
  backdrop-filter: blur(14px);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
}

.nav-logo {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 700;
  color: var(--purple);
  letter-spacing: 0.12em;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s;
}
.nav-logo:hover { opacity: 0.8; }
.nav-logo span { color: var(--text-muted); font-weight: 300; font-size: 13px; margin-left: 4px; }

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.06em;
  transition: color 0.2s;
  cursor: pointer;
}
.nav-links a:hover { color: var(--text); }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
  padding: 130px 0 100px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 55% at 50% -5%, rgba(168, 85, 247, 0.13) 0%, transparent 65%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(26, 32, 56, 0.4) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 32, 56, 0.4) 1px, transparent 1px);
  background-size: 52px 52px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 0%, transparent 100%);
}

.hero-inner { position: relative; z-index: 1; }

.hero-eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.28em;
  color: var(--purple);
  text-transform: uppercase;
  margin-bottom: 28px;
}

.hero-title {
  font-family: var(--mono);
  font-size: clamp(100px, 18vw, 172px);
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1;
  background: linear-gradient(135deg, #ffffff 0%, #c084fc 45%, #22d3ee 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 28px;
}

.hero-tagline {
  font-family: var(--mono);
  font-size: 18px;
  color: var(--text-muted);
  margin-bottom: 20px;
  letter-spacing: 0.04em;
}
.hero-tagline em { color: var(--cyan); font-style: normal; }

.hero-description {
  font-size: 18px;
  color: var(--text-dim);
  max-width: 520px;
  margin: 0 auto 56px;
  line-height: 1.8;
}

.hero-stats {
  display: flex;
  gap: 64px;
  justify-content: center;
  margin-bottom: 52px;
}

.hero-stat-value {
  font-family: var(--mono);
  font-size: 38px;
  font-weight: 700;
  color: var(--purple);
  display: block;
}

.hero-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: var(--mono);
  margin-top: 4px;
}

.hero-cmd {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 20px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text-dim);
}
.hero-cmd .prompt { color: var(--green); }
.hero-cmd .cmd    { color: var(--text); }
.hero-cmd .cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  background: var(--purple);
  animation: blink 1.1s step-end infinite;
  border-radius: 1px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── Section ──────────────────────────────────────────────────────────────── */
.section { padding: 56px 0; }

.section-header { margin-bottom: 44px; }

.section-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--purple);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.section-title {
  font-size: 30px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.section-subtitle {
  font-size: 15px;
  color: var(--text-dim);
  max-width: 540px;
  line-height: 1.7;
}

/* ── Cards Grid ───────────────────────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 900px) { .cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .cards-grid { grid-template-columns: 1fr; } }

/* ── Card Preview ─────────────────────────────────────────────────────────── */
.card-preview {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.2s, background 0.25s;
  display: flex;
  flex-direction: column;
  gap: 14px;
  user-select: none;
}

.card-preview::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(ellipse 100% 70% at 50% 0%, var(--purple-glow), transparent);
  transition: opacity 0.3s;
  pointer-events: none;
}

.card-preview:hover {
  border-color: rgba(124, 58, 237, 0.7);
  box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.3), 0 8px 32px rgba(124, 58, 237, 0.15);
  transform: translateY(-2px);
  background: var(--card-hover);
}
.card-preview:hover::before { opacity: 1; }

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

.card-number {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 100px;
  font-weight: 600;
}
.badge-complete {
  background: rgba(74, 222, 128, 0.1);
  color: var(--green);
  border: 1px solid rgba(74, 222, 128, 0.2);
}
.badge-progress {
  background: rgba(251, 191, 36, 0.1);
  color: var(--yellow);
  border: 1px solid rgba(251, 191, 36, 0.2);
}
.badge-planned {
  background: rgba(148, 163, 184, 0.06);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.card-preview-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.card-preview-cmd {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.06);
  border: 1px solid rgba(34, 211, 238, 0.12);
  border-radius: 4px;
  padding: 4px 10px;
  display: inline-block;
  width: fit-content;
}

.card-preview-desc {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.65;
  flex: 1;
}

.card-preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.card-stat {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
}
.card-stat strong { color: var(--purple); font-weight: 600; }

.card-arrow {
  color: var(--text-muted);
  font-size: 16px;
  transition: color 0.2s, transform 0.2s;
  font-family: var(--mono);
}
.card-preview:hover .card-arrow {
  color: var(--purple);
  transform: translateX(4px);
}

/* ── About Section ────────────────────────────────────────────────────────── */
.about-section {
  border-top: 1px solid var(--border);
  padding: 80px 0;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: center;
}
@media (max-width: 760px) { .about-grid { grid-template-columns: 1fr; gap: 40px; } }

.about-tag {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--purple);
  letter-spacing: 0.18em;
  margin-bottom: 14px;
}

.about-title {
  font-size: 38px;
  font-weight: 700;
  margin-bottom: 18px;
  line-height: 1.15;
}
.about-title span {
  background: linear-gradient(90deg, var(--purple), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.about-text {
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.8;
  margin-bottom: 14px;
}

.about-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 1px solid rgba(34, 211, 238, 0.3);
  padding-bottom: 2px;
  transition: border-color 0.2s;
}
.about-link:hover { border-color: var(--cyan); }

.about-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.skill-chip {
  font-family: var(--mono);
  font-size: 11px;
  padding: 5px 13px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.about-stack {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.about-stack-title {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.14em;
  margin-bottom: 20px;
}

.stack-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.stack-item:last-child { border-bottom: none; }

.stack-icon {
  width: 34px;
  height: 34px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.stack-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
}
.stack-note {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--mono);
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-left {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
}
.footer-left span { color: var(--purple); }

.footer-right { display: flex; gap: 24px; }

.footer-link {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-link:hover { color: var(--text); }

/* ── Detail Page ──────────────────────────────────────────────────────────── */
.detail-page { padding-bottom: 96px; }

.detail-back {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 52px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  transition: color 0.2s;
  padding: 0;
}
.back-btn:hover { color: var(--text); }
.back-btn svg { transition: transform 0.2s; }
.back-btn:hover svg { transform: translateX(-3px); }

.detail-header { margin-bottom: 60px; }

.detail-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.detail-number {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.detail-title {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.15;
}

.detail-cmd {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.06);
  border: 1px solid rgba(34, 211, 238, 0.14);
  border-radius: 6px;
  padding: 7px 15px;
  display: inline-block;
  margin-bottom: 24px;
}

.detail-overview {
  font-size: 17px;
  color: var(--text-dim);
  line-height: 1.8;
  max-width: 680px;
}

.detail-stats {
  display: flex;
  gap: 36px;
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.detail-stat-value {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 700;
  color: var(--purple);
  display: block;
}

.detail-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--mono);
  letter-spacing: 0.1em;
  margin-top: 4px;
}

/* ── Detail Sections ──────────────────────────────────────────────────────── */
.detail-section { margin-bottom: 60px; }

.detail-section-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--purple);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.detail-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.detail-text {
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.8;
  margin-bottom: 16px;
  max-width: 680px;
}

/* ── Files List ───────────────────────────────────────────────────────────── */
.files-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.file-icon {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.07);
  border: 1px solid rgba(34, 211, 238, 0.14);
  border-radius: 4px;
  padding: 2px 7px;
  flex-shrink: 0;
  margin-top: 3px;
  letter-spacing: 0.05em;
}

.file-icon.sh-icon  { color: var(--green);  background: rgba(74,222,128,0.07);  border-color: rgba(74,222,128,0.14); }
.file-icon.h-icon   { color: var(--purple); background: rgba(168,85,247,0.07); border-color: rgba(168,85,247,0.14); }

.file-name {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  margin-bottom: 4px;
}
.file-desc {
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Challenges ───────────────────────────────────────────────────────────── */
.challenges-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.challenge-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--purple-dim);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
}

.challenge-problem {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.4;
}

.challenge-problem::before {
  content: '?';
  min-width: 20px;
  height: 20px;
  background: rgba(168, 85, 247, 0.14);
  color: var(--purple);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-family: var(--mono);
  flex-shrink: 0;
  margin-top: 2px;
}

.challenge-solution {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.75;
  padding-left: 30px;
}

/* ── Code Blocks ──────────────────────────────────────────────────────────── */
.code-block {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 14px 0;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.018);
}

.code-filename {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
}

.code-lang {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--purple);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.code-block pre {
  padding: 20px 22px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-dim);
}

.code-block pre .kw     { color: #c084fc; }
.code-block pre .fn     { color: #7dd3fc; }
.code-block pre .str    { color: #86efac; }
.code-block pre .cm     { color: #475569; font-style: italic; }
.code-block pre .num    { color: #fdba74; }
.code-block pre .prompt { color: var(--green); user-select: none; }
.code-block pre .out    { color: var(--cyan); }
.code-block pre .dim    { color: var(--text-muted); }

/* ── Tests ────────────────────────────────────────────────────────────────── */
.tests-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(74, 222, 128, 0.05);
  border: 1px solid rgba(74, 222, 128, 0.15);
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--green);
}

.tests-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.test-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
}

.test-pass {
  color: var(--green);
  font-size: 11px;
  flex-shrink: 0;
}

/* ── Dir Tree ─────────────────────────────────────────────────────────────── */
.dir-tree {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-dim);
  line-height: 2;
}
.dir-tree .dir  { color: var(--cyan); }
.dir-tree .note { color: var(--text-muted); font-style: italic; margin-left: 8px; }

/* ── Page Transitions ─────────────────────────────────────────────────────── */
.page-enter { animation: pageIn 0.22s ease-out forwards; }

@keyframes pageIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
