/* ============================================================================
   HASHIM RAJA — Engineer · Quant · ML
   Editorial defense-tech system. Near-black canvas, bone type, signal accent.
   ========================================================================== */

:root {
  --bg:       #0a0a0b;
  --bg-2:     #0d0e10;
  --panel:    #121317;
  --panel-2:  #16181d;
  --line:     rgba(236, 233, 227, .12);
  --line-2:   rgba(236, 233, 227, .22);
  --text:     #ece9e3;
  --dim:      #9a9ea6;
  --faint:    #6a6e76;
  --accent:   #f4f1e9;          /* monochrome — bright bone as the only accent */
  --accent-2: #ffffff;
  --accent-soft: rgba(236, 233, 227, .05);

  --sans: "Archivo", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

  --maxw: 1320px;
  --gut:  clamp(1.25rem, 4.5vw, 4.5rem);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  letter-spacing: -0.005em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
::selection { background: var(--accent); color: #0a0a0b; }

.mono {
  font-family: var(--mono); font-weight: 500;
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--dim);
}

.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 1000;
  background: var(--accent); color: #0a0a0b; padding: .6rem 1rem; font-family: var(--mono);
  font-size: .75rem; transition: top .2s;
}
.skip-link:focus { top: 1rem; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #26282d; border-radius: 0; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- BACKGROUND ---------------------------------------------------- */
.bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: .35;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 78%);
          mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 78%);
}
.bg-glow {
  position: absolute; top: -25%; left: 50%; transform: translateX(-50%);
  width: 70vw; height: 60vh;
  background: radial-gradient(ellipse at center, var(--accent-soft) 0%, transparent 68%);
  filter: blur(20px); opacity: .7;
}
.bg-grain {
  position: absolute; inset: 0; opacity: .04; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- PROGRESS ----------------------------------------------------- */
#progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 100%; z-index: 200;
  background: var(--accent); transform: scaleX(0); transform-origin: 0 50%;
  box-shadow: 0 0 12px var(--accent);
}

/* ---------- NAV ---------------------------------------------------------- */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 150;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem var(--gut);
  transition: background .35s var(--ease), border-color .35s, padding .35s;
  border-bottom: 1px solid transparent;
}
#nav.scrolled {
  background: rgba(10, 10, 11, .72);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
  padding-top: .8rem; padding-bottom: .8rem;
}
.brand { display: flex; align-items: center; gap: .7rem; }
.brand-mark {
  font-family: var(--mono); font-weight: 700; font-size: .82rem; letter-spacing: .05em;
  color: #0a0a0b; background: var(--accent); padding: .28em .42em; line-height: 1;
}
.brand-name { font-family: var(--mono); font-weight: 500; font-size: .8rem; letter-spacing: .22em; }

