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

:root {
  --bg:        #080c10;
  --surface:   #0f1620;
  --surface2:  #141d2a;
  --border:    #1c2840;
  --accent:    #4f8ef7;
  --accent2:   #7b5ea7;
  --accent-dim: rgba(79,142,247,0.12);
  --text:      #dde6f0;
  --muted:     #5c7494;
  --mono:      'JetBrains Mono', monospace;
  --sans:      'Montserrat', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 20px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ── NAV ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 2.5rem;
  background: rgba(8,12,16,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 0.1em;
}
.nav-links { display: flex; gap: 2rem; }
.nav-links a {
  font-size: 1rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.04em;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--accent); }

/* ── SCROLL PROGRESS ── */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  z-index: 999;
  transition: width 0.1s linear;
}

/* ── HERO ── */
.hero {
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 9rem 2.5rem 5rem;
  max-width: 1300px; margin: 0 auto;
  position: relative;
}
.hero-tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 1.75rem;
  display: flex; align-items: center; gap: 0.75rem;
}
.hero-tag::before { display: none; }

.hero h1 {
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(120deg, var(--accent) 0%, var(--accent2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 520px;
  line-height: 1.75;
  margin-bottom: 2.5rem;
  font-weight: 400;
}
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.6rem;
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #6ba3ff; transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* ── STACK TICKER ── */
.ticker-wrap {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  padding: 0.9rem 0;
}
.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker 40s linear infinite;
  white-space: nowrap;
}
.ticker-track:hover { animation-play-state: paused; }
.ticker-item {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0 2rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
}
.ticker-item img { width: 16px; height: 16px; object-fit: contain; filter: grayscale(0.3); }
@keyframes ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── SECTIONS ── */
.section {
  padding: 5rem 1.5rem;
  max-width: 1300px;
  margin: 0 auto;
}
.section-eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}
.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 0.75rem;
}
.section-desc {
  color: var(--muted);
  max-width: 500px;
  margin-bottom: 3rem;
  font-size: 1.15rem;
  line-height: 1.75;
}

/* ── ABOUT ── */
.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.about-card { background: var(--surface); padding: 2rem 1.75rem; }
.about-card-label {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.about-card h3 { font-size: 1.2rem; font-weight: 700; line-height: 1.4; margin-bottom: 0.5rem; }
.about-card p { font-size: 1rem; color: var(--muted); line-height: 1.7; }

/* ── SKILLS ── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.skill-block { background: var(--surface); padding: 1.75rem; }
.skill-block-header {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 1rem;
}
.skill-block-icon {
  width: 32px; height: 32px;
  background: var(--accent-dim);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.skill-block h3 { font-size: 0.85rem; font-weight: 700; letter-spacing: 0.03em; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.skill-tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  background: var(--surface2);
  color: var(--muted);
  border: 1px solid var(--border);
  display: inline-flex; align-items: center; gap: 0.3rem;
}
.skill-tag img { width: 12px; height: 12px; object-fit: contain; }

/* ── PROJECT CAROUSEL ── */
.projects-carousel-wrap { position: relative; overflow: hidden; }
.projects-carousel {
  display: flex;
  gap: 0;
  overflow: hidden;
  padding: 1rem 0 1.5rem;
  cursor: grab;
  user-select: none;
}
.projects-carousel.dragging { cursor: grabbing; }
.projects-carousel-inner {
  display: flex;
  gap: 1rem;
  padding-left: 1rem;
  animation: carousel-scroll 30s linear infinite;
  flex-shrink: 0;
}
.projects-carousel:hover .projects-carousel-inner { animation-play-state: paused; }
@keyframes carousel-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(-100% - 1rem)); }
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
  position: relative;
  flex: 0 0 300px;
}
.project-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.project-nda {
  position: absolute; top: 0.75rem; right: 0.75rem;
  font-family: var(--mono); font-size: 0.6rem; padding: 0.15rem 0.45rem;
  border-radius: 3px; background: rgba(123,94,167,0.25); color: #b99ede;
  border: 1px solid rgba(123,94,167,0.35); letter-spacing: 0.08em; z-index: 2;
}
.project-thumb {
  width: 100%; height: 140px; background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; border-bottom: 1px solid var(--border);
}
.project-thumb img { width: 100%; height: 100%; object-fit: contain; transition: transform 0.3s; background: var(--surface2); }
.project-card:hover .project-thumb img { transform: scale(1.04); }
.project-thumb-placeholder { font-family: var(--mono); font-size: 0.7rem; color: var(--border); letter-spacing: 0.08em; }
.project-card-body { padding: 1rem 1.25rem 1.25rem; }
.project-card-body h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.6rem; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-card-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.ptag {
  font-family: var(--mono); font-size: 0.65rem; padding: 0.2rem 0.5rem;
  border-radius: 3px; background: var(--accent-dim); color: var(--accent);
  border: 1px solid rgba(79,142,247,0.2);
}

