/* =========================================================
   Muhammad Husnain — Portfolio
   Aesthetic: technical documentation, paper-white,
   IBM Plex, monospace-heavy. Single muted accent.
   ========================================================= */
.meta-row{
  display:grid;
  grid-template-columns:110px 1fr;
  gap:24px;
  align-items:start;
}

.status{
  display:flex;
  align-items:flex-start;
  gap:10px;
}

.status > span:first-child{
  flex-shrink:0;
  margin-top:4px;
}
:root {
  /* Paper palette */
  --paper:    #f5f2ec;   /* warm off-white */
  --paper-2:  #ebe7df;   /* slightly deeper */
  --rule:     #d6d1c5;   /* hairline rules */
  --rule-2:   #c5bfb0;   /* stronger borders */
  --ink:      #1a1a1a;   /* near-black, never pure */
  --ink-2:    #3a3a38;
  --mute:     #6b6862;
  --mute-2:   #8a867d;
  --accent:   #b8472a;   /* muted brick / oxidized red */
  --accent-2: #6a7d3e;   /* moss for status */

  /* Type */
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --serif: "IBM Plex Serif", ui-serif, Georgia, serif;

  /* Layout */
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --maxw: 1180px;
  --col-meta: 220px;
  --col-gap: 4rem;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 400;
  font-size: 14.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;

  /* Subtle paper texture */
  background-image:
    radial-gradient(circle at 15% 8%, rgba(0,0,0,0.018), transparent 50%),
    radial-gradient(circle at 85% 92%, rgba(0,0,0,0.018), transparent 50%);
}

/* Faint grid lines, like graph paper, very subtle */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(0,0,0,0.025) 1px, transparent 1px);
  background-size: 80px 100%;
  opacity: 0.5;
  z-index: 0;
}

main { position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

::selection { background: var(--accent); color: var(--paper); }

/* =========================================================
   TOP BAR — terminal-style header
   ========================================================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.85rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  font-family: var(--mono);
  font-size: 13px;
}
.topbar-id {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.prompt { color: var(--accent); font-weight: 600; }
.topbar-user { color: var(--ink); font-weight: 500; }
.topbar-host { color: var(--mute); }
.topbar-cursor {
  display: inline-block;
  width: 8px; height: 14px;
  background: var(--ink);
  margin-left: 4px;
  animation: blink 1.1s steps(2) infinite;
}
@keyframes blink {
  50% { opacity: 0; }
}
.topbar-nav {
  display: flex;
  gap: 1.6rem;
  font-size: 13px;
}
.topbar-nav a {
  color: var(--ink-2);
  position: relative;
  padding: 2px 0;
  transition: color 0.15s ease;
}
.topbar-nav a:hover { color: var(--accent); }
.topbar-nav a::before {
  content: "#";
  color: var(--mute-2);
  margin-right: 1px;
}
@media (max-width: 720px) {
  .topbar-nav { display: none; }
  .topbar-inner { justify-content: flex-start; }
}

/* =========================================================
   BLOCK / GRID — two-column doc layout
   ========================================================= */
.block {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 5rem var(--gutter);
  border-bottom: 1px solid var(--rule);
}
.block-header { padding-top: 4.5rem; }

.grid {
  display: grid;
  grid-template-columns: var(--col-meta) 1fr;
  gap: var(--col-gap);
}
.col-meta {
  font-family: var(--mono);
  font-size: 12.5px;
}
.col-main {
  min-width: 0;
}

@media (max-width: 820px) {
  .grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* =========================================================
   HEADER BLOCK
   ========================================================= */
.meta-row {
  display: grid;
  grid-template-columns: 70px 1fr;
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--rule);
  color: var(--ink-2);
}
.meta-row:last-child { border-bottom: none; }
.meta-row span:first-child {
  color: var(--mute);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.06em;
  padding-top: 1px;
}
.meta-row .status {
  color: var(--accent-2);
  font-weight: 500;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 1.4rem;
  position: relative;
  padding-left: 1.5rem;
}
.eyebrow::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.display {
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(2rem, 5.2vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 2rem;
  max-width: 22ch;
}
.display .under {
  position: relative;
  font-weight: 500;
  white-space: nowrap;
}
.display .under::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0.12em;
  height: 7px;
  background: var(--accent);
  opacity: 0.35;
  z-index: -1;
}

.lead {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-2);
  max-width: 58ch;
  margin-bottom: 2.5rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  padding: 0.7rem 1rem;
  border: 1px solid var(--rule-2);
  background: var(--paper);
  color: var(--ink);
  transition: all 0.15s ease;
  cursor: pointer;
}
.btn:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn span {
  color: var(--accent);
  font-weight: 600;
}
.btn:hover span { color: var(--paper); }
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn-primary span { color: var(--paper); }
.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
}

