/* ----------------------------------------------------------------------------
   Reset + base
---------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 200ms ease;
}

button {
  font: inherit;
  cursor: pointer;
}

::selection {
  background: var(--accent-from);
  color: #fff;
}

/* ----------------------------------------------------------------------------
   Tokens
---------------------------------------------------------------------------- */
:root {
  --bg: #0a0a0f;
  --bg-elev: #12121a;
  --bg-elev-2: #181822;
  --border: #1f1f2e;
  --border-hi: #2d2d42;
  --text: #e6e6ec;
  --text-dim: #8a8a99;
  --text-dimmer: #5c5c6e;
  --accent-from: #8b5cf6;
  --accent-to: #22d3ee;
  --accent-gradient: linear-gradient(135deg, var(--accent-from), var(--accent-to));
  --accent-gradient-soft: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(34, 211, 238, 0.15));

  --container: 1100px;
  --radius: 14px;
  --radius-sm: 8px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 0 1px rgba(139, 92, 246, 0.35), 0 8px 32px rgba(139, 92, 246, 0.18);
}

/* ----------------------------------------------------------------------------
   Layout primitives
---------------------------------------------------------------------------- */
.container {
  width: min(100% - 2.5rem, var(--container));
  margin-inline: auto;
}

section {
  padding-block: 6rem;
  position: relative;
}

@media (max-width: 768px) {
  section {
    padding-block: 4rem;
  }
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  margin-bottom: 1.25rem;
}

.section-eyebrow::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--accent-gradient);
}

.section-title {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 2.5rem;
}

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ----------------------------------------------------------------------------
   Header / nav
---------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  background: rgba(10, 10, 15, 0.65);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease, background 200ms ease;
}

.site-header.scrolled {
  border-bottom-color: var(--border);
  background: rgba(10, 10, 15, 0.85);
}

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

.brand {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-gradient);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.6);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--text-dim);
  font-weight: 500;
  position: relative;
}

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

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent-gradient);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border-hi);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  transition: border-color 200ms ease, background 200ms ease, transform 200ms ease;
}

.nav-cta:hover {
  border-color: var(--accent-from);
  background: rgba(139, 92, 246, 0.08);
}

/* Mobile nav */
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-hi);
  background: transparent;
  border-radius: 8px;
  color: var(--text);
  align-items: center;
  justify-content: center;
}

.nav-toggle svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 768px) {
  .nav-links,
  .nav-cta {
    display: none;
  }
  .nav-toggle {
    display: inline-flex;
  }
  .nav.is-open .nav-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 1.25rem 1.25rem 1.5rem;
    background: rgba(10, 10, 15, 0.95);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
  .nav.is-open .nav-cta {
    display: inline-flex;
    margin-left: 0;
  }
}

/* ----------------------------------------------------------------------------
   Hero
---------------------------------------------------------------------------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 6rem;
  padding-bottom: 4rem;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(139, 92, 246, 0.18), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(34, 211, 238, 0.14), transparent 45%);
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(139, 92, 246, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(139, 92, 246, 0.05) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero-greeting {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.85rem;
  color: var(--text-dim);
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 1.75rem;
}

.hero-greeting::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
  animation: pulse 2.4s ease-in-out infinite;
}

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

.hero-title {
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 0 0 1.5rem;
}

.hero-title .line {
  display: block;
}

.hero-subtitle {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--text-dim);
  max-width: 38rem;
  margin: 0 0 2.5rem;
  line-height: 1.55;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 4rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease, background 200ms ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #0a0a0f;
  font-weight: 600;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(139, 92, 246, 0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-hi);
}

.btn-ghost:hover {
  border-color: var(--accent-from);
  background: rgba(139, 92, 246, 0.08);
  transform: translateY(-2px);
}

.btn svg {
  width: 16px;
  height: 16px;
}

.hero-meta {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.hero-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.hero-meta-label {
  color: var(--text-dimmer);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-meta-value {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
}

/* ----------------------------------------------------------------------------
   About
---------------------------------------------------------------------------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 4rem;
  align-items: start;
}

@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

.about-text p {
  color: var(--text-dim);
  font-size: 1.05rem;
  line-height: 1.7;
  margin: 0 0 1rem;
}

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

.about-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  position: sticky;
  top: 6rem;
}

.about-card-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 0 0 1.25rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.about-facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.about-facts li {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  font-size: 0.95rem;
  color: var(--text-dim);
}

.about-facts li svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  stroke: url(#grad-line);
}

.about-facts li strong {
  color: var(--text);
  font-weight: 500;
  margin-right: 0.5rem;
}

/* ----------------------------------------------------------------------------
   Skills
---------------------------------------------------------------------------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.skill-group {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 200ms ease, transform 200ms ease;
}

.skill-group:hover {
  border-color: var(--border-hi);
  transform: translateY(-2px);
}

.skill-group h3 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 0 0 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.skill-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 500;
}

/* ----------------------------------------------------------------------------
   Experience timeline
---------------------------------------------------------------------------- */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent-from), var(--accent-to), transparent);
}

