/* ===== Variables ===== */
:root {
  --bg: #efefef;
  --bg-secondary: #e5e5e5;
  --text: #1a1a1a;
  --text-secondary: #6b6b6b;
  --accent: #10b981;
  --accent-hover: #059669;
  --accent-light: rgba(16, 185, 129, 0.08);
  --border: #d4d4d4;
  --card-bg: #ffffff;
  --card-shadow: none;
  --card-shadow-hover: none;
  --tag-bg: #e8e8e8;
  --tag-text: #525252;
  --timeline-line: #d4d4d4;
  --ticker-bg: #f0f0f0;
  --dim: #999999;
  --color-work: #2563eb;
  --color-school: #d97706;
  --color-move: #9333ea;
}

[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-secondary: #141414;
  --text: #e0e0e0;
  --text-secondary: #808080;
  --accent: #4ade80;
  --accent-hover: #22c55e;
  --accent-light: rgba(74, 222, 128, 0.08);
  --border: #2a2a2a;
  --card-bg: #111111;
  --card-shadow: none;
  --card-shadow-hover: none;
  --tag-bg: #1a1a1a;
  --tag-text: #999999;
  --timeline-line: #444444;
  --ticker-bg: #111111;
  --dim: #555555;
  --color-work: #60a5fa;
  --color-school: #facc15;
  --color-move: #c084fc;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}

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

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

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
  flex: 1;
}

/* ===== Theme Toggle ===== */
.theme-toggle {
  position: fixed;
  top: 1.25rem;
  right: 1.5rem;
  z-index: 100;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-secondary);
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
}

.theme-toggle .sun-icon { display: none; }
.theme-toggle .moon-icon { display: block; }
[data-theme="dark"] .theme-toggle .sun-icon { display: block; }
[data-theme="dark"] .theme-toggle .moon-icon { display: none; }

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding-top: 2rem;
  padding-bottom: 1rem;
}

.hero-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.25rem;
}

.nav-btn {
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.4rem 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.nav-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-light);
}

.nav-btn.active {
  color: #000000;
  background: var(--accent);
  border-color: var(--accent);
}

[data-theme="dark"] .nav-btn.active {
  color: #0a0a0a;
}

.avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.avatar:hover {
  transform: scale(1.05);
}

.avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: 60% 50%;
  transform: scale(1.0);
  display: block;
}

.hero h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.15rem;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
}

/* ===== Social Links ===== */
.social-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.78rem;
}

.social-row a {
  color: var(--text-secondary);
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.social-row a svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.social-row a:hover {
  color: var(--accent);
}

.social-dot {
  color: var(--dim);
  font-size: 0.5rem;
  user-select: none;
}

/* ===== Ask Section ===== */
.ask-section {
  margin: 2rem 0 1.5rem;
}

.ask-form {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  transition: border-color 0.2s ease;
  background: var(--bg-secondary);
}

.ask-form:focus-within {
  border-color: var(--accent);
}

.ask-form input {
  flex: 1;
  padding: 0.7rem 0.85rem;
  border: none;
  outline: none;
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
  font-size: 0.82rem;
  color: var(--text);
  background: transparent;
}

.ask-form input::placeholder {
  color: var(--text-secondary);
  opacity: 0.5;
}

.ask-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  border: none;
  background: var(--accent);
  color: #0a0a0a;
  cursor: pointer;
  transition: background 0.2s ease;
}

.ask-submit:hover {
  background: var(--accent-hover);
}

.ask-form.is-loading {
  opacity: 0.55;
  pointer-events: none;
}

.ask-form input:disabled {
  cursor: not-allowed;
}

.ask-submit svg {
  width: 16px;
  height: 16px;
}

.response-area {
  height: 10.5em;
  padding: 0.75rem 0.25rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
  display: flex;
  align-items: flex-start;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

.response-area::-webkit-scrollbar {
  width: 4px;
}

.response-area::-webkit-scrollbar-track {
  background: transparent;
}

.response-area::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

.response-area p {
  display: inline;
}

.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: text-bottom;
  opacity: 0;
  transition: opacity 0.1s;
}

