/* ===== DESIGN TOKENS ===== */
:root {
  --bg-dark: #0a0a0f;
  --surface: #12121a;
  --surface-hover: #1a1a26;
  --bg-light: #f5f4f0;
  --surface-light: #eeecea;
  --accent: #6c63ff;
  --accent-glow: rgba(108, 99, 255, 0.3);
  --accent-teal: #00d4aa;
  --accent-teal-glow: rgba(0, 212, 170, 0.25);
  --text-dark: #e8e6f0;
  --text-dark-muted: #8b8a9a;
  --text-light: #1a1a2e;
  --text-light-muted: #6b6a7a;
  --border-dark: rgba(255, 255, 255, 0.08);
  --border-light: rgba(0, 0, 0, 0.08);
  --font-display: "Clash Display", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --font-body: "Inter", sans-serif;
  --radius: 16px;
  --radius-sm: 8px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1200px;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); line-height: 1.6; overflow-x: hidden; background: var(--bg-dark); }
img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ===== LAYOUT ===== */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 2rem; }
.section-dark { background: var(--bg-dark); color: var(--text-dark); padding: 6rem 0; }
.section-light { background: var(--bg-light); color: var(--text-light); padding: 6rem 0; }

/* ===== TYPOGRAPHY ===== */
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}
.section-subtitle {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  opacity: 0.55;
  margin-bottom: 3rem;
  letter-spacing: 0.03em;
}

/* ===== SCROLL REVEAL ===== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s var(--transition), transform 0.7s var(--transition);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== WAVE DIVIDERS ===== */
.wave-divider { line-height: 0; overflow: hidden; display: block; }
.wave-divider svg { display: block; width: 100%; height: 60px; }
.light-to-dark { background: var(--bg-light); }
.light-to-dark svg { fill: var(--bg-dark); }
.dark-to-light { background: var(--bg-dark); }
.dark-to-light svg { fill: var(--bg-light); }

/* ===== SKELETON LOADER ===== */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hover) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
  min-height: 80px;
  width: 100%;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== TAGS ===== */
.tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.3rem 0.8rem;
  border-radius: 100px;
  background: var(--surface-light);
  color: var(--text-light-muted);
  border: 1px solid var(--border-light);
  display: inline-block;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .container { padding: 0 1.25rem; }
  .section-dark, .section-light { padding: 4rem 0; }
  .wave-divider svg { height: 40px; }
}

/* ===== NAV ===== */
#site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-dark);
}
.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: -0.01em;
  transition: color var(--transition);
}
.nav-brand:hover { color: var(--accent-teal); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}
.nav-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dark-muted);
  letter-spacing: 0.02em;
  transition: color var(--transition);
}
.nav-link:hover { color: var(--text-dark); }
.nav-link.active { color: var(--accent-teal); }
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-dark);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
section { scroll-margin-top: 60px; }
@media (max-width: 600px) {
  .nav-hamburger { display: flex; }
  .nav-links {
    display: none;
    position: fixed;
    top: 60px; left: 0; right: 0;
    background: rgba(10, 10, 15, 0.96);
    backdrop-filter: blur(16px);
    flex-direction: column;
    padding: 1.5rem 2rem;
    gap: 1.25rem;
    border-bottom: 1px solid var(--border-dark);
  }
  .nav-links.open { display: flex; }
}

/* ===== HERO ===== */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 0;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 40%, rgba(108, 99, 255, 0.22) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 60%, rgba(0, 212, 170, 0.18) 0%, transparent 60%),
    var(--bg-dark);
  animation: hero-shift 12s ease-in-out infinite alternate;
}
@keyframes hero-shift {
  0%   { filter: hue-rotate(0deg) brightness(1); }
  50%  { filter: hue-rotate(15deg) brightness(1.05); }
  100% { filter: hue-rotate(-10deg) brightness(0.98); }
}
#hero .container {
  position: relative;
  z-index: 1;
}
.hero-greeting {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--accent-teal);
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
  opacity: 0;
  animation: fade-up 0.6s 0.2s ease forwards;
}
.hero-name {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 10vw, 8rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text-dark) 0%, var(--accent) 50%, var(--accent-teal) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fade-up 0.6s 0.4s ease forwards;
}
.hero-tagline {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  color: var(--text-dark-muted);
  min-height: 2.2rem;
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 0;
  animation: fade-up 0.6s 0.6s ease forwards;
}
.cursor {
  display: inline-block;
  animation: blink 1s step-end infinite;
  color: var(--accent);
  font-weight: 300;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
.hero-scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dark-muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0;
  animation: float 2.5s ease-in-out infinite, fade-up 0.6s 1.2s ease forwards;
}
@keyframes float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== ABOUT ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  max-width: 760px;
}
.about-text p {
  font-size: 1.1rem;
  line-height: 1.85;
  color: var(--text-light);
  margin-bottom: 1.25rem;
}
.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
}
.section-light .tag {
  background: var(--surface-light);
  color: var(--text-light-muted);
  border-color: var(--border-light);
}
.section-dark .tag {
  background: rgba(108, 99, 255, 0.1);
  color: var(--accent);
  border-color: rgba(108, 99, 255, 0.25);
}