.timeline-item {
  position: relative;
  padding-bottom: 2.5rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 6px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent-from);
  box-shadow: 0 0 0 4px var(--bg), 0 0 12px rgba(139, 92, 246, 0.4);
}

.timeline-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.timeline-meta-divider {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-dimmer);
}

.timeline-role {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  color: var(--text);
}

.timeline-company {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin: 0 0 0.85rem;
}

.timeline-bullets {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-dim);
  font-size: 0.95rem;
}

.timeline-bullets li {
  margin-bottom: 0.35rem;
}

.timeline-bullets li::marker {
  color: var(--accent-from);
}

/* ----------------------------------------------------------------------------
   Projects
---------------------------------------------------------------------------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform 250ms ease, border-color 250ms ease, box-shadow 250ms ease;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-gradient-soft);
  opacity: 0;
  transition: opacity 250ms ease;
  pointer-events: none;
  z-index: 0;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hi);
  box-shadow: 0 24px 48px -16px rgba(139, 92, 246, 0.25);
}

.project-card:hover::before {
  opacity: 1;
}

.project-card > * {
  position: relative;
  z-index: 1;
}

.project-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.project-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0a0a0f;
  flex-shrink: 0;
}

.project-icon svg {
  width: 20px;
  height: 20px;
}

.project-links {
  display: flex;
  gap: 0.5rem;
}

.project-link {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  transition: color 200ms ease, border-color 200ms ease, background 200ms ease;
}

.project-link:hover {
  color: var(--text);
  border-color: var(--accent-from);
  background: rgba(139, 92, 246, 0.1);
}

.project-link svg {
  width: 14px;
  height: 14px;
}

.project-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}

.project-desc {
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0;
  flex-grow: 1;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.project-tech span {
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: var(--bg-elev-2);
}

/* ----------------------------------------------------------------------------
   Contact
---------------------------------------------------------------------------- */
.contact {
  text-align: center;
  padding-block: 8rem;
  position: relative;
}

.contact::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(90%, 800px);
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border-hi), transparent);
}

.contact-headline {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin: 0 0 1.25rem;
}

.contact-sub {
  color: var(--text-dim);
  font-size: 1.05rem;
  max-width: 32rem;
  margin: 0 auto 2.5rem;
}

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.05rem;
  padding: 1rem 1.5rem;
  border-radius: 999px;
  border: 1px solid var(--border-hi);
  background: var(--bg-elev);
  margin-bottom: 2.5rem;
  transition: border-color 200ms ease, background 200ms ease;
}

.contact-email:hover,
.contact-email:focus-visible {
  border-color: var(--accent-from);
  background: rgba(139, 92, 246, 0.06);
}

.contact-email .copy-icon {
  width: 16px;
  height: 16px;
  color: var(--text-dim);
}

.contact-email.copied .copy-icon {
  color: #4ade80;
}

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

.social-link {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  transition: color 200ms ease, border-color 200ms ease, transform 200ms ease;
}

.social-link:hover {
  color: var(--text);
  border-color: var(--accent-from);
  transform: translateY(-2px);
}

.social-link svg {
  width: 18px;
  height: 18px;
}

/* ----------------------------------------------------------------------------
   Footer
---------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 2rem;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-dimmer);
}

.footer-row span:last-child::before {
  content: '~ ';
  color: var(--accent-from);
}

/* ----------------------------------------------------------------------------
   Reveal-on-scroll
---------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ----------------------------------------------------------------------------
   Focus
---------------------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--accent-to);
  outline-offset: 3px;
  border-radius: 4px;
}
