:root {
  --bg: #060b18;
  --bg-soft: #0d1630;
  --text: #e9eeff;
  --muted: #9babcd;
  --primary: #5eead4;
  --secondary: #7f9cff;
  --card: rgba(17, 27, 54, 0.72);
  --border: rgba(117, 141, 210, 0.2);
}

body.theme-pro {
  --bg: #020611;
  --bg-soft: #0b1328;
  --text: #f1f5ff;
  --muted: #aebbe0;
  --primary: #72f6de;
  --secondary: #93acff;
  --card: rgba(12, 20, 44, 0.75);
  --border: rgba(139, 164, 238, 0.22);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: Inter, "Segoe UI", sans-serif;
  background:
    radial-gradient(1400px 500px at 10% -10%, rgba(94, 234, 212, 0.09), transparent 62%),
    radial-gradient(1200px 450px at 100% -5%, rgba(127, 156, 255, 0.13), transparent 58%),
    var(--bg);
  color: var(--text);
}

.container {
  width: min(1100px, 91%);
  margin: 0 auto;
}

.hero {
  border-bottom: 1px solid var(--border);
  position: relative;
}

.progress-wrap {
  position: sticky;
  top: 0;
  z-index: 999;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
}

.scroll-progress {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.1s linear;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.brand {
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
}

.nav-links {
  display: flex;
  gap: 1rem;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.theme-toggle {
  border: 1px solid var(--border);
  background: rgba(19, 31, 62, 0.75);
  color: var(--text);
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.hero-content {
  padding: 2.6rem 0 2.2rem;
}

.hero-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
  align-items: center;
  justify-items: center;
  text-align: center;
}

.hero-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 900px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  color: var(--primary);
  font-size: 0.84rem;
}

h1 {
  font-size: clamp(1.8rem, 3.4vw, 3rem);
  margin: 0.85rem 0 0.7rem;
  max-width: 760px;
}

.subtitle {
  color: var(--muted);
  max-width: 690px;
  line-height: 1.55;
  margin: 0;
}

.stats-grid {
  width: 100%;
  max-width: 720px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.stat-card {
  border: 1px solid var(--border);
  background: linear-gradient(170deg, rgba(17, 32, 65, 0.75), rgba(12, 20, 44, 0.8));
  border-radius: 12px;
  padding: 0.8rem;
  box-shadow: 0 14px 30px rgba(2, 8, 24, 0.4);
}

.stat-number {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
}

.stat-label {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.stat-sub {
  margin: 0.18rem 0 0;
  color: #86efac;
  font-size: 0.74rem;
}

.tech-icons {
  margin-top: 1.15rem;
  display: flex;
  gap: 0.7rem;
  align-items: center;
  flex-wrap: wrap;
}

.tech-icons i {
  font-size: 1.45rem;
  padding: 0.42rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(18, 29, 59, 0.68);
}

.cta-group,
.btn-row,
.control-row {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.terminal-card {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(4, 12, 6, 0.95);
  width: 100%;
  max-width: 900px;
  margin-inline: auto;
}

.terminal-head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid var(--border);
  background: rgba(13, 22, 48, 0.92);
}

.terminal-head span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
}

.terminal-head span:nth-child(1) { background: #fb7185; }
.terminal-head span:nth-child(2) { background: #facc15; }
.terminal-head span:nth-child(3) { background: #4ade80; }

.terminal-head p {
  margin: 0 0 0 0.45rem;
  font-size: 0.76rem;
  color: var(--muted);
}

.terminal-output {
  margin: 0;
  padding: 0.75rem;
  min-height: 142px;
  max-height: 190px;
  overflow-y: auto;
  color: #8df9a8;
  font-size: 0.8rem;
  line-height: 1.5;
  white-space: pre-wrap;
  font-family: Consolas, "Courier New", monospace;
}

.terminal-input-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border-top: 1px solid rgba(120, 255, 160, 0.2);
  padding: 0.55rem 0.75rem;
  background: rgba(4, 16, 8, 0.96);
}

.terminal-prompt {
  color: #5cf57c;
  font-size: 0.78rem;
  font-family: Consolas, "Courier New", monospace;
}

.terminal-input {
  flex: 1;
  border: none;
  background: transparent;
  color: #8df9a8;
  font-size: 0.8rem;
  font-family: Consolas, "Courier New", monospace;
  outline: none;
  max-width: 100%;
}

.terminal-line-error {
  color: #fca5a5;
}

.terminal-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  padding: 0.45rem 0.75rem 0.7rem;
  color: #72de8c;
  font-size: 0.74rem;
  border-top: 1px solid rgba(120, 255, 160, 0.12);
}

.hint-btn {
  border: 1px solid rgba(120, 255, 160, 0.3);
  background: rgba(12, 26, 14, 0.95);
  color: #8df9a8;
  border-radius: 999px;
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  cursor: pointer;
}

.hint-btn:hover {
  border-color: rgba(120, 255, 160, 0.8);
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 0.56rem 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.9rem;
}

.btn-primary {
  background: linear-gradient(135deg, #5eead4, #73f6d0);
  color: #05251f;
}

.btn-secondary {
  background: rgba(27, 40, 78, 0.74);
  color: var(--text);
  border: 1px solid var(--border);
}

.section {
  padding: 2.2rem 0;
}

.section-head h2 {
  margin: 0.2rem 0 0.65rem;
  font-size: 1.52rem;
}

.section-head h2 i {
  color: var(--primary);
  margin-right: 0.35rem;
}

.kicker {
  color: var(--primary);
  margin: 0;
  font-size: 0.86rem;
}

.featured-grid,
.thinking-grid,
.interactive-grid,
.skills-grid {
  display: grid;
  gap: 0.75rem;
}

.featured-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.skills-grid,
.thinking-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.interactive-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card-large {
  grid-column: span 2;
}

.card,
.skill-card {
  background: var(--card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 12px 26px rgba(2, 8, 24, 0.36);
}

.card:hover,
.skill-card:hover {
  transform: translateY(-2px);
  border-color: rgba(94, 234, 212, 0.46);
  box-shadow: 0 16px 34px rgba(2, 10, 28, 0.5);
}

.card h3,
.skill-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.card p,
.skill-card p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
  font-size: 0.92rem;
}

.card ul {
  margin: 0.4rem 0 0;
  padding-left: 1rem;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.92rem;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  margin-top: 0.8rem;
}

.pill-row span {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.27rem 0.62rem;
  color: var(--muted);
  font-size: 0.8rem;
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
}

input {
  width: 100%;
  max-width: 270px;
  background: rgba(7, 14, 32, 0.88);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 9px;
  padding: 0.56rem 0.7rem;
}

.output {
  margin-top: 0.75rem;
  min-height: 116px;
  background: rgba(5, 11, 25, 0.86);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem;
  color: #d4dcff;
  font-size: 0.82rem;
  overflow: auto;
}

.flow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.flow span {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0.5rem 0.55rem;
  background: rgba(13, 22, 48, 0.8);
  color: var(--muted);
  font-size: 0.85rem;
}

.flow i {
  color: #7f9cff;
}

.flow span.active {
  border-color: rgba(94, 234, 212, 0.74);
  color: var(--primary);
  box-shadow: 0 0 0 1px rgba(94, 234, 212, 0.16);
}

.timeline-track {
  position: relative;
  width: min(780px, 100%);
  margin: 0.9rem auto 0;
  padding-left: 2.5rem;
}

.timeline-line {
  position: absolute;
  left: 0.9rem;
  top: 0;
  width: 3px;
  height: 100%;
  background: rgba(127, 156, 255, 0.22);
  border-radius: 999px;
}

.timeline-fill {
  width: 100%;
  height: 0;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  border-radius: 999px;
  transition: height 0.18s linear;
}

.timeline-card {
  position: relative;
  margin-bottom: 1rem;
  background: rgba(13, 22, 48, 0.76);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.95rem;
  transform: translateY(24px) scale(0.97);
  opacity: 0;
  transition: opacity 0.55s ease, transform 0.55s ease, border-color 0.22s ease;
  box-shadow: 0 16px 30px rgba(4, 11, 32, 0.42);
}

.timeline-card::before {
  content: "";
  position: absolute;
  left: -1.96rem;
  top: 1.2rem;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--secondary);
  box-shadow: 0 0 0 4px rgba(127, 156, 255, 0.22);
}

.timeline-card.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.timeline-card:hover {
  border-color: rgba(114, 246, 222, 0.72);
  box-shadow: 0 22px 38px rgba(2, 12, 30, 0.56);
}

.year-tag {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.52rem;
  color: var(--primary);
  font-size: 0.76rem;
  margin-bottom: 0.4rem;
}

.timeline-card h3 {
  margin: 0 0 0.34rem;
}

.timeline-card p {
  margin: 0;
}

.timeline-card ul {
  margin: 0.5rem 0 0;
  padding-left: 1rem;
  color: var(--muted);
  line-height: 1.45;
}

.chart-wrap {
  height: 210px;
  margin-top: 0.4rem;
}

.contact {
  border-top: 1px solid var(--border);
  padding-bottom: 3rem;
}

.contact p {
  color: var(--muted);
}

.contact a {
  color: var(--primary);
}

.back-top {
  display: inline-block;
  margin-top: 0.7rem;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 920px) {
  .container {
    width: min(1100px, 95%);
  }
  .nav {
    flex-direction: column;
    gap: 0.6rem;
    align-items: center;
    justify-content: center;
  }
  .nav-links {
    justify-content: center;
    flex-wrap: wrap;
  }
  .hero-main {
    max-width: 100%;
  }
  .cta-group {
    justify-content: center;
  }
  .tech-icons {
    justify-content: center;
  }
  .terminal-head,
  .terminal-input-row,
  .terminal-hints {
    justify-content: center;
  }
  .featured-grid,
  .thinking-grid,
  .interactive-grid,
  .skills-grid {
    grid-template-columns: 1fr;
  }
  .card-large {
    grid-column: auto;
  }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .timeline-track {
    padding-left: 2rem;
  }
  .timeline-line {
    left: 0.6rem;
  }
  .timeline-card::before {
    left: -1.62rem;
  }
}

@media (max-width: 560px) {
  .hero-content {
    padding: 2rem 0 1.8rem;
  }
  h1 {
    font-size: clamp(1.5rem, 8vw, 2.2rem);
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
}
