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

:root {
  --bg: #f5f0eb;
  --surface: #ffffff;
  --surface-2: #e8e2da;
  --primary: #5b4cff;
  --primary-light: #eeebff;
  --primary-dark: #4338ca;
  --secondary: #06b6d4;
  --gradient: linear-gradient(135deg, #5b4cff, #06b6d4);
  --gradient-2: linear-gradient(135deg, #5b4cff, #a855f7);
  --accent: #f97316;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --border: #e2e8f0;
  --border-2: #cbd5e1;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.04);
  --shadow-xl: 0 24px 64px rgba(0,0,0,0.1);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

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

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
ul, ol { list-style: none; }

::selection { background: rgba(79, 70, 229, 0.15); color: var(--text); }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 100px 0;
  position: relative;
}

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

.section__header {
  text-align: center;
  margin-bottom: 56px;
}

.section__tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-light);
  border-radius: 99px;
  padding: 6px 18px;
  margin-bottom: 16px;
}

.section__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 14px;
}

.section__desc {
  font-size: 1.05rem;
  color: var(--text-2);
  max-width: 540px;
  margin: 0 auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.9375rem;
  border-radius: var(--radius-sm);
  padding: 12px 24px;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1;
}

.btn--lg { padding: 16px 32px; font-size: 1rem; }

.btn--primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 20px rgba(79, 70, 229, 0.3);
}
.btn--primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(79, 70, 229, 0.4);
}
.btn--primary:active { transform: translateY(-1px); }

.btn--ghost {
  color: var(--text);
  background: transparent;
  padding: 16px 24px;
}
.btn--ghost:hover {
  color: var(--primary);
  gap: 14px;
}

/* ===== NAV ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  height: 72px;
  transition: all var(--transition);
}

.nav.scrolled {
  background: rgba(248, 246, 243, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  height: 64px;
}

.nav__inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 12px;
}

.nav__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.nav__logo-mark {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.nav__link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-2);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.nav__link:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.nav__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  margin-left: 8px;
}

.nav__burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 99px;
  transition: all 0.3s ease;
}

.nav__burger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger.active span:nth-child(2) { opacity: 0; }
.nav__burger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 868px) {
  .nav__links {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(248, 246, 243, 0.98);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px 24px;
    gap: 2px;
    margin-left: 0;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
  }
  .nav__links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav__link {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
  }
  .nav .btn--primary { display: none; }
  .nav__burger { display: flex; }
  .nav.scrolled { height: 64px; }
  .nav__links { top: 64px; }
}

/* ===== HERO ===== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 104px 0 60px;
}

.hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero__shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
}

.hero__shape--1 {
  width: 500px;
  height: 500px;
  background: rgba(79, 70, 229, 0.12);
  top: -150px;
  right: -100px;
  animation: float-slow 12s ease-in-out infinite;
}

.hero__shape--2 {
  width: 350px;
  height: 350px;
  background: rgba(14, 165, 233, 0.1);
  bottom: -80px;
  left: -80px;
  animation: float-slow 15s ease-in-out infinite reverse;
}

.hero__shape--3 {
  width: 200px;
  height: 200px;
  background: rgba(245, 158, 11, 0.08);
  top: 40%;
  left: 60%;
  animation: float-slow 10s ease-in-out infinite;
}

@keyframes float-slow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

.hero__inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  width: 100%;
}

.hero__text {
  display: flex;
  flex-direction: column;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid rgba(79, 70, 229, 0.15);
  border-radius: 99px;
  padding: 7px 18px;
  margin-bottom: 28px;
  width: fit-content;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.08;
  margin-bottom: 12px;
}

.hero__subtitle {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 20px;
}

.hero__desc {
  font-size: 1.05rem;
  color: var(--text-2);
  max-width: 520px;
  line-height: 1.75;
  margin-bottom: 36px;
}

.hero__desc strong {
  color: var(--text);
  font-weight: 600;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.hero__visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero__code-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  width: 100%;
  max-width: 400px;
  transform: perspective(1000px) rotateY(-4deg) rotateX(4deg);
  transition: transform 0.4s ease;
}

.hero__code-card:hover {
  transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
}

.code-card__dots {
  display: flex;
  gap: 7px;
  padding: 14px 18px;
  background: #1e1e2e;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.code-card__dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.code-card__dots span:nth-child(1) { background: #ff5f57; }
.code-card__dots span:nth-child(2) { background: #febc2e; }
.code-card__dots span:nth-child(3) { background: #28c840; }

.code-card__content {
  padding: 20px 22px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  line-height: 2;
  color: var(--text-2);
}

.code-line { display: block; }

.code-k { color: #ec4899; font-weight: 600; }
.code-s { color: #059669; }
.code-v { color: #6366f1; }

.hero__scroll {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  z-index: 2;
  animation: scroll-bounce 2s ease-in-out infinite;
}

.hero__scroll i {
  font-size: 0.7rem;
}

@keyframes scroll-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

@media (max-width: 868px) {
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }
  .hero__text { align-items: center; }
  .hero__badge { margin-left: auto; margin-right: auto; }
  .hero__desc { margin-left: auto; margin-right: auto; }
  .hero__actions { justify-content: center; }
  .hero__visual { display: none; }
  .hero__code-card { transform: none; }
}

/* ===== SERVICES ===== */
.services {
  background: var(--surface);
}

