/* M. Malik — portfolio styles
   Palette: warm off-white surface, graphite ink, gold accent.
   Type: Source Sans 3 (body/display), Source Code Pro (labels). */

:root {
  --bg: #fbfaf8;
  --card: #ffffff;
  --ink: #2e3133;
  --ink-soft: #444;
  --muted: #6f6b64;
  --muted-2: #7a766f;
  --muted-3: #8d887f;
  --faint: #a39e94;
  --gold: #f9d76d;
  --gold-deep: #f7cc46;
  --gold-ink: #e0b53d;
  --gold-dim: #c2a64a;
  --gold-dark: #9a7d1f;
  --line: rgba(46, 49, 51, 0.07);
  --line-2: rgba(46, 49, 51, 0.1);
  --gutter: clamp(20px, 5vw, 64px);
  --sans: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'Source Code Pro', monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-soft);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

::selection { background: var(--gold); color: var(--ink); }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #f1efea; }
::-webkit-scrollbar-thumb { background: #d9d4cc; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #c7c1b6; }

h1, h2, h3 { color: var(--ink); }
em { font-style: italic; }

/* ---- Decorative background ---- */
.bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bg-blob { position: absolute; border-radius: 50%; }
.bg-blob--1 {
  top: -12%; right: -6%; width: 46vw; height: 46vw; max-width: 680px; max-height: 680px;
  background: radial-gradient(circle, rgba(249, 215, 109, 0.20), transparent 62%);
  filter: blur(40px); animation: float1 19s ease-in-out infinite;
}
.bg-blob--2 {
  bottom: -16%; left: -10%; width: 52vw; height: 52vw; max-width: 720px; max-height: 720px;
  background: radial-gradient(circle, rgba(249, 215, 109, 0.12), transparent 60%);
  filter: blur(52px); animation: float2 24s ease-in-out infinite;
}
.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(46, 49, 51, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46, 49, 51, 0.028) 1px, transparent 1px);
  background-size: 74px 74px;
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 30%, #000 35%, transparent 78%);
  mask-image: radial-gradient(ellipse 75% 65% at 50% 30%, #000 35%, transparent 78%);
}

/* ---- Scroll progress ---- */
.progress {
  position: fixed; top: 0; left: 0; height: 4px; width: 0%;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold));
  z-index: 200;
}

