:root {
  --accent-primary: #5b46ff;
  --accent-light: #e9e5ff;
  --accent-medium: #d5ccff;
  --accent-dark: #4837cc;
  --text-primary: #212529;
  --text-secondary: #495057;
  --text-tertiary: #6c757d;
  --bg-color: #ffffff;
  --bg-gradient: linear-gradient(135deg, #f8f9fa, #e9ecef);
  --card-bg: #ffffff;
  --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --button-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --card-border: rgba(0, 0, 0, 0.05);
  --section-spacing: 6rem;
  --subsection-spacing: 3rem;
  
  --primary: var(--accent-primary);
  --primary-light: var(--accent-light);
  --primary-medium: var(--accent-medium);
  --primary-dark: var(--accent-dark);
}

.dark {
  --accent-primary: #6c63ff;
  --accent-light: #2c1a6a;
  --accent-medium: #3a2980;
  --accent-dark: #8a7bff;
  --text-primary: #eef1f8;
  --text-secondary: #c4d0e3;
  --text-tertiary: #8896b2;
  --bg-color: #0a0d14;
  --bg-gradient: linear-gradient(135deg, #10141e, #171a2b, #1d2036);
  --card-bg: #161a26;
  --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.2);
  --button-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
  --card-border: rgba(255, 255, 255, 0.06);
  
  --primary: var(--accent-primary);
  --primary-light: var(--accent-light);
  --primary-medium: var(--accent-medium);
  --primary-dark: var(--accent-dark);
}

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

body {
  font-family: 'Open Sans', 'Inter', sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-gradient);
  min-height: 100vh;
  padding: 2rem;
  transition: background 0.3s ease, color 0.3s ease;
  overscroll-behavior: none;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background-color: var(--accent-primary);
  width: 0%;
  z-index: 100;
  transition: width 0.1s ease-out;
}

.theme-toggle {
  position: fixed;
  top: 2rem;
  right: 2rem;
  background: var(--accent-light);
  color: var(--accent-primary);
  border: none;
  border-radius: 9999px;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--button-shadow);
  z-index: 10;
}

.theme-toggle:hover {
  transform: scale(1.1);
  background: var(--accent-medium);
}

.project-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 3rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
  transition: transform 0.3s ease;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
}

.back-link:hover {
  transform: translateX(-5px);
  background: var(--accent-light);
}

.back-button {
  position: fixed;
  top: 2rem;
  left: 1.5rem;
  background: var(--accent-light);
  color: var(--accent-primary);
  border: none;
  border-radius: 9999px;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--button-shadow);
  z-index: 10;
  text-decoration: none;
}

.back-button:hover {
  transform: scale(1.1);
  background: var(--accent-medium);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-family: 'Lato', sans-serif;
  transition: color 0.3s ease;
  margin-top: 0;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent-primary);
}

h2 {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: 1.5rem;
}

h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  transition: color 0.3s ease;
}

strong {
  color: var(--text-primary);
  font-weight: 600;
}

.section-card {
  background: var(--card-bg);
  color: var(--text-primary);
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin-bottom: 2rem;
}

.section-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 20px -3px rgba(0, 0, 0, 0.15), 0 8px 8px -2px rgba(0, 0, 0, 0.08);
}

.card {
  background-color: var(--card-bg);
  border-radius: 1rem;
  box-shadow: var(--card-shadow);
  padding: 2rem;
  margin-bottom: 2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid var(--card-border);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(91, 70, 255, 0.12);
}

.section {
  margin-bottom: var(--section-spacing);
}

.overview-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

.project-media {
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: var(--card-bg);
}

.project-media:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 30px -5px rgba(0, 0, 0, 0.15), 0 15px 15px -5px rgba(0, 0, 0, 0.08);
}

.project-media img {
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.skill-badge {
  background-color: var(--accent-light);
  color: var(--accent-primary);
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, background-color 0.3s ease;
  display: inline-block;
  margin: 0.5rem;
}

.dark .skill-badge {
  background: linear-gradient(45deg, var(--accent-light), var(--accent-medium));
  color: #ffffff;
}

.skill-badge:hover {
  transform: scale(1.05);
  background-color: var(--accent-medium);
}

.skill-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 2.5rem;
}

.github-button {
  background: var(--accent-light);
  color: var(--accent-primary);
  padding: 1rem 2rem;
  border-radius: 9999px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  text-decoration: none;
}

.github-button:hover {
  background: var(--accent-medium);
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.list-item {
  padding: 0.5rem 0;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  color: var(--text-secondary);
}

.list-item:before {
  content: "•";
  color: var(--accent-primary);
  font-weight: bold;
  margin-top: 0.15rem;
}

.image-container {
  margin: 2rem 0;
  text-align: center;
}

.image-container img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  max-height: 500px;
  object-fit: contain;
}