.services__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.service-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px 28px;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.service-card:hover {
  border-color: transparent;
  box-shadow: var(--shadow-lg);
  transform: translateY(-8px) scale(1.01);
}

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

.service-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--icon-clr, var(--primary));
  margin-bottom: 20px;
  transition: all var(--transition);
}

.service-card:hover .service-card__icon {
  background: var(--icon-clr, var(--primary));
  color: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  transform: scale(1.08);
}

.service-card__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.service-card__desc {
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.7;
}

/* ===== STACK ===== */
.stack {
  background: var(--bg);
}

.stack__vert {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 820px;
  margin: 0 auto;
}

.stack__row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  display: flex;
  align-items: center;
  gap: 24px;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.stack__row:hover {
  box-shadow: var(--shadow-lg);
  border-color: transparent;
  transform: translateY(-3px);
}

.stack__row-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 170px;
  flex-shrink: 0;
}

.stack__row-head i {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--row-clr) 12%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  color: var(--row-clr);
  transition: all var(--transition);
}

.stack__row:hover .stack__row-head i {
  background: var(--row-clr);
  color: #fff;
}

.stack__row-head h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.stack__row-body {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
}

.stack__row-body span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-2);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 5px 14px;
  transition: all var(--transition);
  cursor: default;
}

.stack__row-body span i {
  font-size: 0.9rem;
  color: var(--text-3);
  transition: transform 0.5s ease, color var(--transition);
}

.stack__row-body span:hover {
  color: var(--row-clr);
  border-color: color-mix(in srgb, var(--row-clr) 25%, transparent);
  background: color-mix(in srgb, var(--row-clr) 8%, transparent);
  transform: translateY(-2px);
}

.stack__row-body span:hover i {
  color: var(--row-clr);
  animation: spin-tag 0.6s ease;
}

@keyframes spin-tag {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@media (max-width: 720px) {
  .stack__row {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .stack__row-head { min-width: auto; }
}

/* ===== TIMELINE ===== */
.experience {
  background: var(--surface);
}

.timeline {
  max-width: 680px;
  margin: 0 auto;
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}

.timeline__item {
  position: relative;
  padding: 0 0 40px 36px;
}

.timeline__item:last-child { padding-bottom: 0; }

.timeline__marker {
  position: absolute;
  left: -26px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
  z-index: 2;
  transition: background 0.3s ease;
}

.timeline__item:hover .timeline__marker {
  background: var(--primary);
}

.timeline__content {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  transition: all var(--transition);
}

.timeline__content:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-2);
}

.timeline__year {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 3px 12px;
  border-radius: 99px;
  margin-bottom: 10px;
}

.timeline__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.timeline__company {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 10px;
}

.timeline__content p {
  font-size: 0.88rem;
  color: var(--text-2);
  line-height: 1.7;
}

/* ===== ABOUT ===== */
.about {
  background: var(--bg);
}

.about__grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 60px;
  align-items: center;
}

.about__text .section__tag {
  display: inline-block;
  margin-bottom: 12px;
}

.about__text .section__title {
  margin-bottom: 20px;
}

.about__text p {
  color: var(--text-2);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 16px;
}

.about__text strong {
  color: var(--text);
  font-weight: 600;
}

.about__cta {
  margin-top: 24px;
}

.about__stats {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.about__stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  transition: all var(--transition);
}

.about__stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
}

.about__stat-number {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 4px;
}

.about__stat-number::after {
  content: '+';
  -webkit-text-fill-color: initial;
  color: var(--primary);
}

.about__stat-label {
  font-size: 0.85rem;
  color: var(--text-2);
  font-weight: 500;
}

@media (max-width: 868px) {
  .about__grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .about__stats { flex-direction: row; flex-wrap: wrap; }
  .about__stat-card { flex: 1; min-width: 140px; }
  .about__stat-card:hover { transform: translateY(-4px); }
}

/* ===== CONTACT ===== */
.contact {
  background: var(--surface);
}

.contact__card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 56px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  text-align: center;
}

.contact__text .section__tag {
  margin-bottom: 12px;
}

.contact__text .section__title {
  margin-bottom: 12px;
}

.contact__text p {
  font-size: 1rem;
  color: var(--text-2);
}

@media (max-width: 768px) {
  .contact__card {
    flex-direction: column;
    text-align: center;
    padding: 40px 28px;
    justify-content: center;
  }
  .contact__card .btn { width: 100%; justify-content: center; }
}

/* ===== FOOTER ===== */
.footer {
  background: var(--text);
  color: rgba(255,255,255,0.7);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 48px 0;
  flex-wrap: wrap;
}

.footer__logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: #fff;
}

.footer__tagline {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
  margin-top: 6px;
}

.footer__links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.footer__links a {
  font-size: 0.87rem;
  color: rgba(255,255,255,0.6);
  transition: color var(--transition);
}

.footer__links a:hover {
  color: #fff;
}

.footer__ext a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--secondary);
  transition: all var(--transition);
}

.footer__ext a:hover {
  color: #fff;
  gap: 12px;
}

.footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 20px 0;
  text-align: center;
}

.footer__bottom p {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
}

@media (max-width: 768px) {
  .footer__inner {
    flex-direction: column;
    text-align: center;
  }
  .footer__links { justify-content: center; }
}

/* ===== REVEAL ===== */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}