.nav-links { display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 2.2rem); }
.nav-links a {
  font-family: var(--mono); font-size: .76rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--dim); display: inline-flex; align-items: baseline; gap: .45em;
  position: relative; padding: .3rem 0; transition: color .25s;
}
.nav-links a i { font-style: normal; color: var(--faint); font-size: .68em; transition: color .25s; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 1px; width: 0; background: var(--accent);
  transition: width .3s var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a:hover i, .nav-links a.active i { color: var(--accent); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-cta {
  color: var(--text) !important; border: 1px solid var(--line-2); padding: .55rem .9rem !important;
}
.nav-cta::after { display: none; }
.nav-cta:hover { background: var(--accent); color: #0a0a0b !important; border-color: var(--accent); }

#burger { display: none; flex-direction: column; gap: 5px; width: 44px; height: 44px; align-items: center; justify-content: center; z-index: 160; }
#burger span { width: 24px; height: 1.5px; background: var(--text); transition: .3s var(--ease); }
#burger.open span:nth-child(1) { transform: translateY(3.25px) rotate(45deg); }
#burger.open span:nth-child(2) { transform: translateY(-3.25px) rotate(-45deg); }

/* ---------- BUTTONS ------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--mono); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase;
  padding: .95rem 1.6rem; border: 1px solid var(--line-2); transition: all .28s var(--ease);
}
.btn-primary { background: var(--accent); color: #0a0a0b; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); transform: translateY(-2px); }
.btn-ghost:hover { border-color: var(--text); transform: translateY(-2px); }

/* ---------- HERO --------------------------------------------------------- */
.hero {
  position: relative; min-height: 100svh; display: flex; flex-direction: column;
  justify-content: center; padding: 7rem var(--gut) 3rem; max-width: var(--maxw); margin: 0 auto;
}
.hero-frame span {
  position: absolute; width: 26px; height: 26px; border: 1px solid var(--line-2);
}
.hero-frame span:nth-child(1) { top: 5.5rem; left: var(--gut); border-right: 0; border-bottom: 0; }
.hero-frame span:nth-child(2) { top: 5.5rem; right: var(--gut); border-left: 0; border-bottom: 0; }
.hero-frame span:nth-child(3) { bottom: 2.5rem; left: var(--gut); border-right: 0; border-top: 0; }
.hero-frame span:nth-child(4) { bottom: 2.5rem; right: var(--gut); border-left: 0; border-top: 0; }

.status-bar {
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
  padding-bottom: 2.4rem; margin-bottom: clamp(2rem, 6vh, 4rem); border-bottom: 1px solid var(--line);
}
.status-bar .status {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text);
}
.status-bar .mono { color: var(--faint); }
.status-bar .mono:last-child { margin-left: auto; }
.dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent); animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(236,233,227,.5); }
  70% { box-shadow: 0 0 0 7px rgba(236,233,227,0); }
  100% { box-shadow: 0 0 0 0 rgba(236,233,227,0); }
}

.hero-eyebrow { color: var(--accent); margin-bottom: 1.4rem; }
.hero-title {
  font-weight: 900; line-height: .86; letter-spacing: -0.03em;
  font-size: clamp(3.5rem, 16vw, 13rem); text-transform: uppercase;
}
.hero-title span { display: block; }
.hero-meta {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 2rem;
  margin-top: clamp(1.8rem, 5vh, 3rem); padding-top: 2rem; border-top: 1px solid var(--line);
}
.hero-lead { max-width: 46ch; font-size: clamp(1.05rem, 1.5vw, 1.25rem); color: var(--dim); line-height: 1.55; }
.hero-lead strong { color: var(--text); font-weight: 600; }
.hero-actions { display: flex; gap: .8rem; flex-shrink: 0; }
.hero-scroll {
  position: absolute; bottom: 2.5rem; right: var(--gut); display: flex; align-items: center; gap: .6rem;
  color: var(--faint); font-size: .68rem;
}
.hero-scroll span { display: inline-block; animation: bob 2s var(--ease) infinite; color: var(--accent); }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

/* ---------- MARQUEE ------------------------------------------------------ */
.marquee { overflow: hidden; border-block: 1px solid var(--line); padding: 1.1rem 0; background: var(--bg-2); }
.marquee-track { display: flex; align-items: center; gap: 2.5rem; width: max-content; animation: scroll 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
  font-weight: 800; font-size: clamp(1.1rem, 2.4vw, 1.7rem); text-transform: uppercase; letter-spacing: -0.01em;
  color: var(--text); white-space: nowrap;
}
.marquee-track b { color: var(--accent); font-size: .8rem; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ---------- FIELD RECORD ------------------------------------------------- */
.record {
  max-width: var(--maxw); margin: 0 auto; padding: clamp(3.5rem, 9vh, 6rem) var(--gut);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line);
}
.metric { background: var(--bg); padding: 2.2rem 1.6rem; display: flex; flex-direction: column; gap: .8rem; }
.metric-val {
  font-weight: 900; font-size: clamp(2.6rem, 5vw, 4rem); line-height: .9; letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.metric-label { line-height: 1.5; }

/* ---------- SECTION PRIMITIVES ------------------------------------------ */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(4.5rem, 12vh, 9rem) var(--gut); }
.section-head { margin-bottom: clamp(2.5rem, 6vh, 4.5rem); }
.section-index { display: block; color: var(--accent); margin-bottom: 1.2rem; }
.section-title {
  font-weight: 800; line-height: 1.0; letter-spacing: -0.025em;
  font-size: clamp(2rem, 5.5vw, 4.2rem); max-width: 18ch;
}

