/* Gruvbox Color Palette */
:root {
  --bg-dark: #1d2021;
  --bg: #282828;
  --bg-light: #3c3836;
  --fg: #ebdbb2;
  --fg-dim: #a89984;
  --fg-darker: #928374;
  --accent: #83a598;
  --accent-bright: #8ec07c;
  --orange: #fe8019;
  --yellow: #fabd2f;
  --yellow-dim: #d79921;
  --red: #fb4934;
  --green: #b8bb26;
}

.main-container {
  padding-top: 5rem !important;
}

/* Reset and Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  line-height: 1.6;
  color: var(--fg-dim);
  background-color: var(--bg-dark);
  font-size: 16px;
}

/* Top Navigation */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background-color: rgba(29, 32, 33, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--bg-light);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-link {
  color: var(--fg-dim);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--fg);
}

.linkedin-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent);
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  background-color: rgba(131, 165, 152, 0.1);
  transition: all 0.2s;
}

.linkedin-link:hover {
  color: var(--accent-bright);
  background-color: rgba(131, 165, 152, 0.2);
}

.linkedin-link svg {
  flex-shrink: 0;
}

::selection {
  background-color: var(--accent);
  color: var(--bg-dark);
}

/* Two Column Layout */
.site-wrapper {
  display: flex;
  min-height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
}

