/* ════════════════════════════════════════════
   Subhan Umer — portfolio
   dark editorial / security-researcher aesthetic
   ════════════════════════════════════════════ */

:root {
  --bg: #0a0b0a;
  --bg-soft: #111311;
  --ink: #e8ece6;
  --dim: #8a918a;
  --line: rgba(232, 236, 230, 0.1);
  --accent: #c6f24e;
  --accent-dim: rgba(198, 242, 78, 0.12);
  --critical: #ff4d4d;
  --high: #ff9f43;
  --medium: #f5d76e;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --pad: clamp(1.25rem, 5vw, 6rem);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: #0a0b0a; }

.mono { font-family: var(--font-mono); }
.dim { color: var(--dim); }
.accent { color: var(--accent); font-style: normal; }
mark { background: var(--accent-dim); color: var(--accent); padding: 0 0.25em; border-radius: 3px; }
code {
  font-family: var(--font-mono);
  background: var(--accent-dim);
  color: var(--accent);
  padding: 0.05em 0.35em;
  border-radius: 4px;
  font-size: 0.9em;
}

/* ── ambience ─────────────────────────────── */
.noise {
  position: fixed; inset: -50%;
  pointer-events: none; z-index: 9000;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 8s steps(10) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -2%); }
  80% { transform: translate(3%, 3%); }
}

.grid-bg {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, black 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, black 0%, transparent 75%);
}

/* ── cursor ───────────────────────────────── */
.cursor, .cursor-ring {
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 9999;
  border-radius: 50%;
  translate: -50% -50%;
}
.cursor {
  width: 6px; height: 6px;
  background: var(--accent);
}
.cursor-ring {
  width: 36px; height: 36px;
  border: 1px solid rgba(198, 242, 78, 0.5);
  transition: width 0.25s, height 0.25s, border-color 0.25s, background 0.25s;
}
.cursor-ring.is-hover {
  width: 64px; height: 64px;
  background: rgba(198, 242, 78, 0.08);
  border-color: var(--accent);
}
@media (hover: none), (pointer: coarse) {
  .cursor, .cursor-ring { display: none; }
}

