:root {
  /* Light Theme Colors */
  --bg-color: #f4f2ec;
  --text-main: #111111;
  --text-muted: #666666;
  --border-color: #dcd8cf;
  
  /* Badges */
  --badge-blue-bg: #e6f0fc;
  --badge-blue-color: #4a7ab5;
  --badge-green-bg: #e7f7ed;
  --badge-green-color: #4ca36b;
  --badge-purple-bg: #f4e8fa;
  --badge-purple-color: #925ebb;
  --badge-orange-bg: #faefe8;
  --badge-orange-color: #b57a53;

  /* Fonts */
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'Courier New', Courier, monospace;

  --transition: all 0.3s ease;
  --inner-glow: none;
}

[data-theme="dark"] {
  --bg-color: #080808;
  --text-main: #eaeaea;
  --text-muted: #888888;
  --border-color: #222222;

  --badge-blue-bg: rgba(74, 122, 181, 0.1);
  --badge-blue-color: #79a3d4;
  --badge-green-bg: rgba(76, 163, 107, 0.1);
  --badge-green-color: #6db98a;
  --badge-purple-bg: rgba(146, 94, 187, 0.1);
  --badge-purple-color: #ae81d8;
  --badge-orange-bg: rgba(181, 122, 83, 0.1);
  --badge-orange-color: #d19973;

  /* The Signature Vercel Portfolio Blue Glow */
  --inner-glow: inset 0 0 150px rgba(0, 110, 255, 0.25);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  font-family: var(--font-body);
  background: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* The dark mode glowing frame overlay */
.glow-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  box-shadow: var(--inner-glow);
  pointer-events: none;
  z-index: 999;
  transition: box-shadow 0.4s ease;
}

#canvas-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

[data-theme="dark"] #canvas-bg {
  opacity: 1; 
}

/* Typography */
h1, h2, h3, h4, .logo {
  font-family: var(--font-heading);
  color: var(--text-main);
  font-weight: 600;
  transition: color 0.4s ease;
}

p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 1rem;
}

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

/* Header */
header {
  position: fixed;
  top: 0; width: 100%;
  padding: 1.5rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
}

.logo {
  font-size: 2rem;
  font-style: italic;
  font-weight: 700;
  letter-spacing: -0.5px;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2.5rem;
}

nav a {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}
nav a:hover {
  color: var(--text-main);
}

/* Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.theme-toggle svg {
  width: 20px; height: 20px;
  color: var(--text-muted);
  stroke-width: 1.5px;
  transition: var(--transition);
}

.toggle-track {
  width: 44px; height: 24px;
  background-color: var(--border-color);
  border-radius: 20px;
  position: relative;
  transition: var(--transition);
}

.toggle-knob {
  width: 18px; height: 18px;
  background-color: var(--bg-color);
  border-radius: 50%;
  position: absolute;
  top: 3px; left: 3px;
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

[data-theme="dark"] .toggle-track {
  background-color: #555;
}

[data-theme="dark"] .toggle-knob {
  transform: translateX(20px);
  background-color: #ffffff;
}

[data-theme="dark"] .icon-moon { color: var(--text-main); }
body[data-theme="light"] .icon-sun { color: var(--text-main); }

/* Layout System */
main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 5%;
}

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 120px;
  padding-bottom: 60px;
}

.hero-content {
  margin: auto 0;
}

.hero h1 {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 700;
  letter-spacing: -2px;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.hero h2 {
  font-size: clamp(1.5rem, 4vw, 3rem);
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.3;
}
.hero h2 em {
  font-style: italic;
  font-weight: 600;
  color: var(--text-main);
}

.hero p {
  max-width: 650px;
  font-size: 1.15rem;
  line-height: 1.7;
  margin-bottom: 3rem;
  margin-left: auto;
  margin-right: auto;
}

.hero-tags {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-tags span {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 10px 20px;
  border: 1px solid var(--border-color);
  border-radius: 30px;
  color: var(--text-muted);
  transition: var(--transition);
}
.hero-tags span:hover {
  border-color: var(--text-muted);
  color: var(--text-main);
}

/* Section Row Concept */
.section-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 20px;
  padding: 80px 0;
  border-top: 1px solid var(--border-color);
}

.section-index {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
  padding-top: 5px;
}

.section-content {
  max-width: 750px;
}

/* Skills */
.skills-wrapper {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.skill-group h3 {
  font-family: var(--font-body);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tags span {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: 4px; /* Less rounded, more modern tech */
  color: var(--text-main);
  background: transparent;
  transition: var(--transition);
}

.tags span:hover {
  border-color: var(--text-muted);
}

/* Works / Projects */
.work-item {
  margin-bottom: 4rem;
}

.work-header {
  margin-bottom: 1.5rem;
}

.badge {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 6px 12px;
  border-radius: 4px;
}
.badge.blue { background: var(--badge-blue-bg); color: var(--badge-blue-color); }
.badge.green { background: var(--badge-green-bg); color: var(--badge-green-color); }
.badge.purple { background: var(--badge-purple-bg); color: var(--badge-purple-color); }
.badge.orange { background: var(--badge-orange-bg); color: var(--badge-orange-color); }

.work-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.work-title {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.work-link {
  color: var(--text-muted);
  width: 45px; height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  transition: var(--transition);
}
.work-link:hover {
  color: var(--bg-color);
  background: var(--text-main);
  border-color: var(--text-main);
}

.work-desc {
  font-size: 1.1rem;
  margin-bottom: 1.8rem;
}

.tech-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tech-tags span {
  font-family: var(--font-body);
  font-size: 0.8rem;
  padding: 6px 14px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-muted);
}

/* Experience */
.exp-timeline {
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}

.exp-item {
  display: flex;
  flex-direction: column;
}

.exp-date {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 0.8rem;
}

.exp-details h3 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}
.exp-details h4 {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
}

/* Contact */
.contact-title {
  font-size: 3.5rem;
  letter-spacing: -1.5px;
  margin-bottom: 1.5rem;
  line-height: 1.1;
}
.contact-desc {
  font-size: 1.2rem;
  margin-bottom: 3rem;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.contact-links a {
  font-size: 1.8rem;
  font-weight: 600;
  font-family: var(--font-heading);
  display: inline-block;
  width: max-content;
  position: relative;
  letter-spacing: -0.5px;
}
.contact-links a::after {
  content: '';
  position: absolute;
  width: 100%; height: 2px;
  bottom: 0; left: 0;
  background-color: var(--text-main);
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.4s ease;
}
.contact-links a:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

footer {
  text-align: center;
  padding: 4rem 0;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  margin-top: 80px;
}

/* Reveal Animation */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
  nav ul {
    display: none;
  }
  .section-row {
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 60px 0;
  }
  .section-index {
    margin-bottom: 10px;
  }
  .hero h1 {
    font-size: 3.5rem;
  }
  .hero h2 {
    font-size: 1.8rem;
  }
  .work-title {
    font-size: 1.8rem;
  }
}