/* ============================================================
   Amjad Alrifaai — Portfolio
   Type: IBM Plex Sans + IBM Plex Mono
   ============================================================ */

:root {
  --paper: #F6F5F1;
  --surface: #FFFFFF;
  --ink: #191814;
  --ink-soft: #4B4942;
  --muted: #8A877E;
  --hairline: #E4E1D9;
  --hairline-strong: #D3CFC4;
  --accent: #2740E6;          /* tweakable */
  --accent-ink: #1B2DB0;
  --accent-wash: rgba(39, 64, 230, 0.07);

  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  --maxw: 1180px;
  --gutter: clamp(22px, 5vw, 84px);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; }

/* ---------- Top bar / masthead ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px var(--gutter);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-width: 0;
}
.brand__name {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand__role {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.topbar__status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}
.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #19a974;
  box-shadow: 0 0 0 0 rgba(25,169,116,0.5);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(25,169,116,0.45); }
  70% { box-shadow: 0 0 0 7px rgba(25,169,116,0); }
  100% { box-shadow: 0 0 0 0 rgba(25,169,116,0); }
}

/* ---------- HERO / big section header ---------- */
/* decorative icons that fly into the header after the title loads */
.hero__icons {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.hero__icon {
  position: absolute;
  display: block;
  color: var(--accent);
  opacity: 0;
  will-change: transform, opacity;
}
.hero__icon--ink { color: var(--ink); }
.hero__icon svg { display: block; width: 100%; height: 100%; }
@media (prefers-reduced-motion: reduce) {
  .hero__icon { opacity: 0.42; }
}
.hero {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(46px, 8vh, 96px) var(--gutter) clamp(30px, 5vh, 54px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.hero__kicker {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.hero__kicker::before {
  content: "";
  width: 30px; height: 1.5px;
  background: var(--accent);
  display: inline-block;
}
.hero__title {
  position: relative;
  z-index: 2;
  font-weight: 600;
  font-size: clamp(46px, 9.5vw, 132px);
  line-height: 0.96;
  letter-spacing: -0.035em;
  margin-top: 22px;
  max-width: 14ch;
  text-wrap: balance;
}
.hero__sub {
  position: relative;
  z-index: 2;
  margin-top: 24px;
  max-width: 56ch;
  font-size: clamp(16px, 1.8vw, 20px);
  color: var(--ink-soft);
  line-height: 1.55;
}
/* Entrance handled by WAAPI in JS (fill:none keeps resting state visible) */
.hero__inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.hero__inner.is-ghost {
  position: absolute;
  pointer-events: none;
  z-index: 2;
}

/* ---------- portrait on the About header ---------- */
.hero__media {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: clamp(340px, 44vw, 600px);
  margin: 0;
  display: none;
  z-index: 0;
  pointer-events: none;
}
.hero.show-media .hero__media { display: block; }
/* paper veil so centered text stays legible while the portrait emerges at right */
.hero.show-media::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to left, var(--paper) 32%, transparent 64%);
  z-index: 1;
  pointer-events: none;
}
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 16%;
  display: block;
  /* shaded from the side: dissolve the right (and a touch of the bottom) into the paper */
  -webkit-mask-image:
    linear-gradient(to left, transparent 0%, #000 46%),
    linear-gradient(to top, transparent 0%, #000 22%);
  mask-image:
    linear-gradient(to left, transparent 0%, #000 46%),
    linear-gradient(to top, transparent 0%, #000 22%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}
/* keep text legible above the image */
.hero.show-media .hero__kicker,
.hero.show-media .hero__title,
.hero.show-media .hero__sub { position: relative; z-index: 2; }
/* soft white shade behind the About title so it stays legible over the photo */
.hero.show-media .hero__title {
  text-shadow:
    0 1px 16px rgba(246, 245, 241, 0.92),
    0 0 36px rgba(246, 245, 241, 0.75);
}

/* On laptops/desktops: full-bleed header so the faded portrait reaches the
   actual left edge of the screen, and the icons stretch to both screen sides. */
@media (min-width: 821px) {
  .hero { max-width: none; }
}

/* Entrance via transitions: resting state is VISIBLE, so content always shows. */

/* ---------- NAV (page tabs) ---------- */
.nav {
  position: sticky;
  top: 61px;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.nav__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  gap: clamp(6px, 2vw, 30px);
  overflow-x: auto;
  scrollbar-width: none;
}
.nav__inner::-webkit-scrollbar { display: none; }
.nav__inner { position: relative; }
.nav__btn {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 17px 2px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--muted);
  transition: color 0.25s var(--ease);
  white-space: nowrap;
}
.nav__btn .idx {
  font-size: 11px;
  color: var(--hairline-strong);
  transition: color 0.25s var(--ease);
}
/* sliding active indicator — travels from the previous tab */
.nav__ind {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transform: translateX(0);
  transition: transform 0.42s var(--ease), width 0.42s var(--ease);
  pointer-events: none;
}
.nav__ind.no-anim { transition: none; }
.nav__btn:hover { color: var(--ink); }
.nav__btn:hover .idx { color: var(--accent); }
.nav__btn[aria-current="true"] { color: var(--ink); }
.nav__btn[aria-current="true"] .idx { color: var(--accent); }

/* ---------- CONTENT panels ---------- */
.content {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(44px, 7vh, 88px) var(--gutter) clamp(70px, 12vh, 140px);
}
.panel { display: none; }
.panel.is-active { display: block; }

/* section label */
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hairline);
}

/* ---------- About ---------- */
.lede {
  font-size: clamp(20px, 2.6vw, 30px);
  line-height: 1.42;
  letter-spacing: -0.015em;
  max-width: 24ch;
  font-weight: 500;
}
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(34px, 6vw, 90px);
  align-items: start;
  margin-top: 14px;
}
.about-body p { color: var(--ink-soft); font-size: 16.5px; margin-bottom: 18px; max-width: 54ch; }
.edu {
  border-top: 1px solid var(--hairline);
  padding-top: 22px;
  margin-top: 8px;
}
.edu__deg { font-weight: 600; font-size: 17px; }
.edu__meta { font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin-top: 6px; letter-spacing: 0.02em; }

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
}
.stat {
  background: var(--surface);
  padding: 26px 24px;
  transition: background 0.3s var(--ease);
}
.stat:hover { background: var(--accent-wash); }
.stat__num {
  font-family: var(--mono);
  font-weight: 600;
  font-size: clamp(34px, 4vw, 46px);
  letter-spacing: -0.02em;
  line-height: 1;
}
.stat__num .unit { color: var(--accent); }
.stat__label { font-size: 13px; color: var(--muted); margin-top: 10px; line-height: 1.35; }

/* ---------- Experience timeline ---------- */
.timeline { display: grid; gap: 0; }
.job {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: clamp(20px, 5vw, 60px);
  padding: 34px 0;
  border-top: 1px solid var(--hairline);
}
#page-experience .job:first-child { border-top: none; }
.job:last-child { border-bottom: 1px solid var(--hairline); }
.job__when {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--accent);
}
.job__org { color: var(--muted); margin-top: 8px; font-size: 13.5px; }
.job__title { font-weight: 600; font-size: clamp(21px, 2.6vw, 27px); letter-spacing: -0.02em; }
.job ul { list-style: none; margin-top: 16px; display: grid; gap: 11px; }
.job li {
  position: relative;
  padding-left: 22px;
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.5;
  max-width: 70ch;
}
.job li::before {
  content: "";
  position: absolute;
  left: 0; top: 10px;
  width: 7px; height: 7px;
  border: 1.5px solid var(--accent);
  transform: rotate(45deg);
}