/* ---- Nav ---- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 150;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter);
  border-bottom: 1px solid rgba(46, 49, 51, 0.14); box-shadow: 0 2px 10px rgba(46, 49, 51, 0.1);
  transition: background .5s ease, border-color .5s ease, padding .4s ease, box-shadow .5s ease;
  background: rgba(255, 255, 255, 0.1);
}
.nav.is-scrolled {
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(46, 49, 51, 0.14);
  box-shadow: 0 2px 10px rgba(46, 49, 51, 0.1));
  padding-top: 13px; padding-bottom: 13px;
}
.nav-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.nav-brand img { width: 34px; height: 34px; border-radius: 8px; display: block; }
.nav-brand span { font-weight: 900; letter-spacing: 2.5px; font-size: 15px; color: var(--ink); }
.nav-links { display: flex; align-items: center; gap: clamp(8px, 1.8vw, 30px); }
.nav-link {
  position: relative; text-decoration: none; color: var(--muted-2);
  font-family: var(--mono); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase;
  padding: 6px 2px; transition: color .35s ease;
}
.nav-link:hover { color: var(--ink); }
.nav-link i {
  position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--gold);
  transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease);
}
.nav-link:hover i, .nav-link.is-active i { transform: scaleX(1); }
.nav-link.is-active { color: var(--ink); }

/* ---- Buttons ---- */
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  border-radius: 100px; text-decoration: none; font-weight: 700; font-size: 15px;
  transition: transform .4s var(--ease), box-shadow .4s ease, background .4s ease, border-color .4s ease;
}
.btn-arrow { font-family: var(--mono); }
.btn-arrow--gold { color: var(--gold); }
.btn--primary {
  padding: 16px 30px; background: var(--gold); color: var(--ink);
  box-shadow: 0 10px 30px rgba(249, 215, 109, 0.4);
}
.btn--primary:hover { background: var(--gold-deep); box-shadow: 0 16px 40px rgba(247, 204, 70, 0.5); }
.btn--ghost {
  padding: 16px 30px; background: #fff; color: var(--ink); font-weight: 600;
  border: 1px solid rgba(46, 49, 51, 0.14); box-shadow: 0 2px 10px rgba(46, 49, 51, 0.05);
}
.btn--ghost:hover { border-color: rgba(249, 215, 109, 0.7); box-shadow: 0 8px 24px rgba(46, 49, 51, 0.08); }
.btn--dark {
  padding: 17px 32px; background: var(--ink); color: #fff; font-size: 16px;
  box-shadow: 0 10px 30px rgba(46, 49, 51, 0.2);
}
.btn--dark:hover { background: #1f2123; box-shadow: 0 16px 44px rgba(46, 49, 51, 0.3); }

/* ---- Hero ---- */
.hero {
  position: relative; z-index: 1; display: flex; align-items: center;
  padding: 150px var(--gutter) 50px;
  background: linear-gradient(160deg, #fff6dd, #fffdf7);
}
.hero-grid {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(32px, 5vw, 72px);
  align-items: center; width: 100%;
}
.badge {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 30px;
  padding: 7px 14px;
  border: 1px solid rgba(46, 49, 51, 0.14);
  box-shadow: 0 2px 10px rgba(46, 49, 51, 0.05);
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.badge-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--gold);
  box-shadow: 0 0 8px var(--gold-deep); animation: blink 2.6s ease-in-out infinite;
}
.badge span:last-child {
  font-family: var(--mono); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted-2);
}
.hero-title {
  margin: 0; font-weight: 300; font-size: clamp(40px, 7vw, 108px); line-height: 0.98;
  letter-spacing: -0.03em; color: var(--ink);
}
.hero-title span { display: block; }
.hero-title em { font-weight: 900; color: var(--gold-ink); }
.hero-lead {
  margin: 34px 0 0; max-width: 700px; font-size: clamp(16px, 1.4vw, 20px);
  line-height: 1.6; color: var(--muted);
}
.hero-roles { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 26px; }
.hero-roles span {
  font-family: var(--mono); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted-3);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 42px; }

.hero-visual {
  position: relative; display: flex; align-items: center; justify-content: center; min-height: 380px;
}
.hero-glow {
  position: absolute; width: 78%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(249, 215, 109, 0.22), transparent 60%); filter: blur(30px);
}
.orbit { width: min(100%, 460px); height: auto; position: relative; overflow: visible; }
.orbit g, .orbit .orbit-dash-a, .orbit .orbit-dash-b, .orbit .orbit-pulse {
  transform-box: fill-box; transform-origin: center;
}
.orbit-dash-a { animation: spin 26s linear infinite; }
.orbit-dash-b { animation: spinrev 40s linear infinite; }
.orbit-spin--14 { animation: orbit 14s linear infinite; }
.orbit-spin--22-rev { animation: orbit 22s linear infinite reverse; }
.orbit-spin--18 { animation: orbit 18s linear infinite; }
.orbit-pulse { animation: pulse 4.5s ease-out infinite; }
.orbit-pulse--delay { animation-delay: 2.25s; }
.orbit-core { filter: drop-shadow(0 0 10px rgba(224, 181, 61, 0.7)); }

.scroll-cue {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none;
}
.scroll-cue span:first-child {
  font-family: var(--mono); font-size: 10px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--faint);
}
.scroll-cue-arrow { font-size: 14px; color: var(--gold-ink); animation: cue 2.2s ease-in-out infinite; }

/* ---- Marquee ---- */
.marquee {
  position: relative; z-index: 1; padding: 34px 0; overflow: hidden; background: #fff;
  border-top: 1px solid rgba(46, 49, 51, 0.08); border-bottom: 1px solid rgba(46, 49, 51, 0.08);
}
.marquee-track { display: flex; align-items: center; width: max-content; animation: marquee 38s linear infinite; }
.marquee-item {
  font-weight: 300; font-size: clamp(14px, 3.4vw, 24px); letter-spacing: -0.01em;
  color: #cfc9bd; padding: 0 30px; white-space: nowrap;
}
.marquee-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); flex: none; }