/* ===== TECH STACK ===== */
.stack-categories { display: flex; flex-direction: column; gap: 1.5rem; }
.stack-category-row { display: flex; align-items: flex-start; gap: 1.5rem; }
.stack-category-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dark-muted);
  width: 110px;
  flex-shrink: 0;
  padding-top: 0.45rem;
}
.stack-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; flex: 1; }
.stack-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--border-dark);
  border-radius: 100px;
  font-size: 0.82rem;
  color: var(--text-dark);
  cursor: default;
  transition: border-color var(--transition), color var(--transition), transform var(--transition);
}
.stack-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}
.stack-pill img { width: 16px; height: 16px; object-fit: contain; }
.stack-pill-initial {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--accent), var(--accent-teal));
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .stack-category-row { flex-direction: column; gap: 0.5rem; }
  .stack-category-label { width: auto; }
}

/* ===== PROJECTS — SHOWCASE LAYOUT ===== */
.projects-showcase {
  display: flex;
  flex-direction: column;
  gap: 5rem;
}

.showcase-row {
  display: grid;
  grid-template-columns: 55% 45%;
  gap: 3rem;
  align-items: center;
}

.showcase-row.reversed {
  grid-template-columns: 45% 55%;
}

.showcase-row.reversed .showcase-image {
  order: 2;
}

.showcase-row.reversed .showcase-text {
  order: 1;
}

/* Browser frame */
.browser-frame {
  border-radius: var(--radius);
  overflow: hidden;
  background: #1a1a2e;
  border: 1px solid var(--border-light);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
  transition: transform var(--transition), box-shadow var(--transition);
}

.browser-frame:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2), 0 0 40px var(--card-accent, rgba(108, 99, 255, 0.15));
}

.browser-bar {
  background: #2a2a3e;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.browser-dots {
  display: flex;
  gap: 0.35rem;
}

.browser-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: block;
}

.browser-url {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 0.25rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.browser-frame img {
  width: 100%;
  display: block;
}

/* Placeholder for projects without screenshots */
.showcase-placeholder {
  border-radius: var(--radius);
  aspect-ratio: 16 / 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: linear-gradient(135deg, rgba(0, 212, 170, 0.08), rgba(108, 99, 255, 0.08));
  border: 1px dashed var(--border-light);
}

.showcase-placeholder-icon {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  opacity: 0.6;
}

.showcase-placeholder-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-light-muted);
  opacity: 0.6;
}