.scroll-progress {
  position: fixed; top: 0; left: 0; z-index: 9500;
  height: 2px; width: 100%;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

/* ── preloader ────────────────────────────── */
.preloader {
  position: fixed; inset: 0; z-index: 9990;
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: flex-start; justify-content: center;
  padding: var(--pad);
  gap: 2rem;
}
.boot-line {
  font-family: var(--font-mono);
  font-size: clamp(0.75rem, 2vw, 0.95rem);
  color: var(--dim);
  opacity: 0;
}
.boot-line.accent { color: var(--accent); }
.preloader-bar {
  width: min(360px, 60vw); height: 1px;
  background: var(--line);
  overflow: hidden;
}
.preloader-bar span {
  display: block; height: 100%; width: 100%;
  background: var(--accent);
  transform: scaleX(0); transform-origin: 0 50%;
}

/* ── header ───────────────────────────────── */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem var(--pad);
  transition: background 0.4s, backdrop-filter 0.4s, border-color 0.4s, transform 0.4s;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(10, 11, 10, 0.72);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.site-header.is-hidden { transform: translateY(-110%); }

.logo {
  font-family: var(--font-mono);
  font-weight: 700; font-size: 1.25rem;
  color: var(--ink); text-decoration: none;
  letter-spacing: -0.04em;
}
.logo-mark { color: var(--accent); }
.logo-cursor { animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.main-nav { display: flex; gap: clamp(1rem, 2.5vw, 2.25rem); }
.main-nav a {
  color: var(--dim); text-decoration: none;
  font-size: 0.85rem; letter-spacing: 0.02em;
  transition: color 0.25s;
  position: relative;
}
.main-nav a span {
  font-family: var(--font-mono);
  font-size: 0.6rem; color: var(--accent);
  vertical-align: super; margin-right: 0.3em;
  opacity: 0.7;
}
.main-nav a::after {
  content: ""; position: absolute; left: 0; bottom: -4px;
  width: 100%; height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: 100% 50%;
  transition: transform 0.3s cubic-bezier(0.65, 0, 0.35, 1);
}
.main-nav a:hover { color: var(--ink); }
.main-nav a:hover::after { transform: scaleX(1); transform-origin: 0 50%; }

.header-cta {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-mono); font-size: 0.75rem;
  color: var(--accent); text-decoration: none;
  border: 1px solid rgba(198, 242, 78, 0.35);
  padding: 0.5rem 1rem; border-radius: 100px;
  transition: background 0.3s, color 0.3s;
}
.header-cta:hover { background: var(--accent); color: #0a0b0a; }
.header-cta .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}
.header-cta:hover .dot { background: #0a0b0a; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(198, 242, 78, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(198, 242, 78, 0); }
}

.nav-toggle {
  display: none;
  background: none; border: 0; cursor: pointer;
  flex-direction: column; gap: 6px; padding: 8px;
}
.nav-toggle span {
  display: block; width: 26px; height: 2px;
  background: var(--ink);
  transition: transform 0.3s, opacity 0.3s;
}
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 850;
  background: rgba(10, 11, 10, 0.97);
  backdrop-filter: blur(20px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s;
}
.mobile-menu.is-open { opacity: 1; pointer-events: auto; }
.mobile-menu nav { display: flex; flex-direction: column; gap: 1.5rem; text-align: center; }
.mobile-menu a {
  color: var(--ink); text-decoration: none;
  font-size: clamp(1.75rem, 7vw, 2.5rem); font-weight: 500;
}
.mobile-menu a span {
  font-family: var(--font-mono); font-size: 0.8rem;
  color: var(--accent); vertical-align: super; margin-right: 0.4em;
}

/* ── hero ─────────────────────────────────── */
.hero {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 7rem var(--pad) 4rem;
  position: relative; z-index: 1;
}

.hero-meta {
  display: flex; flex-wrap: wrap; gap: 1.5rem;
  font-size: 0.75rem; color: var(--dim);
  margin-bottom: clamp(1.5rem, 4vh, 3rem);
}
.hero-meta .status { color: var(--accent); display: inline-flex; align-items: center; gap: 0.5rem; }
.hero-meta .status i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

.hero-title {
  font-size: clamp(3.2rem, 14vw, 12rem);
  font-weight: 700; line-height: 0.92;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}
.hero-title .line { display: block; overflow: hidden; }
.hero-title .word { display: inline-block; }
.hero-title .outline {
  color: transparent;
  -webkit-text-stroke: 2px var(--ink);
}
.hero-title .outline .accent {
  -webkit-text-stroke: 0;
  color: var(--accent);
}

.hero-sub {
  margin-top: clamp(1.5rem, 4vh, 3rem);
  max-width: 640px;
}
.hero-role {
  font-size: clamp(0.8rem, 2vw, 1rem);
  color: var(--accent);
  margin-bottom: 1rem;
}
.hero-role .prompt { color: var(--dim); }
.hero-desc {
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  color: var(--dim);
}
.hero-desc strong { color: var(--ink); font-weight: 500; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: clamp(2.5rem, 6vh, 4.5rem);
}
.stat {
  background: var(--bg);
  padding: 1.5rem 1.25rem;
  transition: background 0.3s;
}
.stat:hover { background: var(--bg-soft); }
.stat-num {
  display: block;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700; color: var(--accent);
  line-height: 1;
}
.stat-label {
  display: block; margin-top: 0.5rem;
  font-size: 0.78rem; color: var(--dim);
  letter-spacing: 0.04em;
}

.scroll-hint {
  position: absolute; bottom: 2rem; right: var(--pad);
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  color: var(--dim); text-decoration: none;
  font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase;
  writing-mode: vertical-rl;
}
.scroll-hint svg { animation: drift 2s ease-in-out infinite; }
@keyframes drift {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(6px); opacity: 0.4; }
}

