:root {
  --bg: #f6f5ff;
  --bg2: #eef3ff;
  --card: #ffffff;
  --text: #1d1b2f;
  --muted: #5d5a78;
  --line: #e3e0f5;
  --a: #6d5dfc;
  --b: #e0559b;
  --shadow: 0 10px 30px -12px rgba(60, 40, 160, 0.25);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12111c;
    --bg2: #171628;
    --card: #1d1c2e;
    --text: #f1effc;
    --muted: #a9a6c4;
    --line: #2d2b45;
    --a: #8e82ff;
    --b: #ff7ab8;
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  }
}
* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  color: var(--text);
  background: linear-gradient(160deg, var(--bg), var(--bg2)) fixed;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; }
section { max-width: 1080px; margin: 0 auto; padding: 96px 24px; }
h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 800; text-align: center; margin-bottom: 16px; }
.grad {
  background: linear-gradient(90deg, var(--a), var(--b));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.section-lead { text-align: center; color: var(--muted); max-width: 560px; margin: 0 auto 28px; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 32px;
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.logo {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--a), var(--b)); color: #fff; font-weight: 800; text-decoration: none;
}
.links { display: flex; gap: 28px; list-style: none; padding: 0; }
.links a { text-decoration: none; font-weight: 500; font-size: 0.95rem; position: relative; }
.links a::after {
  content: ""; position: absolute; left: 0; bottom: -4px; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--a), var(--b)); transition: width 0.25s;
}
.links a:hover::after { width: 100%; }
.menu-btn { display: none; background: none; border: 0; font-size: 1.5rem; color: var(--text); cursor: pointer; }

/* Hero */
.hero {
  min-height: calc(100vh - 69px);
  display: grid; grid-template-columns: 1.3fr 1fr; align-items: center; gap: 48px;
}
.eyebrow { font-weight: 600; color: var(--a); margin-bottom: 12px; }
h1 { font-size: clamp(2.6rem, 7vw, 4.4rem); line-height: 1.1; font-weight: 800; margin-bottom: 20px; }
.lead { font-size: 1.15rem; max-width: 540px; margin-bottom: 14px; }
.muted { color: var(--muted); }
.socials { display: flex; gap: 14px; margin-top: 28px; align-items: center; flex-wrap: wrap; }
.socials a {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform 0.2s;
}
.socials a:hover { transform: translateY(-4px); }
.socials svg { width: 20px; height: 20px; fill: var(--a); }
.socials .pill {
  width: auto; padding: 0 20px; border-radius: 999px; text-decoration: none; font-weight: 600;
  background: linear-gradient(90deg, var(--a), var(--b)); color: #fff; border: 0;
}

.avatar { position: relative; aspect-ratio: 1; max-width: 400px; width: 100%; justify-self: center; }
.blob {
  position: absolute; inset: 8%;
  background: linear-gradient(135deg, var(--a), var(--b));
  border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%;
  opacity: 0.85; animation: morph 10s ease-in-out infinite;
}
@keyframes morph {
  50% { border-radius: 63% 37% 38% 62% / 55% 61% 39% 45%; transform: rotate(8deg); }
}
.card-stack { position: absolute; inset: 0; }
.face {
  position: absolute; inset: 30%; border-radius: 50%; display: grid; place-items: center;
  background: var(--card); font-size: clamp(2rem, 6vw, 3rem); font-weight: 800; color: var(--a);
  box-shadow: var(--shadow);
}
.mini-card {
  position: absolute; background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 8px 14px; font-weight: 600; font-size: 0.85rem; box-shadow: var(--shadow); white-space: nowrap;
  animation: float 5s ease-in-out infinite; z-index: 1;
}
.mini-card span { margin-right: 4px; }
.c1 { top: 6%; left: 0; }
.c2 { top: 44%; right: -4%; animation-delay: -1.5s; }
.c3 { bottom: 6%; left: 8%; animation-delay: -3s; }
@keyframes float { 50% { transform: translateY(-10px); } }

