* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, sans-serif;
  max-width: 800px;
  margin: 40px auto;
  padding: 0 20px;

  background: var(--bg-primary);
  color: var(--text-primary);
  transition: background 0.3s ease, color 0.3s ease;
}

section {
  padding: 20px 0;
  scroll-margin-top: 80px;
}


h1,
h2 {
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: none;
}

pre {
  overflow: auto;
  font-size: 15px;
}

/* ------------------ Root - Theme ------------------*/
:root {
  /* Base */
  --bg-primary: #0f1115;
  --bg-secondary: #171a21;
  --bg-card: #1e222b;

  /* Text */
  --text-primary: #f0f3f8;
  --text-secondary: #aab2c5;

  /* Accent */
  --accent: #6ccfff;
  --accent-hover: #8edbff;

  /* Borders */
  --border: rgba(255, 255, 255, 0.08);

  /* Shadows */
  --shadow-soft: rgba(0, 0, 0, 0.4);
  --shadow-glow: rgba(108, 207, 255, 0.25);

  --nav-bg: rgba(20, 22, 30, 0.6);
  --nav-border: rgba(255, 255, 255, 0.08);
  --section-bg: #1e222b;

}

body.light {
  --bg-primary: #f7f9fc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;

  --text-primary: #111827;
  --text-secondary: #4b5563;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;

  --border: rgba(0, 0, 0, 0.08);

  --shadow-soft: rgba(0, 0, 0, 0.1);
  --shadow-glow: rgba(37, 99, 235, 0.3);

  --nav-bg: rgba(255, 255, 255, 0.6);
  --nav-border: rgba(0, 0, 0, 0.08);
  --section-bg: #ffffff;

}

/* ------------------ Navbar ------------------*/
.navbar {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* padding: 16px 24px; */
  padding: 14px 30px;
  border-radius: 10px;

  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  border-bottom: 1px solid var(--nav-border);
  z-index: 1000;

  transition: background 0.3s ease;
}

.navbar a {
  color: var(--text-primary);
  margin-right: 20px;
  text-decoration: none;
  transition: color 0.2s ease;

  position: relative;
  padding: 6px 0;
}

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

.navbar a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0%;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.navbar a:hover::after {
  width: 100%;
}

.navbar a.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hamburger {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
}

/* ------------------ Theme Toggle ------------------ */

/* Toggle container */

.theme-toggle {
  position: relative;
  width: 60px;
  height: 30px;
  display: inline-block;
}

.theme-toggle input {
  display: none;
}

/* Track */

.slider {
  position: absolute;
  inset: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50px;
  cursor: pointer;
}

/* Icons */

.icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  stroke: var(--text-secondary);
  stroke-width: 2;
  fill: none;
  opacity: 0.6;
}

.moon {
  left: 8px;
}

.sun {
  right: 8px;
}

/* Toggle knob */

.slider::before {
  content: "";
  position: absolute;

  width: 22px;
  height: 22px;

  top: 50%;
  left: 4px;

  transform: translateY(-50%);

  background: var(--accent);
  border-radius: 50%;

  transition: transform 0.3s ease;

  box-shadow: 0 0 10px var(--shadow-glow);
  z-index: 2;
}

/* Move knob */

.theme-toggle input:checked+.slider::before {
  transform: translate(30px, -50%);
}

/* Dark mode (default) -> highlight sun */

.theme-toggle input:not(:checked)+.slider .sun {
  opacity: 0.5;
  stroke: var(--accent);
}

/* Light mode -> highlight moon */

.theme-toggle input:checked+.slider .moon {
  opacity: 0.5;
  stroke: var(--accent);
}

/* .theme-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.theme-btn:hover {
  background: var(--accent);
  color: white;
} */

/* ------------------ About ------------------*/
.subtitle {
  font-size: 1.2rem;
  color: var(--accent);
  margin-bottom: 20px;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 80vh;
}

.hero-left img {
  width: 280px;
  border-radius: 12px;
  box-shadow: 0 0 50px var(--shadow-soft);
  transition: 0.3s ease;
}

