/* ============================================================
   Anas Naveed — Portfolio
   Static portfolio system:
   dark / gray neutrals · violet brand · soft purple accent
   serif display (Newsreader) + Inter body + JetBrains Mono labels
   ============================================================ */

:root {
  /* surfaces */
  --bg: #0a0a0a;
  --bg-2: #0d0d0d;
  --surface: #141414;
  --surface-2: #1a1a1a;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);

  /* text */
  --text: #ededed;
  --text-2: #b2b2b2;
  --text-3: #8a8a8a;
  --text-4: #5e5e5e;

  /* brand: violet */
  --brand: #8b5cf6;
  --brand-bright: #a78bfa;
  --brand-soft: #c4b5fd;
  --brand-deep: #5b3ab7;
  --brand-10: rgba(139, 92, 246, 0.12);
  --brand-20: rgba(139, 92, 246, 0.26);

  /* accent: soft purple */
  --accent: #7c3aed;
  --accent-bright: #c084fc;

  --maxw: 1180px;
  --pad: clamp(20px, 5vw, 64px);

  --font-display: "Newsreader", "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--brand-20); color: #fff; }

a { color: inherit; text-decoration: none; }

/* ---------- background effects ---------- */
.bg-fx { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* ambient violet glow, drifting */
.bg-glow {
  position: absolute;
  width: 70vw; height: 70vw;
  top: -22vw; left: -14vw;
  background: radial-gradient(circle at center, rgba(139, 92, 246, 0.22), rgba(139, 92, 246, 0.0) 62%);
  filter: blur(20px);
  opacity: 0.9;
  animation: drift 26s var(--ease) infinite alternate;
}
.bg-glow.accent {
  top: auto; left: auto; right: -22vw; bottom: -26vw;
  width: 60vw; height: 60vw;
  background: radial-gradient(circle at center, rgba(192, 132, 252, 0.13), rgba(192, 132, 252, 0) 62%);
  animation-duration: 32s;
  animation-direction: alternate-reverse;
}
@keyframes drift {
  from { transform: translate(0, 0); }
  to   { transform: translate(8vw, 6vw); }
}

/* faint ambient dot grid everywhere */
.bg-dots-base {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 1.4px);
  background-size: 26px 26px;
}
/* brighter dots that follow the cursor */
.bg-dots-cursor {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(167,139,250,0.5) 1px, transparent 1.6px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(280px circle at var(--mx, -999px) var(--my, -999px), #000 0%, transparent 72%);
  mask-image: radial-gradient(280px circle at var(--mx, -999px) var(--my, -999px), #000 0%, transparent 72%);
  transition: opacity 0.4s ease;
}

/* vignette for depth */
.bg-vignette {
  position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 50% 0%, transparent 55%, rgba(0,0,0,0.55) 100%);
}

/* ---------- layout primitives ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad); }
main { position: relative; z-index: 1; }
section { position: relative; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand-bright);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--brand);
}
.eyebrow.plain::before { display: none; }

.serif { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.01em; }
.em { color: var(--brand-bright); }
.em-i { font-style: italic; color: var(--text); }

/* ---------- header ---------- */
header.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  transition: background 0.35s ease, border-color 0.35s ease, backdrop-filter 0.35s ease;
  border-bottom: 1px solid transparent;
}
header.nav.scrolled {
  background: rgba(10, 10, 10, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--border);
}
.nav-inner {
  height: 72px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
}
.brand-mark {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}
.brand-mark::before {
  content: "";
  width: 18px; height: 1px;
  background: var(--brand-bright);
  box-shadow: 0 0 18px var(--brand-20);
}
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.02em;
  color: var(--text-3); padding: 8px 14px; border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
}
.nav-links a:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-links a.active { color: var(--brand-bright); }
.nav-right { display: flex; align-items: center; gap: 16px; }

