/* ===== Reset & base ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0a0a0f;
  --bg-card: #121218;
  --bg-card-hover: #17171f;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f5f5f7;
  --text-muted: #a1a1aa;
  --purple: #8b5cf6;
  --purple-light: #a78bfa;
  --purple-dark: #6d28d9;
  --font-head: "Poppins", sans-serif;
  --font-body: "Inter", sans-serif;
}

html {
  scroll-behavior: smooth;
}

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

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

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

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

/* ===== Custom cursor (desktop only) ===== */
@media (hover: hover) and (pointer: fine) {
  .cursor-dot,
  .cursor-ring,
  .cursor-glow {
    position: fixed;
    top: -10px;
    left: -10px;
    pointer-events: none;
    z-index: 999;
    transition: transform 0.15s ease-out, opacity 0.2s ease;
  }
  .cursor-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--purple-light);
  }
  .cursor-ring {
    width: 28px;
    height: 28px;
    margin: -10px 0 0 -10px;
    border-radius: 50%;
    border: 2px solid var(--purple);
    box-shadow: 0 0 15px 2px rgba(139, 92, 246, 0.5);
  }
  .cursor-glow {
    width: 300px;
    height: 300px;
    margin: -150px 0 0 -150px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.12) 0%, transparent 70%);
    z-index: 0;
  }
  body {
    cursor: none;
  }
  a,
  button {
    cursor: none;
  }
}

/* ===== Layout helpers ===== */
.section {
  position: relative;
  padding: 6rem 1.5rem;
}

.section-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.section-head {
  max-width: 640px;
  margin: 0 auto 3rem;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--purple-light);
  font-style: italic;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.eyebrow.center {
  display: flex;
  justify-content: center;
}

.diamond {
  width: 8px;
  height: 8px;
  background: var(--purple);
  transform: rotate(45deg);
  flex-shrink: 0;
}

.section-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.25;
}

.section-title.center {
  text-align: center;
}

.section-sub {
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  color: #fff;
  box-shadow: 0 8px 24px -8px rgba(139, 92, 246, 0.6);
}

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

.btn-outline {
  background: transparent;
  color: var(--purple-light);
  border-color: rgba(139, 92, 246, 0.5);
}

.btn-outline:hover {
  background: rgba(139, 92, 246, 0.1);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.6rem 1.25rem;
  font-size: 0.85rem;
}

/* ===== Header ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
}

.header.scrolled {
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
}

.header-inner {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
}

.logo {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.1rem;
}

.nav {
  display: flex;
  gap: 2rem;
}

.nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  transition: color 0.2s ease;
}

.nav a:hover {
  color: var(--purple-light);
}

.header-actions {
  display: flex;
  gap: 0.75rem;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: var(--purple-light);
  transition: background 0.2s ease, transform 0.2s ease;
}

.icon-btn:hover {
  background: rgba(139, 92, 246, 0.15);
  transform: translateY(-2px);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 0.5rem;
}

.menu-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

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

.hero-code {
  position: absolute;
  inset: 0;
  opacity: 0.08;
  color: var(--purple-light);
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.95rem;
  pointer-events: none;
  overflow: hidden;
  padding: 2rem;
}

.hero-code pre {
  white-space: pre-wrap;
}

.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  background: rgba(139, 92, 246, 0.25);
}

.hero-glow-1 {
  width: 320px;
  height: 320px;
  top: 10%;
  right: -120px;
}

.hero-glow-2 {
  width: 280px;
  height: 280px;
  top: 45%;
  left: -140px;
}

.hero-glow-3 {
  width: 260px;
  height: 260px;
  bottom: -80px;
  right: 15%;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.hero-title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  line-height: 1.1;
  margin: 1rem 0;
}

.hero-subtitle {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: clamp(1.1rem, 2.4vw, 1.5rem);
  color: var(--text-muted);
  min-height: 2em;
}

.caret {
  color: var(--purple-light);
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.hero-desc {
  margin: 1.5rem auto 2.25rem;
  max-width: 560px;
  color: var(--text-muted);
  font-size: 1.05rem;
}

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

.scroll-down {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--purple-light);
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%,
  100% {
    transform: translate(-50%, 0);
  }
  50% {
    transform: translate(-50%, 8px);
  }
}

/* ===== About ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 4rem;
  align-items: center;
}

.about-p {
  margin: 1.25rem 0;
  color: var(--text-muted);
}

.about-photo {
  display: flex;
  justify-content: center;
}

.photo-ring {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  padding: 6px;
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  box-shadow: 0 0 60px rgba(139, 92, 246, 0.35);
}

.photo-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 30%;
  background: var(--bg-card);
}

/* ===== Skills ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.75rem;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.skill-card:hover {
  transform: translateY(-4px);
  border-color: rgba(139, 92, 246, 0.4);
  background: var(--bg-card-hover);
}

.skill-icon {
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
}

.skill-card h3 {
  font-family: var(--font-head);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.skill-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* ===== Timeline ===== */
