/* ---- Variables ---- */
:root {
  --bg:        #fafafa;
  --bg-2:      #ffffff;
  --line:      #e4e4e8;
  --line-soft: #ececee;
  --text:      #0b111e;
  --muted:     #525761;
  --faint:     #969aa3;
  --accent:    #a395e9;
  --accent-ink:#6f5fd6;
  --on-accent: #ffffff;
  --accent-2:  rgba(163, 149, 233, 0.18);
  --accent-3: rgba(163, 149, 233, 0.18);
  --nav-bg:    rgba(255, 255, 255, 0.8);
  --shadow-1:  rgba(11, 17, 30, 0.05);
  --shadow-2:  rgba(11, 17, 30, 0.18);
  --display: "Space Grotesk", sans-serif;
  --body:    "Manrope", sans-serif;
  --mono:    "JetBrains Mono", monospace;
  --maxw: 1200px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

:root[data-theme="dark"] {
  --bg:        #0b111e;
  --bg-2:      #121a2b;
  --line:      #25304a;
  --line-soft: #1a2236;
  --text:      #f3f4f7;
  --muted:     #99a2b3;
  --faint:     #5d6880;
  --accent:    #a395e9;
  --accent-ink:#bcb1f1;
  --on-accent: #0b111e;
  --accent-2:  rgba(163, 149, 233, 0.20);
  --accent-3:  rgba(163, 149, 233, 0.10);
  --nav-bg:    rgba(11, 17, 30, 0.72);
  --shadow-1:  rgba(0, 0, 0, 0.4);
  --shadow-2:  rgba(0, 0, 0, 0.5);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}
::selection { background: var(--accent); color: var(--on-accent); }
a { color: inherit; text-decoration: none; }

/* ---- Layout ---- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 40px; }
section { position: relative; }
.section-pad { padding: 96px 0; }

.eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-ink);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--accent);
  display: inline-block;
}
.section-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.2rem, 4.4vw, 3.4rem);
  line-height: 1.03;
  letter-spacing: -0.02em;
  margin-top: 20px;
}

/* ---- Navigation ---- */
header.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease);
}
header.nav.scrolled {
  border-bottom: 1px solid var(--line-soft);
}
.nav-inner {
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: 0.04em;
}
.brand-dot { color: var(--accent-ink); }

/* ---- Buttons ---- */
.icon-btn {
  width: 38px; height: 38px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1rem;
  line-height: 1;
  transition: all 0.25s var(--ease);
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.theme-btn .moon { display: none; }
.theme-btn .sun  { display: none; }
:root[data-theme="light"] .theme-btn .moon { display: inline; }
:root[data-theme="dark"]  .theme-btn .sun  { display: inline; }

.btn {
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 11px 19px;
  border-radius: 10px;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  transition: all 0.28s var(--ease);
  cursor: pointer;
  background: transparent;
  color: var(--text);
}
.btn:hover { border-color: var(--accent); color: var(--accent-ink); transform: translateY(-2px); }
.btn-solid { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn-solid:hover { color: var(--on-accent); box-shadow: 0 14px 34px -14px var(--accent); filter: brightness(1.03); }
.btn-solid .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--on-accent); }

/* ---- Hero ---- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 74px;
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, var(--line-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 78% 68% at 50% 34%, #000 8%, transparent 74%);
  mask-image: radial-gradient(ellipse 78% 68% at 50% 34%, #000 8%, transparent 74%);
  opacity: 0.7;
}
.hero-glow {
  position: absolute;
  width: 680px; height: 680px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-2), transparent 62%);
  filter: blur(34px);
  top: -180px; right: -120px;
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-50px, 46px) scale(1.1); }
}

.hero-inner { position: relative; z-index: 2; width: 100%; }
.hero-id { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  border: 1px solid var(--line-soft);
  background: var(--bg-2);
  padding: 6px 12px;
  border-radius: 100px;
}
.status .pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(163, 149, 233, 0.55); }
  70%  { box-shadow: 0 0 0 11px rgba(163, 149, 233, 0); }
  100% { box-shadow: 0 0 0 0 rgba(163, 149, 233, 0); }
}

h1.hero-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(3rem, 9vw, 7rem);
  line-height: 0.93;
  letter-spacing: -0.035em;
  margin: 4px 0 0;
}
h1.hero-name .line { display: block; overflow: hidden; }
h1.hero-name .line > span { display: inline-block; }

.hero-role {
  margin-top: 26px;
  font-family: var(--display);
  font-size: clamp(1.3rem, 2.6vw, 1.9rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.hero-role .sep { color: var(--faint); font-weight: 400; }
.hero-role .rotator { color: var(--accent-ink); display: inline-block; min-width: 1ch; }
.hero-role .rotator::after {
  content: "_";
  color: var(--accent-ink);
  animation: blink 1.1s steps(1) infinite;
  margin-left: 2px;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-desc { margin-top: 26px; max-width: 540px; color: var(--muted); font-size: 1.06rem; text-wrap: pretty; }
.hero-cta { margin-top: 38px; display: flex; gap: 14px; flex-wrap: wrap; }
.hero-meta {
  margin-top: 64px;
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line-soft);
  padding-top: 28px;
}
.hero-meta .k { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.13em; text-transform: uppercase; color: var(--faint); }
.hero-meta .v { font-family: var(--display); font-size: 1.12rem; font-weight: 500; margin-top: 6px; }

/* ---- About ---- */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr;
  gap: 72px;
  align-items: start;
}
.about-photo {
  width: 298px;
  height: 298px;
  border-radius: 50%;
  object-fit: cover;
  margin: 40px 0 15px 48px;
  display: block;
  border: 1px solid var(--line);
  box-shadow: 0 0 0 8px var(--accent-3);
}
.about-lead {
  font-family: var(--display);
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  font-weight: 400;
  line-height: 1.32;
  letter-spacing: -0.015em;
  text-wrap: pretty;
  margin-top: 24px;
}
.about-lead em { font-style: normal; color: var(--accent-ink); }
.about-body p { color: var(--muted); margin-top: 20px; font-size: 1.04rem; text-wrap: pretty; }
.about-body p:first-child { margin-top: 40px; padding-top: 50px; }
.about-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.tag {
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 7px 13px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  color: var(--muted);
  transition: all 0.25s var(--ease);
}
.tag:hover { border-color: var(--accent); color: var(--accent-ink); }

