/* ==========================================================================
   hashim.senmmar.com — portfolio
   Hand-written. No framework, no external requests.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;

  --wrap: 1140px;
  --pad: clamp(1.25rem, 4vw, 2.5rem);
  --radius: 14px;
  --radius-sm: 10px;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur: .45s;
}

html[data-theme="dark"] {
  --bg:        #070b10;
  --bg-alt:    #0a1017;
  --panel:     #0e151e;
  --panel-2:   #121b26;
  --line:      #1c2733;
  --line-soft: #151f2a;

  --text:      #e8eef5;
  --text-dim:  #b8c5d3;
  --muted:     #8496a8;

  --accent:      #5b95ff;
  --accent-2:    #7fb0ff;
  --accent-soft: rgba(91, 149, 255, .13);
  --accent-line: rgba(91, 149, 255, .32);
  --warm:        #ffb454;

  --shadow:    0 18px 50px -20px rgba(0, 0, 0, .85);
  --grid-line: rgba(255, 255, 255, .028);
}

html[data-theme="light"] {
  --bg:        #ffffff;
  --bg-alt:    #f5f8fc;
  --panel:     #ffffff;
  --panel-2:   #f7fafd;
  --line:      #e2e9f2;
  --line-soft: #edf2f8;

  --text:      #0d1722;
  --text-dim:  #33475c;
  --muted:     #61748a;

  --accent:      #1f5fd8;
  --accent-2:    #1a51ba;
  --accent-soft: rgba(31, 95, 216, .08);
  --accent-line: rgba(31, 95, 216, .25);
  --warm:        #b4700a;

  --shadow:    0 16px 40px -22px rgba(15, 35, 65, .35);
  --grid-line: rgba(13, 23, 34, .035);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}

h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -.02em; font-weight: 700; }
p { margin: 0 0 1rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
ul { margin: 0; padding: 0; list-style: none; }
img, svg { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--pad); }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--accent); color: #fff; padding: .7rem 1.1rem; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .78rem 1.4rem;
  font-size: .93rem; font-weight: 600; letter-spacing: -.01em;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .22s var(--ease), background-color .22s var(--ease),
              color .22s var(--ease), transform .22s var(--ease);
}
.btn:hover {
  color: var(--text);
  border-color: var(--accent-line);
  background: var(--accent-soft);
  transform: translateY(-2px);
}
.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn--primary:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: #fff;
}
.btn--sm { padding: .48rem 1rem; font-size: .82rem; }

.iconbtn {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: color .22s var(--ease), border-color .22s var(--ease), background-color .22s var(--ease);
}
.iconbtn:hover { color: var(--text); border-color: var(--accent-line); background: var(--accent-soft); }
.iconbtn svg { display: block; }
html[data-theme="dark"]  .icon-sun  { display: none; }
html[data-theme="light"] .icon-moon { display: none; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background-color .3s var(--ease);
}
.nav.is-stuck { border-bottom-color: var(--line); }

.nav__inner {
  display: flex; align-items: center; gap: 1.5rem;
  height: 68px;
}

.nav__brand { display: flex; align-items: center; gap: .65rem; color: var(--text); flex-shrink: 0; }
.nav__mark {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  font-family: var(--font-mono); font-size: .72rem; font-weight: 700; letter-spacing: .02em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 9px;
}
.nav__name { font-weight: 650; font-size: .95rem; letter-spacing: -.015em; }

.nav__links { display: flex; gap: .35rem; margin-inline: auto; }
.nav__links a {
  position: relative;
  padding: .45rem .8rem;
  font-size: .875rem; font-weight: 500;
  color: var(--muted);
  border-radius: 8px;
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.nav__links a:hover { color: var(--text); background: var(--line-soft); }
.nav__links a.is-active { color: var(--text); }
.nav__links a.is-active::after {
  content: ""; position: absolute; left: 50%; bottom: 1px;
  width: 16px; height: 2px; margin-left: -8px;
  background: var(--accent); border-radius: 2px;
}

.nav__actions { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }

.nav__progress {
  height: 2px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--warm));
  transition: width .1s linear;
}

.burger {
  display: none;
  flex-direction: column; justify-content: center; gap: 5px;
  width: 38px; height: 38px; padding: 0 9px;
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  cursor: pointer;
}
.burger span {
  display: block; height: 1.8px; width: 100%;
  background: var(--text); border-radius: 2px;
  transition: transform .28s var(--ease), opacity .2s var(--ease);
}
.burger.is-open span:nth-child(1) { transform: translateY(6.8px) rotate(45deg); }
.burger.is-open span:nth-child(2) { opacity: 0; }
.burger.is-open span:nth-child(3) { transform: translateY(-6.8px) rotate(-45deg); }

/* `display` here would otherwise beat the [hidden] attribute the script toggles,
   so every element driven by `hidden` restates it explicitly. */