/* ── marquee ──────────────────────────────── */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1.1rem 0;
  background: var(--bg-soft);
  position: relative; z-index: 1;
}
.marquee-track {
  display: flex; width: max-content;
  animation: marquee 28s linear infinite;
}
.marquee-track span {
  font-family: var(--font-mono);
  font-size: clamp(0.8rem, 2vw, 1rem);
  letter-spacing: 0.25em;
  color: var(--dim);
  white-space: nowrap;
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ── sections ─────────────────────────────── */
.section {
  padding: clamp(5rem, 12vh, 9rem) var(--pad);
  position: relative; z-index: 1;
}

.section-head { margin-bottom: clamp(2.5rem, 6vh, 4.5rem); }
.sec-index {
  display: block;
  color: var(--accent); font-size: 0.8rem;
  margin-bottom: 1rem;
}
.sec-index::before { content: "["; color: var(--dim); }
.sec-index::after { content: "]"; color: var(--dim); }
.sec-title {
  font-size: clamp(2.2rem, 6.5vw, 4.5rem);
  font-weight: 600; line-height: 1.05;
  letter-spacing: -0.03em;
}
.sec-title .line { display: block; overflow: hidden; }
.sec-title .line > span { display: inline-block; }
.sec-sub { margin-top: 1rem; color: var(--dim); font-size: 0.85rem; }

/* ── about ────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.about-copy p + p { margin-top: 1.5rem; }
.about-copy .big-p {
  font-size: clamp(1.2rem, 2.6vw, 1.6rem);
  line-height: 1.5; color: var(--ink);
}
.about-copy p { color: var(--dim); font-size: 1.02rem; }

.about-side { display: flex; flex-direction: column; gap: 1.25rem; }

.terminal-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
  overflow: hidden;
}
.terminal-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
}
.terminal-bar i {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--line);
}
.terminal-bar i:first-child { background: rgba(255, 77, 77, 0.6); }
.terminal-bar i:nth-child(2) { background: rgba(245, 215, 110, 0.6); }
.terminal-bar i:nth-child(3) { background: rgba(198, 242, 78, 0.6); }
.terminal-bar span { margin-left: auto; font-size: 0.7rem; color: var(--dim); }
.terminal-body { padding: 1.1rem 1.2rem; font-size: 0.78rem; line-height: 2; }
.terminal-body p { white-space: pre; overflow-x: auto; color: var(--dim); }
.terminal-body .tk { color: var(--accent); }

.edu-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.4rem;
  background: linear-gradient(135deg, var(--accent-dim), transparent 55%);
}
.edu-tag { font-size: 0.7rem; color: var(--accent); letter-spacing: 0.15em; text-transform: uppercase; }
.edu-card h3 { margin: 0.5rem 0 0.25rem; font-weight: 600; }
.edu-card p { color: var(--dim); font-size: 0.9rem; }

/* ── CVE cards ────────────────────────────── */
.cve-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
  gap: 1.25rem;
}
.cve-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.75rem;
  background: var(--bg-soft);
  transition: border-color 0.35s, transform 0.35s, box-shadow 0.35s;
  transform-style: preserve-3d;
  will-change: transform;
  overflow: hidden;
}
.cve-card::before {
  content: "";
  position: absolute; inset: 0 auto 0 0; width: 3px;
  background: var(--sev-color, var(--accent));
  opacity: 0.85;
}
.cve-card[data-sev="critical"] { --sev-color: var(--critical); }
.cve-card[data-sev="high"] { --sev-color: var(--high); }
.cve-card[data-sev="medium"] { --sev-color: var(--medium); }
.cve-card:hover {
  border-color: color-mix(in srgb, var(--sev-color) 50%, transparent);
  box-shadow: 0 24px 60px -28px color-mix(in srgb, var(--sev-color) 35%, transparent);
}

.cve-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.1rem;
}
.sev {
  font-size: 0.65rem; font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--sev-color, var(--accent));
  border: 1px solid color-mix(in srgb, var(--sev-color) 45%, transparent);
  background: color-mix(in srgb, var(--sev-color) 10%, transparent);
  padding: 0.3rem 0.65rem; border-radius: 100px;
}
.cve-id { font-size: 0.68rem; color: var(--dim); }
.cve-card h3 {
  font-size: 1.15rem; font-weight: 600;
  letter-spacing: -0.01em; margin-bottom: 0.6rem;
}
.cve-card p { color: var(--dim); font-size: 0.92rem; }
.cve-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.2rem; }
.cve-tags span {
  font-size: 0.65rem; color: var(--dim);
  border: 1px solid var(--line);
  padding: 0.25rem 0.6rem; border-radius: 100px;
}

