/* ============================================================================
   Shawaiz Ali — Portfolio
   Enhanced cinematic gradient system · pure HTML/CSS/JS · dark-first
   Structure preserved: no navbar, contact area, or footer.
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-head: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --container: 1120px;
  --radius: 18px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --bg: #050711;
  --surface: rgba(12, 18, 35, .84);
  --surface-solid: #0c1223;
  --surface-2: rgba(20, 29, 52, .76);
  --surface-3: #17223e;
  --ink: #f6f8ff;
  --text: #cbd4e7;
  --muted: #9caac4;
  --faint: #71809c;
  --border: rgba(138, 156, 194, .18);
  --border-soft: rgba(138, 156, 194, .1);
  --border-hover: rgba(96, 222, 255, .52);
  --cyan: #4de3ff;
  --blue: #5b8cff;
  --violet: #a66cff;
  --pink: #ff6fbd;
  --gold: #ffc86b;
  --accent: var(--cyan);
  --accent-hover: #a3f3ff;
  --accent-soft: rgba(77, 227, 255, .09);
  --accent-ring: rgba(77, 227, 255, .23);
  --gradient-spectrum: linear-gradient(110deg, var(--cyan), var(--blue) 28%, var(--violet) 56%, var(--pink) 78%, var(--gold));
  --gradient-cool: linear-gradient(125deg, var(--cyan), var(--blue) 48%, var(--violet));
  --gradient-surface: linear-gradient(145deg, rgba(22, 32, 58, .92), rgba(8, 13, 27, .92));
  --shadow: 0 18px 60px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .035);
  --shadow-hover: 0 26px 76px rgba(0, 0, 0, .44), 0 0 36px rgba(77, 227, 255, .08), inset 0 1px 0 rgba(255, 255, 255, .07);
  --shadow-glow: 0 12px 35px rgba(91, 140, 255, .28), 0 0 22px rgba(77, 227, 255, .14);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: clip; color-scheme: dark; }
body {
  min-width: 320px;
  overflow-x: hidden;
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.72;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 5%, rgba(77, 227, 255, .075), transparent 29rem),
    radial-gradient(circle at 92% 24%, rgba(166, 108, 255, .07), transparent 32rem),
    linear-gradient(160deg, #050711 0%, #080c18 48%, #050711 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: .2;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; transition: color .25s var(--ease); }
a:hover { color: var(--accent-hover); }
ul { list-style: none; }
::selection { color: var(--ink); background: rgba(166, 108, 255, .42); }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { border: 2px solid var(--bg); border-radius: 10px; background: linear-gradient(var(--cyan), var(--violet)); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; border-radius: 5px; }

.skip-link { position: absolute; top: 0; left: -9999px; z-index: 999; padding: 10px 18px; border-radius: 0 0 10px; color: #050711; background: var(--cyan); font-weight: 800; }
.skip-link:focus { left: 0; color: #050711; }

.bg-orbs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-orbs span { position: absolute; border-radius: 50%; filter: blur(110px); opacity: .56; will-change: transform; }
.bg-orbs span:nth-child(1) { width: 35rem; height: 35rem; top: -14rem; left: -12rem; background: rgba(77, 227, 255, .2); animation: driftOne 18s ease-in-out infinite alternate; }
.bg-orbs span:nth-child(2) { width: 32rem; height: 32rem; top: 25%; right: -16rem; background: rgba(166, 108, 255, .18); animation: driftTwo 23s ease-in-out infinite alternate; }
.bg-orbs span:nth-child(3) { width: 29rem; height: 29rem; bottom: -13rem; left: 30%; background: rgba(255, 111, 189, .13); animation: driftThree 20s ease-in-out infinite alternate; }
@keyframes driftOne { to { transform: translate(22vw, 15vh) scale(1.15); } }
@keyframes driftTwo { to { transform: translate(-18vw, 18vh) scale(.85); } }
@keyframes driftThree { to { transform: translate(14vw, -22vh) scale(1.12); } }
@keyframes spectrumShift { to { background-position: 200% center; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulseGlow { 50% { opacity: .62; filter: blur(15px); } }
@keyframes shine { to { transform: translateX(180%) skewX(-18deg); } }
@keyframes barFlow { to { background-position: 200% center; } }

.page { width: min(100%, var(--container)); margin: 0 auto; padding: 54px 28px 100px; }
.hero,
.paper,
.exp-list > li,
.skills-col,
.table-wrap,
.edu-card { isolation: isolate; }

.hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 58px;
  padding: 42px 46px;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) + 6px);
  background: linear-gradient(var(--surface-solid), var(--surface-solid)) padding-box, var(--gradient-spectrum) border-box;
  background-size: 100% 100%, 240% 240%;
  box-shadow: var(--shadow), 0 0 70px rgba(91, 140, 255, .08);
  animation: heroBorder 9s linear infinite;
}
@keyframes heroBorder { 50% { background-position: 0 0, 100% 50%; } }
.hero::before {
  content: '';
  position: absolute;
  width: 23rem;
  aspect-ratio: 1;
  right: -7rem;
  top: -12rem;
  z-index: -1;
  border-radius: 50%;
  background: conic-gradient(from 90deg, rgba(77,227,255,.18), rgba(166,108,255,.22), rgba(255,111,189,.14), rgba(77,227,255,.18));
  filter: blur(44px);
  animation: spin 19s linear infinite;
}
.hero::after { content: ''; position: absolute; inset: 0; z-index: -1; opacity: .35; background: radial-gradient(circle at var(--mx, 72%) var(--my, 18%), rgba(77,227,255,.16), transparent 34%); transition: opacity .3s; }
.hero__inner { display: flex; align-items: center; gap: 38px; }
.hero__avatar { position: relative; flex: 0 0 auto; }
.hero__avatar img { position: relative; z-index: 2; width: 164px; height: 164px; object-fit: cover; object-position: center 18%; border: 4px solid var(--surface-solid); border-radius: 50%; box-shadow: 0 0 0 1px var(--accent-ring), 0 18px 50px rgba(0,0,0,.5); }
.hero__ring { position: absolute; inset: -12px; z-index: 1; border-radius: 50%; background: conic-gradient(from 0deg, var(--cyan), var(--blue), var(--violet), var(--pink), var(--gold), var(--cyan)); animation: spin 7s linear infinite, pulseGlow 3s ease-in-out infinite; }
.hero__ring::after { content: ''; position: absolute; inset: 5px; border-radius: inherit; background: var(--surface-solid); }
.hero__meta { min-width: 0; }
.hero__meta h1 { margin-bottom: 4px; color: var(--ink); font-family: var(--font-head); font-size: clamp(2.15rem, 5vw, 3.4rem); font-weight: 800; letter-spacing: 0; line-height: 1.02; }
.hero__role { width: fit-content; margin-bottom: 15px; font-family: var(--font-head); font-size: clamp(1rem, 2.3vw, 1.18rem); font-weight: 700; background: var(--gradient-spectrum); background-size: 200% auto; background-clip: text; -webkit-background-clip: text; color: transparent; -webkit-text-fill-color: transparent; animation: spectrumShift 6s linear infinite; }
.hero__bio { max-width: 65ch; margin-bottom: 18px; color: var(--muted); font-size: 14.5px; }
.hero__facts { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 18px; }
.hero__facts li { color: var(--text); font-size: 13.5px; font-weight: 600; }
.hero__socials { display: flex; flex-wrap: wrap; gap: 10px; }
.hero__socials a { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--border); border-radius: 11px; color: var(--muted); background: rgba(18, 28, 51, .72); box-shadow: inset 0 1px rgba(255,255,255,.04); transition: transform .3s var(--ease), color .3s, border-color .3s, box-shadow .3s; }
.hero__socials a:hover { transform: translateY(-4px); color: var(--ink); border-color: var(--accent); box-shadow: var(--shadow-glow); }
.hero__socials svg { width: 18px; height: 18px; }

.block { position: relative; margin-bottom: 64px; }
.block > p { margin-bottom: 15px; font-size: 15.5px; }
.block strong { color: var(--ink); }
.block h2 { position: relative; margin-bottom: 28px; padding-bottom: 14px; color: var(--ink); border-bottom: 1px solid var(--border); font-family: var(--font-head); font-size: clamp(1.48rem, 3vw, 2rem); font-weight: 800; letter-spacing: 0; }
.block h2::before { content: ''; position: absolute; left: 0; bottom: -1px; width: 108px; height: 3px; border-radius: 3px; background: var(--gradient-spectrum); background-size: 200% auto; animation: spectrumShift 5s linear infinite; box-shadow: 0 0 18px rgba(77,227,255,.34); }
.block h2::after { content: ''; position: absolute; left: 102px; bottom: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 15px var(--cyan); }

.timeline { position: relative; margin-left: 8px; padding-left: 31px; border-left: 1px solid transparent; border-image: linear-gradient(to bottom, var(--cyan), var(--violet), transparent) 1; }
.timeline li { position: relative; padding: 0 0 24px 5px; font-size: 15px; transition: transform .25s var(--ease), color .25s; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:hover { transform: translateX(5px); color: var(--ink); }
.timeline li::before { content: ''; position: absolute; top: 7px; left: -39px; width: 13px; height: 13px; border: 3px solid var(--surface-solid); border-radius: 50%; background: var(--gradient-spectrum); background-size: 200% auto; box-shadow: 0 0 0 3px rgba(77,227,255,.12), 0 0 18px rgba(77,227,255,.35); animation: spectrumShift 4s linear infinite; }
.timeline em, .yr { display: inline-block; margin-right: 8px; padding: 2px 10px; border: 1px solid var(--accent-ring); border-radius: 999px; color: var(--cyan); background: var(--accent-soft); font-family: var(--font-mono); font-size: 11.5px; font-style: normal; font-weight: 600; white-space: nowrap; }

.paper { --mx: 50%; --my: 50%; position: relative; display: grid; grid-template-columns: 355px 1fr; overflow: hidden; margin-bottom: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--gradient-surface); box-shadow: var(--shadow); transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .4s; }
.paper::before, .exp-list > li::after, .skills-col::after, .edu-card::after { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0; background: radial-gradient(520px circle at var(--mx, 50%) var(--my, 50%), rgba(77,227,255,.13), transparent 42%); transition: opacity .4s; }
.paper:hover, .paper:focus-within { transform: translateY(-7px); border-color: var(--border-hover); box-shadow: var(--shadow-hover); }
.paper:hover::before, .paper:focus-within::before, .exp-list > li:hover::after, .skills-col:hover::after, .edu-card:hover::after { opacity: 1; }
.paper--wide { grid-template-columns: 1.05fr .95fr; }
.paper__media { position: relative; min-height: 215px; overflow: hidden; background: var(--surface-3); }
.paper__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(.88) contrast(1.04); transition: transform .7s var(--ease), filter .5s; }
.paper:hover .paper__media img { transform: scale(1.055); filter: saturate(1.08) contrast(1.06); }
.paper__media::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, transparent 55%, rgba(9,14,29,.72)), linear-gradient(0deg, rgba(5,7,17,.25), transparent 50%); }
.paper__media::before { content: ''; position: absolute; top: 0; left: -70%; z-index: 2; width: 35%; height: 100%; pointer-events: none; background: linear-gradient(90deg, transparent, rgba(255,255,255,.15), transparent); transform: skewX(-18deg); }
.paper:hover .paper__media::before { animation: shine 1.15s var(--ease); }
.badge { position: absolute; z-index: 3; top: 14px; left: 14px; padding: 5px 12px; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; color: var(--ink); background: rgba(5,7,17,.72); backdrop-filter: blur(12px); box-shadow: 0 6px 20px rgba(0,0,0,.25); font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.paper__body { align-self: center; padding: 25px 29px; }
.paper__body h3 { margin-bottom: 9px; color: var(--ink); font-family: var(--font-head); font-size: 18px; font-weight: 700; line-height: 1.35; }
.paper__body p { margin-bottom: 15px; color: var(--muted); font-size: 14px; }
.research__authors, .research__venue { margin-bottom: 6px !important; font-size: 13px !important; }
.research__venue { color: var(--faint) !important; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 17px; }
.tags span { padding: 3px 10px; border: 1px solid var(--accent-ring); border-radius: 999px; color: #9defff; background: linear-gradient(120deg, rgba(77,227,255,.095), rgba(166,108,255,.075)); font-size: 11.5px; font-weight: 600; transition: transform .25s var(--ease), border-color .25s, background .25s; }
.paper:hover .tags span, .skills-col:hover .tags span { border-color: rgba(77,227,255,.38); }
.tags span:hover { transform: translateY(-2px); background: rgba(77,227,255,.15); }
.links { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 0 !important; }
.links a { display: inline-flex; align-items: center; min-height: 38px; padding: 7px 15px; border: 1px solid rgba(77,227,255,.55); border-radius: 9px; color: var(--cyan); background: rgba(77,227,255,.035); font-size: 12.5px; transition: transform .25s var(--ease), color .25s, box-shadow .25s, background .25s; }
.links a strong { color: inherit; }
.links a:hover { transform: translateY(-3px); color: var(--ink); background: var(--gradient-cool); box-shadow: var(--shadow-glow); }
.links-note { color: var(--faint); font-size: 12.5px; font-style: italic; }

.exp-list { display: grid; gap: 18px; }
.exp-list > li { --mx: 50%; --my: 50%; position: relative; overflow: hidden; padding: 23px 27px 23px 31px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--gradient-surface); box-shadow: var(--shadow); transition: transform .35s var(--ease), border-color .35s, box-shadow .35s; }
.exp-list > li:hover { transform: translateY(-5px); border-color: rgba(166,108,255,.42); box-shadow: var(--shadow-hover); }
.exp-list > li::before { content: ''; position: absolute; top: 16px; bottom: 16px; left: 0; width: 4px; border-radius: 0 5px 5px 0; background: var(--gradient-spectrum); background-size: auto 200%; animation: barFlow 5s linear infinite; }
.exp-list strong { color: var(--ink); font-family: var(--font-head); font-size: 16px; font-weight: 700; }
.exp-list em { display: inline-block; margin-left: 8px; padding: 2px 10px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); background: var(--surface-2); font-family: var(--font-mono); font-size: 11.5px; font-style: normal; font-weight: 600; white-space: nowrap; }
.exp-org { display: inline-block; margin: 6px 0 10px; color: var(--cyan); font-size: 13.5px; font-weight: 600; }
.exp-list ul { display: grid; gap: 6px; }
.exp-list ul li { position: relative; padding-left: 21px; color: var(--text); font-size: 14px; }
.exp-list ul li::before { content: '▹'; position: absolute; left: 0; color: var(--cyan); font-weight: 800; }

.skills-3col { display: grid; grid-template-columns: 1.06fr 1fr 1fr; gap: 22px; align-items: start; }
.skills-col { --mx: 50%; --my: 50%; position: relative; overflow: hidden; padding: 25px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--gradient-surface); box-shadow: var(--shadow); transition: transform .35s var(--ease), border-color .35s, box-shadow .35s; }
.skills-col:hover { transform: translateY(-5px); border-color: rgba(77,227,255,.35); box-shadow: var(--shadow-hover); }
.col-title { margin-bottom: 19px; padding-bottom: 13px; border-bottom: 1px solid var(--border); color: var(--cyan); font-family: var(--font-head); font-size: 13.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.stack-group { margin-bottom: 18px; }
.stack-group:last-child { margin-bottom: 0; }
.stack-group h4 { margin-bottom: 8px; color: var(--ink); font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.stack-group .tags { margin-bottom: 0; }
.stack-group .tags span { padding: 3px 8px; font-size: 10.5px; }
.bars { display: grid; gap: 15px; }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; }
.bar-label { color: var(--ink); font-size: 12px; font-weight: 600; line-height: 1.35; }
.bar-pct { color: var(--cyan); font-family: var(--font-mono); font-size: 11px; font-weight: 600; }
.bar { grid-column: 1 / -1; height: 8px; overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: rgba(5,7,17,.7); }
.bar-fill { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--gradient-spectrum); background-size: 200% auto; box-shadow: 0 0 14px rgba(77,227,255,.55); transition: width 1.25s var(--ease); animation: spectrumShift 4s linear infinite; }
.soft-list { display: grid; gap: 9px; }
.soft-list li { position: relative; padding-left: 23px; color: var(--text); font-size: 13px; line-height: 1.52; }
.soft-list li::before { content: '✦'; position: absolute; left: 0; color: var(--pink); font-size: 11px; filter: drop-shadow(0 0 6px rgba(255,111,189,.6)); }

.table-wrap { overflow: hidden; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--gradient-surface); box-shadow: var(--shadow); }
.certs-table { width: 100%; min-width: 680px; border-collapse: collapse; }
.certs-table th { padding: 15px 18px; border-bottom: 1px solid var(--border); color: var(--cyan); background: rgba(20,29,52,.86); font-family: var(--font-head); font-size: 11px; font-weight: 800; letter-spacing: .07em; text-align: left; text-transform: uppercase; }
.certs-table td { padding: 16px 18px; border-bottom: 1px solid var(--border-soft); color: var(--text); font-size: 13px; line-height: 1.55; vertical-align: top; }
.certs-table tbody tr { transition: background .25s, transform .25s; }
.certs-table tbody tr:last-child td { border-bottom: 0; }
.certs-table tbody tr:hover { background: linear-gradient(90deg, rgba(77,227,255,.06), rgba(166,108,255,.045)); }
.certs-table td:first-child { color: var(--faint); font-family: var(--font-mono); font-size: 12px; }
.certs-table strong { color: var(--ink); }
.verify { color: var(--cyan); font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.verify:hover { text-decoration: underline; text-underline-offset: 4px; }

.edu-card { --mx: 50%; --my: 50%; position: relative; overflow: hidden; padding: 28px 31px; border: 1px solid transparent; border-radius: var(--radius); background: linear-gradient(var(--surface-solid), var(--surface-solid)) padding-box, var(--gradient-spectrum) border-box; background-size: 100%, 200% auto; box-shadow: var(--shadow); transition: transform .35s var(--ease), box-shadow .35s; animation: heroBorder 10s linear infinite; }
.edu-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.edu-card::before { content: ''; position: absolute; top: 0; right: 0; left: 0; height: 3px; background: var(--gradient-spectrum); background-size: 200% auto; animation: spectrumShift 5s linear infinite; }
.edu-card p { margin-bottom: 12px; font-size: 14.5px; }
.edu-card p:last-child { margin-bottom: 0; }
.edu-card strong { color: var(--ink); }
.edu-card .courses { color: var(--muted); font-size: 13.5px; }

.reveal { opacity: 0; transform: translateY(24px) scale(.99); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 1024px) {
  .paper, .paper--wide { grid-template-columns: 310px 1fr; }
}
@media (max-width: 900px) {
  .skills-3col { grid-template-columns: 1fr 1fr; }
  .skills-col:last-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .page { padding: 30px 16px 64px; }
  .hero { padding: 30px 23px; margin-bottom: 48px; }
  .hero__inner { flex-direction: column; gap: 23px; text-align: center; }
  .hero__role { margin-inline: auto; }
  .hero__bio { margin-inline: auto; }
  .hero__facts, .hero__socials { justify-content: center; }
  .hero__avatar img { width: 142px; height: 142px; }
  .paper, .paper--wide { grid-template-columns: 1fr; }
  .paper__media { min-height: 230px; aspect-ratio: 16 / 9; }
  .paper__media img { position: absolute; }
  .paper__media::after { background: linear-gradient(0deg, rgba(9,14,29,.7), transparent 48%); }
  .exp-list > li { padding: 20px 19px 20px 25px; }
  .exp-list em { margin-top: 6px; margin-left: 0; }
}
@media (max-width: 640px) {
  .skills-3col { grid-template-columns: 1fr; }
  .skills-col:last-child { grid-column: auto; }
  .block { margin-bottom: 50px; }
  .block h2 { margin-bottom: 22px; }
  .timeline { padding-left: 24px; }
  .timeline li::before { left: -32px; }
  .paper__body { padding: 21px 19px 23px; }
  .paper__media { min-height: 190px; }
  .edu-card { padding: 23px 20px; }
}
@media (max-width: 380px) {
  .page { padding-inline: 12px; }
  .hero { padding: 25px 16px; }
  .hero__avatar img { width: 122px; height: 122px; }
  .hero__socials a { width: 39px; height: 39px; }
  .timeline em { display: table; margin-bottom: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