/* =========================================================
   METRICS STRIP
   ========================================================= */
.block-metrics {
  padding: 2.5rem var(--gutter);
  background: var(--paper-2);
}
.metrics {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--rule-2);
  border: 1px solid var(--rule-2);
}
.metric {
  background: var(--paper-2);
  padding: 1.2rem 1.1rem;
}
.metric-key {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
  margin-bottom: 0.6rem;
  letter-spacing: 0.02em;
}
.metric-val {
  font-family: var(--sans);
  font-size: 2.1rem;
  font-weight: 400;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.metric-val span {
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 500;
  margin-left: 1px;
}

/* =========================================================
   SECTION META
   ========================================================= */
.section-label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 0.6rem;
}
.section-h {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 1.4rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 0.8rem;
}
.section-note {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mute);
  line-height: 1.5;
  max-width: 28ch;
}

/* =========================================================
   PROSE (about)
   ========================================================= */
.prose {
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--ink-2);
  max-width: 62ch;
}
.prose p { margin-bottom: 1.1rem; }
.prose p:last-child { margin-bottom: 0; }

.aside {
  margin-top: 1.8rem !important;
  padding: 1rem 1.1rem;
  background: var(--paper-2);
  border-left: 3px solid var(--accent);
  font-family: var(--mono) !important;
  font-size: 13px !important;
  line-height: 1.55 !important;
  color: var(--ink-2);
}
.aside-tag {
  display: inline-block;
  font-weight: 600;
  color: var(--accent);
  margin-right: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
}

/* =========================================================
   EXPERIENCE (details/summary)
   ========================================================= */
.role {
  border-top: 1px solid var(--rule);
}
.role:last-child { border-bottom: 1px solid var(--rule); }
.role[open] { background: rgba(255, 255, 255, 0.35); }

.role-summary {
  display: grid;
  grid-template-columns: 160px 1fr auto auto;
  align-items: baseline;
  gap: 1.2rem;
  padding: 1.1rem 0;
  cursor: pointer;
  list-style: none;
  font-family: var(--mono);
}
.role-summary::-webkit-details-marker { display: none; }
.role-summary::marker { display: none; }
.role-summary:hover .role-company { color: var(--accent); }

.role-date {
  font-size: 12px;
  color: var(--mute);
  letter-spacing: 0.02em;
}
.role-company {
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
  transition: color 0.15s ease;
}
.role-title {
  font-size: 12px;
  color: var(--ink-2);
  font-style: italic;
}
.role-arrow {
  font-size: 12px;
  color: var(--mute);
  transition: transform 0.2s ease;
}
.role[open] .role-arrow { transform: rotate(180deg); }

.role-body {
  padding: 0.4rem 0 1.8rem 0;
  padding-left: clamp(0px, 160px, 0px); /* alignment hack ignored */
}

.bullets {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 70ch;
}
.bullets li {
  position: relative;
  padding-left: 1.5rem;
}
.bullets li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--mono);
}
.bullets em {
  font-style: normal;
  background: rgba(184, 71, 42, 0.12);
  padding: 0 0.25rem;
  font-weight: 500;
  color: var(--ink);
}