.caption {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-tertiary);
  margin-top: 0.5rem;
  margin-bottom: 2rem;
}

.highlight-box {
  background-color: var(--accent-light);
  border-left: 4px solid var(--accent-primary);
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: 0.5rem;
}

.highlight-box p {
  margin-bottom: 1rem;
}

.highlight-box p:last-child {
  margin-bottom: 0;
}

.intro-text {
  font-size: 1.25rem;
  line-height: 1.8;
  margin-bottom: 3rem;
  color: var(--text-secondary);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.project-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: var(--accent-light);
  color: var(--accent-primary);
  border-radius: 9999px;
  font-weight: 500;
  font-size: 0.875rem;
  margin-right: 0.75rem;
  margin-bottom: 0.75rem;
}

.project-badges {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.feature-card {
  background: var(--card-bg);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--card-border);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.feature-icon {
  font-size: 1.75rem;
  color: var(--accent-primary);
  margin-bottom: 1rem;
}

.feature-title {
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.feature-description {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

code:not(pre code) {
  background-color: var(--accent-light);
  color: var(--accent-primary);
  padding: 0.15rem 0.45rem;
  border-radius: 0.3rem;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.875em;
}

pre {
  background-color: #1a1d2b;
  border-radius: 0.75rem;
  padding: 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid rgba(108, 99, 255, 0.2);
}

.dark pre {
  background-color: #0d1117;
  border-color: rgba(108, 99, 255, 0.3);
}

pre code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.875rem;
  color: #c9d1d9;
  line-height: 1.7;
}

.tech-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

.tech-table th {
  background-color: var(--accent-light);
  color: var(--accent-primary);
  font-weight: 600;
  padding: 0.85rem 1.25rem;
  text-align: left;
  border-bottom: 2px solid var(--accent-medium);
}

.tech-table td {
  padding: 0.85rem 1.25rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--card-border);
  vertical-align: top;
}

.tech-table tr:last-child td {
  border-bottom: none;
}

.tech-table tr:hover td {
  background-color: rgba(91, 70, 255, 0.03);
}

.pipeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 2rem 0;
}

.pipeline-step {
  display: flex;
  align-items: stretch;
  gap: 1.5rem;
}

.pipeline-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 40px;
  flex-shrink: 0;
}

.pipeline-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(91, 70, 255, 0.3);
  z-index: 2;
}

.pipeline-line {
  flex: 1;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-primary), var(--accent-medium));
  min-height: 1.5rem;
}

.pipeline-body {
  flex: 1;
  padding-bottom: 2rem;
}

.pipeline-step:last-child .pipeline-body {
  padding-bottom: 0;
}

.pipeline-title {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  padding-top: 0.5rem;
}

.pipeline-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.65;
  margin: 0;
}

.pipeline-fork {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0 0;
}

.fork-card {
  border-radius: 0.75rem;
  padding: 1.25rem;
  border: 2px solid;
}

.fork-card.primary {
  border-color: var(--accent-primary);
  background: rgba(91, 70, 255, 0.04);
}

.fork-card.fallback {
  border-color: var(--text-tertiary);
  background: rgba(108, 117, 125, 0.04);
}

.fork-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.fork-card.primary .fork-label {
  color: var(--accent-primary);
}

.fork-card.fallback .fork-label {
  color: var(--text-tertiary);
}

.fork-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.priority-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 1rem 0;
}

.priority-table th {
  background-color: var(--accent-light);
  color: var(--accent-primary);
  padding: 0.6rem 1rem;
  text-align: left;
  font-weight: 600;
}

.priority-table td {
  padding: 0.6rem 1rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--card-border);
}

.priority-table tr:last-child td {
  border-bottom: none;
}

.priority-badge {
  display: inline-block;
  background: var(--accent-primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
}

.process-step {
  display: flex;
  align-items: flex-start;
  margin-bottom: 2.5rem;
  position: relative;
}

.step-number {
  background-color: var(--accent-primary);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  margin-right: 2rem;
  flex-shrink: 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 2;
}

.process-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 20px;
  top: 40px;
  bottom: -40px;
  width: 2px;
  background-color: var(--accent-light);
  z-index: 1;
}

.step-content {
  flex: 1;
  padding-top: 0.5rem;
}

.screenshot-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.screenshot {
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s ease;
  background: var(--accent-light);
  padding: 0.5rem;
}

.screenshot:hover {
  transform: scale(1.03);
}