.hero-left img:hover {
  transform: scale(1.03);
  transition: 0.3s ease;
  box-shadow: 0 0 70px var(--shadow-glow);
}

.hero-right {
  flex: 1;
}

.hero-right h1 {
  font-size: 2.8rem;
  margin-bottom: 10px;
}

pre {
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  max-width: 100%;
}

@media (max-width: 768px) {

  .hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
  }

  .hero-left,
  .hero-right {
    width: 100%;
    max-width: 100%;
  }

  .hero-right {
    overflow: hidden;
  }

  .hero-left img {
    max-width: 100%;
    height: auto;
  }
}

@media (max-width: 768px) {

  .nav-left {
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;

    background: var(--bg-secondary);
    border-top: 1px solid var(--border);

    flex-direction: column;
    align-items: center;
    padding: 20px 0;

    display: none;
  }

  .nav-left a {
    margin: 10px 0;
  }

  .nav-left.active {
    display: flex;
  }

  .hamburger {
    display: block;
  }

}

/* ------------------Experience - Timeline ------------------*/
.timeline {
  position: relative;
  margin-top: 50px;
  padding-left: 40px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 0;
  width: 3px;
  height: 100%;
  background: var(--border);
}

.timeline-progress {
  position: absolute;
  left: 18px;
  top: 0;
  width: 3px;
  height: 0%;
  background: var(--accent);
  box-shadow: 0 0 15px var(--shadow-glow);
  transition: height 0.2s ease-out;
}

.timeline-item {
  position: relative;
  margin-bottom: 60px;
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.6s ease;
}

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

.timeline-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 0 30px var(--shadow-soft);
  transition: 0.3s ease;
  position: relative;
  z-index: 1;
}

.timeline-content:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 50px var(--shadow-glow);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.timeline-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.timeline-date {
  font-size: 0.9rem;
  color: var(--accent);
}

.timeline-role {
  margin-top: 6px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* .timeline-date {
  display: block;
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 10px;
} */

.tech-tags {
  margin-top: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tech-tags span {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  transition: 0.3s ease;
}

.tech-tags span:hover {
  background: var(--accent);
  color: white;
  box-shadow: 0 0 15px var(--shadow-glow);
}

@media (max-width: 768px) {

  .timeline {
    padding-left: 25px;
  }

  .timeline-dot {
    left: -4px;
  }

  .timeline-content {
    padding: 16px;
  }

  .timeline-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .timeline-date {
    margin-top: 4px;
  }
}

/* ------------------ Projects ------------------*/

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
  margin: 40px 0;
}

/* card */

.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  transition: transform .25s ease, box-shadow .25s ease;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 0 40px var(--shadow-glow);
}

/* title */

.project-title {
  color: var(--accent);
  margin-bottom: 6px;
}

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

/* category badge */

.category {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;

  background: var(--bg-secondary);
  color: var(--accent);

  letter-spacing: .5px;
  text-transform: uppercase;
}

/* description */

.project-description {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 10px;
}

/* bullet points */

.project-points {
  padding-left: 18px;
  margin-bottom: 12px;
}

.project-points li {
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.4;
}

/* tags */

.project-tags {
  margin-bottom: 12px;
}

.project-tags span {
  display: inline-block;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 4px 10px;
  margin: 3px;
  font-size: 11px;
  border-radius: 6px;
  color: var(--text-secondary);
  transition: all .2s ease;
}

.card:hover .project-tags span {
  transform: translateY(-2px);
  color: var(--accent);
  border-color: var(--accent);
}

/* button */

.open-project {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  transition: color .2s ease;
}

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

/* ------------------ Icons Anim ------------------*/

.tech-marquee {
  padding: 60px 0;
  overflow: hidden;
  position: relative;
  /* background-color: #1e222b; */

  background: var(--section-bg);
}