[hidden] { display: none !important; }

.mobile {
  display: none;
  flex-direction: column;
  padding: .5rem var(--pad) 1.1rem;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.mobile a {
  padding: .85rem .25rem;
  color: var(--text-dim);
  font-weight: 500;
  border-bottom: 1px solid var(--line-soft);
}
.mobile a:last-child { border-bottom: 0; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: flex; align-items: center;
  min-height: min(100svh, 900px);
  padding: 8.5rem 0 5rem;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero__grid {
  position: absolute; inset: -20% -10% auto -10%; height: 140%;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: radial-gradient(ellipse 75% 60% at 50% 35%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 75% 60% at 50% 35%, #000 20%, transparent 78%);
  pointer-events: none;
}
.hero__glow {
  position: absolute; top: -22%; left: 50%; transform: translateX(-50%);
  width: min(1000px, 130%); aspect-ratio: 1.6;
  background: radial-gradient(ellipse at center, var(--accent-soft), transparent 62%);
  filter: blur(20px);
  pointer-events: none;
}
.hero__inner { position: relative; }

.eyebrow {
  /* Must be able to wrap: on a narrow phone this pill is wider than the
     viewport, and an unwrappable line here stretches the whole document. */
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: .1rem .55rem;
  max-width: 100%;
  padding: .38rem .85rem .38rem .7rem;
  margin: 0 0 1.6rem;
  font-family: var(--font-mono); font-size: .755rem; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-dim);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.eyebrow__sep { color: var(--muted); opacity: .6; }
.dot {
  flex-shrink: 0;
  width: 7px; height: 7px; border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, .55);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  70%  { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.hero__title {
  font-size: clamp(2.6rem, 8.2vw, 5.4rem);
  font-weight: 800;
  letter-spacing: -.038em;
  margin-bottom: .9rem;
  background: linear-gradient(170deg, var(--text) 30%, color-mix(in srgb, var(--text) 55%, var(--accent)) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__role {
  font-size: clamp(1rem, 2.4vw, 1.32rem);
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: -.015em;
  margin-bottom: 1.5rem;
}
.hero__role .sep { color: var(--accent); margin-inline: .45rem; font-weight: 400; }

.hero__lede {
  max-width: 62ch;
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  color: var(--muted);
  margin-bottom: 2.4rem;
}
.hero__lede a { border-bottom: 1px solid var(--accent-line); }

.hero__cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 4rem; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: 0;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.stat { padding: 1.25rem 1.35rem; background: var(--panel); }
.stat dt {
  font-size: .74rem; font-weight: 500; letter-spacing: .015em;
  color: var(--muted);
  margin-bottom: .3rem;
}
.stat dd {
  margin: 0;
  font-size: clamp(1.7rem, 3.4vw, 2.15rem);
  font-weight: 750;
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
}
.stat .plus { color: var(--accent); }

/* ---------- Section shell ---------- */
.section { padding: clamp(4.5rem, 9vw, 7.5rem) 0; }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--line); }

.sechead { margin-bottom: clamp(2.2rem, 4vw, 3.2rem); }
.sechead__num {
  display: block;
  font-family: var(--font-mono); font-size: .78rem; letter-spacing: .12em;
  color: var(--accent);
  margin-bottom: .55rem;
}
.sechead h2 {
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  letter-spacing: -.032em;
}
.sechead__sub {
  max-width: 58ch;
  margin: .7rem 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

/* ---------- About ---------- */
.about {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}
.about__text p { color: var(--muted); font-size: 1.03rem; }
.about__text .lead { font-size: 1.16rem; color: var(--text-dim); }
.about__text strong { color: var(--text); font-weight: 650; }

.about__card {
  padding: 1.6rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.about__card h3 {
  font-size: .78rem; font-family: var(--font-mono); letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.1rem;
}
.kv li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: .62rem 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: .88rem;
}
.kv li:last-child { border-bottom: 0; }
.kv span { color: var(--muted); flex-shrink: 0; }
.kv strong { font-weight: 600; text-align: right; }

.about__stack { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1.3rem; }
.tag {
  padding: .28rem .65rem;
  font-family: var(--font-mono); font-size: .715rem; letter-spacing: -.005em;
  color: var(--text-dim);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 7px;
}

/* ---------- Expertise cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 1rem;
}
.card {
  position: relative;
  padding: 1.7rem 1.5rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .28s var(--ease), transform .28s var(--ease), box-shadow .28s var(--ease);
}
.card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0;
  transition: opacity .28s var(--ease);
}
.card:hover { transform: translateY(-4px); border-color: var(--accent-line); box-shadow: var(--shadow); }
.card:hover::before { opacity: 1; }
.card__icon {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  margin-bottom: 1.1rem;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 11px;
}
.card h3 { font-size: 1.08rem; margin-bottom: .55rem; }
.card p { margin: 0; font-size: .9rem; color: var(--muted); line-height: 1.62; }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 1.9rem; }
.timeline::before {
  content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px;
  width: 1px;
  background: linear-gradient(180deg, var(--accent-line), var(--line) 45%, transparent);
}
.tl { position: relative; padding-bottom: 2.6rem; }
.tl:last-child { padding-bottom: 0; }
.tl__marker {
  position: absolute; left: -1.9rem; top: .5rem;
  width: 11px; height: 11px;
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: 50%;
}
.tl:first-child .tl__marker { border-color: var(--accent); background: var(--accent); }
.tl__pulse {
  position: absolute; inset: -4px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  opacity: .5;
  animation: ring 2.6s ease-out infinite;
}
@keyframes ring {
  0%   { transform: scale(.6); opacity: .7; }
  100% { transform: scale(2.1); opacity: 0; }
}
.section--alt .tl__marker { background: var(--bg-alt); }

.tl__head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem;
}
.tl__head h3 { font-size: 1.22rem; }
.tl__when {
  font-family: var(--font-mono); font-size: .765rem; letter-spacing: .01em;
  color: var(--muted);
  white-space: nowrap;
}
.tl__org {
  margin: .3rem 0 1rem;
  font-size: .9rem; font-weight: 550;
  color: var(--accent);
}
.tl__list li {
  position: relative;
  padding-left: 1.15rem;
  margin-bottom: .58rem;
  font-size: .95rem;
  color: var(--muted);
  line-height: 1.62;
}
.tl__list li::before {
  content: ""; position: absolute; left: 0; top: .68em;
  width: 5px; height: 1px;
  background: var(--muted);
  opacity: .65;
}
.tl__list strong { color: var(--text-dim); font-weight: 600; }

/* ---------- Projects ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.7rem; }
.chip {
  padding: .45rem 1rem;
  font-family: inherit; font-size: .83rem; font-weight: 550;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: color .2s var(--ease), border-color .2s var(--ease), background-color .2s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--accent-line); }
.chip.is-active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 1rem;
}
.proj {
  display: flex; flex-direction: column;
  padding: 1.6rem 1.5rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .28s var(--ease), transform .28s var(--ease), box-shadow .28s var(--ease);
}
.proj:hover { transform: translateY(-4px); border-color: var(--accent-line); box-shadow: var(--shadow); }
.proj.is-hidden { display: none; }

.proj__head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.proj__head h3 { font-size: 1.18rem; }
.proj__badge {
  padding: .2rem .6rem;
  font-family: var(--font-mono); font-size: .66rem; letter-spacing: .05em; text-transform: uppercase;
  color: #22c55e;
  background: rgba(34, 197, 94, .1);
  border: 1px solid rgba(34, 197, 94, .3);
  border-radius: 999px;
  white-space: nowrap;
}
.proj__badge--alt {
  color: var(--muted);
  background: var(--panel-2);
  border-color: var(--line);
}
.proj__badge--gov {
  color: var(--warm);
  background: color-mix(in srgb, var(--warm) 12%, transparent);
  border-color: color-mix(in srgb, var(--warm) 32%, transparent);
}
.proj__kicker {
  margin: .45rem 0 .85rem;
  font-size: .85rem; font-weight: 550;
  color: var(--accent);
}
.proj__body {
  flex: 1;
  margin: 0 0 1.15rem;
  font-size: .915rem;
  color: var(--muted);
  line-height: 1.63;
}
.proj__body strong { color: var(--text-dim); font-weight: 600; }
.proj__meta {
  display: flex; flex-wrap: wrap; gap: .38rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line-soft);
}
.proj__meta li {
  padding: .24rem .58rem;
  font-family: var(--font-mono); font-size: .69rem;
  color: var(--text-dim);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.projects__empty { margin-top: 2rem; color: var(--muted); text-align: center; }

/* ---------- Credentials ---------- */
.creds {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}
.creds__title {
  font-family: var(--font-mono); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.1rem;
}
.creds__title--spaced { margin-top: 2.4rem; }

.certs li {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .3rem 1rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--line-soft);
}
.certs li:last-child { border-bottom: 0; }
.certs div { font-size: .93rem; color: var(--muted); }
.certs strong { color: var(--text); font-weight: 600; }
.certs > li > span {
  font-family: var(--font-mono); font-size: .74rem;
  color: var(--muted);
  white-space: nowrap;
}

.edu {
  display: flex; flex-direction: column; gap: .28rem;
  padding: 1.3rem 1.4rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius-sm);
}
.edu strong { font-size: 1.02rem; }
.edu span { font-size: .88rem; color: var(--muted); }
.edu__date { font-family: var(--font-mono); font-size: .75rem !important; }

.langs li {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: .2rem .8rem;
  margin-bottom: 1rem;
}
.langs span { font-size: .93rem; font-weight: 600; }
.langs em { font-style: normal; font-size: .78rem; color: var(--muted); }
.langs i {
  grid-column: 1 / -1;
  height: 4px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.langs i::after {
  content: ""; display: block; height: 100%;
  width: var(--lvl);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
}

/* ---------- Contact ---------- */
.section--contact {
  position: relative;
  background:
    radial-gradient(ellipse 70% 100% at 50% 0%, var(--accent-soft), transparent 70%),
    var(--bg);
  border-top: 1px solid var(--line);
}
.contact { max-width: 780px; margin-inline: auto; text-align: center; }
.contact h2 {
  font-size: clamp(1.9rem, 4.6vw, 3rem);
  letter-spacing: -.035em;
  margin-bottom: 1rem;
}
.contact__lede {
  max-width: 58ch; margin-inline: auto; margin-bottom: 2.4rem;
  color: var(--muted);
  font-size: 1.03rem;
}
.contact__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: .75rem;
  margin-bottom: 2.4rem;
  text-align: left;
}
.ccard {
  display: flex; flex-direction: column; gap: .18rem;
  padding: 1.05rem 1.2rem;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color .24s var(--ease), transform .24s var(--ease), background-color .24s var(--ease);
}
.ccard:hover { transform: translateY(-3px); border-color: var(--accent-line); background: var(--panel-2); color: var(--text); }
.ccard__label {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
}
.ccard strong { font-size: .93rem; font-weight: 600; word-break: break-word; }

.contact__cta { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; }

/* ---------- Footer ---------- */
.footer { padding: 2.2rem 0; border-top: 1px solid var(--line); background: var(--bg); }
.footer__inner {
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; justify-content: space-between;
}
.footer p { margin: 0; font-size: .83rem; color: var(--muted); }
.footer__meta { font-family: var(--font-mono); font-size: .75rem !important; opacity: .8; }

/* ---------- Back to top ---------- */
.totop {
  position: fixed; right: 1.4rem; bottom: 1.4rem; z-index: 90;
  display: grid; place-items: center;
  width: 42px; height: 42px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .25s var(--ease), border-color .25s var(--ease), opacity .25s var(--ease);
}
.totop:hover { transform: translateY(-3px); border-color: var(--accent-line); }

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .about, .creds { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .nav__links { display: none; }
  .burger { display: flex; }
  .mobile { display: flex; }
  .nav__name { display: none; }
  .nav__brand { margin-right: auto; }
  html { scroll-padding-top: 78px; }
}

@media (max-width: 560px) {
  .eyebrow { font-size: .68rem; letter-spacing: .02em; }
  .hero { padding-top: 7rem; min-height: auto; }
  .hero__cta { margin-bottom: 3rem; }
  .hero__cta .btn { flex: 1 1 auto; }
  .projects { grid-template-columns: 1fr; }
  .stat { padding: 1rem 1.05rem; }
  .footer__inner { justify-content: center; text-align: center; }
  .totop { right: 1rem; bottom: 1rem; }
}

/* ---------- Motion / print ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .nav, .totop, .filters, .hero__grid, .hero__glow, .hero__cta, .footer__meta { display: none !important; }
  body { background: #fff; color: #000; }
  .reveal { opacity: 1; transform: none; }
  .section, .hero { padding: 1rem 0; border: 0; }
  .proj, .card, .about__card, .edu { break-inside: avoid; border: 1px solid #ccc; }
}