.screenshot img {
  width: 100%;
  height: auto;
  border-radius: 0.75rem;
}

.iphone-mockup {
  position: relative;
  width: 300px;
  height: 600px;
  background-color: #111;
  border-radius: 40px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  padding: 10px;
  margin: 0 auto;
  border: 10px solid #333;
  overflow: hidden;
}

.iphone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 25px;
  background-color: var(--bg-color);
  border-bottom-left-radius: 15px;
  border-bottom-right-radius: 15px;
  z-index: 2;
}

.iphone-screen {
  width: 100%;
  height: 100%;
  border-radius: 30px;
  overflow: hidden;
  position: relative;
  background-color: var(--bg-color);
}

.iphone-screen video,
.iphone-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.demo-section {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 3rem;
  margin: 3rem 0;
}

.mockup-container {
  position: relative;
}

.mockup-shadow {
  position: absolute;
  width: 90%;
  height: 30px;
  bottom: -15px;
  left: 5%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0) 70%);
  border-radius: 50%;
  z-index: -1;
}

.app-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tech-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.tech-icon {
  color: var(--accent-primary);
}

.version-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.version-card {
  background-color: var(--accent-light);
  border-radius: 1rem;
  padding: 1.5rem;
  color: var(--text-primary);
}

.code-block {
  background-color: var(--bg-color);
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 1rem 0;
  font-family: monospace;
  overflow-x: auto;
  border: 1px solid var(--card-border);
}

.code-line {
  display: block;
  margin-bottom: 0.25rem;
}

@media (max-width: 768px) {
  body {
    padding: 1rem;
  }

  .project-container {
    padding: 0 1.25rem;
  }

  .section-card {
    padding: 1.5rem;
  }

  .theme-toggle {
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
  }

  .back-button {
    top: 1rem;
    left: 1rem;
    width: 2.5rem;
    height: 2.5rem;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.1rem;
  }

  .overview-section {
    grid-template-columns: 1fr;
  }

  .demo-section {
    grid-template-columns: 1fr;
  }

  .iphone-mockup {
    margin: 0 auto 2rem;
  }

  .pipeline-fork {
    grid-template-columns: 1fr;
  }

  .version-comparison {
    grid-template-columns: 1fr;
  }

  .skill-badge {
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
  }

  .tech-table th,
  .tech-table td {
    padding: 0.65rem 0.85rem;
    font-size: 0.875rem;
  }

  .priority-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .priority-table th,
  .priority-table td {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    white-space: nowrap;
  }

  .card {
    padding: 1.25rem;
  }
}

@media (max-width: 480px) {
  .project-container {
    padding: 0 0.75rem;
  }

  .section-card {
    padding: 1.25rem 0.75rem;
  }

  .feature-card {
    padding: 1.25rem 0.75rem;
  }
}

@media (hover: none) {
  .project-card:hover,
  .experience-item:hover,
  .section-card:hover,
  .card:hover {
    transform: none;
    box-shadow: var(--card-shadow);
  }

  .project-card:active,
  .experience-item:active,
  .section-card:active,
  .card:active {
    background-color: var(--accent-light);
    opacity: 0.95;
  }

  .resume-button:active,
  .github-button:active,
  .view-all-button:active,
  .social-link:active {
    transform: scale(0.98);
    opacity: 0.9;
  }

  .skill-badge {
    padding: 0.5rem 1.25rem;
    margin: 0.25rem;
  }
}

.algorithm-comparison {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}

.algorithm-card {
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: var(--card-bg);
}

.algorithm-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.architecture-comparison {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin: 2rem 0;
}

.architecture-card {
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: var(--card-bg);
}

.architecture-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.inspiration-section {
  background: linear-gradient(135deg, var(--accent-light), var(--accent-medium));
  border-radius: 1.5rem;
  padding: 2rem;
  color: var(--text-primary);
  margin: 3rem 0;
  position: relative;
  overflow: hidden;
}

.inspiration-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, var(--accent-primary), transparent);
  opacity: 0.05;
  z-index: 0;
}

.inspiration-content {
  position: relative;
  z-index: 1;
}

@media (max-width: 768px) {
  .algorithm-comparison {
    grid-template-columns: 1fr;
  }
  
  .architecture-comparison {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  * {
    transition-duration: 0.2s !important;
  }

  .profile-photo-wrapper,
  .profile-photo,
  .text-pressure-title span {
    animation: none !important;
    transform: none !important;
    transition: none !important;
    will-change: auto !important;
  }

  .project-image {
    height: 140px;
  }

  @supports not (backdrop-filter: blur(10px)) {
    header {
      background-color: var(--header-bg);
      backdrop-filter: none;
    }
  }
}
