/* ===== Variables ===== */
:root {
  --bg: #0a0b0d;
  --bg-card: #111215;
  --bg-card-hover: #16181c;
  --text: #e8e9ec;
  --text-muted: #8b8f97;
  --accent: #22d3ee;
  --accent-dim: rgba(34, 211, 238, 0.15);
  --accent-glow: rgba(34, 211, 238, 0.25);
  --border: #1e2126;
  --font-sans: "Outfit", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --radius: 12px;
  --radius-lg: 20px;
  --header-h: 72px;
}

/* ===== Reset & base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% -20%, var(--accent-dim), transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.noise {
  position: fixed;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===== Header ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  z-index: 100;
  background: rgba(10, 11, 13, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  position: relative;
}

.logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo-img {
  height: 32px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  vertical-align: middle;
}

.logo-img[src*=".svg"] {
  color: var(--text);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav-links a {
  font-size: 0.9375rem;
  color: var(--text-muted);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.menu-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.btn-primary {
  background: var(--accent);
  color: var(--bg);
}
.btn-primary:hover {
  background: #2ee0f5;
  box-shadow: 0 0 24px var(--accent-glow);
}
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text-muted);
}
.btn-large { padding: 0.875rem 1.75rem; font-size: 1rem; }

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--header-h);
  overflow: hidden;
}

.hero-inner {
  position: relative;
  z-index: 2;
}

.hero-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 1rem;
}

.hero-title {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0 0 1.25rem;
  max-width: 18ch;
}
.hero-title .highlight {
  color: var(--accent);
  position: relative;
}

.hero-desc {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 42ch;
  margin: 0 0 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(to top, var(--bg), transparent);
  pointer-events: none;
}

/* ===== Sections ===== */
.section {
  position: relative;
  z-index: 2;
  padding: 5rem 0;
}

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

.section-desc {
  color: var(--text-muted);
  margin: 0 0 2.5rem;
  max-width: 50ch;
}

/* ===== About ===== */
.about-text {
  font-size: 1.0625rem;
  color: var(--text-muted);
  max-width: 60ch;
  margin: 0 0 2rem;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.skill-tag {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, color 0.2s;
}
.skill-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== Project cards ===== */
.projects { padding-bottom: 6rem; }

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.project-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.project-card:hover {
  border-color: rgba(34, 211, 238, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.5);
}

.card-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.25s;
}
.project-card:hover .card-glow { opacity: 0.6; }

.card-inner {
  position: relative;
  padding: 1.75rem;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

.card-desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
  flex: 1;
}

.card-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.card-stack li {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  padding: 0.25rem 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.card-link {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: gap 0.2s;
}
.card-link:hover { gap: 0.5rem; }

/* ===== Contact ===== */
.contact {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}

.contact-inner {
  text-align: center;
}

.contact-desc {
  color: var(--text-muted);
  margin: 0 0 2rem;
  max-width: 40ch;
  margin-left: auto;
  margin-right: auto;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.contact-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
  opacity: 0.8;
}

/* ===== Footer ===== */
.footer {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
}
.footer-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .nav-links.is-open {
    display: flex;
  }
  .menu-toggle {
    display: flex;
  }
  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }
  .project-grid {
    grid-template-columns: 1fr;
  }
}
