:root {
  --accent: #007aff;
  --text: #222;
  --bg: #fff;
  --muted: #555;
  --radius: 12px;
  --bg-alt: #fafafa;
}

/* Dark mode variables */
body.dark {
  --bg: #111;
  --text: #eee;
  --muted: #bbb;
  --bg-alt: #1a1a1a;
  --accent: #4da3ff;
}

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

body {
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  scroll-behavior: smooth;
  transition: background 0.3s ease, color 0.3s ease;
}

.container {
  width: 90%;
  max-width: 1100px;
  margin: 0 auto;
}

/* --- Header --- */
header {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  z-index: 100;
  transition: background 0.3s ease;
}
body.dark header {
  background: rgba(0,0,0,0.7);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.logo {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.5px;
}

nav a {
  margin-left: 1.5rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  transition: color 0.3s ease;
}

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

#theme-toggle {
  margin-left: 1.5rem;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  transition: transform 0.2s ease;
}
#theme-toggle:hover { transform: scale(1.1); }

/* --- Hero --- */
.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero .container {
  z-index: 2;
}


.topo-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 40%, rgba(0,0,0,0.02), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 800'%3E%3Cdefs%3E%3ClinearGradient id='grad' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0%' stop-color='rgba(0,122,255,0.2)'/%3E%3Cstop offset='100%' stop-color='rgba(0,122,255,0.05)'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg fill='none' stroke='url(%23grad)'%3E%3Cpath d='M0,400 Q100,360 200,400 T400,400 T600,400 T800,400' stroke-width='1.6'/%3E%3Cpath d='M0,380 Q100,340 200,380 T400,380 T600,380 T800,380' stroke-width='1.2'/%3E%3Cpath d='M0,420 Q100,380 200,420 T400,420 T600,420 T800,420' stroke-width='1.3'/%3E%3Cpath d='M0,440 Q100,400 200,440 T400,440 T600,440 T800,440' stroke-width='0.9'/%3E%3Cpath d='M0,460 Q100,420 200,460 T400,460 T600,460 T800,460' stroke-width='1.4'/%3E%3Cpath d='M0,480 Q100,440 200,480 T400,480 T600,480 T800,480' stroke-width='1.1'/%3E%3Cpath d='M0,500 Q100,460 200,500 T400,500 T600,500 T800,500' stroke-width='1.6'/%3E%3Cpath d='M0,520 Q100,480 200,520 T400,520 T600,520 T800,520' stroke-width='1.2'/%3E%3Cpath d='M0,540 Q100,500 200,540 T400,540 T600,540 T800,540' stroke-width='1.5'/%3E%3Cpath d='M0,560 Q100,520 200,560 T400,560 T600,560 T800,560' stroke-width='1.0'/%3E%3Cpath d='M0,580 Q100,540 200,580 T400,580 T600,580 T800,580' stroke-width='1.3'/%3E%3Cpath d='M0,600 Q100,560 200,600 T400,600 T600,600 T800,600' stroke-width='1.1'/%3E%3Cpath d='M0,620 Q100,580 200,620 T400,620 T600,620 T800,620' stroke-width='1.4'/%3E%3Cpath d='M0,640 Q100,600 200,640 T400,640 T600,640 T800,640' stroke-width='1.6'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 800px 800px;
  background-repeat: repeat;
  opacity: 0.8;
  animation: topoDrift 60s linear infinite;
}

@keyframes topoDrift {
  from { background-position: 0 0; }
  to { background-position: 800px 800px; }
}