/* ---------- PROFILE ------------------------------------------------------ */
.profile-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.profile-prose p { font-size: clamp(1.05rem, 1.5vw, 1.3rem); color: var(--dim); line-height: 1.65; margin-bottom: 1.4rem; }
.profile-prose p:last-child { margin-bottom: 0; }
.profile-prose strong { color: var(--text); font-weight: 600; }
.spec { border-top: 1px solid var(--line-2); }
.spec-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  padding: 1rem 0; border-bottom: 1px solid var(--line);
}
.spec-row .mono { color: var(--faint); }
.spec-row b { font-weight: 600; font-size: .98rem; text-align: right; }
.spec-row b.live { display: inline-flex; align-items: center; gap: .5rem; color: var(--accent); }

/* ---------- DEPLOYMENT LOG ---------------------------------------------- */
.log { border-top: 1px solid var(--line-2); }
.log-row {
  display: grid; grid-template-columns: 56px 1.1fr 1.5fr auto; gap: 1.8rem; align-items: center;
  padding: 1.9rem 1rem; border-bottom: 1px solid var(--line);
  transition: background .3s var(--ease), padding .3s var(--ease);
}
.log-row:hover { background: var(--panel); padding-left: 1.6rem; }
.log-idx { color: var(--faint); font-size: .85rem; transition: color .3s; }
.log-row:hover .log-idx { color: var(--accent); }
.log-org h3 { font-weight: 700; font-size: clamp(1.15rem, 1.8vw, 1.5rem); letter-spacing: -0.01em; }
.log-org .mono { margin-top: .35rem; color: var(--dim); }
.log-note { color: var(--dim); font-size: .98rem; line-height: 1.55; max-width: 46ch; }
.log-note strong { color: var(--text); font-weight: 600; }
.log-meta { display: flex; flex-direction: column; gap: .35rem; text-align: right; color: var(--faint); white-space: nowrap; }

/* ---------- SYSTEMS ------------------------------------------------------ */
.systems-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.sys {
  background: var(--bg); padding: clamp(1.8rem, 3vw, 2.8rem);
  display: flex; flex-direction: column; gap: 1rem; position: relative;
  transition: background .3s var(--ease);
}
.sys::before {
  content: ""; position: absolute; left: 0; top: 0; width: 0; height: 2px; background: var(--accent);
  transition: width .35s var(--ease);
}
.sys:hover { background: var(--panel); }
.sys:hover::before { width: 100%; }
.sys-top { display: flex; justify-content: space-between; color: var(--faint); }
.sys-top span:last-child { color: var(--accent); }
.sys-name { font-weight: 800; font-size: clamp(1.5rem, 2.6vw, 2.1rem); letter-spacing: -0.02em; }
.sys-desc { color: var(--dim); font-size: .98rem; line-height: 1.6; flex-grow: 1; }
.sys-desc strong { color: var(--text); font-weight: 600; }
.sys-stack { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .4rem; }
.sys-stack li { font-family: var(--mono); font-size: .68rem; letter-spacing: .06em; color: var(--dim); border: 1px solid var(--line-2); padding: .3rem .55rem; }

/* ---------- CAPABILITIES ------------------------------------------------- */
.cap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 4vw, 4rem); }
.cap-col h4 { color: var(--accent); padding-bottom: 1rem; margin-bottom: .5rem; border-bottom: 1px solid var(--line-2); }
.cap-col ul li {
  padding: .85rem 0; border-bottom: 1px solid var(--line); font-size: 1.05rem; font-weight: 500;
  display: flex; align-items: center; gap: .8rem; color: var(--text); transition: color .2s, padding-left .25s var(--ease);
}
.cap-col ul li::before { content: "—"; color: var(--faint); font-family: var(--mono); }
.cap-col ul li:hover { color: var(--accent); padding-left: .5rem; }