/* ---- Skills ---- */
.head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
  flex-wrap: wrap;
  margin-bottom: 56px;
}
.head-row .note { color: var(--muted); max-width: 330px; }
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }

.skill-card {
  border: 1px solid var(--line-soft);
  background: var(--bg-2);
  border-radius: 16px;
  padding: 30px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 2px var(--shadow-1);
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.skill-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 0%), var(--accent-3), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
}
.skill-card:hover { border-color: var(--line); transform: translateY(-4px); box-shadow: 0 22px 44px -26px var(--shadow-2); }
.skill-card:hover::before { opacity: 1; }
.skill-card .num { font-family: var(--mono); font-size: 0.74rem; color: var(--accent-ink); letter-spacing: 0.12em; }
.skill-card h3 { font-family: var(--display); font-size: 1.3rem; font-weight: 600; margin: 14px 0 18px; letter-spacing: -0.01em; }
.skill-list .row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
  font-size: 0.97rem;
  color: var(--muted);
}
.skill-list .row:first-child { border-top: none; }
.skill-list .row .d { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); flex: none; }

.marquee {
  margin-top: 64px;
  overflow: hidden;
  border-block: 1px solid var(--line-soft);
  padding: 24px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: flex;
  gap: 52px;
  width: max-content;
  animation: marquee 36s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--faint);
  display: inline-flex;
  align-items: center;
  gap: 52px;
}
.marquee-track span::after { content: "✦"; color: var(--accent); font-size: 0.75rem; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---- Journey ---- */
.timeline { margin-top: 56px; }
.tl-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 44px;
  padding: 38px 0;
  border-top: 1px solid var(--line-soft);
}
.tl-item:last-child { border-bottom: 1px solid var(--line-soft); }
.tl-year { font-family: var(--mono); font-size: 0.82rem; color: var(--accent-ink); padding-top: 6px; letter-spacing: 0.04em; }
.tl-body h3 { font-family: var(--display); font-size: 1.4rem; font-weight: 600; letter-spacing: -0.01em; transition: color 0.3s var(--ease); }
.tl-body .org { color: var(--muted); font-family: var(--mono); font-size: 0.82rem; margin-top: 5px; }
.tl-body p { color: var(--muted); margin-top: 14px; max-width: 600px; text-wrap: pretty; }
.tl-body .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.tl-body .chips span { font-family: var(--mono); font-size: 0.74rem; color: var(--muted); padding: 5px 11px; border: 1px solid var(--line-soft); border-radius: 7px; }
.tl-item:hover .tl-body h3 { color: var(--accent-ink); }

/* ---- Stats strip ---- */
.stats-strip {
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: 44px 0;
}
.stats-inner {
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat {
  flex: 1;
  text-align: center;
  padding: 0 32px;
}
.stat + .stat { border-left: 1px solid var(--line-soft); }
.stat-n {
  display: block;
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}
.stat-l {
  display: block;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 6px;
}

/* ---- Work / Projects ---- */
.proj-grid {
  margin-top: 64px;
  display: flex;
  flex-direction: column;
  gap: 88px;
}
.project {
  display: flex;
  align-items: center;
  gap: 64px;
}
.project:nth-child(even) .proj-img { order: 2; }
.project:nth-child(even) .proj-content { order: 1; }

.proj-img {
  flex: 0 0 58%;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  box-shadow: 0 24px 64px -28px var(--shadow-2);
  position: relative;
}
.proj-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 0.7s var(--ease);
}
.project:hover .proj-img img { transform: scale(1.04); }

