:root {
  --bg: #0a0a0f;
  --bg2: #111118;
  --surface: #16161f;
  --border: #2a2a3a;
  --accent: #00d4aa;
  --accent2: #7c6af7;
  --text: #e8e8f0;
  --muted: #6b6b80;
  --font-display: "Syne", sans-serif;
  --font-mono: "DM Mono", monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  overflow-x: hidden;
}

/* Noise texture overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 100;
  opacity: 0.4;
}

/* NAVBAR */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 50;
  padding: 1.2rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: all 0.3s;
  backdrop-filter: blur(0px);
}

nav.scrolled {
  background: rgba(10, 10, 15, 0.9);
  border-color: var(--border);
  backdrop-filter: blur(12px);
}

.nav-brand {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.nav-brand span {
  color: var(--accent);
}

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

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 0.2s;
}

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

/* HERO */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 0 2rem;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.3;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 80%);
}

.hero-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(0, 212, 170, 0.08) 0%,
    transparent 70%
  );
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hero-content {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 2;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 212, 170, 0.08);
  border: 1px solid rgba(0, 212, 170, 0.2);
  border-radius: 100px;
  padding: 0.4rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  margin-bottom: 2rem;
  animation: fadeUp 0.6s ease both;
}

.hero-tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

.hero h1 {
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin-bottom: 1.5rem;
  animation: fadeUp 0.6s 0.1s ease both;
}

.hero h1 .name-accent {
  color: var(--accent);
}

.hero-sub {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 3rem;
  max-width: 600px;
  line-height: 1.7;
  animation: fadeUp 0.6s 0.2s ease both;
}

.hero-sub span {
  color: var(--accent2);
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  animation: fadeUp 0.6s 0.3s ease both;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: #0a0a0f;
  padding: 0.85rem 2rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: #00f0c0;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 212, 170, 0.3);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.85rem 2rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* SECTIONS */
section {
  padding: 6rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 3rem;
}

/* ABOUT */
#about {
  max-width: 1100px;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.about-text p {
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

.about-text p strong {
  color: var(--text);
}

.code-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.8;
  position: relative;
  overflow: hidden;
}

.code-block::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}

.code-dots {
  display: flex;
  gap: 6px;
  margin-bottom: 1rem;
}

.code-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.code-dots span:nth-child(1) {
  background: #ff5f56;
}

.code-dots span:nth-child(2) {
  background: #ffbd2e;
}

.code-dots span:nth-child(3) {
  background: #27c93f;
}

.code-key {
  color: var(--accent2);
}

.code-str {
  color: var(--accent);
}

.code-arr {
  color: #f8c96d;
}

.code-bracket {
  color: var(--muted);
}

/* STACK */
#stack {
  max-width: 1100px;
}

.stack-categories {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.stack-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color 0.2s;
}

.stack-card:hover {
  border-color: var(--accent);
}

.stack-card h3 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.stack-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.stack-tag {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.3rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text);
}

/* PROJECTS */
#projects {
  max-width: 1100px;
}

.projects-grid {
  display: grid;
  gap: 1.5rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  transition:
    border-color 0.3s,
    transform 0.3s;
}

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

.project-card.reverse {
  direction: rtl;
}

.project-card.reverse > * {
  direction: ltr;
}

.project-img {
  background: var(--bg2);
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.project-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
}

.project-img-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  color: var(--border);
}

.project-img-placeholder i {
  font-size: 3rem;
}

.project-img-placeholder span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
}

/* Unique placeholder gradients per project */
.project-card:nth-child(1) .project-img {
  background: linear-gradient(135deg, #0f1f2e, #0a2a1f);
}

.project-card:nth-child(2) .project-img {
  background: linear-gradient(135deg, #1a0f2e, #2a0a1f);
}

.project-card:nth-child(3) .project-img {
  background: linear-gradient(135deg, #0f1a2e, #0a1a2a);
}

.project-card:nth-child(4) .project-img {
  background: linear-gradient(135deg, #1f1a0f, #2a1a0a);
}

.project-card:nth-child(5) .project-img {
  background: linear-gradient(135deg, #0f2a1a, #0a1f15);
}

.project-info {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.project-number {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.project-info h3 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.project-info p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.project-tag {
  background: rgba(0, 212, 170, 0.08);
  border: 1px solid rgba(0, 212, 170, 0.15);
  color: var(--accent);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.project-links {
  display: flex;
  gap: 1rem;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: color 0.2s;
}

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

.project-link i {
  font-size: 0.9rem;
}

/* CONTACT */
#contact {
  max-width: 1100px;
  text-align: center;
}

.contact-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 4rem 2rem;
  position: relative;
  overflow: hidden;
}

.contact-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}

.contact-box h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.contact-box p {
  color: var(--muted);
  margin-bottom: 2.5rem;
  font-size: 1rem;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 1.1rem;
  transition: all 0.2s;
}

.social-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-3px);
}

/* FOOTER */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr;
  }

  .stack-categories {
    grid-template-columns: 1fr;
  }

  .project-card {
    grid-template-columns: 1fr;
  }

  .project-card.reverse {
    direction: ltr;
  }

  .nav-links {
    display: none;
  }
}
