/* ============================================================
   Taha Iqbal — portfolio
   Plain CSS. Deep-indigo theme, no build step.
   ============================================================ */

:root {
  --bg:        #0f0e33;
  --bg-2:      #16154a;
  --panel:     rgba(255, 255, 255, 0.04);
  --panel-2:   rgba(255, 255, 255, 0.07);
  --line:      rgba(255, 255, 255, 0.12);
  --text:      #ececf6;
  --muted:     #a6a6cc;
  --accent:    #f5b83d;   /* amber */
  --accent-2:  #8ab4ff;   /* soft blue */
  --cream:     #f1e7d0;
  --max:       1000px;
  --pad:       clamp(1.25rem, 5vw, 3rem);
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  background: var(--bg);
  background-image:
    radial-gradient(60rem 40rem at 15% -10%, #211f6b 0%, transparent 60%),
    radial-gradient(50rem 40rem at 100% 0%, #2a1c56 0%, transparent 55%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--pad); }
.mono { font-family: var(--font-mono); }
a { color: inherit; text-decoration: none; }
code {
  font-family: var(--font-mono); font-size: 0.88em;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 4px; padding: 0.05em 0.35em; color: var(--cream);
}

.skip {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--accent); color: #1a1400; padding: 0.6rem 1rem; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 4rem; }
.nav__brand {
  font-family: var(--font-mono); font-weight: 700; font-size: 1.05rem;
  color: var(--accent); letter-spacing: 0.05em;
  border: 1px solid var(--line); border-radius: 8px; padding: 0.2rem 0.55rem;
}
.nav__links { display: flex; align-items: center; gap: 1.6rem; }
.nav__links a { color: var(--muted); font-size: 0.9rem; transition: color 0.15s; }
.nav__links a:hover { color: var(--text); }
.nav__cta {
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0.4rem 0.95rem !important; color: var(--text) !important;
  transition: border-color 0.15s, color 0.15s;
}
.nav__cta:hover { border-color: var(--accent); color: var(--accent) !important; }
.nav__toggle { display: none; background: none; border: 0; cursor: pointer; flex-direction: column; gap: 5px; padding: 0.5rem; }
.nav__toggle span { width: 22px; height: 2px; background: var(--text); display: block; transition: 0.2s; }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: calc(100vh - 4rem);
  display: flex; flex-direction: column; justify-content: center;
  padding-block: 4rem 6rem; overflow: hidden;
}
.hero__bg { position: absolute; inset: 0; pointer-events: none; }
.hero__bg span {
  position: absolute; font-family: var(--font-mono); font-size: clamp(1rem, 2vw, 1.6rem);
  color: var(--accent-2); opacity: 0.12; animation: float 14s ease-in-out infinite;
}
.hero__bg span:nth-child(1){ top: 12%; left: 8%;  animation-delay: -1s; }
.hero__bg span:nth-child(2){ top: 26%; left: 78%; animation-delay: -3s; }
.hero__bg span:nth-child(3){ top: 68%; left: 12%; animation-delay: -5s; }
.hero__bg span:nth-child(4){ top: 82%; left: 62%; animation-delay: -7s; }
.hero__bg span:nth-child(5){ top: 40%; left: 90%; animation-delay: -2s; }
.hero__bg span:nth-child(6){ top: 8%;  left: 52%; animation-delay: -9s; }
.hero__bg span:nth-child(7){ top: 58%; left: 84%; animation-delay: -4s; }
.hero__bg span:nth-child(8){ top: 90%; left: 30%; animation-delay: -6s; }
.hero__bg span:nth-child(9){ top: 18%; left: 34%; animation-delay: -8s; }
.hero__bg span:nth-child(10){ top: 48%; left: 4%; animation-delay: -10s; }
.hero__bg span:nth-child(11){ top: 74%; left: 46%; animation-delay: -11s; }
.hero__bg span:nth-child(12){ top: 34%; left: 20%; animation-delay: -12s; }
@keyframes float { 0%,100%{ transform: translateY(0); } 50%{ transform: translateY(-14px); } }

.hero__inner {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  gap: clamp(2rem, 6vw, 5rem); flex-wrap: wrap;
}
.hero__kicker { color: var(--accent); font-size: 0.82rem; letter-spacing: 0.04em; margin-bottom: 1rem; }
.hero__name {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(3.5rem, 13vw, 7rem); line-height: 0.92; letter-spacing: 0.01em;
  color: var(--cream);
  text-shadow:
    1px 1px 0 #c9b98f, 2px 2px 0 #b6a678, 3px 3px 0 #9c8c60,
    4px 4px 0 #7d6f4b, 5px 5px 0 #5c5138, 6px 7px 14px rgba(0,0,0,0.45);
}
.hero__role {
  margin-top: 1.4rem; font-family: var(--font-mono); font-size: clamp(0.95rem, 2.4vw, 1.2rem);
  color: var(--text); display: flex; align-items: baseline; gap: 0.5rem; min-height: 1.6em;
}
.hero__role .mono { color: var(--accent); }
.caret { color: var(--accent); animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero__links { display: flex; align-items: center; gap: 0.75rem; margin-top: 1.8rem; flex-wrap: wrap; }
.hero__links a {
  width: 42px; height: 42px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 10px; color: var(--text);
  transition: transform 0.15s, border-color 0.15s, color 0.15s;
}
.hero__links a:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--accent); }
.hero__links .hero__resume {
  width: auto; height: 42px; padding-inline: 1rem; font-size: 0.82rem; color: var(--accent);
}

.hero__photo {
  position: relative; flex-shrink: 0;
  width: clamp(200px, 34vw, 300px); aspect-ratio: 1;
  border-radius: 50%; overflow: hidden;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 10px rgba(245, 184, 61, 0.08), 0 20px 50px rgba(0,0,0,0.4);
}
.hero__photo img { position: absolute; width: 200%; max-width: none; height: auto; left: -62%; top: -14%; display: block; }
.hero__initials {
  position: absolute; inset: 0; display: none; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 4rem; color: var(--cream);
  background: linear-gradient(135deg, #22205f, #2e2270);
}
.hero__photo--empty .hero__initials { display: grid; }

.hero__scroll {
  position: absolute; left: 50%; bottom: 1.6rem; transform: translateX(-50%);
  color: var(--muted); font-size: 1.3rem; animation: bob 2s ease-in-out infinite;
}
@keyframes bob { 0%,100%{ transform: translate(-50%, 0);} 50%{ transform: translate(-50%, 8px);} }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; border-radius: 8px; font-size: 0.9rem; font-weight: 500;
  padding: 0.7rem 1.3rem; border: 1px solid transparent; transition: 0.15s;
}
.btn--primary { background: var(--accent); color: #1a1400; font-family: var(--font-mono); }
.btn--primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn--ghost { border-color: var(--line); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- sections ---------- */
.section { padding-block: clamp(3.5rem, 9vw, 6rem); border-top: 1px solid var(--line); }
.section__title {
  font-family: var(--font-display); font-size: 1.55rem; font-weight: 600;
  margin-bottom: 2.25rem; display: flex; align-items: baseline; gap: 0.75rem;
}
.section__title .mono { color: var(--accent); font-size: 0.9rem; }

.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: 1.7fr 1fr; gap: 2.5rem; }
.about__body { color: var(--muted); }
.about__body p + p { margin-top: 1rem; }
.about__body strong { color: var(--text); font-weight: 600; }
.about__facts { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1.5rem; align-self: start; }
.about__facts h3 { color: var(--accent); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 1rem; }
.about__facts ul { list-style: none; display: flex; flex-direction: column; gap: 0.7rem; }
.about__facts li { font-size: 0.9rem; display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px dashed var(--line); padding-bottom: 0.7rem; }
.about__facts li:last-child { border: 0; padding-bottom: 0; }
.about__facts span { color: var(--muted); font-family: var(--font-mono); font-size: 0.78rem; }

/* ---------- filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.75rem; }
.filter {
  background: var(--panel); border: 1px solid var(--line); color: var(--muted);
  font-family: var(--font-mono); font-size: 0.8rem; padding: 0.4rem 0.85rem;
  border-radius: 999px; cursor: pointer; transition: 0.15s;
}
.filter:hover { color: var(--text); }
.filter.is-active { background: var(--accent); border-color: var(--accent); color: #1a1400; }

/* ---------- projects ---------- */
.projects { list-style: none; display: flex; flex-direction: column; gap: 1.25rem; }
.project {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 1.6rem; transition: border-color 0.15s, transform 0.15s;
}
.project.hide { display: none; }
.project:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); transform: translateY(-2px); }
.project__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.75rem; }
.project__head h3 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; }
.project__tag { color: var(--accent-2); font-size: 0.74rem; }
.project__desc { color: var(--muted); margin-bottom: 0.9rem; }
.project__points { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; margin-bottom: 1rem; }
.project__points li { font-size: 0.9rem; padding-left: 1.2rem; position: relative; }
.project__points li::before { content: "—"; color: var(--accent); position: absolute; left: 0; }
.project__links { display: flex; gap: 1.25rem; font-size: 0.8rem; }
.project__links a { color: var(--accent); }
.project__links a:hover { text-decoration: underline; }