/* Left Column - Fixed */
.left-column {
  position: sticky;
  top: 3rem;
  width: 45%;
  height: calc(100vh - 3rem);
  padding: 4rem 4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.intro {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.intro h1 {
  font-size: 3rem;
  font-weight: 700;
  color: var(--yellow);
  margin-bottom: 0.5rem;
  line-height: 1.1;
}

.intro .tagline {
  font-size: 1.5rem;
  color: var(--fg-dim);
  margin-bottom: 2rem;
}

.intro .about {
  max-width: 500px;
  margin-bottom: 3rem;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--fg-dim);
}

/* Navigation Links */
.section-nav {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 3rem;
}

.section-nav a {
  color: var(--fg-darker);
  text-decoration: none;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.section-nav a::before {
  content: "";
  display: inline-block;
  width: 2rem;
  height: 1px;
  background-color: var(--fg-darker);
  transition: all 0.2s;
}

.section-nav a:hover {
  color: var(--fg);
}

.section-nav a:hover::before {
  width: 4rem;
  background-color: var(--fg);
}

.linkedin-nav-link {
  margin-top: 1rem;
  color: var(--accent) !important;
}

.linkedin-nav-link::before {
  background-color: var(--accent) !important;
}

.linkedin-nav-link svg {
  margin-right: -0.25rem;
}

/* Social Links */
.social-links {
  display: flex;
  gap: 1.5rem;
  margin-top: auto;
}

.social-links a {
  color: var(--fg-darker);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

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

/* Right Column - Scrollable */
.right-column {
  width: 55%;
  padding: 6rem 4rem 4rem 2rem;
}

/* Section Headers */
section {
  margin-bottom: 4rem;
  scroll-margin-top: 2rem;
}

section h2 {
  font-size: 0.85rem;
  color: var(--fg);
  margin-bottom: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  position: sticky;
  top: 3rem;
  background-color: var(--bg-dark);
  padding: 0.75rem 0;
  z-index: 10;
}

/* Experience */
.company-group {
  margin-bottom: 1.5rem;
}

.company-name {
  font-size: 1rem;
  color: var(--yellow-dim);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

/* Timeline styling */
.timeline {
  position: relative;
  padding-left: 1.5rem;
  border-left: 2px solid var(--bg-light);
  margin-left: 0.5rem;
}

.timeline-entry {
  position: relative;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  border-radius: 4px;
  transition: all 0.2s;
}

.timeline-entry:last-child {
  margin-bottom: 0;
}

.timeline-entry::before {
  content: "";
  position: absolute;
  left: -1.75rem;
  top: 0.75rem;
  width: 6px;
  height: 6px;
  background-color: var(--fg-darker);
  border-radius: 50%;
}

.timeline-entry:hover {
  background-color: rgba(60, 56, 54, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.timeline-entry:hover::before {
  background-color: var(--accent);
}

.job-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.timeline-entry h4 {
  font-size: 0.95rem;
  color: var(--fg);
  margin-bottom: 0.15rem;
  font-weight: 600;
}

.date {
  color: var(--fg-darker);
  font-size: 0.8rem;
  margin-bottom: 0.35rem;
  font-family: monospace;
}

.location {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

.job-summary {
  color: var(--fg-dim);
  margin-bottom: 0.75rem;
  line-height: 1.6;
  font-size: 0.95rem;
}

details {
  margin-top: 0.35rem;
}

details summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 500;
  user-select: none;
  list-style: none;
  font-family: monospace;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::before {
  content: "▶ ";
  display: inline-block;
  transition: transform 0.2s;
}

details[open] summary::before {
  transform: rotate(90deg);
}

details summary:hover {
  color: var(--accent-bright);
}

details ul {
  margin-top: 0.5rem;
  margin-left: 1.5rem;
}

details li {
  margin-bottom: 0.35rem;
  color: var(--fg-dim);
  line-height: 1.5;
  font-size: 0.85rem;
}

/* Education */
.school-group {
  margin-bottom: 2rem;
}

.school-name {
  font-size: 1.05rem;
  color: var(--accent-bright);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.degree {
  padding: 0.75rem;
  border-radius: 4px;
  transition: all 0.2s;
}

.degree:hover {
  background-color: rgba(60, 56, 54, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.degree h4 {
  color: var(--fg);
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
  font-weight: 600;
}

.degree .date {
  color: var(--fg-darker);
  font-size: 0.8rem;
  margin-bottom: 0;
  font-family: monospace;
}

/* Blog List */
.blog-list h1 {
  font-size: 2rem;
  color: var(--fg);
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.subtitle {
  color: var(--fg-dim);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

.posts {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.post-preview {
  padding: 1rem;
  background-color: rgba(60, 56, 54, 0.2);
  border: 1px solid var(--bg-light);
  border-radius: 4px;
  transition: all 0.2s;
}

.post-preview:hover {
  border-color: var(--accent);
  background-color: rgba(60, 56, 54, 0.3);
  transform: translateY(-2px);
}

.post-preview h2 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
  position: static;
  background: none;
  padding: 0;
  text-transform: none;
  letter-spacing: normal;
}

.post-preview h2 a {
  color: var(--fg);
  text-decoration: none;
  transition: color 0.2s;
}

.post-preview h2 a:hover {
  color: var(--accent-bright);
}

.post-meta {
  color: var(--fg-darker);
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
  font-family: monospace;
}

.post-excerpt {
  color: var(--fg-dim);
  margin-bottom: 0.5rem;
  line-height: 1.6;
  font-size: 0.95rem;
}

.read-more {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  font-family: monospace;
}

.read-more:hover {
  color: var(--accent-bright);
}

/* Individual Post */
.post {
  max-width: 700px;
}

.post-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--bg-light);
}

.post-header h1 {
  font-size: 1.7rem;
  color: var(--fg);
  margin-bottom: 0.25rem;
  font-weight: 700;
  line-height: 1.2;
}

.post-author {
  font-size: 0.85rem;
  color: var(--yellow-dim);
  font-weight: 500;
  margin-bottom: 0.5rem;
  font-family: monospace;
}

.post-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--fg-dim);
}

.post-content h1 {
  font-size: 1.7rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--fg);
  line-height: 1.2;
}

.post-content h1+h2 {
  margin-top: 0.5rem;
}

.post-content h2 {
  font-size: 1.45rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--fg);
  position: static;
  background: none;
  padding: 0;
  text-transform: none;
  letter-spacing: normal;
  line-height: 1.2;
}

.post-header+.post-content h2 {
  margin-top: 0.5rem;
}

.post-content h3 {
  font-size: 1.2rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--fg);
  line-height: 1.2;
}

.post-content h2+h3 {
  margin-top: 0.5rem;
}

.post-content p {
  margin-bottom: 1.5rem;
}

.post-content ul,
.post-content ol {
  margin-bottom: 1.5rem;
  margin-left: 2rem;
}

.post-content li {
  margin-bottom: 0.2rem;
}

.post-content a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.post-content a:hover {
  border-bottom-color: var(--accent);
}

.post-content code {
  background-color: var(--bg);
  color: var(--orange);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-size: 0.9em;
  font-family: 'Monaco', 'Courier New', monospace;
}

.post-content pre {
  background-color: var(--bg);
  border: 1px solid var(--bg-light);
  padding: 1.25rem;
  border-radius: 4px;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.post-content pre code {
  background-color: transparent;
  padding: 0;
  color: var(--fg-dim);
}

.post-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--bg-light);
}

.back-link {
  color: var(--accent);
  text-decoration: none;
  font-family: monospace;
}

.back-link:hover {
  color: var(--accent-bright);
}

/* Table of Contents - Interactive Sidebar with Progress */
.post-toc {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  /* Track Width */
  height: 200px;
  background-color: rgba(215, 153, 33, 0.1);
  /* Dimmed Accent (Track) */
  z-index: 1000;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s;
  overflow: hidden;
  border-radius: 0 4px 4px 0;
  box-shadow: 2px 0 15px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

.toc-dot {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 8px;
  /* Dot height */
  background-color: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  transition: top 0.1s linear;
  pointer-events: none;
}

.post-toc:hover {
  width: 340px;
  height: auto;
  min-height: 140px;
  max-height: 85vh;
  padding: 1.5rem;
  background-color: var(--bg-light);
  border: 1px solid var(--bg-light);
  overflow-y: auto;
  box-shadow: 5px 0 30px rgba(0, 0, 0, 0.5);
}

.post-toc:hover .toc-dot {
  display: none;
  /* Hide dot when fully expanded for cleaner look */
}

.toc-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--fg-darker);
  margin-bottom: 1.5rem;
  font-weight: 800;
  font-family: monospace;
  opacity: 0;
  transition: opacity 0.2s;
}

.post-toc:hover .toc-title {
  opacity: 1;
}

.toc ol,
.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  opacity: 0;
  transition: opacity 0.2s;
}

.post-toc:hover .toc ol,
.post-toc:hover .toc ul {
  opacity: 1;
}

.toc li {
  margin-bottom: 0.8rem;
  font-size: 0.85rem;
  font-family: monospace;
  line-height: 1.5;
}

.toc li a {
  color: var(--fg-dim);
  text-decoration: none;
  transition: all 0.2s ease;
  display: block;
}

.toc li a:hover {
  color: var(--accent-bright);
  transform: translateX(6px);
}

.toc ol ol,
.toc ul ul {
  margin-left: 2.5rem;
  /* Deep indentation as requested */
  padding-left: 1rem;
  border-left: 1px solid var(--bg);
  margin-top: 0.5rem;
}

.toc ol ol li,
.toc ul ul li {
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

/* Hide TOC on very small screens or make it static */
@media (max-width: 1024px) {
  .post-toc {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    width: 100%;
    height: auto;
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background-color: rgba(60, 56, 54, 0.3);
    border-radius: 4px;
    box-shadow: none;
  }

  .toc-dot {
    display: none;
  }

  .post-toc:hover {
    width: 100%;
    padding: 1.5rem;
  }

  .toc-title,
  .toc ol,
  .toc ul {
    opacity: 1;
  }
}

/* Footer */
.footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--bg-light);
}

.footer p {
  color: var(--fg-darker);
  font-size: 0.8rem;
  font-family: monospace;
}

/* Tech Tags */
.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.tag {
  background-color: rgba(131, 165, 152, 0.15);
  color: var(--accent);
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s;
}

.tag:hover {
  background-color: rgba(131, 165, 152, 0.25);
  color: var(--accent-bright);
}

/* Fun Facts */
.fun-facts {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.fun-fact {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 4px;
  background-color: rgba(60, 56, 54, 0.2);
  transition: all 0.2s;
}

.fun-fact:hover {
  background-color: rgba(60, 56, 54, 0.4);
  transform: translateX(4px);
}

.fact-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.fact-content h4 {
  color: var(--fg);
  font-size: 0.9rem;
  margin-bottom: 0;
  font-weight: 500;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.company-group,
.fun-fact {
  animation: fadeInUp 0.5s ease-out both;
}

.company-group:nth-child(1) {
  animation-delay: 0.1s;
}

.company-group:nth-child(2) {
  animation-delay: 0.2s;
}

.company-group:nth-child(3) {
  animation-delay: 0.3s;
}

.company-group:nth-child(4) {
  animation-delay: 0.4s;
}

.fun-fact:nth-child(1) {
  animation-delay: 0.1s;
}

.fun-fact:nth-child(2) {
  animation-delay: 0.2s;
}

/* Responsive */
@media (max-width: 1024px) {
  .site-wrapper {
    flex-direction: column;
  }

  .left-column {
    position: static;
    width: 100%;
    height: auto;
    padding: 3.5rem 2rem 1rem;
    /* Slightly reduced top, much less bottom */
  }

  .intro {
    justify-content: flex-start;
  }

  .intro h1 {
    font-size: 2.2rem;
    margin-bottom: 0.25rem;
  }

  .intro .tagline {
    font-size: 1.15rem;
    margin-bottom: 1rem;
  }

  .intro .about {
    margin-bottom: 1.5rem;
    font-size: 1rem;
  }

  .nav-links {
    gap: 1.5rem;
  }

  .nav-container {
    padding: 0.85rem 2rem;
  }

  .section-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin: 1rem 0 2rem;
  }

  .section-nav a {
    font-size: 0.68rem;
    /* Slightly smaller for safer fit */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 0.25rem;
    background-color: rgba(60, 56, 54, 0.4);
    border: 1px solid var(--bg-light);
    border-radius: 4px;
    color: var(--fg-dim);
    text-decoration: none;
    transition: all 0.2s;
    font-family: monospace;
    font-weight: 500;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 3.2rem;
    /* Increased and switched to min-height for wrap safety */
    box-sizing: border-box;
    line-height: 1.2;
  }

  .section-nav a::before,
  .section-nav a::after {
    display: none !important;
  }

  .section-nav a:hover {
    background-color: rgba(60, 56, 54, 0.6);
    border-color: var(--accent);
    color: var(--fg);
  }

  .linkedin-nav-link {
    color: var(--accent) !important;
    background-color: rgba(131, 165, 152, 0.1) !important;
    border-color: rgba(131, 165, 152, 0.3) !important;
    margin-top: 0 !important;
    /* Remove desktop margin that breaks mobile grid */
  }

  .linkedin-nav-link:hover {
    background-color: rgba(131, 165, 152, 0.2) !important;
    color: var(--accent-bright) !important;
  }

  .right-column {
    width: 100%;
    padding: 1.5rem 2rem;
  }

  section h2 {
    position: static;
  }

  .job-header {
    flex-direction: column;
    gap: 0.5rem;
  }

  .job-meta {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .left-column {
    padding: 3rem 1.5rem 0.5rem;
  }

  .intro h1 {
    font-size: 2rem;
  }

  .nav-container {
    padding: 0.85rem 1.5rem;
  }

  .right-column {
    padding: 1rem 1.5rem;
  }

  .social-links {
    flex-direction: column;
    gap: 1rem;
  }
}