@import url("./assets/fonts/gfonts.css");

/* ============================================================
   Mohammed Nadeem Mansoori - portfolio
   Cinematic black. Instrument Serif display, Inter UI.
   Atmospheric fog, scroll animation. No em-dashes.
   ============================================================ */

:root {
  --bg:        #000000;
  --bg-2:      #060608;
  --surface:   #0c0c0f;
  --surface-2: #131317;
  --line:      rgba(255, 255, 255, 0.09);
  --line-soft: rgba(255, 255, 255, 0.055);

  --text:  #f4f4f5;
  --muted: rgba(244, 244, 245, 0.62);
  --dim:   rgba(244, 244, 245, 0.4);

  --accent:      #cfe8ff;          /* cool rim-light white */
  --accent-ink:  #000000;
  --glow:        rgba(150, 200, 255, 0.16);
  --glow-warm:   rgba(255, 245, 220, 0.10);

  --r-sm: 10px;
  --r:    16px;
  --r-lg: 24px;
  --r-pill: 999px;

  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;

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

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
html:not(.lenis) { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
::selection { background: var(--accent); color: var(--accent-ink); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* film grain + vignette over everything, very subtle */
.grain { position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.vignette { position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 80% at 50% 40%, transparent 55%, rgba(0,0,0,0.6) 100%); }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 26px; }
section { position: relative; padding-block: clamp(80px, 12vw, 168px); }

/* labels */
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-family: var(--sans); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.28em; color: var(--muted); font-weight: 500; }
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }

.section-head { max-width: 760px; margin-inline: auto; text-align: center; margin-bottom: clamp(48px, 6vw, 80px); }
.section-head h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.4rem, 5.5vw, 4.6rem); line-height: 1.02; letter-spacing: -0.01em; margin-top: 20px; text-wrap: balance; }
.section-head h2 em { font-style: italic; color: var(--muted); }
.section-head p { color: var(--muted); margin-top: 18px; font-size: 1.05rem; max-width: 54ch; margin-inline: auto; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 9px; font-family: var(--sans); font-weight: 500; font-size: 0.92rem; padding: 13px 24px; border-radius: var(--r-pill); border: 1px solid var(--line); cursor: pointer; color: var(--text); background: rgba(255,255,255,0.02); transition: transform 0.2s var(--ease), background 0.25s, border-color 0.25s, color 0.25s; }
.btn:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.28); background: rgba(255,255,255,0.06); }
.btn:active { transform: translateY(0) scale(0.99); }
.btn-primary { background: #fff; color: #000; border-color: #fff; }
.btn-primary:hover { background: #e9e9e9; color: #000; }
.ico { width: 16px; height: 16px; }

/* nav */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 50; padding-top: 18px; transition: padding 0.3s; }
.nav .bar { max-width: var(--container); margin-inline: auto; margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 11px 14px 11px 20px; border: 1px solid var(--line); border-radius: var(--r-pill); background: rgba(10,10,12,0.5); backdrop-filter: blur(16px) saturate(150%); }
.nav.scrolled { padding-top: 10px; }
.brand { font-family: var(--serif); font-size: 1.2rem; font-style: italic; letter-spacing: 0.01em; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a { font-size: 0.86rem; color: var(--muted); transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }

/* HERO */
.hero { min-height: 100svh; display: grid; place-items: center; text-align: center; position: relative; overflow: hidden; padding-top: 90px; }
.hero-atmos { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
/* original glowing orb: a soft light source, my own, not the template's asset */
.hero-atmos .head { position: absolute; top: 8%; left: 50%; transform: translateX(-50%); width: min(360px, 62vw); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 50% 44%, rgba(255,255,255,0.92), rgba(206,232,255,0.55) 20%, rgba(130,170,225,0.2) 44%, transparent 68%);
  filter: blur(3px); animation: orbFloat 9s ease-in-out infinite; }
.hero-atmos .head::after { content: ""; position: absolute; left: 50%; bottom: -46%; transform: translateX(-50%); width: 2px; height: 52%;
  background: linear-gradient(rgba(206,232,255,0.4), transparent); filter: blur(1px); }
@keyframes orbFloat { 0%, 100% { transform: translateX(-50%) translateY(0) scale(1); } 50% { transform: translateX(-50%) translateY(-16px) scale(1.035); } }
/* original abstract bloom, hand-authored SVG */
.hero-atmos .bloom { position: absolute; top: 7%; left: 50%; transform: translateX(-50%); width: min(320px, 56vw); aspect-ratio: 1; filter: drop-shadow(0 0 50px rgba(150,190,240,0.45)); animation: bloomFloat 11s ease-in-out infinite; }
.hero-atmos .bloom svg { width: 100%; height: 100%; animation: bloomSpin 60s linear infinite; transform-origin: 50% 50%; }
@keyframes bloomFloat { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-18px); } }
@keyframes bloomSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .hero-atmos .head, .hero-atmos .bloom, .hero-atmos .bloom svg { animation: none; } }

