:root {
  --bg: #0b0e14;
  --bg-alt: #10141d;
  --surface: #151a24;
  --border: #232a38;
  --text: #e6e9ef;
  --text-muted: #8b93a7;
  --accent: #5eead4;
  --accent-2: #7c9dff;
  --danger: #ff6b6b;
  --radius: 14px;
  --max-w: 1080px;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

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

html { scroll-behavior: smooth; }

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

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(94,234,212,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94,234,212,0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 50% at 50% 0%, black 40%, transparent 100%);
}

a { color: inherit; text-decoration: none; }

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

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(11,14,20,0.75);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
}
.nav-links {
  display: flex;
  gap: 28px;
  font-size: 0.92rem;
  color: var(--text-muted);
}
.nav-links a:hover { color: var(--text); }

.lang-switch {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
  flex-shrink: 0;
}
.lang-btn {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.lang-btn:hover { color: var(--text); }
.lang-btn.is-active { background: var(--accent); color: #0b1410; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, opacity .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--accent);
  color: #0b1410;
}
.btn-primary:hover { opacity: 0.9; }
.btn-ghost {
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-small { padding: 8px 16px; font-size: 0.85rem; }

/* Hero */
.hero {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 100px 24px 80px;
}
.hero-inner { max-width: 720px; }
.hero-photo {
  width: 96px; height: 96px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--border); margin-bottom: 24px; display: block;
}
.eyebrow {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.85rem;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.hero-role {
  font-size: clamp(1.1rem, 2.6vw, 1.4rem);
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 22px;
  line-height: 1.4;
}
.hero-desc {
  color: var(--text-muted);
  font-size: 1.02rem;
  max-width: 640px;
  margin-bottom: 34px;
}
.hero-cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 34px;
}
.ico { flex-shrink: 0; }
.hero-links {
  display: flex;
  gap: 20px;
  color: var(--text-muted);
}
.hero-links a { transition: color .15s ease; }
.hero-links a:hover { color: var(--accent); }

/* Sections */
.section { padding: 90px 24px; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-inner { max-width: var(--max-w); margin: 0 auto; }
.section-tag {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.85rem;
  margin-bottom: 14px;
}
.section-title {
  font-size: clamp(1.6rem, 3.6vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
  max-width: 640px;
}
.section-text {
  color: var(--text-muted);
  max-width: 680px;
  margin-bottom: 16px;
  font-size: 1.02rem;
}

/* Timeline */
.timeline { margin-top: 40px; display: flex; flex-direction: column; gap: 28px; }
.timeline-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px;
}
.timeline-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.timeline-head h3 { font-size: 1.15rem; }
.timeline-client { font-size: 0.85rem; color: var(--text-muted); font-weight: 400; }
.timeline-period { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent); white-space: nowrap; }
.timeline-role { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 14px; }
.timeline-list { margin: 12px 0 18px; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.timeline-list li { color: var(--text-muted); font-size: 0.92rem; line-height: 1.6; }
.timeline-list strong { color: var(--text); }

/* Services */
.services-grid {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color .15s ease, transform .15s ease;
}
.service-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.service-icon {
  display: inline-block;
  color: var(--accent);
  font-size: 0.9rem;
  margin-bottom: 12px;
}
.service-card h3 { font-size: 1rem; margin-bottom: 8px; }
.service-card p { color: var(--text-muted); font-size: 0.92rem; }

/* Skills */
.skills-grid {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.skill-card h3 {
  font-size: 0.95rem;
  margin-bottom: 14px;
  color: var(--text);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(94,234,212,0.08);
  color: var(--accent);
  border: 1px solid rgba(94,234,212,0.18);
}

/* Projects */
.projects-grid {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color .15s ease, transform .15s ease;
}
.project-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.project-card.featured { grid-column: span 1; border-color: rgba(94,234,212,0.35); }
.project-gif { width: 100%; border-radius: 10px; border: 1px solid var(--border); display: block; cursor: zoom-in; }
.project-gif.is-expandable:hover { border-color: var(--accent); }

.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(6,8,12,0.92);
  display: none; align-items: center; justify-content: center; padding: 32px; cursor: zoom-out;
}
.lightbox.is-open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; border: 1px solid var(--border); }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.project-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.project-head h3 { font-size: 1.1rem; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.tag-api { background: rgba(124,157,255,0.12); color: var(--accent-2); }
.tag-worker { background: rgba(255,183,94,0.12); color: #ffb75e; }
.tag-micro { background: rgba(94,234,212,0.12); color: var(--accent); }
.project-card p { color: var(--text-muted); font-size: 0.94rem; flex-grow: 1; }
.project-link { font-weight: 600; font-size: 0.9rem; color: var(--accent); }
.project-link:hover { text-decoration: underline; }
.project-links { display: flex; gap: 18px; flex-wrap: wrap; }

.projects-more { margin-top: 32px; color: var(--text-muted); font-size: 0.95rem; }
.projects-more a { color: var(--accent); font-weight: 600; }

/* Contact */
.contact-inner { max-width: 780px; }
.contact-grid {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color .15s ease, transform .15s ease;
}
.contact-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.contact-label { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted); }
.contact-value { font-weight: 600; font-size: 1rem; overflow-wrap: anywhere; word-break: break-word; }

.contact-form {
  margin-top: 48px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.form-note { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 18px; }
.form-row { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.form-row input, .contact-form textarea {
  flex: 1;
  min-width: 200px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
}
.contact-form textarea { width: 100%; margin-bottom: 16px; resize: vertical; }
.form-row input:focus, .contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-status { margin-top: 12px; font-size: 0.88rem; color: var(--text-muted); }

/* Footer */
.footer {
  text-align: center;
  padding: 32px 24px;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .hero { padding: 70px 20px 60px; }
  .section { padding: 60px 20px; }
}
