/* ============================================================
   Abdul Manan — portfolio  ·  clean minimal, mouse-interactive
   Light + dark theme · loader · GitHub blog · testimonials
   ============================================================ */

:root {
  --paper:    #faf8f5;
  --paper-2:  #f2efe9;
  --ink:      #16151a;
  --ink-soft: #4b4a52;
  --muted:    #8a8780;
  --line:     #e6e2db;
  --accent:   #ff5a3c;
  --accent-d: #e8492d;
  --card:     #ffffff;
  --radius:   18px;
  --ease:     cubic-bezier(.22,1,.36,1);
  --shadow:   0 20px 50px -30px rgba(22,21,26,.5);
}
:root[data-theme="dark"] {
  --paper:    #131219;
  --paper-2:  #1b1a23;
  --ink:      #f4f1ea;
  --ink-soft: #c3bfb5;
  --muted:    #837f77;
  --line:     #2a2933;
  --accent:   #ff6a4d;
  --card:     #1b1a23;
  --shadow:   0 24px 60px -28px rgba(0,0,0,.7);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--paper); color: var(--ink);
  line-height: 1.6; overflow-x: hidden; -webkit-font-smoothing: antialiased;
  transition: background .4s var(--ease), color .4s var(--ease);
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(255,90,60,.06), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(255,90,60,.05), transparent 60%);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
code { font-family: "JetBrains Mono", monospace; font-size: .85em; }