/* custom cursor */
.cursor { position: fixed; top: 0; left: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); z-index: 90; pointer-events: none; mix-blend-mode: difference; transform: translate(-50%, -50%); transition: width 0.25s var(--ease), height 0.25s var(--ease), background 0.25s; }
.cursor.ring { width: 40px; height: 40px; background: transparent; border: 1px solid var(--accent); }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }
/* horizontal fog band */
.hero-atmos .fog { position: absolute; top: 34%; left: -10%; width: 120%; height: 42%;
  background: radial-gradient(60% 100% at 50% 50%, rgba(150,190,240,0.14), transparent 70%); filter: blur(40px); }
.hero-atmos .fog.b { top: 48%; opacity: 0.6; background: radial-gradient(70% 100% at 40% 50%, rgba(120,160,220,0.10), transparent 72%); }
.hero-atmos .floor { position: absolute; bottom: 0; left: 0; right: 0; height: 40%; background: linear-gradient(transparent, rgba(0,0,0,0.9)); }

.hero-inner { position: relative; z-index: 2; }
.hero .tagpill { display: inline-flex; align-items: center; gap: 9px; font-size: 0.76rem; color: var(--muted); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 7px 15px; margin-bottom: 30px; opacity: 0; }
.hero .tagpill .dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 10px #4ade80; }
.hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(3.2rem, 10vw, 8rem); line-height: 0.95; letter-spacing: -0.015em; }
.hero h1 .im { display: block; font-size: 0.34em; letter-spacing: 0.02em; color: var(--muted); margin-bottom: 4px; }
.hero h1 .name { font-style: italic; display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: 0.08em; }
.hero h1 .name > span { display: inline-block; transform: translateY(110%); }
.role { margin-top: 26px; height: 1.4em; overflow: hidden; opacity: 0; }
.role .track { display: flex; flex-direction: column; }
.role .track span { font-family: var(--sans); font-weight: 700; font-size: clamp(1rem, 2.4vw, 1.7rem); letter-spacing: 0.14em; text-transform: uppercase; line-height: 1.4; }
.hero-cta { margin-top: 40px; display: inline-flex; gap: 14px; opacity: 0; }