/* Text side */
.showcase-text {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.showcase-accent-bar {
  width: 40px;
  height: 3px;
  background: var(--card-accent, var(--accent));
  border-radius: 2px;
  margin-bottom: 1.25rem;
}

.showcase-name {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.showcase-desc {
  font-size: 1rem;
  color: var(--text-light-muted);
  line-height: 1.8;
  margin-bottom: 1.25rem;
}

.showcase-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

.showcase-features li {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.2rem 0.65rem 0.2rem 0.5rem;
  border-radius: 100px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--text-light-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.showcase-features li::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--card-accent, var(--accent));
  flex-shrink: 0;
}

.showcase-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.showcase-tags .tag {
  font-size: 0.7rem;
  padding: 0.22rem 0.6rem;
  background: rgba(108, 99, 255, 0.08);
  color: var(--accent);
  border-color: rgba(108, 99, 255, 0.18);
}

.showcase-links {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.showcase-link {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--card-accent, var(--accent));
  padding: 0.5rem 1.25rem;
  border-radius: 100px;
  border: 1px solid var(--card-accent, var(--accent));
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

.showcase-link:hover {
  background: var(--card-accent, var(--accent));
  color: white;
  transform: translateY(-2px);
}

.showcase-link-github {
  border-color: var(--border-light);
  color: var(--text-light-muted);
}

.showcase-link-github:hover {
  border-color: var(--text-light-muted);
  background: var(--text-light-muted);
  color: white;
}

@media (max-width: 900px) {
  .showcase-row,
  .showcase-row.reversed {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .showcase-row.reversed .showcase-image,
  .showcase-row.reversed .showcase-text {
    order: unset;
  }
  .projects-showcase {
    gap: 4rem;
  }
}

@media (max-width: 600px) {
  .projects-showcase {
    gap: 3rem;
  }
}

/* ===== HOMELAB ===== */
#homelab { position: relative; isolation: isolate; }
#homelab::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(108, 99, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(108, 99, 255, 0.03) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
  z-index: 0;
}
#homelab .container { position: relative; z-index: 1; }

.terminal-panel {
  background: #0d0d14;
  border: 1px solid rgba(0, 212, 170, 0.28);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 0 60px rgba(0, 212, 170, 0.07), 0 0 0 1px rgba(0, 212, 170, 0.08);
  font-family: var(--font-mono);
  position: relative;
}
.terminal-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.04) 3px,
    rgba(0, 0, 0, 0.04) 4px
  );
  pointer-events: none;
  z-index: 0;
}
.terminal-header {
  background: rgba(0, 212, 170, 0.06);
  border-bottom: 1px solid rgba(0, 212, 170, 0.18);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 1;
}
.terminal-header-dots { display: flex; gap: 0.4rem; }
.terminal-dot { width: 11px; height: 11px; border-radius: 50%; }
.terminal-dot.red { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green { background: #28c840; }
.terminal-title {
  font-size: 0.75rem;
  color: rgba(0, 212, 170, 0.7);
  letter-spacing: 0.06em;
}
.terminal-body {
  padding: 1.75rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem 2.5rem;
  position: relative;
  z-index: 1;
}
.terminal-category-label {
  font-size: 0.65rem;
  color: var(--accent-teal);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.terminal-category-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(0, 212, 170, 0.18);
}
.terminal-service-list { display: flex; flex-direction: column; gap: 0.45rem; }
.terminal-service {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: default;
}
.terminal-service:hover .terminal-service-name { color: var(--accent-teal); }
.terminal-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #28c840;
  flex-shrink: 0;
  box-shadow: 0 0 5px #28c840;
  animation: status-pulse 3s ease-in-out infinite;
}
@keyframes status-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.terminal-service-name {
  font-size: 0.8rem;
  color: var(--text-dark-muted);
  transition: color var(--transition);
}
.terminal-service-sub {
  font-size: 0.7rem;
  color: rgba(139, 138, 154, 0.45);
  margin-left: 0.25rem;
}
@media (max-width: 768px) {
  .terminal-body { grid-template-columns: 1fr; gap: 1.25rem; }
}

/* ===== CURRENTLY ===== */
.currently-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
@media (max-width: 768px) {
  .currently-grid { grid-template-columns: 1fr; }
}
.currently-card {
  background: var(--surface-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.currently-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-light-muted);
  margin-bottom: 1rem;
}
.currently-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 64px;
}
.currently-img {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface);
}
.currently-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}
.currently-meta strong {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.currently-meta span {
  font-size: 0.78rem;
  color: var(--text-light-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.currently-empty {
  font-size: 0.85rem;
  color: var(--text-light-muted);
  font-style: italic;
}
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-teal);
  box-shadow: 0 0 10px var(--accent-teal);
  animation: pulse-dot 2s ease-in-out infinite;
  vertical-align: middle;
  margin-left: 0.5rem;
  margin-bottom: 2px;
}
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.65; }
}

/* ===== CONTACT ===== */
#contact {
  text-align: center;
  padding-bottom: 8rem;
}
#contact .section-title {
  margin-bottom: 0.5rem;
}
#contact .section-subtitle {
  margin-bottom: 3rem;
}
.contact-links {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  flex-wrap: wrap;
}
.contact-link {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  padding: 0.85rem 2.25rem;
  border-radius: 100px;
  border: 2px solid var(--accent);
  color: var(--text-dark);
  letter-spacing: 0.01em;
  transition: background var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.contact-link:hover {
  background: var(--accent);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 10px 30px var(--accent-glow);
}

/* ===== FINAL RESPONSIVE POLISH ===== */
@media (max-width: 480px) {
  .hero-scroll-hint { display: none; }
  .contact-links { flex-direction: column; align-items: center; }
  .contact-link { width: 100%; max-width: 280px; text-align: center; }
  .currently-grid { gap: 1rem; }
}

/* ===== GSAP ANIMATION SUPPORT ===== */
.char { display: inline-block; }
html { scroll-behavior: auto !important; }
#projects .container { perspective: 1200px; }

/* ===== FOOTER ===== */
.site-footer {
  background: var(--bg-dark);
  border-top: 1px solid var(--border-dark);
  padding: 2rem 0;
  text-align: center;
}
.site-footer p {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-dark-muted);
}
.site-footer a {
  color: var(--text-dark-muted);
  transition: color var(--transition);
}
.site-footer a:hover {
  color: var(--accent);
}
