:root {
  --bg: #000000;
  --surface: #434343;
  --text: #e7e7e7;
  --muted: #b7b7b7;
  --teal: #007e6c;
  --accent: #00e58e;
  --blue-light: #a4c2f4;
  --blue: #4a86e8;
  --cyan: #00ffff;
  --yellow: #f8ed89;
  --white: #ffffff;
  --radius: 10px;
  --gap: 1rem;
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;
  --text-3xl: 2.5rem;
  --bg-soft: #101010;
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --surface: #e7e7e7;
  --text: #000000;
  --muted: #4a4a4a;
  --bg-soft: #f5f5f5;
  --accent: #00916e;
  --teal: #0b6b5c;
  --blue-light: #2c5bbd;
  --blue: #1a4bb8;
  --cyan: #00848f;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* --- Layout --- */
.layout-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (min-width: 1024px) {
  .layout-wrapper {
    display: flex;
    justify-content: space-between;
    gap: 3rem;
  }
  .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 45%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 5rem 0;
  }
  .content-area {
    width: 55%;
    padding: 5rem 0;
  }
}

@media (max-width: 1023px) {
  .sidebar {
    padding: 3rem 0 2rem;
  }
  .content-area {
    padding: 2rem 0 4rem;
  }
}

/* --- Sidebar --- */
.sidebar-logo {
  font-family: var(--font-mono);
  color: var(--accent);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 700;
  display: inline-block;
  margin-bottom: 0.5rem;
}
.nav-cursor {
  color: var(--cyan);
  animation: blink 1.2s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.sidebar-name {
  font-family: var(--font-mono);
  font-size: var(--text-3xl);
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 0.3rem;
}
.sidebar-title {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: 500;
  margin-bottom: 0.8rem;
}
.sidebar-tagline {
  color: var(--muted);
  font-size: var(--text-base);
  line-height: 1.5;
  margin-bottom: 2rem;
  max-width: 320px;
}

.sidebar-nav ul { list-style: none; display: flex; flex-direction: column; gap: 0.8rem; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: color 0.2s ease;
}
.nav-indicator {
  width: 24px;
  height: 1px;
  background: var(--muted);
  transition: width 0.2s ease, background 0.2s ease;
}
.nav-item:hover, .nav-item.active {
  color: var(--text);
}
.nav-item:hover .nav-indicator, .nav-item.active .nav-indicator {
  width: 48px;
  background: var(--accent);
}

.sidebar-bottom {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 2rem;
}
.sidebar-socials { display: flex; gap: 1.2rem; align-items: center; }
.sidebar-socials a {
  color: var(--muted);
  transition: color 0.2s ease, transform 0.2s ease;
}
.sidebar-socials a:hover {
  color: var(--accent);
  transform: translateY(-2px);
}
#theme-toggle {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  margin: 0;
  border: 1px solid var(--surface);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
#theme-toggle:hover {
  color: var(--accent);
  border-color: var(--teal);
}

/* --- Sections --- */
.section {
  margin-bottom: 5rem;
  scroll-margin-top: 5rem;
}
.section-title {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  color: var(--text);
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.section-title::before {
  content: attr(data-label);
  font-size: var(--text-xs);
  color: var(--teal);
  background: var(--bg-soft);
  border: 1px solid var(--surface);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.about-highlight {
  font-size: var(--text-lg);
  color: var(--text);
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 1.2rem;
}
.about-paragraphs p {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 1rem;
  font-size: var(--text-base);
}

/* --- Skills --- */
.skills-grid { display: flex; flex-direction: column; gap: 1.2rem; }
.skill-card { background: var(--bg-soft); border: 1px solid var(--surface); border-radius: var(--radius); padding: 1.2rem; transition: border-color 0.2s ease, transform 0.2s ease; }
.skill-card:hover { border-color: var(--teal); transform: translateY(-2px); }
.skill-category { font-family: var(--font-mono); color: var(--accent); font-weight: 700; margin-bottom: 0.8rem; font-size: var(--text-sm); }
.skill-items { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.skill-tag { background: var(--surface); color: var(--text); border-radius: 999px; padding: 0.25rem 0.75rem; font-size: var(--text-xs); font-family: var(--font-mono); }

/* --- Projects --- */
.project-grid { display: flex; flex-direction: column; gap: 1.5rem; }
.project-card {
  background: var(--bg-soft);
  border: 1px solid var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  position: relative;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.project-card:hover {
  border-color: var(--teal);
  transform: translateY(-2px);
}
.project-badge {
  align-self: flex-start;
  background: var(--yellow);
  color: #000;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-family: var(--font-mono);
}
.project-title-link {
  color: var(--accent);
  text-decoration: none;
  font-size: var(--text-lg);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.project-title-link .arrow { transition: transform 0.2s ease; }
.project-title-link:hover .arrow { transform: translate(2px, -2px); }
.project-desc {
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.6;
}
.project-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.4rem; }
.project-tag {
  color: var(--cyan);
  background: rgba(0, 255, 255, 0.08);
  border: 1px solid rgba(0, 255, 255, 0.2);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: var(--text-xs);
  font-family: var(--font-mono);
}

/* --- Experience --- */
.experience-list { display: flex; flex-direction: column; gap: 2rem; }
.exp-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1rem;
  padding: 1.2rem;
  background: var(--bg-soft);
  border: 1px solid var(--surface);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
@media (max-width: 600px) {
  .exp-card { grid-template-columns: 1fr; gap: 0.5rem; }
}
.exp-card:hover {
  border-color: var(--teal);
  transform: translateY(-2px);
}
.exp-period {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-top: 0.2rem;
}
.exp-role {
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--text);
  margin-bottom: 0.2rem;
}
.exp-company { color: var(--accent); }
.exp-points {
  margin: 0.6rem 0 1rem;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.6;
}
.exp-points li { margin-bottom: 0.3rem; }
.exp-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.exp-tag {
  color: var(--cyan);
  background: rgba(0, 255, 255, 0.08);
  border: 1px solid rgba(0, 255, 255, 0.2);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: var(--text-xs);
  font-family: var(--font-mono);
}

.resume-wrapper { margin-top: 2rem; }
.resume-link {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s ease;
}
.resume-link:hover { color: var(--accent); }
.resume-link .arrow { transition: transform 0.2s ease; }
.resume-link:hover .arrow { transform: translate(2px, -2px); }

/* --- Footer --- */
.footer {
  margin-top: 5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--surface);
  color: var(--muted);
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  line-height: 1.6;
  max-width: 480px;
}
.footer a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--surface);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.footer a:hover {
  color: var(--accent);
  border-color: var(--teal);
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .section-title::before { font-size: 0.7rem; }
}

/* --- Reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.reveal-in {
  opacity: 1;
  transform: none;
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nav-cursor { animation: none; }
  .project-card { transition: none; }
  .project-card:hover { transform: none; }
  .skill-card { transition: none; }
  .skill-card:hover { transform: none; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}