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

:root {
  --bg:           #0d1117;
  --bg2:          #161b22;
  --bg3:          #1c2128;
  --border:       #21262d;
  --border-hover: #30363d;
  --text:         #e6edf3;
  --text-muted:   #8b949e;
  --text-faint:   #484f58;
  --accent:       #58a6ff;
  --accent2:      #3fb950;
  --serif:        "Fraunces", Georgia, serif;
  --mono:         "JetBrains Mono", "Courier New", monospace;
  --sans:         "Inter", system-ui, sans-serif;
}

html {
  scroll-behavior: smooth;
}

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

/* Noise texture overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  //background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

/* ===== LAYOUT ===== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 1;
}

section {
  padding: 5rem 0;
}

/* ===== NAV ===== */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 0;
  background: rgba(10, 10, 9, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

nav .inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.05em;
}

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

.nav-links a {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
  font-family: var(--mono);
}

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

.nav-cta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent) !important;
  border: 1px solid rgba(200, 240, 96, 0.3);
  padding: 6px 14px;
  border-radius: 4px;
  transition:
    background 0.2s,
    color 0.2s !important;
}

.nav-cta:hover {
  background: rgba(200, 240, 96, 0.1) !important;
  color: var(--accent) !important;
}

/* ===== HERO ===== */
#hero {
  padding: 10rem 0 6rem;
  position: relative;
  overflow: hidden;
}

.hero-grid-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
  opacity: 0.4;
}

.hero-eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-eyebrow::before {
  content: "";
  display: block;
  width: 24px;
  height: 1px;
  background: var(--accent);
}

h1 {
  font-family: var(--serif);
  font-size: clamp(3rem, 7vw, 5.5rem);
  line-height: 1.05;
  font-weight: 400;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

h1 em {
  font-style: italic;
  color: var(--text-muted);
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 540px;
  line-height: 1.7;
  margin-bottom: 2.5rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #238636;
  padding: 12px 24px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition:
    opacity 0.2s,
    transform 0.2s;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  padding: 12px 24px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 13px;
  text-decoration: none;
  border: 1px solid var(--border);
  transition:
    border-color 0.2s,
    color 0.2s;
}

.btn-ghost:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.hero-stats {
  display: flex;
  gap: 3rem;
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}

.stat-num {
  font-family: var(--serif);
  font-size: 2.2rem;
  color: var(--text);
  line-height: 1;
  display: block;
}

.stat-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 4px;
  display: block;
}

/* ===== SECTION HEADERS ===== */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 3rem;
  gap: 1rem;
}

.section-label-top {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

h2 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

h3 {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 500;
}

/* ===== SERVICES ===== */
#services {
  background: var(--bg2);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.service-card {
  padding: 2rem;
  background: var(--bg2);
  transition: background 0.2s;
  position: relative;
}

.service-card:hover {
  background: var(--bg3);
}

.service-icon {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
  display: block;
}

.service-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.service-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

.service-tags {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 3px;
}

/* ===== STACK ===== */
.stack-section {
  padding: 4rem 0;
}

.stack-row {
  display: flex;
  align-items: center;
  gap: 0;
  border-top: 1px solid var(--border);
  padding: 1.25rem 0;
}

.stack-row:last-child {
  border-bottom: 1px solid var(--border);
}

.stack-category {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  width: 140px;
  flex-shrink: 0;
}

.stack-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stack-pill {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 100px;
  transition:
    color 0.2s,
    border-color 0.2s;
}

.stack-pill:hover {
  color: var(--accent2);
  border-color: rgba(96, 208, 240, 0.3);
}

.stack-pill.featured {
  color: var(--accent);
  border-color: rgba(200, 240, 96, 0.25);
}

/* ===== EXPERIENCE ===== */
#experience {
  background: var(--bg2);
}

.exp-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.exp-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 2rem;
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--border);
}

.exp-item:first-child {
  border-top: 1px solid var(--border);
}

.exp-meta {
  padding-top: 3px;
}

.exp-period {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
  display: block;
  margin-bottom: 4px;
}

.exp-location {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 4px;
}

.exp-title {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}

