/* =====================================================
   DARK THEME: deep navy with purple and blue accents
   (change the colours here to restyle the whole site)
   ===================================================== */
:root {
  --bg: #090819;          /* page background: midnight navy */
  --bg2: #100e2b;         /* slightly lighter panels */
  --ink: #ecebff;         /* main text */
  --soft: #a6a3c7;        /* secondary text */
  --purple: #8b5cf6;
  --violet: #a78bfa;      /* links, highlights */
  --blue: #3b82f6;
  --cyan: #38bdf8;
  --line: rgba(167, 139, 250, .2);
  --glass: rgba(255, 255, 255, .045);
  --grad: linear-gradient(135deg, #7c3aed, #2563eb);
  --grad-text: linear-gradient(90deg, #c4b5fd, #7dd3fc);
  --radius: 22px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* lets us animate a gradient's angle (rotating borders) */
@property --angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes spin { to { --angle: 360deg; } }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; color-scheme: dark; }

body {
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
}

a { color: var(--violet); }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
::selection { background: var(--purple); color: #fff; }

.wrap { width: min(100% - 2.5rem, 1080px); margin-inline: auto; }

h1, h2 { font-family: "DM Serif Display", Georgia, serif; font-weight: 400; line-height: 1.05; }
h2 { font-size: clamp(2.2rem, 6vw, 3.2rem); margin-bottom: 1.5rem; }
h3 { font-size: 1.2rem; line-height: 1.3; margin-bottom: .4rem; }
p { margin-bottom: .9rem; }

/* ---------- SCROLL PROGRESS BAR ---------- */
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 30;
  background: linear-gradient(90deg, var(--purple), var(--blue), var(--cyan));
  transform: scaleX(0); transform-origin: left;
}

/* ---------- CURSOR GLOW (desktop) ---------- */
.cursor-glow {
  position: fixed; top: 0; left: 0; width: 500px; height: 500px; z-index: 5;
  pointer-events: none; opacity: 0; transition: opacity .6s;
  background: radial-gradient(circle, rgba(139, 92, 246, .16), rgba(59, 130, 246, .08) 40%, transparent 70%);
  mix-blend-mode: screen;
}
@media (hover: none) { .cursor-glow { display: none; } }

/* ---------- NAV ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(9, 8, 25, .72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .4rem 1.5rem; padding: .8rem 0;
}
.logo { font-family: "DM Serif Display", serif; font-size: 1.3rem; color: var(--ink); text-decoration: none; }
nav { display: flex; flex-wrap: wrap; gap: 1.3rem; font-size: .95rem; font-weight: 500; }
nav a { color: var(--soft); text-decoration: none; position: relative; padding: .1rem 0; }
nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
  transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease);
}
nav a:hover, nav a[aria-current="true"] { color: #fff; }
nav a:hover::after, nav a[aria-current="true"]::after { transform: scaleX(1); }

/* ---------- HERO ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(4rem, 12vw, 8rem) 0 clamp(3rem, 8vw, 5rem); }
#net { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

.hero-inner { position: relative; z-index: 1; display: grid; gap: 3rem; align-items: center; }
@media (min-width: 960px) { .hero-inner { grid-template-columns: 1.1fr .9fr; } }

.intro { color: var(--soft); font-weight: 500; margin-bottom: .6rem; }

.name { font-size: clamp(3.4rem, 12vw, 6.8rem); letter-spacing: -.02em; }
.word { display: inline-block; overflow: hidden; vertical-align: bottom; padding: .05em .02em .15em; margin-bottom: -.15em; }
@media (min-width: 960px) { .word { display: block; width: fit-content; } }
.word > span {
  display: inline-block;
  background: linear-gradient(90deg, #ffffff 0%, #c4b5fd 30%, #7dd3fc 60%, #ffffff 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: rise 1.1s var(--ease) both, shine 7s linear infinite;
}
.word:nth-child(2) > span { animation-delay: .12s, 0s; }
@keyframes rise { from { transform: translateY(110%); } }
@keyframes shine { to { background-position: -220% 0; } }

.role-line { margin-top: 1.1rem; font-family: "DM Serif Display", serif; font-size: clamp(1.4rem, 4.5vw, 2rem); min-height: 1.3em; }
.role { color: var(--violet); }
.caret {
  display: inline-block; width: 3px; height: 1em; margin-left: 3px; vertical-align: -.12em;
  background: var(--cyan); animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.tagline { max-width: 34rem; margin-top: .6rem; font-size: 1.15rem; color: var(--soft); }

.hero-in { animation: fadeUp .9s var(--ease) both; animation-delay: calc(var(--i, 0) * .12s + .1s); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } }

/* soft glows */
.blob {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; z-index: 0;
  animation: drift 14s ease-in-out infinite alternate;
  transition: translate .6s var(--ease);
}
.b1 { width: 420px; height: 420px; background: var(--purple); top: -120px; right: 5%; }
.b2 { width: 360px; height: 360px; background: var(--blue);   bottom: -100px; left: -60px; animation-delay: -5s; }
.b3 { width: 260px; height: 260px; background: #6d28d9;       top: 35%; right: 35%; animation-delay: -9s; opacity: .4; }
@keyframes drift { to { transform: translate(40px, 30px) scale(1.12); } }
.b1 { translate: calc(var(--px, 0) * -30px) calc(var(--py, 0) * -30px); }
.b2 { translate: calc(var(--px, 0) * 40px)  calc(var(--py, 0) * 30px); }
.b3 { translate: calc(var(--px, 0) * -55px) calc(var(--py, 0) * 45px); }

/* ---------- HERO DATA GRAPHIC ---------- */
.hero-visual { position: relative; display: none; }
@media (min-width: 960px) { .hero-visual { display: block; } }

.viz-card {
  position: relative; padding: 1.2rem 1.3rem 1.3rem; border-radius: 24px;
  background: linear-gradient(160deg, rgba(139, 92, 246, .18), rgba(15, 14, 40, .85) 55%);
  border: 1px solid var(--line);
  box-shadow: 0 30px 70px -30px rgba(124, 58, 237, .65), inset 0 1px 0 rgba(255, 255, 255, .08);
  backdrop-filter: blur(10px);
  animation: float 7s ease-in-out infinite alternate;
}
@keyframes float { to { transform: translateY(-14px) rotate(.6deg); } }

.viz-head { display: flex; align-items: center; gap: .4rem; margin-bottom: .6rem; }
.viz-head span { width: 10px; height: 10px; border-radius: 50%; background: rgba(167, 139, 250, .5); }
.viz-head span:nth-child(2) { background: rgba(56, 189, 248, .55); }
.viz-head span:nth-child(3) { background: rgba(255, 255, 255, .3); }
.viz-head em { margin-left: auto; font-style: normal; font-size: .8rem; color: var(--soft); letter-spacing: .02em; }

.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .line { animation: draw 2.4s var(--ease) .9s backwards; filter: drop-shadow(0 0 6px rgba(139, 92, 246, .8)); }
.chart .area { animation: fadeIn 1.6s ease 1.8s backwards; }
@keyframes draw { from { stroke-dasharray: 1; stroke-dashoffset: 1; } to { stroke-dasharray: 1; stroke-dashoffset: 0; } }
@keyframes fadeIn { from { opacity: 0; } }
.dot-pulse { transform-box: fill-box; transform-origin: center; animation: pulse 2s ease-out infinite 3s; opacity: .8; }
@keyframes pulse { from { transform: scale(1); opacity: .8; } to { transform: scale(3.2); opacity: 0; } }

.viz-row { display: flex; align-items: center; gap: .9rem; margin-top: .6rem; }
.ring-wrap { position: relative; width: 78px; height: 78px; flex: none; }
.ring { width: 100%; height: 100%; }
.ring-fill { stroke-dasharray: 59 100; animation: fillRing 1.8s var(--ease) 1.2s backwards; }
@keyframes fillRing { from { stroke-dasharray: 0 100; } }
.ring-num { position: absolute; inset: 0; display: grid; place-items: center; font-family: "DM Serif Display", serif; font-size: 1.25rem; }
.ring-label { font-size: .85rem; line-height: 1.35; color: var(--soft); }
.bars { margin-left: auto; width: 90px; height: 56px; flex: none; }
.bars rect { fill: url(#lineGrad); transform-box: fill-box; transform-origin: bottom; animation: grow 1s var(--ease) backwards; }
.bars rect:nth-child(1) { animation-delay: 1.5s; } .bars rect:nth-child(2) { animation-delay: 1.62s; }
.bars rect:nth-child(3) { animation-delay: 1.74s; } .bars rect:nth-child(4) { animation-delay: 1.86s; }
.bars rect:nth-child(5) { animation-delay: 1.98s; }
@keyframes grow { from { transform: scaleY(0); } }

.float-chip {
  position: absolute; padding: .3rem .85rem; border-radius: 999px; font-size: .8rem; font-weight: 700;
  color: #e0d9ff; background: rgba(139, 92, 246, .22); border: 1px solid rgba(167, 139, 250, .45);
  backdrop-filter: blur(8px); animation: bob 5s ease-in-out infinite alternate;
}
.c1 { top: -16px; left: -22px; }
.c2 { bottom: 60px; right: -18px; animation-delay: -1.7s; background: rgba(59, 130, 246, .25); border-color: rgba(125, 211, 252, .5); }
.c3 { bottom: -18px; left: 26%; animation-delay: -3.2s; }
@keyframes bob { to { transform: translateY(-10px); } }

/* ---------- BUTTONS ---------- */
.buttons { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }
.btn {
  display: inline-block; padding: .75rem 1.5rem; border-radius: 999px;
  font-weight: 700; text-decoration: none; color: #e0d9ff;
  background: rgba(255, 255, 255, .05); border: 1.5px solid rgba(167, 139, 250, .5);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s;
}
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; }
.btn:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -10px rgba(124, 58, 237, .8); }
.btn:not(.primary):hover { background: rgba(139, 92, 246, .22); }
.btn:active { transform: translateY(0); }

/* ---------- STATS ---------- */
.stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.4rem 1rem;
  padding: 1.6rem 1.4rem; border-radius: 28px;
  background: var(--glass); border: 1px solid var(--line);
  box-shadow: 0 24px 50px -30px rgba(124, 58, 237, .6);
}
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, 1fr); padding: 2rem; } }
.stat { text-align: center; }
.num {
  display: block; font-family: "DM Serif Display", serif; font-size: clamp(2.3rem, 6vw, 3.3rem); line-height: 1.15;
  background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.label { display: block; font-size: .9rem; color: var(--soft); line-height: 1.4; }

/* ---------- SKILLS TICKER ---------- */
.marquee {
  overflow: hidden; margin-top: clamp(2.5rem, 6vw, 4rem);
  border-block: 1px solid var(--line); background: rgba(139, 92, 246, .05);
  -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; width: max-content; animation: scroll 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee ul { display: flex; flex: none; list-style: none; }
.marquee li {
  padding: 1rem 0; font-family: "DM Serif Display", serif; font-size: 1.4rem; color: var(--soft); white-space: nowrap;
}
.marquee li::after { content: "✦"; margin: 0 1.6rem; color: var(--purple); font-family: "DM Sans", sans-serif; font-size: 1rem; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ---------- SECTIONS ---------- */
.section { padding: clamp(3rem, 8vw, 5.5rem) 0; scroll-margin-top: 60px; }
.tinted {
  background:
    radial-gradient(rgba(167, 139, 250, .16) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(180deg, rgba(139, 92, 246, .08), rgba(59, 130, 246, .08));
  border-block: 1px solid var(--line);
}

/* scroll reveal (only active when JavaScript is running) */
.js .reveal {
  opacity: 0; translate: 0 26px;
  transition: opacity .8s var(--ease), translate .8s var(--ease);
  transition-delay: var(--d, 0s);
}
.js .reveal.in,
.reveal-all .reveal { opacity: 1; translate: 0 0; }

/* ABOUT */
.about { display: grid; gap: 2.5rem; align-items: center; }
.portrait-wrap { position: relative; isolation: isolate; width: 100%; max-width: 280px; }
.portrait-wrap::before {      /* rotating purple-blue glow behind the photo */
  content: ""; position: absolute; inset: -4px; z-index: -1;
  border-radius: 999px 999px 28px 28px;
  background: conic-gradient(from var(--angle), #8b5cf6, #3b82f6, #38bdf8, #8b5cf6);
  filter: blur(14px); opacity: .75;
  animation: spin 7s linear infinite;
}
.portrait {
  position: relative; overflow: hidden;
  width: 100%; aspect-ratio: 4 / 5;
  border-radius: 999px 999px 24px 24px;     /* arch shape */
  background: linear-gradient(160deg, #2a1f5c, #12204a);
  border: 2px solid rgba(255, 255, 255, .18);
  display: grid; place-items: center;
}
.portrait .initials { font-family: "DM Serif Display", serif; font-size: 4rem; color: var(--violet); }
.portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.portrait-wrap:hover img { transform: scale(1.05); }
.portrait.no-photo img { display: none; }
.facts { margin-top: 1rem; padding-left: 1.2rem; color: var(--soft); }
.facts li { margin-bottom: .5rem; }
.facts strong { color: var(--ink); }
.facts li::marker { color: var(--purple); }
@media (min-width: 800px) { .about { grid-template-columns: 280px 1fr; gap: 4rem; } }

/* PROJECT FILTERS */
.filters { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.8rem; }
.filters button {
  font: inherit; font-weight: 500; cursor: pointer;
  padding: .45rem 1.1rem; border-radius: 999px;
  background: var(--glass); color: var(--ink); border: 1.5px solid var(--line);
  transition: background .25s, border-color .25s, transform .2s var(--ease);
}
.filters button:hover { transform: translateY(-2px); border-color: var(--violet); }
.filters button[aria-pressed="true"] { background: var(--grad); border-color: transparent; color: #fff; }

/* PROJECT CARDS */
.grid { display: grid; gap: 1.4rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid { grid-template-columns: 1fr 1fr; } }
.card {
  min-width: 0;
  background-color: rgba(18, 16, 48, .8); border-radius: var(--radius); padding: 1.6rem;
  border: 1px solid var(--line);
  box-shadow: 0 16px 36px -22px rgba(0, 0, 0, .8);
  transition: transform .2s ease-out, box-shadow .35s var(--ease), border-color .35s;
  will-change: transform;
}
.card:hover {
  border-color: rgba(167, 139, 250, .6);
  box-shadow: 0 28px 50px -22px rgba(124, 58, 237, .6);
  background-image: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), rgba(139, 92, 246, .2), rgba(59, 130, 246, .07) 60%, transparent 80%);
}
.card[hidden] { display: none; }
.card.pop { animation: pop .5s var(--ease) backwards; animation-delay: var(--d, 0s); }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.97); } }

.card-top { display: flex; align-items: center; gap: .8rem; margin-bottom: .8rem; }
.icon {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; flex: none;
  background: var(--grad); color: #fff; box-shadow: 0 8px 20px -8px rgba(124, 58, 237, .9);
  transition: transform .4s var(--ease);
}
.icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card:hover .icon { transform: rotate(-8deg) scale(1.1); }
.meta { font-size: .85rem; font-weight: 500; color: var(--soft); margin: 0; }

.tags, .chips { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; }
.tags { margin: .4rem 0 1rem; }
.tags li {
  font-size: .8rem; font-weight: 500; padding: .15rem .75rem; border-radius: 999px;
  background: rgba(139, 92, 246, .16); color: #cdbfff; border: 1px solid rgba(139, 92, 246, .3);
}
.links { display: flex; gap: 1.2rem; margin: 0; font-weight: 700; }
.links a { text-underline-offset: 4px; }
.links a:hover { color: var(--cyan); }

/* SKILLS */
.skills { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .skills { grid-template-columns: 1fr 1fr; } }
.chips li {
  padding: .35rem 1rem; border-radius: 999px; background: var(--glass);
  border: 1.5px solid var(--line); font-weight: 500;
  transition: transform .25s var(--ease), background .25s, border-color .25s;
}
.chips li:hover { transform: translateY(-3px) rotate(-2deg); background: var(--grad); border-color: transparent; color: #fff; }
.chips.soft li { background: rgba(59, 130, 246, .14); border-color: rgba(59, 130, 246, .35); }

/* CONTACT */
.contact-panel {
  text-align: center; padding: clamp(2rem, 7vw, 4rem) 1.5rem;
  border-radius: 32px; border: 2px solid transparent;
  background:
    radial-gradient(600px 240px at 50% 0%, rgba(139, 92, 246, .28), transparent 70%) padding-box,
    linear-gradient(var(--bg2), var(--bg2)) padding-box,
    conic-gradient(from var(--angle), #8b5cf6, #3b82f6, #38bdf8, #8b5cf6) border-box;
  animation: spin 6s linear infinite;
}
.contact-panel p { max-width: 30rem; margin-inline: auto; color: var(--soft); }
.contact-panel .buttons { justify-content: center; }

footer { padding: 2rem 0 2.5rem; text-align: center; color: var(--soft); font-size: .9rem; border-top: 1px solid var(--line); }

/* ---------- RESPECT "REDUCE MOTION" SETTINGS ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; translate: 0 0; }
  .progress, .caret, .cursor-glow { display: none; }
}