.tech-marquee::before,
.tech-marquee::after {
  content: "";
  position: absolute;
  top: 0;
  width: 200px;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.tech-marquee::before {
  left: 0;
  background: linear-gradient(to right, var(--bg-primary), transparent);
}

.tech-marquee::after {
  right: 0;
  background: linear-gradient(to left, var(--bg-primary), transparent);
}

.marquee-wrapper {
  width: 100%;
  overflow: hidden;
}

.marquee-track {
  display: flex;
  align-items: center;
  gap: 60px;
  width: max-content;
  animation: scrollLeft 20s linear infinite;
}

.marquee-track img {
  height: 60px;
  opacity: 0.8;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.marquee-track img:hover {
  transform: scale(1.15);
  opacity: 1;
}

.tech-item {
  width: 60px;
  height: 60px;

  display: flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;
}

.tech-item img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

@keyframes scrollLeft {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

@media (max-width: 768px) {
  .marquee-track {
    gap: 40px;
    animation-duration: 15s;
  }

  .marquee-track img {
    height: 45px;
  }
}

/* ------------------ Playground ------------------*/
.play-card {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}

.play-card::before {
  content: "";
  position: absolute;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, var(--shadow-glow), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

#playground {
  padding: 50px 0;
  text-align: center;
  overflow-x: hidden;

}

.pixel-box {
  width: 100%;
  max-width: 400px;
  aspect-ratio: 4 / 3;

  margin: 40px auto;

  display: grid;
  grid-template-columns: repeat(20, 1fr);
  grid-template-rows: repeat(15, 1fr);
  gap: 2px;

  background: var(--border);
  padding: 5px;
  border-radius: 12px;
}

.pixel {
  background: var(--bg-card);
  transition: background 0.4s ease;
  border-radius: 2px;
}

/* ------------------ Contact ------------------*/
.footer {
  padding: 60px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.footer-content {
  max-width: 1100px;
  margin: auto;
  text-align: center;
}

.footer-text {
  font-size: 1.2rem;
  margin-bottom: 25px;
  color: var(--text-primary);
}

.footer-icons {
  display: flex;
  justify-content: center;
  gap: 24px;
}

.icon-link {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.icons {
  width: 20px;
  height: 20px;
}

.icon-link:hover {
  color: white;
  background: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 0 25px var(--shadow-glow);
}

.icon-link:active {
  transform: scale(0.95);
}

/* ------------------ Project modal ------------------*/
.project-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);

  display: none;
  align-items: center;
  justify-content: center;

  padding: 20px;
  z-index: 2000;

  overflow-y: auto;
  /* important */
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex: 0 0 auto;
}

.modal-header h2 {
  color: var(--text-primary);
}

.modal-body {
  flex: 1 1 auto;
  overflow-y: auto;

  margin: 16px 0;
  padding-right: 8px;

  min-height: 120px;
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 10px;
}

.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.modal-actions {
  flex: 0 0 auto;

  margin-bottom: 16px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.project-modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;

  width: 100%;
  max-width: 700px;
  height: 90vh;

  padding: 28px;
  box-shadow: 0 0 80px var(--shadow-soft);

  display: flex;
  flex-direction: column;

  position: relative;
}

.close-modal {
  position: absolute;
  top: 16px;
  right: 18px;

  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
}

.close-modal:hover {
  color: var(--accent);
}

.live-link {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 10px;
  background: var(--accent);
  color: #0f1115;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px var(--shadow-glow);
}

.live-link:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 20px var(--shadow-glow);
  transform: translateY(-2px);
}

.live-link:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px var(--shadow-glow);
}

.video-wrapper {
  flex: 0 0 auto;

  width: 100%;
  max-height: 240px;

  aspect-ratio: 16/9;
  border-radius: 12px;
  overflow: hidden;
}

.video-wrapper video {
  width: 100%;
  height: 100%;
  /* object-fit: cover; */
  object-fit: contain;
  background: #000;
  /* black bars if needed */
}

.modal-content::-webkit-scrollbar {
  width: 6px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 10px;
}

@media (max-width: 768px) {

  .modal-content {
    padding: 20px;
    border-radius: 14px;
  }

  .modal-content h2 {
    font-size: 1.4rem;
  }

  .modal-content p {
    font-size: 0.95rem;
  }

}

@keyframes fadeIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

#modal-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.modal-points {
  padding-left: 18px;
  margin-top: 10px;
}

.modal-points li {
  margin-bottom: 8px;
  color: var(--text-secondary);
  line-height: 1.5;
}