.avail {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 12px; color: var(--text-2);
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: rgba(255,255,255,0.02);
}
.dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--brand-bright);
  box-shadow: 0 0 0 0 rgba(167,139,250,0.5);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(167,139,250,0.5); }
  70% { box-shadow: 0 0 0 8px rgba(167,139,250,0); }
  100% { box-shadow: 0 0 0 0 rgba(167,139,250,0); }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.02em;
  padding: 13px 22px; border-radius: 10px;
  border: 1px solid var(--border-strong);
  color: var(--text); background: transparent;
  cursor: pointer; transition: all 0.25s var(--ease);
  white-space: nowrap;
}
.btn:hover { border-color: var(--brand); color: #fff; transform: translateY(-2px); }
.btn .arrow { transition: transform 0.25s var(--ease); }
.btn:hover .arrow { transform: translate(3px, -3px); }
.btn.solid {
  background: var(--brand); border-color: var(--brand); color: #0f0b18; font-weight: 600;
}
.btn.solid:hover {
  background: var(--brand-bright); border-color: var(--brand-bright);
  box-shadow: 0 14px 34px -12px var(--brand-20);
}

/* ---------- hero ---------- */
.hero { padding-top: 168px; padding-bottom: 100px; }
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 40px; }
.hero h1 {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2.7rem, 7vw, 6rem);
  line-height: 0.98; letter-spacing: -0.025em;
  margin-top: 26px; text-wrap: balance;
  max-width: 16ch;
}
.hero .subline {
  margin-top: 30px; max-width: 56ch;
  font-size: clamp(1.05rem, 1.5vw, 1.3rem); line-height: 1.6; color: var(--text-2);
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 38px; }
.hero-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 22px 34px;
  margin-top: 52px; padding-top: 30px; border-top: 1px solid var(--border);
}
.meta-item { display: flex; flex-direction: column; gap: 4px; }
.meta-item .k { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-4); }
.meta-item .v { font-size: 14.5px; color: var(--text-2); }
.socials { display: flex; gap: 8px; margin-left: auto; }
.icon-link {
  width: 42px; height: 42px; border-radius: 10px;
  display: grid; place-items: center;
  border: 1px solid var(--border); color: var(--text-3);
  transition: all 0.22s var(--ease);
}
.icon-link:hover { color: var(--brand-bright); border-color: var(--brand); transform: translateY(-2px); background: var(--brand-10); }
.icon-link svg { width: 18px; height: 18px; }

/* ---------- marquee ---------- */
.marquee {
  border-block: 1px solid var(--border);
  background: rgba(255,255,255,0.012);
  overflow: hidden; padding: 18px 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: 0; width: max-content; animation: scroll-x 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.04em;
  color: var(--text-3); padding: 0 26px; display: inline-flex; align-items: center; gap: 26px;
}
.marquee-track span::after { content: "◆"; color: var(--brand); font-size: 7px; }
@keyframes scroll-x { to { transform: translateX(-50%); } }

/* ---------- section heading ---------- */
.sec { padding-block: clamp(80px, 11vw, 140px); scroll-margin-top: 90px; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 56px; flex-wrap: wrap; }
.sec-head h2 {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2rem, 4.5vw, 3.4rem); line-height: 1.02; letter-spacing: -0.02em; margin-top: 18px;
  text-wrap: balance;
}
.sec-head .count { font-family: var(--font-mono); font-size: 12px; color: var(--text-4); letter-spacing: 0.1em; }

/* ---------- work ---------- */
.work-list { display: flex; flex-direction: column; }
.project {
  display: grid; grid-template-columns: 64px 1fr minmax(280px, 0.85fr);
  gap: 36px; align-items: center;
  padding: 40px 0; border-top: 1px solid var(--border);
  transition: padding 0.4s var(--ease);
}
.project:last-child { border-bottom: 1px solid var(--border); }
.project .idx { font-family: var(--font-mono); font-size: 13px; color: var(--text-4); padding-top: 4px; }
.project .pbody { min-width: 0; }
.project .ptitle {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(1.7rem, 3vw, 2.5rem); line-height: 1.04; letter-spacing: -0.02em;
  transition: color 0.3s ease;
}
.project .ptag {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent-bright); margin-bottom: 4px; display: block;
}
.project .pdesc { color: var(--text-2); margin-top: 16px; max-width: 52ch; font-size: 16px; }
.stack-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.tag {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3);
  padding: 5px 11px; border-radius: 7px; border: 1px solid var(--border);
  transition: all 0.2s ease;
}
.project:hover .ptitle { color: var(--brand-bright); }
.project:hover .tag { border-color: var(--border-strong); }

/* project visual */
.pvisual {
  aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; position: relative;
  border: 1px solid var(--border); background: var(--surface);
  transition: transform 0.45s var(--ease), border-color 0.3s ease;
}
.project:hover .pvisual { transform: translateY(-6px); border-color: var(--brand-20); }
.pvisual > img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  filter: saturate(0.9) contrast(1.02);
  transition: transform 0.7s var(--ease), filter 0.4s ease;
}
.project:hover .pvisual > img { transform: scale(1.03); filter: saturate(1) contrast(1.04); }
.pvisual::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.46));
  pointer-events: none;
}
.pvisual .pv-glow { position: absolute; inset: 0; opacity: 0.9; }
.pv-mesh {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.06) 1px, transparent 1.4px);
  background-size: 20px 20px;
}
.pv-meta {
  position: absolute; left: 16px; bottom: 14px; right: 16px;
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-mono); font-size: 11px; color: var(--text-2);
  z-index: 2;
}
.pv-chip {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text); padding: 5px 9px; border-radius: 6px;
  background: rgba(0,0,0,0.35); border: 1px solid var(--border); backdrop-filter: blur(4px);
}
.pv-figure {
  position: absolute; inset: 0; display: grid; place-items: center;
}
.pv-figure svg { width: 56%; height: 56%; opacity: 0.92; }