/* ---------- loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 10000; background: var(--paper);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px;
  transition: opacity .6s var(--ease), visibility .6s;
}
.loader.done { opacity: 0; visibility: hidden; }
.loader__name {
  font-family: "Fraunces", serif; font-size: clamp(2rem, 8vw, 4.5rem);
  display: flex; gap: .3em; letter-spacing: -.02em;
}
.loader__name span { opacity: 0; transform: translateY(20px); animation: loadUp .7s var(--ease) forwards; }
.loader__name span:nth-child(2) { animation-delay: .15s; font-style: italic; }
@keyframes loadUp { to { opacity: 1; transform: none; } }
.loader__bar { width: 180px; height: 2px; background: var(--line); overflow: hidden; border-radius: 2px; }
.loader__bar i { display: block; height: 100%; width: 0; background: var(--accent); animation: loadBar 1.1s var(--ease) forwards; }
@keyframes loadBar { to { width: 100%; } }

/* ---------- custom cursor ---------- */
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0; border-radius: 50%; pointer-events: none;
  z-index: 9999; mix-blend-mode: difference;
}
.cursor-dot  { width: 7px; height: 7px; background: #fff; transform: translate(-50%,-50%); }
.cursor-ring {
  width: 38px; height: 38px; border: 1.5px solid #fff; transform: translate(-50%,-50%);
  transition: width .25s var(--ease), height .25s var(--ease), background .25s;
}
.cursor-ring.is-hover { width: 62px; height: 62px; background: rgba(255,255,255,.12); }
@media (hover: none) { .cursor-dot, .cursor-ring { display: none; } }

/* ---------- scroll progress ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: var(--accent); z-index: 999; transition: width .1s linear;
}

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px clamp(20px, 5vw, 64px);
  transition: background .4s var(--ease), padding .4s var(--ease), box-shadow .4s;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(14px); padding-top: 14px; padding-bottom: 14px;
  box-shadow: 0 1px 0 var(--line);
}
.nav__logo { font-family: "Fraunces", serif; font-weight: 600; font-size: 1.5rem; letter-spacing: -.02em; }
.nav__logo span { color: var(--accent); }
.nav__links { display: flex; gap: 28px; font-size: .92rem; font-weight: 500; }
.nav__links a { position: relative; color: var(--ink-soft); transition: color .25s; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -4px; height: 1.5px; width: 0;
  background: var(--accent); transition: width .3s var(--ease);
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { width: 100%; }
.nav__right { display: flex; align-items: center; gap: 16px; }
.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--line);
  background: transparent; color: var(--ink); cursor: pointer;
  display: grid; place-items: center; transition: border-color .3s, transform .3s var(--ease);
}
.theme-toggle:hover { border-color: var(--accent); transform: rotate(15deg); }
.theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: block; }
.nav__cta {
  border: 1.5px solid var(--ink); border-radius: 100px; padding: 9px 20px;
  font-weight: 600; font-size: .9rem; transition: background .3s var(--ease), color .3s;
}
.nav__cta:hover { background: var(--ink); color: var(--paper); }
.nav__burger { display: none; background: none; border: 0; flex-direction: column; gap: 5px; cursor: pointer; }
.nav__burger span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: .3s; }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; padding: 0 clamp(20px, 5vw, 64px); z-index: 1; }
.hero__blob {
  position: absolute; width: 460px; height: 460px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 50%, transparent), transparent 70%);
  filter: blur(30px); pointer-events: none; z-index: -1; transform: translate(-50%,-50%);
  left: 60%; top: 45%; opacity: .55;
}
.hero__inner { max-width: 1000px; }
.hero__eyebrow { font-family: "JetBrains Mono", monospace; font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 22px; }
.hero__title { font-family: "Fraunces", serif; font-weight: 400; font-size: clamp(3rem, 11vw, 8.5rem); line-height: .92; letter-spacing: -.03em; margin-bottom: 28px; }
.hero__title span { display: block; }
.accent { color: var(--accent); font-style: italic; }
.hero__lead { max-width: 540px; font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--ink-soft); margin-bottom: 40px; }
.hero__actions { display: flex; gap: 16px; flex-wrap: wrap; }
.hero__scroll { margin-top: 70px; font-family: "JetBrains Mono", monospace; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 12px; }
.hero__scroll span { width: 40px; height: 1px; background: var(--muted); position: relative; overflow: hidden; }
.hero__scroll span::after { content: ""; position: absolute; inset: 0; background: var(--accent); animation: scrollLine 2s var(--ease) infinite; }
@keyframes scrollLine { 0%{transform:translateX(-100%)} 60%,100%{transform:translateX(100%)} }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 28px; border-radius: 100px; font-weight: 600; font-size: .95rem; transition: transform .3s var(--ease), background .3s, color .3s, box-shadow .3s; will-change: transform; }
.btn--solid { background: var(--ink); color: var(--paper); }
.btn--solid:hover { background: var(--accent); color: #fff; box-shadow: 0 14px 30px -12px rgba(255,90,60,.7); }
.btn--ghost { border: 1.5px solid var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); }

/* ---------- marquee ---------- */
.marquee { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 22px 0; overflow: hidden; white-space: nowrap; position: relative; z-index: 1; background: var(--paper); }
.marquee__track { display: inline-flex; gap: 26px; will-change: transform; }
.marquee__track span { font-family: "Fraunces", serif; font-size: 1.6rem; font-style: italic; color: var(--ink); opacity: .85; }
.marquee__track span:nth-child(even) { color: var(--accent); font-style: normal; }

/* ---------- sections ---------- */
.section { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; padding: clamp(70px, 12vw, 140px) clamp(20px, 5vw, 64px); }
.section__head { margin-bottom: 56px; }
.section__num { font-family: "JetBrains Mono", monospace; font-size: .8rem; color: var(--accent); letter-spacing: .15em; }
.section__title { font-family: "Fraunces", serif; font-weight: 400; font-size: clamp(2.2rem, 6vw, 4rem); letter-spacing: -.02em; line-height: 1; margin-top: 8px; }
.section__sub { color: var(--ink-soft); margin-top: 14px; max-width: 560px; }

/* ---------- about ---------- */
.about__grid { display: grid; grid-template-columns: 1.3fr .9fr; gap: 60px; align-items: start; }
.about__avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); margin-bottom: 24px; box-shadow: var(--shadow); }
.about__text p { font-size: 1.12rem; color: var(--ink-soft); margin-bottom: 20px; }
.about__text strong { color: var(--ink); }
.link-underline { font-weight: 600; color: var(--ink); border-bottom: 2px solid var(--accent); padding-bottom: 2px; transition: color .25s; }
.link-underline:hover { color: var(--accent); }
.about__stats { list-style: none; display: grid; gap: 22px; }
.about__stats li { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; background: var(--card); }
.about__stats b { font-family: "Fraunces", serif; font-size: 2.6rem; display: block; line-height: 1; letter-spacing: -.02em; }
.about__stats span { font-size: .9rem; color: var(--muted); }