/* ---------- Certifications ---------- */
.cards { display: grid; gap: 16px; }
.cert {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 28px 30px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.cert:hover { border-color: var(--accent); transform: translateX(6px); }
.cert.is-clickable { cursor: pointer; }
.cert.is-current { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.cert.has-preview { cursor: pointer; }
/* certificate image preview — expands below the card on click */
.cert__preview {
  grid-column: 1 / -1;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s cubic-bezier(0.22, 0.61, 0.36, 1), padding 0.3s ease;
  padding: 0;
}
.cert.is-open { border-color: var(--accent); transform: translateX(6px); }
.cert.is-open .cert__preview {
  max-height: 1000px;
  padding-top: 18px;
}
.cert__preview img {
  width: 100%;
  display: block;
  border: 1px solid var(--hairline);
  box-shadow: 0 20px 40px -20px rgba(25, 24, 20, 0.35);
}
.cert__mark {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  border: 1px solid var(--hairline-strong);
  border-radius: 50%;
  width: 52px; height: 52px;
  display: grid;
  place-items: center;
}
.cert__name { font-weight: 600; font-size: clamp(17px, 2vw, 21px); letter-spacing: -0.01em; }
.cert__meta { color: var(--muted); font-size: 13.5px; margin-top: 6px; font-family: var(--mono); letter-spacing: 0.01em; }
.cert__year { font-family: var(--mono); font-size: 13px; color: var(--ink-soft); white-space: nowrap; }

/* certifications sub-tabs — matches the main section nav */
.subnav {
  position: relative;
  display: flex;
  gap: clamp(6px, 2vw, 30px);
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 36px;
  overflow-x: auto;
  scrollbar-width: none;
}
/* sit flush directly under the main sections nav (cancel the content top gap) */
#page-certs, #page-experience { margin-top: calc(-1 * clamp(44px, 7vh, 88px)); }
.subnav::-webkit-scrollbar { display: none; }
.subnav__btn {
  position: relative;
  flex: 0 0 auto;
  padding: 16px 2px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--muted);
  transition: color 0.25s var(--ease);
  white-space: nowrap;
}
.subnav__btn:hover { color: var(--ink); }
.subnav__btn[aria-current="true"] { color: var(--ink); }
.subnav__ind {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transform: translateX(0);
  transition: transform 0.42s var(--ease), width 0.42s var(--ease);
  pointer-events: none;
}
.subnav__ind.no-anim { transition: none; }
.certgroup { display: none; }
.certgroup.is-active { display: block; }
.expgroup { display: none; }
.expgroup.is-active { display: block; }
/* photo + framed certificate gallery */
.certlayout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: clamp(26px, 4vw, 56px);
  align-items: start;
}
.certpic {
  margin: 0;
  position: sticky;
  top: 120px;
}
.certpic__photo {
  width: 100%;
  display: block;
  border: 1px solid var(--hairline-strong);
  box-shadow: 0 34px 60px -34px rgba(25, 24, 20, 0.45);
}
/* the certificate composited into the black frame he is holding */
.certframe {
  position: absolute;
  left: 20.3%;
  top: 60%;
  width: 25.4%;
  height: 28.6%;
  transform: rotate(5deg);
  transform-origin: center center;
  background: #0a0a0a;
  overflow: hidden;
  z-index: 1;
}
.certframe img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: opacity 0.28s var(--ease);
}
.certframe.is-swapping img { opacity: 0; }
.certpic__cap {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.01em;
  color: var(--muted);
}
.certpic__cap .cap-name { color: var(--ink); }
.certpic__cap .cap-count { flex: 0 0 auto; }
.certpic__arrow {
  position: absolute;
  bottom: 14px;
  z-index: 3;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--hairline-strong);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(6px);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.certpic__arrow--prev { left: 14px; }
