:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #0f1016;
  --bg-card: rgba(25, 27, 36, 0.6);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-blue: #3b82f6;
  --accent-cyan: #2dd4bf;
  --accent-red: #ef4444;
  --card-border: rgba(255, 255, 255, 0.05);
  --nav-bg: rgba(10, 10, 15, 0.85);

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Background Canvas */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  opacity: 0.6;
}

/* Typography */
h1,
h2,
h3,
h4 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(2rem, 3vw, 2.5rem);
  margin-bottom: 2.5rem;
}

h3 {
  font-size: 1.25rem;
}

p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-blue);
}

.text-gradient {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.text-gradient-red {
  background: linear-gradient(135deg, #f87171, var(--accent-red));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Navigation */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 1.25rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  transition: background-color 0.3s ease, padding 0.3s ease, border-bottom 0.3s ease;
  border-bottom: 1px solid transparent;
}

nav.scrolled {
  background-color: var(--nav-bg);
  backdrop-filter: blur(12px);
  padding: 1rem 5%;
  border-bottom: 1px solid var(--card-border);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.nav-brand img {
  height: 32px;
}

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

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
}

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

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

.btn-primary {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  color: #fff;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(45, 212, 191, 0.3);
  color: #fff;
}

/* Layout */
section {
  padding: 6rem 5%;
  max-width: 1200px;
  margin: 0 auto;
}

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 8rem;
  position: relative;
}

.hero p.lead {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  max-width: 600px;
  margin-top: 1rem;
  margin-bottom: 2.5rem;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
}

.btn-secondary {
  display: inline-block;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: background 0.2s ease;
  border: 1px solid var(--card-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

/* Grid & Cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 2rem;
  backdrop-filter: blur(10px);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  border-color: rgba(45, 212, 191, 0.3);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(45, 212, 191, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: var(--accent-cyan);
}

/* Feature Rows (Vertical Layout) */
.feature-row {
  display: flex;
  align-items: center;
  gap: 4rem;
  margin-bottom: 6rem;
}

.feature-row:last-child {
  margin-bottom: 0;
}

.feature-row.reverse {
  flex-direction: row-reverse;
}

.feature-text {
  flex: 1;
}

.feature-text h3 {
  font-size: 2.25rem;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.feature-text p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.feature-image {
  flex: 1;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  border: 1px solid var(--card-border);
}

.feature-image img {
  width: 100%;
  height: auto;
  min-height: 300px;
  display: block;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.2, 1, 0.3, 1);
  background: var(--bg-card);
}

.feature-row:hover .feature-image img {
  transform: scale(1.05);
}

@media (max-width: 900px) {

  .feature-row,
  .feature-row.reverse {
    flex-direction: column;
    gap: 2rem;
  }
}

/* Code Snippets */
.code-block {
  background: #0f1016;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1.5rem 0;
  overflow-x: auto;
}

.code-block code {
  color: #e2e8f0;
  white-space: nowrap;
}

.copy-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.copy-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

/* Footer */
footer {
  border-top: 1px solid var(--card-border);
  padding: 4rem 5%;
  margin-top: 4rem;
  background: var(--bg-secondary);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
}

.footer-col h4 {
  font-size: 1rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.75rem;
}

.footer-col a {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer-col a:hover {
  color: var(--accent-cyan);
}

.footer-bottom {
  max-width: 1200px;
  margin: 3rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Contact Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 10, 15, 0.85);
  /* Matches dark theme */
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.contact-container {
  width: 100%;
  max-width: 600px;
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 3rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .contact-container {
  transform: translateY(0);
}

.close-modal {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
}

.close-modal:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

.contact-container h2 {
  margin-bottom: 2rem;
  font-size: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.2);
}

.form-control::placeholder {
  color: var(--text-muted);
}

.contact-form button[type="submit"] {
  width: 100%;
  padding: 0.8rem;
  font-size: 1rem;
  margin-top: 1rem;
}

/* Utilities */
.tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-mono);
  margin-bottom: 1rem;
}

.tag-blue {
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
}

.tag-cyan {
  background: rgba(45, 212, 191, 0.1);
  color: #5eead4;
}

.tag-rust {
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
}

/* Animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Mobile */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .hero {
    min-height: 80vh;
  }

  h1 {
    font-size: 2.5rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}