/* ---- Section scaffolding ---- */
.section_01 { position: relative; z-index: 1; padding: clamp(50px, 8vw, 50px) var(--gutter); }
.section { position: relative; z-index: 1; padding: clamp(150px, 8vw, 150px) var(--gutter); }
.section--flush { padding-top: 0; }
.section_100 { padding-top: 100px; }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap;
  gap: 24px; margin-bottom: clamp(40px, 6vw, 40px);
}
.section-head--stack { display: block; margin-bottom: clamp(40px, 6vw, 64px); }
/* Centered header variant (What I Build, Experiments) */
.section-head--center { flex-direction: column; align-items: center; text-align: center; }
.section-head--center .eyebrow { justify-content: center; }
.section-head--center .section-title,
.section-head--center .section-note { margin-left: auto; margin-right: auto; }
.eyebrow { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.eyebrow-num { font-family: var(--mono); font-size: 12px; letter-spacing: 2px; color: var(--gold-ink); }
.eyebrow-line { width: 42px; height: 1px; background: rgba(224, 181, 61, 0.6); }
.eyebrow-label { font-family: var(--mono); font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted-3); }
.section-title {
  margin: 0; font-weight: 300; font-size: clamp(32px, 5vw, 68px); line-height: 1;
  letter-spacing: -0.025em; color: var(--ink); 
}
.section-title--narrow {}
.section-title em { font-weight: 900; color: var(--gold-ink); }
.section-note { margin: 0; max-width: 500px; font-size: 16px; line-height: 1.6; color: var(--muted-2); }

/* ---- Cards (shared) ---- */
.card {
  background: #fff; border: 1px solid var(--line); overflow: hidden;
  transition: transform .5s var(--ease), border-color .5s ease, box-shadow .5s ease;
}
.card:hover { border-color: rgba(249, 215, 109, 0.7); }

/* What I Build */
.cap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.cap { padding: 28px; border-radius: 18px; box-shadow: 0 2px 14px rgba(46, 49, 51, 0.04); }
.cap:hover { box-shadow: 0 16px 38px rgba(46, 49, 51, 0.10); }
.cap-n { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 1px; color: var(--gold-dim); margin-bottom: 22px; }
.cap h3 { margin: 0 0 8px; font-weight: 600; font-size: 20px; letter-spacing: -0.01em; }
.cap p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--muted-3); }

/* Experiments */
.exp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.exp {
  padding: 24px; border-radius: 16px; min-height: 150px; box-shadow: 0 2px 12px rgba(46, 49, 51, 0.04);
  display: flex; flex-direction: column; justify-content: space-between;
}
.exp:hover { box-shadow: 0 14px 32px rgba(46, 49, 51, 0.10); transform: translateY(-4px); }
.exp-glyph { font-family: var(--mono); font-size: 22px; color: var(--gold-ink); line-height: 1; margin-bottom: 18px; }
.exp h3 { margin: 0 0 5px; font-weight: 600; font-size: 16px; }
.exp p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted-3); }

/* ---- Articles ---- */
.articles { display: flex; flex-direction: column; }
.article-row {
  display: flex; align-items: center; gap: clamp(16px, 4vw, 48px); padding: 26px 8px;
  border-top: 1px solid var(--line-2); text-decoration: none;
  transition: padding .45s var(--ease), background .4s ease;
}
.article-row:hover { padding-left: 20px; background: rgba(249, 215, 109, 0.05); }
.article-date { font-family: var(--mono); font-size: 12px; letter-spacing: 1px; color: var(--gold-dim); flex: none; width: 54px; }
.article-body { flex: 1; min-width: 0; }
.article-title { display: block; font-weight: 500; font-size: clamp(18px, 2.2vw, 26px); letter-spacing: -0.01em; color: var(--ink); }
.article-tag { display: block; margin-top: 4px; font-size: 13px; color: var(--faint); }
.article-arrow { flex: none; font-family: var(--mono); font-size: 18px; color: var(--gold-ink); transition: transform .45s var(--ease); }
.article-row:hover .article-arrow { transform: translateX(8px); }
.articles-end { border-top: 1px solid var(--line-2); }