/* marquee */
.marquee { border-block: 1px solid var(--line-soft); overflow: hidden; padding-block: 26px; background: var(--bg-2); }
.marquee-track { display: flex; gap: 60px; width: max-content; animation: marq 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span { font-family: var(--serif); font-style: italic; font-size: clamp(1.3rem, 2.4vw, 2rem); color: var(--dim); white-space: nowrap; display: inline-flex; align-items: center; gap: 60px; }
.marquee span::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
@keyframes marq { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

/* services / expertise blocks (image + text, alternating) */
.svc { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: center; padding-block: clamp(40px, 6vw, 80px); border-top: 1px solid var(--line-soft); }
.svc:first-of-type { border-top: 0; }
.svc .visual { aspect-ratio: 4/3; border-radius: var(--r-lg); border: 1px solid var(--line); background:
  radial-gradient(90% 90% at 30% 20%, rgba(120,160,220,0.14), transparent 60%), linear-gradient(160deg, var(--surface), var(--bg-2));
  position: relative; overflow: hidden; display: grid; place-items: center; }
.svc .visual::before { content: ""; position: absolute; width: 62%; aspect-ratio: 1; border-radius: 50%; border: 1px solid rgba(255,255,255,0.08); box-shadow: inset 0 0 60px rgba(130,170,225,0.14), 0 0 80px rgba(130,170,225,0.06); }
.svc .visual::after { content: ""; position: absolute; width: 34%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(206,232,255,0.16), transparent 70%); filter: blur(6px); }
.svc .visual .num { position: relative; z-index: 1; font-family: var(--serif); font-style: italic; font-size: clamp(4rem, 10vw, 8rem); color: rgba(255,255,255,0.12); }
.svc:nth-child(even) .visual { order: 2; }
.svc .body .kicker { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.svc .body h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.9rem, 3.6vw, 2.8rem); letter-spacing: -0.01em; margin: 14px 0 14px; line-height: 1.05; }
.svc .body p { color: var(--muted); font-size: 1rem; max-width: 46ch; }
.svc .body ul { list-style: none; margin: 22px 0 26px; display: grid; gap: 11px; }
.svc .body ul li { display: flex; align-items: center; gap: 12px; color: var(--text); font-size: 0.96rem; }
.svc .body ul li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); flex: none; }

/* work grid */
.work-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.wcard { grid-column: span 3; border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 30px; background: linear-gradient(180deg, var(--surface), var(--bg-2)); transition: border-color 0.3s, transform 0.3s var(--ease); position: relative; overflow: hidden; min-height: 260px; display: flex; flex-direction: column; }
.wcard:hover { border-color: rgba(255,255,255,0.22); transform: translateY(-4px); }
.wcard.big { grid-column: span 6; }
.wcard .idx { font-family: var(--mono); font-size: 0.74rem; color: var(--dim); }
.wcard h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.6rem, 2.6vw, 2.2rem); letter-spacing: -0.01em; margin: 14px 0 12px; }
.wcard p { color: var(--muted); font-size: 0.97rem; max-width: 60ch; }
.wcard .spacer { flex: 1; }
.wcard .tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.wcard .tag { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 5px 12px; }
.wcard .links { display: flex; gap: 18px; margin-top: 20px; }
.wcard .links a { font-family: var(--mono); font-size: 0.8rem; color: var(--text); display: inline-flex; gap: 7px; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 3px; transition: color 0.2s, border-color 0.2s; }
.wcard .links a:hover { color: var(--accent); border-color: var(--accent); }
.wcard .media { margin: -30px -30px 22px; aspect-ratio: 16/7; overflow: hidden; border-bottom: 1px solid var(--line-soft); background: var(--bg-2); }
.wcard .media img { width: 100%; height: 100%; object-fit: cover; object-position: top center; opacity: 0.92; }

/* stat row */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--r); overflow: hidden; margin-top: 16px; }
.stat-row .cell { background: var(--bg); padding: 30px 26px; text-align: center; }
.stat-row .num { font-family: var(--serif); font-style: italic; font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.01em; }
.stat-row .lbl { color: var(--dim); font-size: 0.82rem; font-family: var(--mono); margin-top: 8px; }

/* certifications grid */
.cert-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--r-lg); overflow: hidden; }
.cert-line { background: var(--bg); padding: 18px 24px; display: flex; align-items: baseline; justify-content: space-between; gap: 16px; transition: background 0.25s; }
.cert-line:hover { background: var(--surface); }
.cert-line .cn { font-family: var(--sans); font-weight: 500; font-size: 0.98rem; }
.cert-line:hover .cn { color: var(--accent); }
.cert-line .ci { font-family: var(--mono); font-size: 0.72rem; color: var(--dim); white-space: nowrap; text-align: right; }