/* ---------- skills ---------- */
.skills__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; }
.skill { border: 1px solid var(--line); border-radius: var(--radius); padding: 32px 28px; background: var(--card); transition: transform .3s var(--ease), box-shadow .3s, border-color .3s; transform-style: preserve-3d; will-change: transform; }
.skill:hover { border-color: transparent; box-shadow: var(--shadow); }
.skill h3 { font-family: "Fraunces", serif; font-weight: 500; font-size: 1.5rem; margin-bottom: 12px; }
.skill p { color: var(--ink-soft); font-size: .98rem; }

/* ---------- projects ---------- */
.projects__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 22px; }
.projects__loading { color: var(--muted); font-family: "JetBrains Mono", monospace; }
.project { position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; background: var(--card); min-height: 210px; transition: transform .3s var(--ease), box-shadow .3s, border-color .3s; overflow: hidden; }
.project::before { content: ""; position: absolute; inset: 0; background: radial-gradient(400px circle at var(--mx,50%) var(--my,0%), color-mix(in srgb, var(--accent) 12%, transparent), transparent 45%); opacity: 0; transition: opacity .3s; }
.project:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: transparent; }
.project:hover::before { opacity: 1; }
.project__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.project__icon { font-size: 1.4rem; color: var(--accent); }
.project__lang { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); font-family: "JetBrains Mono", monospace; }
.project__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.project h3 { font-family: "Fraunces", serif; font-weight: 500; font-size: 1.35rem; margin-bottom: 8px; word-break: break-word; text-transform: capitalize; }
.project p { color: var(--ink-soft); font-size: .95rem; flex: 1; }
.project__meta { display: flex; gap: 18px; margin-top: 18px; font-size: .82rem; color: var(--muted); font-family: "JetBrains Mono", monospace; }
.projects__all { margin-top: 40px; }

/* ---------- blog ---------- */
.blog__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.post {
  display: flex; flex-direction: column; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card);
  overflow: hidden; transition: transform .3s var(--ease), box-shadow .3s, border-color .3s;
}
.post:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: transparent; }
.post__cover { aspect-ratio: 16/9; object-fit: cover; width: 100%; background: var(--paper-2); }
.post__body { padding: 24px 26px 28px; display: flex; flex-direction: column; flex: 1; }
.post__date { font-family: "JetBrains Mono", monospace; font-size: .76rem; color: var(--accent); letter-spacing: .06em; }
.post h3 { font-family: "Fraunces", serif; font-weight: 500; font-size: 1.4rem; margin: 8px 0 10px; line-height: 1.2; }
.post p { color: var(--ink-soft); font-size: .95rem; flex: 1; }
.post__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.post__tags span { font-size: .72rem; font-family: "JetBrains Mono", monospace; color: var(--muted); border: 1px solid var(--line); border-radius: 100px; padding: 3px 10px; }
.blog__empty { grid-column: 1/-1; border: 1px dashed var(--line); border-radius: var(--radius); padding: 40px; color: var(--ink-soft); }
.blog__empty code { color: var(--accent); }