.proj-content { flex: 1; min-width: 0; }
.proj-num {
  display: block;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--faint);
  letter-spacing: 0.12em;
  margin-bottom: 10px;
}
.proj-content .pn {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent-ink);
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}
.proj-content h3 {
  font-family: var(--display);
  font-size: clamp(1.55rem, 2.8vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.proj-content > p {
  color: var(--muted);
  margin-top: 16px;
  font-size: 0.96rem;
  text-wrap: pretty;
  line-height: 1.68;
}
.proj-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.proj-tags span {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  padding: 5px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--bg);
}
.proj-links { display: flex; gap: 22px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.proj-links a {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 0.25s var(--ease);
}
.proj-links a:hover { color: var(--accent-ink); }
.proj-links a .arr { transition: transform 0.25s var(--ease); }
.proj-links a:hover .arr { transform: translate(3px, -3px); }

/* ---- Contact ---- */
.contact { text-align: center; padding-bottom: 120px; }
.contact .eyebrow { justify-content: center; }
.contact .big {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.6rem, 7vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin: 24px 0 10px;
}
.contact .big a {
  background: linear-gradient(var(--accent), var(--accent)) no-repeat left bottom / 0% 3px;
  transition: background-size 0.4s var(--ease), color 0.3s;
  padding-bottom: 4px;
}
.contact .big a:hover { color: var(--accent-ink); background-size: 100% 3px; }
.contact-sub { color: var(--muted); max-width: 500px; margin: 20px auto 0; font-size: 1.06rem; text-wrap: pretty; }
.contact-rows { margin-top: 48px; display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.contact-rows a {
  font-family: var(--mono);
  font-size: 0.86rem;
  color: var(--muted);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 13px 19px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.28s var(--ease);
}
.contact-rows a:hover { border-color: var(--accent); color: var(--accent-ink); transform: translateY(-3px); }

/* ---- Bottom nav pill ---- */
.bottom-nav {
  background-color: #dde3ee33;
  width: fit-content;
  min-width: 320px;
  margin: 25px auto;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  border: 1px solid #cccccc4a;
  border-radius: 500px;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0 8px;
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  white-space: nowrap;
}
:root[data-theme="dark"] .bottom-nav {
  background-color: rgba(18, 26, 43, 0.2);
  border-color: rgba(255, 255, 255, 0.06);
}
.bottom-nav a {
  font-family: var(--body);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  padding: 12px 16px;
  text-decoration: none;
  transition: color 0.25s var(--ease);
}
.bottom-nav a:hover { color: var(--accent-ink); }
.bottom-nav-cta {
  border-radius: 500px;
  background-color: var(--accent);
  padding: 10px 20px;
  border: 2px solid var(--accent);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.48);
  transition: box-shadow 0.8s !important;
  cursor: pointer;
  margin: 8px 0 8px 4px;
  color: var(--on-accent) !important;
  font-weight: 600;
}
.bottom-nav-cta:hover {
  box-shadow: inset -2px -1px 1px rgba(255,255,255,0.48);
  color: var(--on-accent) !important;
  transition-delay: 0.18s;
}

/* ---- Footer ---- */
footer.foot { border-top: 1px solid var(--line-soft); padding: 38px 0; }
.foot-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.foot-inner .c { font-family: var(--mono); font-size: 0.78rem; color: var(--faint); }
.foot-links { display: flex; gap: 24px; }
.foot-links a { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); transition: color 0.25s; }
.foot-links a:hover { color: var(--accent-ink); }

/* ---- Reveal animations ---- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-glow, .marquee-track, .status .pulse, .hero-role .rotator::after { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---- Tablet ---- */
@media (max-width: 940px) {
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .skills-grid { grid-template-columns: 1fr; }
  .tl-item { grid-template-columns: 1fr; gap: 14px; }
  .tl-year { padding-top: 0; }
  .project { gap: 40px; }
  .proj-img { flex: 0 0 52%; }
}

/* ---- Mobile ---- */
@media (max-width: 660px) {
  .wrap { padding: 0 22px; }
  .section-pad { padding: 72px 0; }
  .hero-cta .btn { flex: 1; justify-content: center; }
  body { font-size: 16px; }

  .stats-inner { flex-wrap: wrap; }
  .stat { flex: 0 0 calc(50% - 1px); padding: 20px 16px; }
  .stat + .stat { border-left: none; border-top: 1px solid var(--line-soft); }
  .stat:nth-child(2) { border-left: 1px solid var(--line-soft); border-top: none; }

  .proj-grid { gap: 56px; }
  .project { flex-direction: column; gap: 24px; }
  .project:nth-child(even) .proj-img { order: 0; }
  .project:nth-child(even) .proj-content { order: 0; }
  .proj-img { flex: none; width: 100%; }
    .about-photo {
    width: 240px;
    height: 240px;
    margin: 30px auto 15px;
  }
}


/* --accent-3: rgba(163, 149, 233, 0.09); */