@media (max-width: 720px) {
  .role-summary {
    grid-template-columns: 1fr auto;
    gap: 0.4rem 1rem;
  }
  .role-date { grid-column: 1 / -1; }
  .role-title { grid-column: 1 / -1; padding-top: 2px; }
}

/* =========================================================
   PROJECTS
   ========================================================= */
.project {
  padding: 2rem 0;
  border-top: 1px solid var(--rule);
}
.project:first-of-type { border-top: none; padding-top: 0; }
.project:last-of-type { padding-bottom: 0; }

.project-head {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 0.8rem;
  align-items: baseline;
  margin-bottom: 0.9rem;
}
.project-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.04em;
  padding-top: 6px;
}
.project-title {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1.15rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.project-desc {
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink-2);
  margin: 0 0 1rem 58px;
  max-width: 60ch;
}
.project-spec {
  margin-left: 58px;
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 0.35rem 1rem;
  font-family: var(--mono);
  font-size: 12px;
  padding-top: 0.8rem;
  border-top: 1px dashed var(--rule);
}
.project-spec dt {
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
  padding-top: 2px;
}
.project-spec dd {
  color: var(--ink-2);
  line-height: 1.5;
}

@media (max-width: 560px) {
  .project-desc, .project-spec { margin-left: 0; }
  .project-head { grid-template-columns: 1fr; }
}

/* =========================================================
   STACK
   ========================================================= */
.stack-table {
  border-top: 1px solid var(--rule-2);
  border-bottom: 1px solid var(--rule-2);
  margin-bottom: 3rem;
}
.stack-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1.5rem;
  padding: 0.9rem 0;
  border-bottom: 1px dashed var(--rule);
}
.stack-row:last-child { border-bottom: none; }
.stack-key {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-top: 3px;
}
.stack-val {
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  line-height: 1.5;
}

@media (max-width: 560px) {
  .stack-row { grid-template-columns: 1fr; gap: 0.3rem; }
}

.certs-h {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.certs-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.55rem 1.5rem;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 3rem;
}
.certs-list li {
  display: flex;
  gap: 0.7rem;
  align-items: baseline;
  padding: 0.3rem 0;
  border-bottom: 1px dashed var(--rule);
}
.cert-vendor {
  display: inline-block;
  min-width: 78px;
  font-weight: 600;
  color: var(--accent);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.education {
  border-top: 1px solid var(--rule-2);
  padding-top: 1.5rem;
}
.edu-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1rem;
  padding: 0.4rem 0;
  font-family: var(--mono);
  font-size: 13px;
}
.edu-key {
  color: var(--mute);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.06em;
}
.edu-val {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14.5px;
}

/* =========================================================
   CONTACT
   ========================================================= */
.block-contact {
  background: var(--paper-2);
  border-bottom: none;
}
.contact-lead {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-2);
  margin-bottom: 2rem;
  max-width: 50ch;
}
.contact-block {
  border-top: 1px solid var(--rule-2);
  border-bottom: 1px solid var(--rule-2);
}
.contact-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.5rem;
  padding: 0.9rem 0;
  border-bottom: 1px dashed var(--rule);
  align-items: baseline;
}
.contact-row:last-child { border-bottom: none; }
.contact-key {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.contact-val {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink);
}
.contact-val.link {
  color: var(--ink);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
  display: inline-block;
  width: fit-content;
  transition: color 0.15s ease;
}
.contact-val.link:hover { color: var(--accent); }
.dot { color: var(--accent-2); font-size: 10px; }

@media (max-width: 560px) {
  .contact-row { grid-template-columns: 1fr; gap: 0.2rem; }
}

/* =========================================================
   FOOTER
   ========================================================= */
.footer {
  border-top: 1px solid var(--rule);
  background: var(--paper);
  padding: 1.5rem var(--gutter);
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--mute);
  letter-spacing: 0.02em;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.footer-build { color: var(--mute-2); }

/* =========================================================
   Reveal — gentle, no flashy motion
   ========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .topbar-cursor { animation: none; }
}