/* ---------- blog reader ---------- */
.reader {
  position: fixed; inset: 0; z-index: 500; background: var(--paper);
  overflow-y: auto; opacity: 0; visibility: hidden; transform: translateY(20px);
  transition: opacity .4s var(--ease), transform .4s var(--ease), visibility .4s;
}
.reader.open { opacity: 1; visibility: visible; transform: none; }
.reader__bar {
  position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between;
  align-items: center; padding: 18px clamp(20px, 6vw, 80px);
  background: color-mix(in srgb, var(--paper) 85%, transparent); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.reader__back, .reader__close { background: none; border: 0; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; padding: 8px 4px; }
.reader__back:hover, .reader__close:hover { color: var(--accent); }
.reader__body { max-width: 760px; margin: 0 auto; padding: 40px clamp(20px, 6vw, 40px) 120px; }
.reader__body h1 { font-family: "Fraunces", serif; font-weight: 500; font-size: clamp(2rem, 6vw, 3.4rem); line-height: 1.05; letter-spacing: -.02em; margin-bottom: 12px; }
.reader__meta { color: var(--muted); font-family: "JetBrains Mono", monospace; font-size: .82rem; margin-bottom: 40px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.reader__body h2 { font-family: "Fraunces", serif; font-weight: 500; font-size: 1.8rem; margin: 40px 0 14px; }
.reader__body h3 { font-family: "Fraunces", serif; font-weight: 500; font-size: 1.35rem; margin: 30px 0 10px; }
.reader__body p { font-size: 1.12rem; color: var(--ink-soft); margin: 0 0 22px; }
.reader__body a { color: var(--accent); border-bottom: 1px solid var(--accent); }
.reader__body img { border-radius: var(--radius); margin: 26px 0; border: 1px solid var(--line); }
.reader__body ul, .reader__body ol { color: var(--ink-soft); font-size: 1.1rem; margin: 0 0 22px 22px; }
.reader__body li { margin-bottom: 8px; }
.reader__body pre { background: var(--paper-2); border: 1px solid var(--line); border-radius: 12px; padding: 18px; overflow-x: auto; margin: 0 0 22px; }
.reader__body code { background: var(--paper-2); padding: 2px 6px; border-radius: 6px; }
.reader__body pre code { background: none; padding: 0; }
.reader__body blockquote { border-left: 3px solid var(--accent); padding-left: 20px; margin: 0 0 22px; color: var(--ink); font-family: "Fraunces", serif; font-style: italic; font-size: 1.2rem; }

/* ---------- github ---------- */
.gh-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 44px; }
.gh-stat { border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 20px; text-align: center; background: var(--card); }
.gh-stat b { font-family: "Fraunces", serif; font-size: 2.4rem; display: block; line-height: 1; color: var(--ink); }
.gh-stat span { font-size: .82rem; color: var(--muted); }
.gh-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 26px; }
.gh-card, .gh-graph, .gh-streak { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 18px; }
.gh-graph { margin-bottom: 26px; }
.gh-streak { max-width: 560px; }

/* ---------- testimonials ---------- */
.testi__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; }
.testi__card { border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 28px; background: var(--card); transition: transform .3s var(--ease), box-shadow .3s, border-color .3s; will-change: transform; }
.testi__card:hover { border-color: transparent; box-shadow: var(--shadow); }
.testi__card blockquote { font-family: "Fraunces", serif; font-size: 1.18rem; line-height: 1.5; margin-bottom: 20px; }
.testi__card blockquote::before { content: "“"; color: var(--accent); font-size: 2rem; line-height: 0; }
.testi__card figcaption b { display: block; font-weight: 600; }
.testi__card figcaption span { font-size: .84rem; color: var(--muted); }