/* ---------- stack ---------- */
.stack-section { background:
    linear-gradient(180deg, transparent, rgba(255,255,255,0.012) 12%, rgba(255,255,255,0.012) 88%, transparent);
}
.stack-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.stack-cell { background: var(--bg); padding: 32px clamp(20px,3vw,38px); transition: background 0.3s ease; }
.stack-cell:hover { background: var(--surface); }
.stack-cell .cat {
  display: flex; align-items: center; gap: 12px; margin-bottom: 22px;
}
.stack-cell .cat .n { font-family: var(--font-mono); font-size: 11px; color: var(--text-4); }
.stack-cell .cat h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; letter-spacing: -0.01em; white-space: nowrap; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.skill {
  font-family: var(--font-mono); font-size: 12.5px; color: var(--text-2);
  padding: 7px 13px; border-radius: 8px; border: 1px solid var(--border);
  background: rgba(255,255,255,0.014);
  transition: all 0.2s var(--ease);
}
.skill:hover { color: #fff; border-color: var(--brand); background: var(--brand-10); transform: translateY(-2px); }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(36px, 6vw, 80px); align-items: start; }
.portrait {
  position: relative; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--border); aspect-ratio: 1 / 1.08;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.02); transition: filter 0.6s ease, transform 0.8s var(--ease); }
.portrait:hover img { filter: grayscale(0.35) contrast(1.05); transform: scale(1.03); }
.portrait::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(160deg, transparent 55%, rgba(139,92,246,0.18));
  mix-blend-mode: screen;
}
.about-bio p { color: var(--text-2); font-size: clamp(1.05rem, 1.4vw, 1.2rem); line-height: 1.7; }
.about-bio p + p { margin-top: 22px; }
.about-lead { color: var(--text) !important; font-family: var(--font-display); font-size: clamp(1.4rem,2.2vw,1.9rem) !important; line-height: 1.4 !important; letter-spacing: -0.01em; }

.timeline { margin-top: 48px; }
.tl-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-4); margin-bottom: 18px; }
.tl-item { display: grid; grid-template-columns: 130px 1fr; gap: 22px; padding: 22px 0; border-top: 1px solid var(--border); }
.tl-item:last-child { border-bottom: 1px solid var(--border); }
.tl-when { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-3); padding-top: 3px; }
.tl-role { font-size: 17px; color: var(--text); font-weight: 500; }
.tl-co { color: var(--brand-bright); }
.tl-desc { color: var(--text-3); font-size: 14.5px; margin-top: 7px; }

/* ---------- contact ---------- */
.contact { padding-block: clamp(90px, 14vw, 170px); text-align: center; }
.contact .eyebrow { justify-content: center; }
.contact h2 {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2.4rem, 6vw, 5rem); line-height: 1.0; letter-spacing: -0.025em;
  margin: 24px auto 0; max-width: 16ch; text-wrap: balance;
}
.contact .lead { color: var(--text-2); max-width: 48ch; margin: 28px auto 0; font-size: 1.1rem; }
.contact-cta { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin-top: 42px; }

/* ---------- footer ---------- */
footer.foot { border-top: 1px solid var(--border); padding-block: 36px; }
.foot-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; }
.foot-meta { font-family: var(--font-mono); font-size: 12px; color: var(--text-4); display: flex; gap: 22px; flex-wrap: wrap; }
.foot-meta .lit { color: var(--text-3); }

/* ---------- reveal ---------- */
[data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }
[data-reveal][data-d="1"] { transition-delay: 0.08s; }
[data-reveal][data-d="2"] { transition-delay: 0.16s; }
[data-reveal][data-d="3"] { transition-delay: 0.24s; }
[data-reveal][data-d="4"] { transition-delay: 0.32s; }
[data-reveal][data-d="5"] { transition-delay: 0.40s; }

/* ---------- responsive ---------- */
@media (max-width: 880px) {
  .nav-links { display: none; }
  .about-grid { grid-template-columns: 1fr; }
  .portrait { max-width: 340px; }
  .stack-grid { grid-template-columns: 1fr; }
  .project { grid-template-columns: 40px 1fr; gap: 20px; }
  .pvisual { grid-column: 1 / -1; margin-top: 8px; max-width: 460px; }
  .socials { margin-left: 0; width: 100%; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .avail { display: none; }
  .tl-item { grid-template-columns: 1fr; gap: 6px; }
  .hero-meta { gap: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