.exp-company {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 1rem;
}

.exp-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1rem;
}

/* ===== PROJECTS ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.75rem;
  transition:
    border-color 0.2s,
    transform 0.2s;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  opacity: 0;
  transition: opacity 0.2s;
}

.project-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}
.project-card:hover::before {
  opacity: 1;
}

.project-type {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.project-card h3 {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.project-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

/* ===== ABOUT ===== */
#about {
  background: var(--bg2);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5rem;
  align-items: start;
}

.about-text p {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 1.25rem;
}

.about-text p strong {
  color: var(--text);
  font-weight: 500;
}

.about-sidebar {
  padding-top: 0.5rem;
}

.sidebar-block {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-block:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.sidebar-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.sidebar-value {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
}

.sidebar-link {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent2);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.sidebar-link:hover {
  color: var(--text);
}

/* ===== CONTACT ===== */
#contact {
  overflow: hidden;
}

.contact-inner {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.contact-inner h2 {
  margin-bottom: 1rem;
}

.contact-inner p {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

.contact-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.contact-detail {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.contact-item {
  text-align: center;
}

.contact-item-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 4px;
}

.contact-item-value {
  font-size: 14px;
  color: var(--text);
}

.contact-item-value a {
  color: var(--text);
  text-decoration: none;
}

.contact-item-value a:hover {
  color: var(--accent);
}

/* ===== FOOTER ===== */
footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-copy {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--text-muted);
}

/* ===== AVAILABILITY BADGE ===== */
.avail-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  color: #4ade80;
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.2);
  padding: 5px 12px;
  border-radius: 100px;
}

.avail-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

/* ===== AI CHAT WIDGET ===== */
#chat-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 200;
}

#chat-toggle {
  width: 54px;
  height: 54px;
  background: #238636;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(200, 240, 96, 0.3);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  font-size: 20px;
}

#chat-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 28px rgba(200, 240, 96, 0.4);
}

#chat-window {
  position: absolute;
  bottom: 68px;
  right: 0;
  width: 360px;
  background: var(--bg2);
  border: 1px solid var(--border-hover);
  border-radius: 16px;
  overflow: hidden;
  display: none;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

#chat-window.open {
  display: flex;
}

.chat-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-title {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-title-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}

.chat-close {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0;
  transition: color 0.2s;
}

.chat-close:hover {
  color: var(--text);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 280px;
  max-height: 360px;
}

.msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
}

.msg-bot {
  background: var(--bg3);
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 3px;
}

.msg-user {
  background: rgba(200, 240, 96, 0.12);
  color: var(--text);
  align-self: flex-end;
  border-bottom-right-radius: 3px;
  border: 1px solid rgba(200, 240, 96, 0.2);
}

.msg-typing {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 12px 16px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
  animation: typing 1.2s infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}
.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

/* Typing cursor */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.msg-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: currentColor;
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 0.7s steps(1) infinite;
}

.chat-quick {
  padding: 0 1.25rem 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-btn {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 100px;
  cursor: pointer;
  transition:
    border-color 0.2s,
    color 0.2s;
}

.quick-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.chat-input-row {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: center;
}

#chat-input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

#chat-input:focus {
  border-color: rgba(200, 240, 96, 0.4);
}
#chat-input::placeholder {
  color: var(--text-faint);
}

#chat-send {
  width: 34px;
  height: 34px;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

#chat-send:hover {
  opacity: 0.85;
}

#chat-window { display: none; }
#chat-fab.chat-open #chat-window { display: flex; }

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-up {
  animation: fadeUp 0.6s ease both;
}

.fade-up-2 {
  animation-delay: 0.1s;
}
.fade-up-3 {
  animation-delay: 0.2s;
}
.fade-up-4 {
  animation-delay: 0.3s;
}
.fade-up-5 {
  animation-delay: 0.4s;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .exp-item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .hero-stats {
    gap: 2rem;
    flex-wrap: wrap;
  }
  #chat-window {
    width: calc(100vw - 2rem);
    right: -1rem;
  }
  section {
    padding: 3.5rem 0;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 2.6rem;
  }
}