/* ---------- CREDENTIALS -------------------------------------------------- */
.cred { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.cred-primary { border-left: 2px solid var(--accent); padding-left: 1.6rem; }
.cred-primary h3 { font-weight: 800; font-size: clamp(1.6rem, 3vw, 2.4rem); letter-spacing: -0.02em; margin-bottom: .7rem; }
.cred-primary p { color: var(--dim); font-size: 1.05rem; line-height: 1.5; margin-bottom: .8rem; }
.cred-primary .mono { color: var(--faint); }
.cred-list { border-top: 1px solid var(--line-2); }
.cred-list li {
  display: flex; align-items: baseline; gap: 1rem; padding: 1.05rem 0; border-bottom: 1px solid var(--line);
  font-size: 1.05rem; color: var(--dim);
}
.cred-list li .mono { color: var(--accent); flex-shrink: 0; min-width: 3.2rem; }
.cred-list li b { color: var(--text); font-weight: 600; }

/* ---------- CONTACT ------------------------------------------------------ */
.contact { max-width: var(--maxw); margin: 0 auto; padding: clamp(5rem, 14vh, 11rem) var(--gut); border-top: 1px solid var(--line); }
.contact-title { font-weight: 900; line-height: .92; letter-spacing: -0.035em; font-size: clamp(2.6rem, 9vw, 7.5rem); text-transform: uppercase; }
.contact-lead { margin-top: 1.8rem; max-width: 44ch; font-size: clamp(1.05rem, 1.5vw, 1.25rem); color: var(--dim); }
.contact-links { margin-top: clamp(2.5rem, 6vh, 4rem); border-top: 1px solid var(--line-2); }
.contact-link {
  display: grid; grid-template-columns: 8rem 1fr auto; align-items: center; gap: 1.5rem;
  padding: 1.5rem .5rem; border-bottom: 1px solid var(--line); transition: background .3s var(--ease), padding .3s var(--ease);
}
.contact-link .mono { color: var(--faint); }
.contact-link b { font-weight: 700; font-size: clamp(1.1rem, 2.4vw, 1.7rem); letter-spacing: -0.01em; }
.contact-link i { font-style: normal; color: var(--faint); font-size: 1.4rem; transition: transform .3s var(--ease), color .3s; }
.contact-link:hover { background: var(--panel); padding-left: 1.2rem; }
.contact-link:hover .mono { color: var(--accent); }
.contact-link:hover i { color: var(--accent); transform: translate(4px, -4px); }

/* ---------- FOOTER ------------------------------------------------------- */
.foot {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 2rem var(--gut); border-top: 1px solid var(--line); color: var(--faint);
}
.foot .mono { color: var(--faint); }
.foot-top:hover { color: var(--accent); }

/* ---------- REVEAL ------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.hero-title span { opacity: 0; transform: translateY(40px); }
.hero-title span.in { opacity: 1; transform: none; transition: opacity .9s var(--ease), transform .9s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  .reveal, .hero-title span { opacity: 1 !important; transform: none !important; }
  .marquee-track, .dot, .hero-scroll span { animation: none !important; }
}

/* ---------- RESPONSIVE --------------------------------------------------- */
@media (max-width: 960px) {
  .profile-grid, .cred { grid-template-columns: 1fr; }
  .systems-grid { grid-template-columns: 1fr; }
  .record { grid-template-columns: repeat(2, 1fr); }
  .cap-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .log-row { grid-template-columns: 40px 1fr; grid-template-areas: "idx org" "note note" "meta meta"; gap: .6rem 1.2rem; }
  .log-idx { grid-area: idx; } .log-org { grid-area: org; } .log-note { grid-area: note; max-width: none; } .log-meta { grid-area: meta; flex-direction: row; gap: 1.2rem; text-align: left; }
  .log-row:hover { padding-left: 1rem; }
}
@media (max-width: 720px) {
  #burger { display: flex; }
  .nav-links {
    position: fixed; inset: 0 0 0 auto; width: min(80vw, 300px); flex-direction: column;
    align-items: flex-start; justify-content: center; gap: 1.8rem; padding: 2rem var(--gut);
    background: rgba(10,10,11,.98); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border-left: 1px solid var(--line); transform: translateX(100%); transition: transform .4s var(--ease);
  }
  .nav-links.open { transform: none; }
  .nav-links a { font-size: 1rem; }
  .status-bar .mono:last-child { margin-left: 0; width: 100%; }
  .hero-meta { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 540px) {
  .record { grid-template-columns: 1fr; }
  .contact-link { grid-template-columns: 1fr auto; }
  .contact-link .mono { grid-column: 1 / -1; }
}