.certpic__arrow--next { right: 14px; }
.certpic__arrow:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.certpic__arrow:active { transform: scale(0.92); }
.cert-empty {
  border: 1px dashed var(--hairline-strong);
  padding: 44px 32px;
  text-align: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: 0.01em;
}

/* ---------- Skills ---------- */
.skillset { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--hairline); border: 1px solid var(--hairline); }
.skillgrp { background: var(--surface); padding: 28px 28px 30px; }
.skillgrp h3 {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 13.5px;
  padding: 7px 13px;
  border: 1px solid var(--hairline-strong);
  border-radius: 100px;
  color: var(--ink-soft);
  transition: all 0.22s var(--ease);
  cursor: default;
}
.chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-wash); }

/* ---------- Home Lab — interactive topology ---------- */
.topo__hint-line {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 18px;
  letter-spacing: 0.02em;
}
.topo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 322px;
  gap: 16px;
  align-items: stretch;
}

/* device colours */
.tnode--router  { --c: #2740E6; }
.tnode--dreamax { --c: #2740E6; }
.tnode--pihole  { --c: #C0392B; }
.tnode--azurevm { --c: #0078D4; }
.tnode--kuma    { --c: #16A06B; }

.topo__stage {
  position: relative;
  height: 560px;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  overflow: hidden;
  background-color: #FBFAF6;
  background-image: radial-gradient(rgba(25, 24, 20, 0.09) 1px, transparent 1.5px);
  background-size: 24px 24px;
  background-position: -12px -12px;
}
.topo__wires {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}
.topo__view {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
}
.topo__stage.is-grabbing { cursor: grabbing; }
.topo__zoom {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 8;
  display: flex;
  gap: 6px;
}
.topo__zoom button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: 7px;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.topo__zoom button:hover { border-color: var(--accent); color: var(--accent); }
.wire { fill: none; stroke-linecap: round; }
.wire--net { stroke: #2740E6; stroke-width: 2; stroke-dasharray: 8 5; opacity: 0.62; }
.wire--mon { stroke: #16A06B; stroke-width: 1.6; stroke-dasharray: 2.5 7; opacity: 0.72; }
.wire--vpn { stroke: #7048E8; stroke-width: 3; stroke-dasharray: 11 7; opacity: 0.92; }
.wire--host { stroke: #0078D4; stroke-width: 2; opacity: 0.5; }

/* connection labels */
.wire-label {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 3;
  pointer-events: none;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding: 4px 9px;
  border-radius: 100px;
}
.wire-label--vpn {
  color: #fff;
  background: #7048E8;
  box-shadow: 0 6px 16px -8px rgba(112, 72, 232, 0.8);
}

/* zone bubbles — draggable; nodes are confined within these */
.topo__zone {
  position: absolute;
  border: 1.5px solid color-mix(in srgb, var(--z) 38%, var(--hairline));
  border-radius: 18px;
  background:
    linear-gradient(color-mix(in srgb, var(--z) 7%, transparent), color-mix(in srgb, var(--z) 3%, transparent));
  z-index: 0;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
}
.topo__zone.is-dragging { cursor: grabbing; }
.topo__zone-label { cursor: grab; }
.topo__zone.is-dragging .topo__zone-label { cursor: grabbing; }
.topo__zone-label {
  position: absolute;
  top: 4%;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: #fff;
  background: var(--z);
  padding: 4px 11px;
  border-radius: 100px;
  white-space: nowrap;
}

/* nodes */
.tnode {
  position: absolute;
  width: 76px;
  height: 76px;
  transform: translate(-50%, -50%);
  z-index: 2;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.tnode--dreamax { width: 92px; height: 92px; }
.tnode--azurevm { width: 86px; height: 86px; }
.tnode--square .tnode__disc { border-radius: 24%; }
.tnode.is-dragging { cursor: grabbing; z-index: 6; }
.tnode__disc {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--c);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 10px 24px -12px rgba(25, 24, 20, 0.5);
  transition: box-shadow 0.25s var(--ease), transform 0.12s var(--ease);
}
.tnode__disc svg { width: 60%; height: 60%; display: block; }
.tnode:hover .tnode__disc { box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px color-mix(in srgb, var(--c) 35%, transparent), 0 12px 26px -12px rgba(25, 24, 20, 0.5); }
.tnode:active .tnode__disc { transform: scale(0.96); }
.tnode.is-selected .tnode__disc {
  box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--c), 0 14px 30px -12px rgba(25, 24, 20, 0.55);
}
.tnode:focus-visible { outline: none; }
.tnode:focus-visible .tnode__disc { box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--c); }

.tnode__label, .tnode__sub {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  text-align: center;
  pointer-events: none;
}
.tnode__label {
  top: calc(100% + 10px);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.tnode__sub {
  top: calc(100% + 29px);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.07em;
  color: var(--muted);
}

/* detail panel */
.topo__panel {
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: var(--surface);
  padding: 26px 24px 28px;
  display: flex;
  flex-direction: column;
}
.topo__empty {
  margin: auto;
  text-align: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  letter-spacing: 0.02em;
  max-width: 22ch;
}
.topo__empty-mark {
  display: block;
  font-size: 30px;
  color: var(--hairline-strong);
  margin-bottom: 12px;
}
.tp__head { display: flex; align-items: center; gap: 14px; }
.tp__icon {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--c, var(--accent));
  display: grid;
  place-items: center;
}
.tp__icon svg { width: 26px; height: 26px; }
.tp__tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c, var(--accent));
}
.tp__title { font-weight: 600; font-size: 21px; letter-spacing: -0.02em; margin-top: 3px; }
.tp__body { color: var(--ink-soft); font-size: 14.5px; line-height: 1.55; margin-top: 16px; }
.tp__list {
  list-style: none;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
  display: grid;
  gap: 9px;
}
.tp__list li {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-soft);
  display: flex;
  gap: 9px;
  line-height: 1.45;
}
.tp__list li::before { content: "▸"; color: var(--c, var(--accent)); flex: 0 0 auto; }

/* Azure cloud documentation card */
.tp__cloud {
  margin-top: 18px;
  border: 1px solid color-mix(in srgb, #0078D4 35%, var(--hairline));
  border-radius: 8px;
  background: color-mix(in srgb, #0078D4 5%, var(--surface));
  overflow: hidden;
}
.tp__cloud-head {
  padding: 13px 15px 11px;
  border-bottom: 1px solid color-mix(in srgb, #0078D4 22%, var(--hairline));
  background: color-mix(in srgb, #0078D4 8%, transparent);
}
.tp__cloud-sub {
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: #0078D4;
}
.tp__cloud-title {
  display: block;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  margin-top: 3px;
  color: var(--ink);
}
.tp__crows { display: grid; }
.tp__crow {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  padding: 10px 15px;
}
.tp__crow + .tp__crow { border-top: 1px solid color-mix(in srgb, #0078D4 14%, var(--hairline)); }
.tp__crow dt {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.5;
}
.tp__crow dd {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* legend */
.topo__legend {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.lg { display: inline-flex; align-items: center; gap: 9px; }
.lg__line { width: 26px; border-top: 2px dashed; }
.lg__line--net { border-color: #2740E6; }
.lg__line--mon { border-color: #16A06B; }
.lg__line--vpn { border-color: #7048E8; border-top-width: 3px; }
.lg__line--host { border-color: #0078D4; border-top-style: solid; }
.topo__reset {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  background: none;
  border: 1px solid var(--hairline-strong);
  border-radius: 100px;
  padding: 7px 15px;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.topo__reset:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; gap: 1px; background: var(--hairline); border: 1px solid var(--hairline); }
.crow {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  align-items: center;
  gap: 20px;
  background: var(--surface);
  padding: 26px 30px;
  transition: background 0.3s var(--ease);
}
.crow:hover { background: var(--accent-wash); }
.crow__k { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.crow__v { font-size: clamp(17px, 2.2vw, 23px); font-weight: 500; letter-spacing: -0.01em; }
.crow__act { font-family: var(--mono); font-size: 12px; color: var(--accent); opacity: 0; transform: translateX(-6px); transition: all 0.3s var(--ease); }
.crow:hover .crow__act { opacity: 1; transform: translateX(0); }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .about-grid { grid-template-columns: 1fr; }
  .job { grid-template-columns: 1fr; gap: 14px; }
  .skillset, .lab-grid { grid-template-columns: 1fr; }
  .topo { grid-template-columns: 1fr; }
  .topo__stage { height: 440px; }
  .certlayout { grid-template-columns: 1fr; gap: 28px; }
  .certpic { position: static; max-width: 460px; }
  .cert { grid-template-columns: auto 1fr; }
  .cert__year { display: none; }
  .crow { grid-template-columns: 1fr; gap: 6px; }
  .crow__act { display: none; }
  .topbar__status { display: none; }
  .topbar { gap: 12px; }
  .brand { gap: 8px; flex-wrap: wrap; }
  .brand__role { font-size: 9px; letter-spacing: 0.02em; }

  /* phone: mirror the laptop About header — faded portrait on the left with a
     shade, the title over it, and the decorative icons visible */
  .hero { height: 340px !important; }
  .hero.show-media .hero__media { width: 56%; }
  .hero__media::after { right: -10px; bottom: -10px; }
}

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

/* ---------- Language toggle + RTL / Arabic ---------- */
.topbar__right {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.lang-toggle {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  background: none;
  border: 1px solid var(--hairline-strong);
  border-radius: 100px;
  padding: 6px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background 0.2s var(--ease);
}
.lang-toggle:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-wash); }

/* When Arabic is active, swap the type stack and flow direction */
html[dir="rtl"] {
  --sans: "IBM Plex Sans Arabic", "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Sans Arabic", "IBM Plex Mono", ui-monospace, monospace;
}
html[dir="rtl"] .hero__title { font-family: "IBM Plex Sans Arabic", "IBM Plex Sans", sans-serif !important; letter-spacing: 0; line-height: 1.12; }
html[dir="rtl"] .brand__role,
html[dir="rtl"] .topbar__status,
html[dir="rtl"] .eyebrow,
html[dir="rtl"] .job__when,
html[dir="rtl"] .chip,
html[dir="rtl"] .lang-toggle { letter-spacing: 0; text-transform: none; }
/* the lang toggle always shows its label in its own script — keep it readable */
html[dir="rtl"] .lang-toggle { font-family: "IBM Plex Sans", sans-serif; }
/* About portrait stays on the LEFT even in RTL */
/* Arabic renders small at a given px — scale the reading text up a notch */
html[dir="rtl"] .lede { font-size: clamp(23px, 2.7vw, 31px); }
html[dir="rtl"] .about-body p { font-size: 17.5px; line-height: 1.85; }
html[dir="rtl"] .nav__btn { font-size: 16px; }
html[dir="rtl"] .eyebrow { font-size: 15px; }
html[dir="rtl"] .job__title { font-size: 1.18em; }
html[dir="rtl"] .job ul li { font-size: 15.5px; line-height: 1.85; }
html[dir="rtl"] .job__when,
html[dir="rtl"] .job__org { font-size: 14px; }
html[dir="rtl"] .chip { font-size: 14px; }
html[dir="rtl"] .skillgrp h3 { font-size: 17px; }
html[dir="rtl"] .stat__label { font-size: 14px; }
html[dir="rtl"] .cert__name { font-size: 16.5px; }
html[dir="rtl"] .cert__meta { font-size: 13.5px; }
html[dir="rtl"] .crow__k { font-size: 14px; }
html[dir="rtl"] .topbar__status,
html[dir="rtl"] .brand__role { font-size: 13px; }
html[dir="rtl"] .tp__body { font-size: 15.5px; line-height: 1.8; }
html[dir="rtl"] .tp__list li { font-size: 14px; }
html[dir="rtl"] .tp__tag { font-size: 12px; }
html[dir="rtl"] .lg,
html[dir="rtl"] .topo__reset,
html[dir="rtl"] .topo__hint-line { font-size: 13px; }
html[dir="rtl"] .tnode__label { font-size: 15px; }
html[dir="rtl"] .tnode__sub { font-size: 11px; }