/* timeline */
.timeline { max-width: 820px; margin-inline: auto; }
.job { position: relative; padding-left: 30px; padding-bottom: 44px; border-left: 1px solid var(--line); }
.job:last-child { padding-bottom: 0; }
.job::before { content: ""; position: absolute; left: -6px; top: 5px; width: 11px; height: 11px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px var(--accent); }
.job-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 18px; }
.job h3 { font-family: var(--serif); font-weight: 400; font-size: 1.5rem; }
.job h3 .co { font-style: italic; color: var(--muted); }
.job .when { font-family: var(--mono); font-size: 0.78rem; color: var(--dim); }
.job .where { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); margin-top: 6px; }
.job ul { list-style: none; margin-top: 16px; display: grid; gap: 10px; }
.job ul li { position: relative; padding-left: 18px; color: var(--muted); font-size: 0.95rem; }
.job ul li::before { content: ""; position: absolute; left: 0; top: 10px; width: 6px; height: 1px; background: var(--accent); }
.job ul li b { color: var(--text); font-weight: 600; }

/* frameworks + writing */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.panel { border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 30px; background: linear-gradient(180deg, var(--surface), var(--bg-2)); transition: border-color 0.3s, transform 0.3s var(--ease); }
.panel:hover { border-color: rgba(255,255,255,0.2); transform: translateY(-3px); }
.panel .date { font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--dim); }
.panel h3 { font-family: var(--serif); font-weight: 400; font-size: 1.5rem; margin: 12px 0 10px; }
.panel p { color: var(--muted); font-size: 0.95rem; }
.panel .read { margin-top: 18px; font-family: var(--mono); font-size: 0.8rem; display: inline-flex; gap: 7px; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 3px; }
.panel .read:hover { color: var(--accent); border-color: var(--accent); }
.fr { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.fr:last-child { border-bottom: 0; }
.fr .name { font-weight: 500; font-size: 0.95rem; }
.fr .role { font-family: var(--mono); font-size: 0.74rem; color: var(--dim); text-align: right; }

/* contact */
.contact-wrap { text-align: center; max-width: 720px; margin-inline: auto; }
.contact-wrap h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.6rem, 7vw, 5.5rem); line-height: 1; letter-spacing: -0.01em; }
.contact-wrap h2 em { font-style: italic; color: var(--muted); }
.contact-wrap p { color: var(--muted); margin-top: 20px; font-size: 1.05rem; }
.contact-actions { margin-top: 38px; display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.copy-note { font-family: var(--mono); font-size: 0.74rem; color: var(--accent); height: 16px; margin-top: 16px; }

/* footer */
footer { border-top: 1px solid var(--line-soft); padding-block: 40px; }
footer .container { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
footer .brandf { font-family: var(--serif); font-style: italic; font-size: 1.4rem; }
footer .fnote { font-family: var(--mono); font-size: 0.76rem; color: var(--dim); }
footer .flinks { display: flex; gap: 20px; }
footer .flinks a { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); transition: color 0.2s; }
footer .flinks a:hover { color: var(--accent); }

/* reveal */
.js .reveal { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1 !important; transform: none !important; } .hero .tagpill, .hero-cta, .role { opacity: 1 !important; } .hero h1 .name > span { transform: none !important; } }
html:not(.js) .hero .tagpill, html:not(.js) .hero-cta, html:not(.js) .role { opacity: 1; }
html:not(.js) .hero h1 .name > span { transform: none; }

/* responsive */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .svc { grid-template-columns: 1fr; gap: 26px; }
  .svc:nth-child(even) .visual { order: 0; }
  .work-grid { grid-template-columns: 1fr; }
  .wcard, .wcard.big { grid-column: span 1; }
  .two-col { grid-template-columns: 1fr; }
  .cert-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
}