/* ---- About ---- */
.about-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(36px, 6vw, 90px); }
.about-intro .section-title { margin-bottom: 24px; }
.about-intro p { margin: 0 0 18px; font-size: 17px; line-height: 1.65; color: var(--muted); }
.about-intro p:last-of-type { margin-bottom: 0; }
.stats { display: flex; gap: 36px; margin-top: 38px; flex-wrap: wrap; }
.stat-num { font-weight: 300; font-size: clamp(34px, 4vw, 52px); line-height: 1; color: var(--gold-ink); letter-spacing: -0.02em; }
.stat-num span { font-size: 0.5em; }
.stat-label { font-family: var(--mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--faint); margin-top: 8px; }

.timeline { display: flex; flex-direction: column; }
.tl-item { position: relative; padding: 0 0 34px 32px; border-left: 1px solid rgba(46, 49, 51, 0.14); }
.tl-dot { position: absolute; left: -5.5px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--bg); border: 2px solid var(--gold); }
.tl-year { font-family: var(--mono); font-size: 12px; letter-spacing: 1.5px; color: var(--gold-dim); margin-bottom: 8px; }
.tl-item h3 { margin: 0 0 6px; font-weight: 600; font-size: 19px; }
.tl-item p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--muted-2); }

/* ---- Contact ---- */
.section--contact { padding: clamp(70px, 9vw, 120px) var(--gutter) clamp(70px, 9vw, 110px); }
.contact-card {
  position: relative; border-radius: 30px; overflow: hidden; padding: clamp(44px, 7vw, 96px);
  border: 1px solid rgba(249, 215, 109, 0.5); background: linear-gradient(160deg, #fff6dd, #fffdf7);
  box-shadow: 0 20px 60px rgba(46, 49, 51, 0.08);
}
.contact-glow {
  position: absolute; top: -30%; right: -10%; width: 50%; height: 160%;
  background: radial-gradient(circle, rgba(249, 215, 109, 0.4), transparent 60%); filter: blur(40px); pointer-events: none;
}
.contact-inner { position: relative; text-align: center; }
.contact-title, .contact-lead { margin-left: auto; margin-right: auto; }
.contact-actions { justify-content: center; }
.contact-eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--gold-dark); }
.contact-title { margin: 20px 0 0; font-weight: 300; font-size: clamp(36px, 6.5vw, 92px); line-height: 0.98; letter-spacing: -0.03em;}
.contact-title em { font-weight: 900; color: var(--gold-ink); }
.contact-lead { margin: 26px 0 0; font-size: 17px; line-height: 1.6; color: var(--muted); }
.contact-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 38px; align-items: center; }
.contact-socials { display: flex; gap: 20px; }
.contact-socials a {
  font-family: var(--mono); font-size: 13px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--muted); text-decoration: none; padding-bottom: 3px; border-bottom: 1px solid transparent;
  transition: color .35s ease, border-color .35s ease;
}
.contact-socials a:hover { color: var(--gold-dark); border-color: var(--gold); }

/* ---- Footer ---- */
.footer { position: relative; z-index: 1; background: var(--ink); color: #e2e3e4; }
.footer-inner {
  padding: 40px var(--gutter) 50px; display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 18px;
}
.footer-brand { display: flex; align-items: center; gap: 11px; }
.footer-brand img { width: 28px; height: 28px; border-radius: 7px; display: block; }
.footer-brand span { font-family: var(--mono); font-size: 12px; letter-spacing: 1px; color: #a8acae; }
.footer-top {
  font-family: var(--mono); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
  color: #a8acae; text-decoration: none; transition: color .35s ease;
}
.footer-top:hover { color: var(--gold); }

/* ---- Reveal-on-scroll (progressive enhancement) ---- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .95s var(--ease), transform .95s var(--ease); transition-delay: var(--d, 0ms); }
.js .hero-visual.reveal { transform: translateY(0); }
.reveal.is-in { opacity: 1; transform: none; }

/* ---- Animations ---- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spinrev { to { transform: rotate(-360deg); } }
@keyframes pulse { 0% { transform: scale(0.55); opacity: 0.5; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes float1 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(34px, -46px); } }
@keyframes float2 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-40px, 34px); } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes cue { 0% { opacity: 0; transform: translateY(-7px); } 45% { opacity: 1; } 100% { opacity: 0; transform: translateY(9px); } }
@keyframes orbit { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ---- Responsive ---- */
@media (max-width: 880px) {
  html { scroll-padding-top: 74px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { min-height: 300px; }
  .about-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .nav-links { display: none; }
}

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