body.dark .topo-bg {
  background:
    radial-gradient(circle at 50% 40%, rgba(255,255,255,0.03), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 800'%3E%3Cdefs%3E%3ClinearGradient id='gradDark' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0%' stop-color='rgba(77,163,255,0.25)'/%3E%3Cstop offset='100%' stop-color='rgba(77,163,255,0.1)'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg fill='none' stroke='url(%23gradDark)'%3E%3Cpath d='M0,400 Q100,360 200,400 T400,400 T600,400 T800,400' stroke-width='1.7'/%3E%3Cpath d='M0,380 Q100,340 200,380 T400,380 T600,380 T800,380' stroke-width='1.2'/%3E%3Cpath d='M0,420 Q100,380 200,420 T400,420 T600,420 T800,420' stroke-width='1.4'/%3E%3Cpath d='M0,440 Q100,400 200,440 T400,440 T600,440 T800,440' stroke-width='1.0'/%3E%3Cpath d='M0,460 Q100,420 200,460 T400,460 T600,460 T800,460' stroke-width='1.3'/%3E%3Cpath d='M0,480 Q100,440 200,480 T400,480 T600,480 T800,480' stroke-width='1.1'/%3E%3Cpath d='M0,500 Q100,460 200,500 T400,500 T600,500 T800,500' stroke-width='1.6'/%3E%3Cpath d='M0,520 Q100,480 200,520 T400,520 T600,520 T800,520' stroke-width='1.3'/%3E%3Cpath d='M0,540 Q100,500 200,540 T400,540 T600,540 T800,540' stroke-width='1.5'/%3E%3Cpath d='M0,560 Q100,520 200,560 T400,560 T600,560 T800,560' stroke-width='1.0'/%3E%3Cpath d='M0,580 Q100,540 200,580 T400,580 T600,580 T800,580' stroke-width='1.3'/%3E%3Cpath d='M0,600 Q100,560 200,600 T400,600 T600,600 T800,600' stroke-width='1.2'/%3E%3Cpath d='M0,620 Q100,580 200,620 T400,620 T600,620 T800,620' stroke-width='1.5'/%3E%3Cpath d='M0,640 Q100,600 200,640 T400,640 T600,640 T800,640' stroke-width='1.7'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 800px 800px;
  background-repeat: repeat;
  opacity: 0.85;
}


.hero h1 {
  font-size: 2.6rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.hero p {
  color: var(--muted);
  margin-bottom: 2rem;
}

.cta {
  background: var(--accent);
  color: #fff;
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  transition: background 0.3s ease;
}
.cta:hover { background: #005ecb; }

/* --- About --- */
.about {
  padding: 6rem 0;
  text-align: center;
}
.about p {
  max-width: 650px;
  margin: 1rem auto 2rem;
  color: var(--muted);
}
.services {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
}
.service {
  flex: 1 1 200px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform 0.3s ease;
}
.service:hover { transform: translateY(-5px); }

/* --- Work --- */
.work {
  background: var(--bg-alt);
  padding: 6rem 0;
  text-align: center;
}
.projects {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-top: 2rem;
}
.project-card {
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  padding: 2rem;
}
body.dark .project-card {
  box-shadow: 0 2px 6px rgba(255,255,255,0.05);
}

/* --- Contact --- */
.contact {
  padding: 6rem 0;
  text-align: center;
}
.contact-form {
  max-width: 500px;
  margin: 2rem auto 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.contact-form input,
.contact-form textarea {
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  border: 1px solid #ccc;
  font-size: 1rem;
  width: 100%;
  background: var(--bg);
  color: var(--text);
  transition: border 0.3s ease;
}
.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
  outline: none;
}
body.dark .contact-form input,
body.dark .contact-form textarea {
  border: 1px solid #333;
}

.contact-form button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.9rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
}
.contact-form button:hover { background: #005ecb; }

/* --- Footer --- */
.footer {
  border-top: 1px solid rgba(0,0,0,0.05);
  padding: 1.5rem 0;
  font-size: 0.9rem;
}
body.dark .footer {
  border-top: 1px solid rgba(255,255,255,0.1);
}
.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
.footer-links a {
  margin-left: 1rem;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.3s ease;
}
.footer-links a:hover { color: var(--accent); }

/* --- Responsive --- */
@media (max-width: 700px) {
  .hero h1 { font-size: 2rem; }
  nav a { margin-left: 1rem; }
  .footer-content { flex-direction: column; gap: 1rem; }
}


/* --- Floating Theme Toggle --- */
.theme-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--bg-alt);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: background 0.3s ease, transform 0.2s ease;
  z-index: 200;
}
.theme-toggle:hover {
  transform: scale(1.1);
  background: var(--accent);
  color: #fff;
}
body.dark .theme-toggle {
  background: var(--bg-alt);
  box-shadow: 0 2px 6px rgba(255,255,255,0.08);
}