.timeline {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
  padding-left: 2rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--purple), rgba(139, 92, 246, 0.1));
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
}

.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 0.4rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2);
}

.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem 1.75rem;
}

.timeline-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.timeline-tag {
  color: var(--purple-light);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.timeline-card h3 {
  font-family: var(--font-head);
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}

.timeline-role {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.timeline-date {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.65rem;
}

.timeline-card p:last-child {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.badge-current {
  background: rgba(139, 92, 246, 0.15);
  color: var(--purple-light);
  border-color: rgba(139, 92, 246, 0.4);
}

.badge-highlight {
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  color: #fff;
  border: none;
}

.badge-private {
  margin-top: 0.75rem;
}

/* ===== Projects ===== */
.project-feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 3rem;
  margin-bottom: 2.5rem;
}

.project-feature-mockups {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.phone-frame {
  width: 130px;
  border-radius: 22px;
  border: 3px solid #26262f;
  overflow: hidden;
  background: #000;
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.6);
  transition: transform 0.3s ease;
}

.phone-frame img {
  width: 100%;
  display: block;
}

.phone-1 {
  transform: translateY(14px) rotate(-4deg);
}

.phone-2 {
  transform: translateY(-10px);
  width: 150px;
  z-index: 1;
  border-color: var(--purple);
}

.phone-3 {
  transform: translateY(14px) rotate(4deg);
}

.project-feature:hover .phone-1 {
  transform: translateY(6px) rotate(-6deg);
}

.project-feature:hover .phone-3 {
  transform: translateY(6px) rotate(6deg);
}

.project-feature-text h3 {
  font-family: var(--font-head);
  font-size: 1.6rem;
  margin: 0.75rem 0 0.75rem;
}

.project-feature-text p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tag {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--purple-light);
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.3);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 2rem;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(139, 92, 246, 0.4);
}

.project-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(139, 92, 246, 0.12);
  color: var(--purple-light);
  font-family: monospace;
  font-weight: 700;
  margin-bottom: 1rem;
}

.project-card h3 {
  font-family: var(--font-head);
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.project-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 1rem;
}

/* ===== Contact ===== */
.contact-card {
  background: linear-gradient(145deg, var(--bg-card), rgba(139, 92, 246, 0.08));
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 28px;
  padding: 4rem 2rem;
  text-align: center;
}

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

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 2.5rem 1.5rem;
  border-top: 1px solid var(--border);
}

.footer p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.75rem;
}

/* ===== Back to top ===== */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 40;
  box-shadow: 0 8px 20px -6px rgba(139, 92, 246, 0.6);
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  transform: translateY(-3px);
}

/* ===== Scroll reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .about-photo {
    order: -1;
  }
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .project-feature {
    grid-template-columns: 1fr;
    padding: 2rem;
  }
}

@media (max-width: 768px) {
  .nav,
  .header-actions {
    display: none;
  }
  .menu-toggle {
    display: flex;
  }
  .nav.open {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    flex-direction: column;
    background: rgba(10, 10, 15, 0.97);
    padding: 1.5rem;
    gap: 1.25rem;
    border-bottom: 1px solid var(--border);
  }
  .skills-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }
  .hero-actions .btn {
    justify-content: center;
  }
  .phone-frame {
    width: 90px;
  }
  .phone-2 {
    width: 104px;
  }
  .project-feature-mockups {
    gap: 0.5rem;
  }
}