/* ---------- timeline ---------- */
.timeline { list-style: none; display: flex; flex-direction: column; gap: 2rem; }
.tl { display: grid; grid-template-columns: 150px 1fr; gap: 1.5rem; }
.tl__date { color: var(--muted); font-size: 0.8rem; }
.tl__body h3 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; margin-bottom: 0.3rem; }
.tl__org { color: var(--muted); font-weight: 400; }
.tl__stack { color: var(--accent-2); font-size: 0.75rem; margin-bottom: 0.6rem; }
.tl__body ul { list-style: none; display: flex; flex-direction: column; gap: 0.45rem; }
.tl__body li { font-size: 0.9rem; color: var(--muted); padding-left: 1.2rem; position: relative; }
.tl__body li::before { content: "▸"; color: var(--accent); position: absolute; left: 0; }
.tl__body strong, .tl__body code { color: var(--text); }

/* ---------- education ---------- */
.edu { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1.6rem; }
.edu__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem; margin-bottom: 1rem; }
.edu__head h3 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; }
.edu__head .mono { color: var(--muted); font-size: 0.78rem; }
.edu__course { color: var(--muted); font-size: 0.9rem; }
.edu__course strong { color: var(--text); }

/* ---------- skills ---------- */
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.25rem; }
.skills__group { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1.35rem; }
.skills__group h3 { color: var(--accent); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.9rem; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tags li { font-size: 0.8rem; background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: 0.25rem 0.55rem; }

/* ---------- contact ---------- */
.contact__lede { color: var(--muted); max-width: 46ch; margin-bottom: 1.5rem; }
.contact__links { display: flex; flex-wrap: wrap; gap: 0.9rem; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding-block: 2rem; }
.footer__inner { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--muted); }
.footer__inner a:hover { color: var(--accent); }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .hero__inner { flex-direction: column-reverse; align-items: flex-start; }
  .about { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav__toggle { display: flex; }
  .nav__links {
    position: absolute; top: 4rem; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    max-height: 0; overflow: hidden; transition: max-height 0.25s ease;
  }
  .nav__links.open { max-height: 26rem; }
  .nav__links a { padding: 0.9rem var(--pad); border-top: 1px solid var(--line); }
  .nav__cta { border-radius: 0 !important; }
  .tl { grid-template-columns: 1fr; gap: 0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* Consistent category and skill icons. */
.ui-icon { width: 1.15em; height: 1.15em; flex-shrink: 0; vertical-align: -0.18em; margin-right: .5em; }
.project__head h3 .ui-icon, .skills__group h3 .ui-icon { color: var(--accent); }
.filter { display: inline-flex; align-items: center; justify-content: center; }

/* Reference-inspired portfolio cards */
:root { --max: 1240px; }
.university-emblem { margin-top: 1.8rem; width: 154px; padding: 20px; background: #f5f5f3; border-radius: 22px; box-shadow: 0 4px 14px #0003; }
.university-emblem img { display: block; width: 100%; height: auto; }
.section__title { font-size: clamp(1.8rem, 4vw, 2.8rem); }
#projects { background: transparent; }
.filters { gap: 0; width: fit-content; border-radius: 7px; overflow: hidden; background: #203e9e; }
.filter { border: 0; border-radius: 0; background: transparent; color: #fff; padding: .8rem 1rem; font-size: .95rem; }
.filter .ui-icon { width: 1.6em; height: 1.6em; }
.filter.is-active { background: #6244c9; color: #fff; }
.projects { gap: 2.5rem; }
.project { display: grid; grid-template-columns: 1fr 1fr; padding: 0; border-radius: 8px; overflow: hidden; background: #202126; }
.project.hide { display: none; }
.project-copy { padding: clamp(1.4rem,3vw,2.4rem); display: flex; flex-direction: column; min-width: 0; }
.project__head h3 { font-size: 1.6rem; line-height: 1.25; }
.project__desc { color: #c5c8d6; }
.project__points { margin-block: .5rem 1.5rem; }
.project__links { margin-top: auto; margin-bottom: 1rem; }
.project__links a { background: var(--accent); color: #201800; padding: .5rem .8rem; border-radius: 6px; }
.project-badges { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; }
.project-badges li { background: #39305e; color: #f1eafb; font-size: .75rem; padding: .35rem .6rem; border-radius: 4px; }
.project-visual { background: #161c34; background-image: linear-gradient(#ffffff07 1px,transparent 1px),linear-gradient(90deg,#ffffff07 1px,transparent 1px); background-size: 24px 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.7rem; padding: 2.5rem 1.5rem; min-width: 0; }
.project-visual > p, .project-visual figcaption { color: #bac8e0; font-size: .72rem; text-align: center; letter-spacing: .04em; }
.flow-diagram { width: min(100%,260px); display: grid; gap: 24px; }
.flow-diagram div { position: relative; text-align: center; padding: .8rem; border: 1px solid #7fadd7; background: #24334e; border-radius: 5px; font-family: var(--font-mono); font-size: .85rem; }
.flow-diagram div:not(:last-child)::after { content: '↓'; position: absolute; top: 100%; left: 50%; color: var(--accent); height: 24px; }
.experience-timeline { list-style: none; border-left: 3px solid var(--accent); padding-left: clamp(1.5rem,5vw,4rem); display: grid; gap: 3rem; }
.experience-item { position: relative; }
.experience-item::before { content: ''; position: absolute; width: 20px; height: 20px; border: 3px solid #eee; background: #3c6e71; border-radius: 50%; left: calc(-1 * clamp(1.5rem,5vw,4rem) - 11px); top: 48%; }
.experience-card { position: relative; perspective: 1200px; }
.experience-inner { display: grid; transform-style: preserve-3d; transition: transform .65s ease; }
.experience-front, .experience-back { grid-area: 1 / 1; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 14px; padding: clamp(1.5rem,4vw,3rem); padding-bottom: 5rem; min-height: 380px; background: #202126; border: 1px solid #ffffff18; }
.experience-front { display: flex; flex-direction: column; justify-content: center; background: radial-gradient(ellipse at 100% 0%,#3d4273,transparent 65%),#202126; }
.experience-front h3 { font-family: var(--font-display); font-size: clamp(1.8rem,4vw,2.8rem); }
.experience-date { color: var(--accent); font-size: .8rem; margin-bottom: .8rem; }
.experience-role { font-size: 1.15rem; color: #dadbe6; }
.experience-mark { font-family: var(--font-mono); font-size: 2rem; color: #322950; background: #f0edf5; border-radius: 14px; width: 80px; height: 70px; display: grid; place-items: center; margin-block: 1.5rem; }
.experience-hint { color: #b6b9d2; font-size: .8rem; }
.experience-back { transform: rotateY(180deg); }
.experience-back h3 { font-size: 1.4rem; }
.experience-back li { color: #c5c8d6; }
.experience-card.is-flipped .experience-inner { transform: rotateY(180deg); }
.experience-toggle { position: absolute; bottom: 1.4rem; left: clamp(1.5rem,4vw,3rem); background: var(--accent); border: 0; padding: .55rem .9rem; border-radius: 6px; color: #201800; font: inherit; font-size: .85rem; cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 4px; }
@media (max-width: 760px) { .project { grid-template-columns: 1fr; } .project-visual { min-height: 360px; } .filter { font-size: .78rem; padding: .7rem; } .experience-front, .experience-back { min-height: 420px; } }
@media (prefers-reduced-motion: reduce) { .experience-inner { transition: none; } }
html:not(.js) .experience-inner { display: block; }
html:not(.js) .experience-back { transform: none; }
html:not(.js) .experience-toggle, html:not(.js) .experience-hint { display: none; }

/* Portrait, campus card, and skill tiles */
.hero__inner { width: 100%; display: grid; grid-template-columns: minmax(0,1.25fr) minmax(0,1fr); gap: clamp(2rem,5vw,4rem); }
.hero__text { min-width: 0; }
.hero__photo { width: min(100%,460px); justify-self: end; }
.hero__role { font-size: clamp(.85rem,1.5vw,1.1rem); }
.hero__links a { width: 52px; height: 52px; }
.hero__links a svg { width: 27px; height: 27px; }
.hero__links .hero__cv svg { width: 32px; height: 32px; }
.education-front { position: relative; overflow: hidden; padding: 0; min-height: 450px; }
.campus-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 40% center; }
.education-overlay { position: relative; z-index: 1; padding: clamp(1.5rem,4vw,3rem); padding-bottom: 5rem; width: 100%; height: 100%; background: linear-gradient(90deg,rgba(15,14,33,.9),rgba(15,14,33,.3)); }
.education-overlay h3 { font-size: clamp(1.6rem,3.2vw,2.4rem); line-height: 1.2; margin-bottom: .75rem; }
.education-overlay .mono { font-size: .8rem; margin-top: .6rem; }
.education-seal { display: block; width: 110px; height: 110px; padding: 12px; margin-top: 1.5rem; background: #f5f5f3; border-radius: 16px; }
.education-card .experience-back h4 { margin-block: 1.5rem .7rem; }
.skills { display: grid; grid-template-columns: 1fr; gap: 2rem; }
.skills__group { display: grid; grid-template-columns: 160px minmax(0,1fr); gap: 1.5rem; align-items: start; background: none; border: none; padding: 0; }
.skills__group h3 { margin-top: 1.5rem; font-size: .85rem; }
.skills__group .tags { display: grid; grid-template-columns: repeat(auto-fill,minmax(105px,1fr)); gap: 1rem; }
.skills__group .skill-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .65rem; min-height: 128px; padding: 1rem .5rem; background: #f2f1f5; color: #343063; border: 0; border-radius: 16px; box-shadow: 0 4px 8px #0003; text-align: center; transition: transform .2s,box-shadow .2s; }
.skill-tile span { font-size: .72rem; line-height: 1.35; font-weight: 600; }
.skill-tile img,.skill-tile svg { flex-shrink: 0; }
.skill-tile:hover { transform: translateY(-4px); box-shadow: 0 8px 18px #0004; }
@media (max-width: 820px) { .hero__inner { grid-template-columns: 1fr; } .hero__photo { grid-row: 1; justify-self: center; width: min(72vw,380px); } .hero__text { width: 100%; } .skills__group { grid-template-columns: 1fr; gap: .6rem; } .skills__group h3 { margin-top: 0; } }
@media (max-width: 420px) { .skills__group .tags { grid-template-columns: repeat(3,minmax(0,1fr)); gap: .65rem; } .skills__group .skill-tile { min-height: 118px; } }
