:root {
  --bg: #0d1117;
  --text: #c9d1d9;
  --highlight: #58a6ff;
  --card-bg: #161b22;
  --badge-bg: #2d3748;
  --hover-glow: rgba(88, 166, 255, 0.2);
  --border-color: rgba(255, 255, 255, 0.1);
  --text-contrast: #d1d5db;
}

body.light {
  --bg: #f5f5f5;
  --text: #111;
  --highlight: #007acc;
  --card-bg: #ffffff;
  --badge-bg: #e2e8f0;
  --hover-glow: rgba(0, 122, 204, 0.12);
  --border-color: rgba(167, 169, 173, 0.2);
  --text-contrast: #1a1a1a;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.4s ease, color 0.4s ease;
}

/* LIGHT MODE code syntax */
body.light pre code span.keyword {
  color: #af00db;
}
body.light pre code span.function {
  color: #795e26;
}
body.light pre code span.variable {
  color: #001080;
}
body.light pre code span.control {
  color: #0000ff;
}

/* DARK MODE code syntax */
body:not(.light) pre code span.keyword {
  color: #c586c0;
}
body:not(.light) pre code span.function {
  color: #dcdcaa;
}
body:not(.light) pre code span.variable {
  color: #9cdcfe;
}
body:not(.light) pre code span.control {
  color: #569cd6;
}

/* NAVBAR */
.navbar-wrapper {
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 2000;
  backdrop-filter: blur(0px);
  transition: 0.3s ease;
  background: transparent;
}

.navbar-wrapper.scrolled {
  backdrop-filter: blur(10px);
  background: var(--bg);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  margin: 0 max(20px, 5vw);
  border-bottom: 1px solid var(--border-color);
}

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

nav a {
  text-decoration: none;
  color: var(--text);
  padding-bottom: 4px;
  position: relative;
  opacity: 0.85;
  transition: 0.25s ease;
}

nav a:hover,
nav a.active {
  opacity: 1;
  color: var(--highlight);
}

nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--highlight);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.25s ease;
}

nav a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* THEME TOGGLE + SCROLL TO TOP BUTTONS */
.theme-toggle,
.scroll-to-top {
  width: 42px;
  height: 42px;
  background: var(--card-bg);
  border-radius: 50%;
  border: 1px solid var(--text-contrast);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: 0.3s ease;
}

.theme-toggle svg,
.scroll-to-top svg {
  width: 22px;
  height: 22px;
  position: absolute;
  fill: var(--text);
  transition: opacity 0.3s, transform 0.3s;
}

#iconSun {
  opacity: 0;
  transform: scale(0.5);
}
body.light #iconSun {
  opacity: 1;
  transform: scale(1);
}
body.light #iconMoon {
  opacity: 0;
  transform: scale(0.5);
}

/* SCROLL TO TOP POSITIONING */
.scroll-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  opacity: 0;
  pointer-events: none;
  z-index: 1000;
}
.scroll-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

/* CONTENT */
.container {
  max-width: 900px;
  margin: auto;
  padding: 2rem 1rem;
}

header {
  margin-bottom: 1.5rem;
  padding-top: 1rem;
}

h1 {
  font-size: 3rem;
}
h1 span {
  color: var(--highlight);
}

h2 {
  margin-top: 0.4rem;
  opacity: 0.85;
}

section {
  margin-top: 3rem;
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.tile {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
  transition: 0.3s ease;
}

.tile:hover {
  border-color: var(--highlight);
  box-shadow: 0 0 10px var(--highlight);
  background: var(--hover-glow);
}

.tech-stack span {
  display: inline-block;
  padding: 0.35rem 0.6rem;
  background: var(--badge-bg);
  margin: 0.3rem 0.5rem 0.3rem 0;
  border-radius: 6px;
  font-size: 0.75rem;
}

/* FOOTER */
footer {
  text-align: center;
  padding: 2rem 1rem 3rem;
  border-top: 1px solid var(--border-color);
  margin-top: 4rem;
}

footer .icons {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 0.8rem;
}

footer .icons a {
  color: var(--text);
  transition: 0.3s ease;
}

footer .icons a:hover {
  color: var(--highlight);
  transform: scale(1.2);
}

footer svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

footer p {
  font-size: 0.875rem;
  opacity: 0.7;
}

.fade-in {
  animation: fadeIn 0.4s ease-in-out;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