/* ── timeline ─────────────────────────────── */
.timeline { position: relative; padding-left: clamp(1.5rem, 4vw, 3rem); }
.timeline-line {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 1px; background: var(--line);
}
.timeline-line span {
  display: block; width: 100%; height: 0%;
  background: var(--accent);
}
.t-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(150px, 200px) 1fr;
  gap: clamp(1rem, 4vw, 3rem);
  padding: 2.25rem 0;
  border-bottom: 1px solid var(--line);
}
.t-item:last-child { border-bottom: 0; }
.t-item::before {
  content: "";
  position: absolute;
  left: calc(-1 * clamp(1.5rem, 4vw, 3rem) - 4px);
  top: 2.85rem;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.t-when { font-size: 0.72rem; color: var(--accent); letter-spacing: 0.08em; padding-top: 0.35rem; }
.t-body h3 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
.t-org { display: block; font-size: 0.85rem; font-weight: 400; color: var(--dim); margin-top: 0.25rem; }
.t-body ul { margin-top: 1rem; padding-left: 1.1rem; }
.t-body li { color: var(--dim); font-size: 0.95rem; margin-bottom: 0.5rem; }
.t-body li::marker { color: var(--accent); }

/* ── projects ─────────────────────────────── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 1.25rem;
}
.project-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 2rem 1.75rem 4rem;
  background: var(--bg-soft);
  transition: border-color 0.35s, box-shadow 0.35s;
  will-change: transform;
  overflow: hidden;
}
.project-card::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(198, 242, 78, 0.07), transparent 65%);
  opacity: 0; transition: opacity 0.35s;
  pointer-events: none;
}
.project-card:hover::after { opacity: 1; }
.project-card:hover {
  border-color: rgba(198, 242, 78, 0.4);
  box-shadow: 0 24px 60px -30px rgba(198, 242, 78, 0.25);
}
.p-num { font-size: 0.7rem; color: var(--accent); }
.project-card h3 { font-size: 1.3rem; font-weight: 600; margin: 0.9rem 0 0.7rem; letter-spacing: -0.01em; }
.project-card p { color: var(--dim); font-size: 0.93rem; }
.p-stack { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.2rem; }
.p-stack span {
  font-size: 0.65rem; color: var(--dim);
  border: 1px solid var(--line);
  padding: 0.25rem 0.6rem; border-radius: 100px;
}
.p-arrow {
  position: absolute; right: 1.5rem; bottom: 1.25rem;
  font-size: 1.4rem; color: var(--accent);
  transition: transform 0.3s;
}
.project-card:hover .p-arrow { transform: translate(4px, -4px); }

/* ── achievements ─────────────────────────── */
.achievements {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  position: relative; z-index: 1;
}
.ach-item {
  background: var(--bg);
  padding: clamp(2rem, 5vw, 3.5rem) var(--pad);
  transition: background 0.3s;
}
.ach-item:hover { background: var(--bg-soft); }
.ach-big {
  display: block;
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700; color: var(--accent);
  line-height: 1; margin-bottom: 0.75rem;
}
.ach-item p { color: var(--dim); font-size: 0.9rem; max-width: 32ch; }

/* ── contact ──────────────────────────────── */
.contact { text-align: center; padding-bottom: clamp(4rem, 10vh, 7rem); }
.contact .sec-index { margin-bottom: 2rem; }
.contact-title {
  font-size: clamp(2.6rem, 9vw, 7rem);
  font-weight: 700; line-height: 1;
  letter-spacing: -0.04em; text-transform: uppercase;
}
.contact-title .line { display: block; overflow: hidden; }
.contact-title .line > span { display: inline-block; }
.contact-sub { color: var(--dim); margin: 1.75rem auto 3rem; max-width: 48ch; }
.contact-mail {
  display: inline-flex; align-items: center; gap: 1rem;
  font-family: var(--font-mono);
  font-size: clamp(1rem, 3.4vw, 1.6rem);
  color: var(--ink); text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 1.1rem 2.25rem;
  transition: border-color 0.3s, background 0.3s, color 0.3s;
}
.contact-mail:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #0a0b0a;
}
.mail-arrow { transition: transform 0.3s; }
.contact-mail:hover .mail-arrow { transform: translateX(6px); }
.contact-links {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: clamp(1.25rem, 4vw, 2.5rem);
  margin-top: 3rem; font-size: 0.8rem;
}
.contact-links a { color: var(--dim); text-decoration: none; transition: color 0.25s; }
.contact-links a:hover { color: var(--accent); }

/* ── footer ───────────────────────────────── */
.site-footer {
  display: flex; flex-wrap: wrap; gap: 1rem;
  align-items: center; justify-content: space-between;
  padding: 1.5rem var(--pad);
  border-top: 1px solid var(--line);
  font-size: 0.72rem; color: var(--dim);
  position: relative; z-index: 1;
}
.site-footer a { color: var(--dim); text-decoration: none; transition: color 0.25s; }
.site-footer a:hover { color: var(--accent); }

/* ── responsive ───────────────────────────── */
@media (max-width: 860px) {
  .main-nav, .header-cta { display: none; }
  .nav-toggle { display: flex; }
  .about-grid { grid-template-columns: 1fr; }
  .t-item { grid-template-columns: 1fr; gap: 0.5rem; }
  .scroll-hint { display: none; }
}

/* ── reduced motion ───────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
