/* ===== VARIABLES ===== */
:root {
  --bg: #0d1117;
  --bg2: #161b22;
  --bg3: #1f2937;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #00d4aa;
  --accent2: #58a6ff;
  --danger: #f85149;
  --radius: 10px;
  --font: 'Inter', sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --nav-h: 64px;
}

[data-theme="light"] {
  --bg: #f6f8fa;
  --bg2: #ffffff;
  --bg3: #eaeef2;
  --border: #d0d7de;
  --text: #1f2328;
  --text-muted: #57606a;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background 0.3s, color 0.3s;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ===== NAV ===== */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(13,17,23,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 100;
  transition: background 0.3s;
}
[data-theme="light"] #navbar {
  background: rgba(246,248,250,0.85);
}
.nav-logo {
  font-family: var(--mono);
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 600;
}
.nav-links {
  display: flex;
  gap: 2rem;
}
.nav-links a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }
#theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text);
  transition: border-color 0.2s;
}
#theme-toggle:hover { border-color: var(--accent); }

/* ===== SECTIONS ===== */
section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 2rem) 1rem 4rem;
}
.section-inner {
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
}
.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
  max-width: 300px;
}

/* ===== HERO ===== */
#hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4rem;
  padding-top: var(--nav-h);
}
.hero-content { max-width: 560px; }
.hero-tag {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}
.hero-content h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}
.hero-content h2 {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: 1.25rem;
}
.hero-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 2rem;
}
.highlight { color: var(--accent); }
.mono { font-family: var(--mono); color: var(--accent); font-size: 0.9em; }

.hero-btns { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--accent);
  color: #0d1117;
}
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-2px); }
.btn-outline {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-outline:hover { background: var(--accent); color: #0d1117; }

/* ===== SERVER RACK VISUAL ===== */
.hero-visual {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}
.hero-photo {
  width: 260px;
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 18px 45px rgba(0, 212, 170, 0.18);
  object-fit: cover;
}
.server-rack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg2);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  box-shadow: 0 0 40px rgba(0,212,170,0.1);
}
.rack-unit {
  width: 140px;
  height: 22px;
  background: var(--bg3);
  border-radius: 4px;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.rack-unit::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #333;
}
.rack-unit.active::before {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
  animation: blink 2s infinite;
}
.rack-unit::after {
  content: '';
  position: absolute;
  left: 26px;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ===== ABOUT ===== */
#about { background: var(--bg2); }
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}
.about-text p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.about-text strong { color: var(--text); }
.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.stat-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: border-color 0.2s;
}
.stat-card:hover { border-color: var(--accent); }
.stat-num {
  font-family: var(--mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===== SKILLS ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.skill-category {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.2s, transform 0.2s;
}
.skill-category:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}
.skill-category h4 {
  color: var(--accent2);
  font-family: var(--mono);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}
.skill-category li {
  color: var(--text-muted);
  font-size: 0.92rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
}
.skill-category li:last-child { border-bottom: none; }
.skill-category li::before {
  content: '▸ ';
  color: var(--accent);
}

/* ===== SERVICES ===== */
#services { background: var(--bg2); }
.services-intro {
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 640px;
}
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.service-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.service-card:hover {
  border-color: var(--accent);
  transform: translateY(-6px);
  box-shadow: 0 10px 30px rgba(0,212,170,0.1);
}
.service-icon { font-size: 2rem; }
.service-card h4 { font-size: 1rem; font-weight: 700; }
.service-card p { color: var(--text-muted); font-size: 0.9rem; flex: 1; }
.service-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.service-tags span {
  font-size: 0.75rem;
  font-family: var(--mono);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  color: var(--accent2);
}

/* ===== PROJECTS ===== */
#projects { background: var(--bg2); }
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.project-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-6px);
  box-shadow: 0 10px 30px rgba(0,212,170,0.1);
}
.project-icon { font-size: 2rem; }
.project-card h4 { font-size: 1rem; font-weight: 700; }
.project-card p { color: var(--text-muted); font-size: 0.9rem; flex: 1; }
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.project-tags span {
  font-size: 0.75rem;
  font-family: var(--mono);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  color: var(--accent2);
}

/* ===== CONTACT ===== */
.contact-sub {
  color: var(--text-muted);
  margin-bottom: 2rem;
}
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 640px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.contact-form input,
.contact-form textarea {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  width: 100%;
  transition: border-color 0.2s;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.contact-form textarea { resize: vertical; }
.contact-form .btn { align-self: flex-start; }
.form-msg {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--accent);
  min-height: 1.5rem;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  #hero { flex-direction: column; text-align: center; gap: 2.5rem; }
  .hero-btns { justify-content: center; }
  .about-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .nav-links { display: none; }
}