.typing-cursor.active {
  animation: blink 0.6s step-end infinite;
  opacity: 1;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ===== Book a Consult ===== */
.book-consult-wrap {
  text-align: center;
  margin: 1.5rem 0;
}

.book-consult {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  padding: 0.45rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}

.book-consult:hover {
  background: var(--accent);
  color: var(--bg);
}

/* ===== Views Container ===== */
.views-container {
  position: relative;
  min-height: 200px;
}

.view {
  display: none;
  animation: fadeIn 0.3s ease;
}

.view.active {
  display: block;
}

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

/* ===== Home View: Interests ===== */
.interests {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.pill {
  font-size: 0.75rem;
  padding: 0.3rem 0.7rem;
  border-radius: 3px;
  background: var(--tag-bg);
  color: var(--tag-text);
  border: 1px solid var(--border);
  white-space: nowrap;
  transition: all 0.2s ease;
}

.pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== Home View: Ticker ===== */
.ticker-wrapper {
  padding: 0.85rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  background: var(--ticker-bg);
  border-radius: 3px;
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker 35s linear infinite;
}

.ticker-track:hover {
  animation-play-state: paused;
}

.ticker-items {
  display: flex;
  gap: 2.5rem;
  padding-right: 2.5rem;
  flex-shrink: 0;
}

.ticker-item {
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.ticker-item strong {
  color: var(--accent);
  font-weight: 600;
  margin-right: 0.35rem;
}

@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ===== Experience View: Timeline ===== */
.timeline {
  position: relative;
  padding-left: 2rem;
  margin: 0.5rem 0 2rem;
  margin-bottom: 4rem;
  overflow: visible;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 8px;
  bottom: 0;
  width: 1px;
  background: var(--timeline-line);
}

.timeline::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 100%;
  height: 3rem;
  width: 1px;
  background: repeating-linear-gradient(
    to bottom,
    var(--timeline-line) 0px,
    var(--timeline-line) 4px,
    transparent 4px,
    transparent 8px
  );
}

.timeline-item:last-child {
  padding-bottom: 0;
}


.timeline-item {
  position: relative;
  padding-left: 1.5rem;
  padding-bottom: 2rem;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.timeline-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 7px;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--bg);
  border: 2px solid var(--accent);
  z-index: 1;
}

.timeline-item.work::before {
  border-color: var(--color-work);
}

.timeline-item.school::before {
  border-color: var(--color-school);
}

.timeline-item.personal::before {
  border-color: var(--color-move);
}

.timeline-icon.personal {
  color: var(--color-move);
}

.timeline-item.highlight::before {
  background: var(--color-work);
  border-color: var(--color-work);
}

.timeline-date {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.2rem;
  letter-spacing: 0.02em;
}

[data-theme="dark"] .timeline-date {
  font-weight: 600;
}

.timeline-title {
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 0.1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.timeline-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.timeline-icon.work {
  color: var(--color-work);
}

.timeline-icon.school {
  color: var(--color-school);
}


.timeline-role {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.15rem;
}

.timeline-location {
  font-size: 0.72rem;
  color: var(--text-secondary);
  opacity: 0.6;
  margin-bottom: 0.4rem;
}

.timeline-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ===== Timeline Milestone ===== */
.timeline-milestone {
  position: relative;
  padding-left: 1.5rem;
  padding-top: 0.75rem;
  padding-bottom: 2.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.timeline-milestone.visible {
  opacity: 1;
  transform: translateY(0);
}

.timeline-milestone::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: calc(0.75rem + 5px);
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--bg);
  border: 2px solid var(--color-move);
  z-index: 1;
}

.timeline-milestone svg {
  width: 16px;
  height: 16px;
  color: var(--color-move);
  flex-shrink: 0;
}

.timeline-milestone span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

/* Staggered transition delays for scroll reveal */
.timeline > :nth-child(1).visible { transition-delay: 0s; }
.timeline > :nth-child(2).visible { transition-delay: 0.05s; }
.timeline > :nth-child(3).visible { transition-delay: 0.1s; }
.timeline > :nth-child(4).visible { transition-delay: 0.15s; }
.timeline > :nth-child(5).visible { transition-delay: 0.2s; }
.timeline > :nth-child(6).visible { transition-delay: 0.25s; }
.timeline > :nth-child(7).visible { transition-delay: 0.3s; }
.timeline > :nth-child(8).visible { transition-delay: 0.35s; }
.timeline > :nth-child(9).visible { transition-delay: 0.4s; }
.timeline > :nth-child(10).visible { transition-delay: 0.45s; }
.timeline > :nth-child(11).visible { transition-delay: 0.5s; }

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

/* ===== Projects View ===== */
.section-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.project-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.1rem;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  border-color: var(--accent);
}

.project-card h3 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  line-height: 1.3;
}

.project-card p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.65rem;
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.65rem;
}

.project-tag {
  font-size: 0.68rem;
  font-weight: 500;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  background: var(--tag-bg);
  color: var(--tag-text);
  border: 1px solid var(--border);
}

.project-links {
  display: flex;
  gap: 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.project-links a {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.project-links svg {
  width: 13px;
  height: 13px;
}

/* ===== GitHub Section ===== */
.github-section {
  margin-bottom: 2rem;
}

.github-section h3 {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.contrib-count {
  color: var(--accent);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

.github-chart {
  width: 100%;
  border-radius: 4px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--card-bg);
  padding: 0.85rem;
}

.github-chart img {
  width: 100%;
  height: auto;
  display: block;
}

[data-theme="dark"] .github-chart img {
  filter: invert(1) hue-rotate(180deg);
}

/* ===== Footer ===== */
footer {
  text-align: center;
  padding: 2rem 1.5rem;
  font-size: 0.72rem;
  color: var(--dim);
  border-top: 1px solid var(--border);
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .hero-nav {
    gap: 1rem;
  }

  .nav-btn {
    font-size: 0.75rem;
    padding: 0.35rem 0.85rem;
  }

  .avatar {
    width: 80px;
    height: 80px;
  }

  .hero h1 {
    font-size: 1.25rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .interests {
    gap: 0.35rem;
  }

  .pill {
    font-size: 0.7rem;
    padding: 0.25rem 0.6rem;
  }

  .social-row {
    font-size: 0.72rem;
  }
}