/* Timeline */
.timeline { list-style: none; padding: 0; max-width: 720px; margin: 40px auto 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 36px 32px; }
.dot {
  position: absolute; left: -9px; top: 6px; width: 16px; height: 16px; border-radius: 50%;
  background: linear-gradient(135deg, var(--a), var(--b)); box-shadow: 0 0 0 5px var(--bg);
}
.date { font-size: 0.85rem; font-weight: 600; color: var(--a); }
.kind { margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: 0.72rem; color: var(--b); background: color-mix(in srgb, var(--b) 12%, transparent); }
.timeline h3 { font-size: 1.15rem; margin: 2px 0 6px; }
.at { color: var(--muted); font-weight: 500; }
.timeline p:last-child { color: var(--muted); }

/* Projects */
.filters { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 32px; }
.chip {
  font: inherit; font-size: 0.9rem; font-weight: 600; padding: 7px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
}
.chip.on { background: linear-gradient(90deg, var(--a), var(--b)); color: #fff; border-color: transparent; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 26px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px;
  transition: transform 0.25s, border-color 0.25s;
  animation: pop 0.4s ease both;
}
@keyframes pop { from { opacity: 0; transform: translateY(12px); } }
.card:hover { transform: translateY(-6px); border-color: var(--a); }
.meta { font-size: 0.8rem; font-weight: 600; color: var(--a); text-transform: uppercase; letter-spacing: 0.05em; }
.card h3 { font-size: 1.3rem; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.wip {
  font-size: 0.7rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  color: #b7791f; background: rgba(236, 179, 66, 0.16); border: 1px solid rgba(236, 179, 66, 0.4);
}
@media (prefers-color-scheme: dark) { .wip { color: #f2c46d; } }
.card > p:not(.meta) { color: var(--muted); font-size: 0.95rem; flex: 1; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span {
  font-size: 0.78rem; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--a) 12%, transparent); color: var(--a);
}
.actions { display: flex; gap: 16px; margin-top: 6px; }
.actions a { font-weight: 700; font-size: 0.9rem; text-decoration: none; color: var(--a); }
.actions .demo { color: var(--b); }
.actions a:hover { text-decoration: underline; }

/* Skills */
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; max-width: 980px; margin: 40px auto 0; }
.skill-group { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px; box-shadow: var(--shadow); }
.skill-group h3 { font-size: 0.95rem; margin-bottom: 12px; }
.skill-group .tags span { font-size: 0.85rem; padding: 5px 12px; }

/* Footer */
footer { text-align: center; padding: 96px 24px 40px; border-top: 1px solid var(--line); }
footer > p { color: var(--muted); }
.cta {
  display: inline-block; margin: 24px 0 56px; padding: 14px 32px; border-radius: 999px; font-weight: 700;
  text-decoration: none; color: #fff; background: linear-gradient(90deg, var(--a), var(--b)); box-shadow: var(--shadow);
  transition: transform 0.2s;
}
.cta:hover { transform: scale(1.05); }
.fine { font-size: 0.85rem; }

/* Reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  * { animation: none !important; }
}

/* Mobile */
@media (max-width: 760px) {
  .nav { padding: 12px 16px; }
  .menu-btn { display: block; }
  .links {
    display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .links a { display: block; padding: 14px 20px; }
  .menu-open .links { display: flex; }
  section { padding: 72px 16px; }
  .hero { grid-template-columns: 1fr; text-align: center; min-height: auto; padding-top: 48px; }
  .lead { margin-left: auto; margin-right: auto; }
  .socials { justify-content: center; }
  .avatar { max-width: 300px; order: -1; }
  .c2 { right: 0; top: auto; bottom: 20%; }
  .c3 { bottom: 2%; }
  .grid { grid-template-columns: 1fr; }
}