/* ---------- contact ---------- */
.contact__lead { font-size: clamp(1.1rem, 2.4vw, 1.5rem); color: var(--ink-soft); max-width: 560px; margin-bottom: 44px; }
.contact__form { max-width: 560px; display: grid; gap: 26px; }
.field { position: relative; }
.field input, .field textarea { width: 100%; background: transparent; border: 0; border-bottom: 1.5px solid var(--line); padding: 14px 2px; font: inherit; color: var(--ink); resize: vertical; transition: border-color .3s; }
.field textarea { min-height: 90px; }
.field input:focus, .field textarea:focus { outline: 0; border-color: var(--accent); }
.field label { position: absolute; left: 2px; top: 14px; color: var(--muted); pointer-events: none; transition: .25s var(--ease); }
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label { top: -12px; font-size: .78rem; color: var(--accent); }
.hidden { display: none; }
.contact__form button { justify-self: start; margin-top: 6px; }
.contact__socials { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 46px; font-weight: 600; }
.contact__socials a { position: relative; }
.contact__socials a::after { content: "↗"; margin-left: 4px; color: var(--accent); }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); position: relative; z-index: 1; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 30px clamp(20px, 5vw, 64px); font-size: .85rem; color: var(--muted); }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation: none !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .nav__links, .nav__cta { display: none; }
  .nav__burger { display: flex; }
  .nav__links.open { display: flex; flex-direction: column; position: absolute; top: 100%; right: 20px; background: var(--card); padding: 20px 26px; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); gap: 18px; }
  .about__grid { grid-template-columns: 1fr; gap: 40px; }
  .gh-strip { grid-template-columns: 1fr 1fr; }
  .gh-cards { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .hero__actions { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }
  .footer { flex-direction: column; }
}

/* ---------- github: native languages bar ---------- */
.gh-langs { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 26px 28px; margin-bottom: 26px; }
.gh-langs__title { font-family: "Fraunces", serif; font-weight: 500; font-size: 1.3rem; margin-bottom: 18px; }
.gh-langs__bar { display: flex; height: 14px; border-radius: 100px; overflow: hidden; gap: 2px; background: var(--paper-2); }
.gh-langs__bar span { display: block; min-width: 4px; transition: filter .2s; }
.gh-langs__bar span:hover { filter: brightness(1.15); }
.gh-langs__legend { display: flex; flex-wrap: wrap; gap: 12px 22px; margin-top: 18px; font-size: .9rem; color: var(--ink-soft); }
.gh-langs__legend span { display: inline-flex; align-items: center; }
.gh-langs__legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 7px; }
.gh-langs__legend b { color: var(--ink); font-weight: 600; margin-left: 5px; }

/* ============================================================
   RESPONSIVE HARDENING  (mobile-first correctness)
   ============================================================ */
html { overflow-x: hidden; }
/* grids never demand more width than the screen has → no horizontal scroll */
.projects__grid, .blog__grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.skills__grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.testi__grid  { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.gh-card, .gh-graph, .gh-streak, .about__avatar, .post__cover { max-width: 100%; height: auto; }

@media (max-width: 900px) {
  .about__stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .section { padding-left: 18px; padding-right: 18px; }
  .section__head { margin-bottom: 40px; }
  .hero { padding-left: 18px; padding-right: 18px; }
  .hero__lead { font-size: 1.05rem; }
  .hero__scroll { margin-top: 44px; }
  .about__stats { grid-template-columns: 1fr; }
  .gh-strip { grid-template-columns: 1fr 1fr; gap: 12px; }
  .gh-stat { padding: 20px 12px; }
  .gh-stat b { font-size: 2rem; }
  .gh-langs { padding: 22px 20px; }
  .marquee__track span { font-size: 1.3rem; }
  .nav { padding-left: 18px; padding-right: 18px; }
  .nav__right { gap: 10px; }
  .reader__bar { padding-left: 18px; padding-right: 18px; }
  .reader__body { padding: 24px 18px 100px; }
  .reader__body p, .reader__body ul, .reader__body ol { font-size: 1.02rem; }
  .contact__socials { gap: 16px 20px; }
}
@media (max-width: 380px) {
  .hero__title { font-size: 2.6rem; }
  .nav__logo { font-size: 1.3rem; }
}