/* ── MODAL ── */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 500;
  background: rgba(8,12,16,0.94); backdrop-filter: blur(8px);
  overflow-y: auto; padding: 2rem 1rem;
}
.modal-overlay.open { display: flex; justify-content: center; }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; width: 100%; max-width: 780px;
  padding: 2.5rem; position: relative; margin: auto;
}
.modal-close {
  position: absolute; top: 1.25rem; right: 1.25rem;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; color: var(--muted); font-size: 1rem;
  width: 2rem; height: 2rem; display: flex; align-items: center;
  justify-content: center; cursor: pointer; transition: color 0.2s;
}
.modal-close:hover { color: var(--text); }
.modal-eyebrow { font-family: var(--mono); font-size: 0.68rem; color: var(--accent); letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 0.4rem; }
.modal h2 { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 0.4rem; }
.modal-divider { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }
.modal-screenshots {
  width: 100%;
  margin: 0 0 1.5rem 0;
}
.modal-screenshot {
  border-radius: 6px; overflow: hidden; border: 1px solid var(--border);
  background: var(--surface2); aspect-ratio: 16/9;
  display: flex; align-items: center; justify-content: center;
}
.modal-screenshot img { width: 100%; height: 100%; object-fit: cover; }
.modal-body-wrap {
  width: 100%;
}
.modal-section { margin-bottom: 1.5rem; }
.modal-label { font-family: var(--mono); font-size: 0.68rem; color: var(--accent); letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 0.5rem; }
.modal-section p { font-size: 1.05rem; color: var(--muted); line-height: 1.75; }
.modal-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.flow-steps { list-style: none; display: flex; flex-direction: column; gap: 0.25rem; }
.flow-steps li {
  font-family: var(--mono); font-size: 0.75rem; color: var(--muted);
  padding: 0.4rem 0.75rem; background: var(--surface2); border-radius: 4px;
}
.flow-steps li:not(:last-child)::after {
  content: '↓';
  display: flex;
  justify-content: center;
  font-size: 0.65rem;
  color: var(--border);
  line-height: 1;
  margin: 0;
  padding: 0;
  height: 14px;
  align-items: center;
}
.tech-row { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.challenge-list { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.challenge-list li {
  font-size: 0.82rem; padding: 0.7rem 1rem; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 6px; line-height: 1.65; color: var(--muted);
}
.challenge-list li .prob { color: #e07070; font-weight: 600; }
.challenge-list li .sol  { color: #6ecb8a; font-weight: 600; }
.result-list { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.result-list li {
  font-size: 0.82rem; color: var(--muted);
  padding-left: 1.25rem; position: relative; line-height: 1.65;
}
.result-list li::before { content: '✓'; position: absolute; left: 0; color: var(--accent); font-size: 0.7rem; top: 0.1rem; }

/* ── CONTACT ── */
#contact { border-top: 1px solid var(--border); text-align: center; }
#contact .section-desc { margin-left: auto; margin-right: auto; }
.contact-box {
  display: inline-flex; flex-direction: column; align-items: center; gap: 1.25rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 2.5rem 3rem;
}
.contact-cta { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; max-width: 400px; line-height: 1.3; }
.contact-email {
  font-family: var(--mono); font-size: 0.9rem; color: var(--accent);
  padding: 0.6rem 1.2rem; border: 1px solid rgba(79,142,247,0.3);
  border-radius: 6px; background: var(--accent-dim); cursor: pointer;
}
.contact-email:hover { background: rgba(79,142,247,0.2); }
.contact-links { display: flex; gap: 1rem; }
.contact-link {
  font-family: var(--mono); font-size: 0.75rem; color: var(--muted);
  display: flex; align-items: center; gap: 0.4rem; transition: color 0.2s;
}
.contact-link:hover { color: var(--accent); }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--surface); border: 1px solid var(--accent);
  color: var(--accent); font-family: var(--mono); font-size: 0.75rem;
  padding: 0.5rem 1.25rem; border-radius: 6px;
  opacity: 0; transition: all 0.3s; pointer-events: none; z-index: 999;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── BOOKING ── */
.booking-placeholder {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 2.5rem; text-align: center; max-width: 500px;
}
.booking-placeholder p { font-size: 0.875rem; color: var(--muted); }
.booking-placeholder strong { display: block; color: var(--text); font-size: 1rem; margin-bottom: 0.5rem; }

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem 2.5rem;
  max-width: 1300px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
}
footer p { font-size: 0.78rem; color: var(--muted); font-family: var(--mono); }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { font-size: 0.78rem; color: var(--muted); transition: color 0.2s; }
.footer-links a:hover { color: var(--accent); }

/* ── DIVIDER ── */
.section-divider { border: none; border-top: 1px solid var(--border); margin: 0 2.5rem; }

/* ── AOS SCROLL REVEAL ── */
[data-aos] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-aos].aos-animate {
  opacity: 1;
  transform: translateY(0);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .about-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .modal-two-col { grid-template-columns: 1fr; }
  .modal { padding: 1.5rem; }
  footer { flex-direction: column; }
}
@media (max-width: 480px) {
  .hero h1 { font-size: 2.4rem; }
  .skills-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-track, .projects-carousel-inner { animation: none; }
  [data-aos] { opacity: 1; transform: none; }
}
