/* ===============================================================
   style.css - Suleiman Ahmed portfolio
   Design tokens (colours, type, radius) are the custom properties
   on :root and html[data-theme="dark"]. Print and reduced-motion
   rules are at the end of the file.
   =============================================================== */

:root {
  --bg: #f3f7fa;
  --fg: #0c1a28;
  --mut: #4d6074;
  --line: rgba(12, 26, 40, .11);
  --card: rgba(255, 255, 255, .78);
  --accent: #0a7480; /* 5.1:1 on --bg (WCAG AA for text) */
  --g1: #0284c7;
  --g2: #0d9488;
  --glow1: rgba(2, 132, 199, .13);
  --glow2: rgba(13, 148, 136, .12);
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --r: 22px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #07101a;
  --fg: #e9f1f7;
  --mut: #93a8ba;
  --line: rgba(255, 255, 255, .09);
  --card: rgba(255, 255, 255, .04);
  --accent: #4fd1c5;
  --g1: #38bdf8;
  --g2: #2dd4bf;
  --glow1: rgba(56, 189, 248, .14);
  --glow2: rgba(45, 212, 191, .10);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: clamp(16px, .94rem + .2vw, 17.5px)/1.7 var(--sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color .4s, color .4s;
  animation: pagein .5s ease-out;
}

body.leaving {
  opacity: 0;
  transition: opacity .2s ease-in;
}

@keyframes pagein {
  from {
    opacity: 0;
  }
}


main:focus {
  outline: none;
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 100;
  background: linear-gradient(90deg, var(--g1), var(--g2));
  transform-origin: 0 50%;
  transform: scaleX(0);
  will-change: transform;
  pointer-events: none;
}

.glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  contain: strict;
}

.glow i {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}

.glow i:first-child {
  width: 900px;
  height: 900px;
  left: -300px;
  top: -420px;
  background: radial-gradient(closest-side, var(--glow1), transparent);
  animation: drift1 30s ease-in-out infinite alternate;
}

.glow i:last-child {
  width: 820px;
  height: 820px;
  right: -280px;
  top: -200px;
  background: radial-gradient(closest-side, var(--glow2), transparent);
  animation: drift2 36s ease-in-out infinite alternate;
}

@keyframes drift1 {
  to {
    transform: translate3d(180px, 140px, 0);
  }
}


@keyframes drift2 {
  to {
    transform: translate3d(-200px, 180px, 0);
  }
}


a {
  color: inherit;
}

img,
svg {
  max-width: 100%;
}

p {
  margin: 0 0 1em;
  color: var(--mut);
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 650;
  letter-spacing: -.025em;
  line-height: 1.12;
}

h3 {
  font-size: 1.05rem;
  letter-spacing: -.01em;
  color: var(--fg);
}

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

.wrap {
  width: min(1180px, calc(100% - clamp(32px, 6vw, 80px)));
  margin-inline: auto;
}

.skip {
  position: absolute;
  top: -80px;
  left: 10px;
  background: var(--bg);
  padding: 10px 14px;
  z-index: 300;
  border-radius: 8px;
}

.skip:focus {
  top: 8px;
}

.bar {
  position: sticky;
  top: 12px;
  z-index: 50;
  padding: 0 clamp(12px, 3vw, 32px);
}

.bar-in {
  position: relative;
  max-width: 1140px;
  margin: 12px auto 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .12);
  animation: drop .8s var(--ease);
}

@keyframes drop {
  from {
    opacity: 0;
    transform: translate3d(0, -20px, 0);
  }
}


.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 650;
  margin-right: auto;
}

.mk {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--g1), var(--g2));
  color: #fff;
  font-size: .74rem;
  font-weight: 700;
  transition: transform .6s var(--ease);
}

.brand:hover .mk {
  transform: rotate(360deg);
}

.nav-list {
  display: flex;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nl {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--mut);
  font: 500 .91rem var(--sans);
  text-decoration: none;
  transition: color .2s, background-color .2s;
}

.nl::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 7px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--g1), var(--g2));
  transform: scaleX(0);
  transition: transform .4s var(--ease);
}

.nl:hover {
  color: var(--fg);
}

.nl:hover::after,
.nl[aria-current]::after {
  transform: scaleX(1);
}

.nl[aria-current] {
  color: var(--fg);
  background: var(--card);
}

.ic {
  width: 20px;
  height: 20px;
  flex: none;
}

.ic.sm {
  width: 16px;
  height: 16px;
}

.ic.xs {
  width: 12px;
  height: 12px;
}

.tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.soc {
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.soc a,
.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--fg);
  cursor: pointer;
  transition: transform .4s var(--ease), background-color .3s, color .3s, border-color .3s;
}

.soc a:hover,
.icon-btn:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--g1), var(--g2));
  border-color: transparent;
  transform: translate3d(0, -3px, 0);
}

.icon-btn svg {
  transition: transform .6s var(--ease);
}

.icon-btn:hover svg {
  transform: rotate(25deg);
}

.mini a {
  border-color: transparent;
  background: none;
  width: 40px;
  height: 40px;
}

[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  translate: -50% 0;
  padding: 3px 9px;
  border-radius: 7px;
  background: var(--fg);
  color: var(--bg);
  font: 500 .72rem var(--sans);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
}

[data-tip]:hover::after,
[data-tip]:focus-visible::after {
  opacity: 1;
}

.footer [data-tip]::after {
  top: auto;
  bottom: calc(100% + 8px);
}

.i-moon {
  display: none;
}

html[data-theme="dark"] .i-sun {
  display: none;
}

html[data-theme="dark"] .i-moon {
  display: block;
}

.menu-btn {
  display: none;
}

.ani {
  opacity: 0;
  animation: rise 1s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 80ms + 100ms);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translate3d(0, 22px, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}


.w {
  display: inline-block;
  opacity: 0;
  animation: word 1s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 100ms + 120ms);
}

@keyframes word {
  from {
    opacity: 0;
    transform: translate3d(0, 40%, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}


.hero {
  padding: clamp(40px, 7vw, 100px) 0 clamp(24px, 4vw, 50px);
}

.hero-g {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font: 500 .82rem var(--sans);
}

.status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  animation: p 2.2s infinite;
}

@keyframes p {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, .6);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(52, 211, 153, 0);
  }
}


h1 {
  font-size: clamp(2.6rem, 1.2rem + 5.6vw, 5.4rem);
  line-height: 1;
  letter-spacing: -.04em;
  margin: .4em 0 .35em;
  max-width: 14ch;
}

.grad {
  background: linear-gradient(120deg, var(--g1), var(--g2), var(--g1));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: word 1s var(--ease) forwards, shine 8s linear 1.4s infinite;
  animation-delay: calc(var(--i, 0) * 100ms + 120ms), 0s;
}

@keyframes shine {
  to {
    background-position: -200% 0;
  }
}


.lede {
  font-size: clamp(1.15rem, 1rem + .8vw, 1.5rem);
  line-height: 1.4;
  color: var(--fg);
  max-width: 28ch;
}

.words {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0 0 6px;
}

.words li {
  padding: 5px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .88rem;
  background: var(--card);
}

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
}

.cta .soc {
  margin-left: 6px;
}

.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--fg);
  font: 600 .93rem var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: transform .4s var(--ease), border-color .3s, box-shadow .4s, background-color .3s, color .3s;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, .3) 50%, transparent 70%);
  transform: translate3d(-120%, 0, 0);
  transition: transform .8s var(--ease);
}

.btn:hover::before {
  transform: translate3d(120%, 0, 0);
}

.btn .ic {
  transition: transform .4s var(--ease);
}

.btn:hover .ic {
  transform: translate3d(4px, 0, 0);
}

.btn:hover {
  transform: translate3d(0, -3px, 0);
  border-color: var(--accent);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .18);
}

.btn.pri {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.btn.pri:hover {
  background: linear-gradient(135deg, var(--g1), var(--g2));
  color: #fff;
  border-color: transparent;
}

.btn[disabled] {
  opacity: .6;
  pointer-events: none;
}

.hero-art {
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .28);
}

.hero-art img {
  width: 100%;
  height: auto;
  display: block;
}

.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}

.facts p {
  margin: 0;
  padding: 18px 22px;
  background: var(--bg);
  font-size: .9rem;
}

.facts b {
  display: block;
  font-size: 1.5rem;
  letter-spacing: -.03em;
  color: var(--fg);
}

.recent {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  overflow: hidden;
}

.recent a {
  display: grid;
  grid-template-columns: 96px 1fr 20px;
  gap: 16px;
  align-items: center;
  padding: 16px clamp(16px, 2.5vw, 26px);
  border-top: 1px solid var(--line);
  text-decoration: none;
  transition: background-color .3s, padding .4s var(--ease);
}

.recent li:first-child a {
  border-top: 0;
}

.recent a:hover {
  background: var(--glow1);
  padding-left: clamp(22px, 3vw, 34px);
}

.recent .rt {
  display: block;
  font-weight: 600;
  line-height: 1.4;
}

.recent .rt b {
  display: block;
  font: 700 .66rem var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--mut);
  margin-bottom: 2px;
}

.recent small {
  display: block;
  font-weight: 400;
  color: var(--mut);
  font-size: .8rem;
  margin-top: 2px;
}

.recent .ic {
  color: var(--accent);
  width: 18px;
  height: 18px;
}

.quote {
  margin: 0;
  padding: clamp(10px, 3vw, 30px) 0;
  text-align: center;
}

.quote p {
  font-size: clamp(1.5rem, 1rem + 2.4vw, 2.6rem);
  line-height: 1.2;
  letter-spacing: -.03em;
  color: var(--fg);
  font-weight: 600;
  max-width: 24ch;
  margin: 0 auto .6em;
}

.quote cite {
  font-style: normal;
  font-size: .85rem;
  color: var(--mut);
}

.sec {
  padding: clamp(26px, 4.5vw, 64px) 0;
}

.eb {
  font: 700 .76rem var(--sans);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.phead {
  padding: clamp(36px, 6vw, 80px) 0 0;
}

.phead h1 {
  font-size: clamp(2.1rem, 1.2rem + 3.6vw, 4rem);
  max-width: 20ch;
}

.lede2 {
  font-size: 1.1rem;
  max-width: 60ch;
  margin-top: 16px;
}

.ntiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.ntile:last-child {
  grid-column: 1/-1;
  min-height: 150px;
}

.ntile,
.themes li,
.rcard {
  --mx: 50%;
  --my: 50%;
}

.ntile {
  position: relative;
  display: block;
  padding: clamp(22px, 3vw, 32px);
  min-height: 210px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  text-decoration: none;
  overflow: hidden;
  transition: transform .6s var(--ease), border-color .3s, box-shadow .4s;
}

.ntile::before,
.themes li::before,
.rcard::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at var(--mx) var(--my), var(--glow1), var(--glow2) 40%, transparent 70%);
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
}

.ntile:hover {
  border-color: var(--accent);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .2);
}

.ntile:hover::before,
.themes li:hover::before,
.rcard:hover::before {
  opacity: 1;
}

.ntile.tilting {
  transition: transform .12s ease-out, border-color .3s, box-shadow .4s;
}

.ntile>* {
  position: relative;
}

.nn {
  font: 700 .8rem var(--sans);
  color: var(--accent);
}

.ntile h2 {
  font-size: 1.6rem;
  margin: 12px 0 8px;
}

.ntile p {
  margin: 0;
  font-size: .95rem;
}

.go {
  position: absolute!important;
  right: 22px;
  bottom: 20px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  transition: transform .5s var(--ease), background-color .3s, color .3s;
}

.ntile:hover .go {
  background: var(--fg);
  color: var(--bg);
  transform: translate3d(6px, 0, 0) rotate(-45deg);
}

.big {
  font-size: clamp(1.3rem, 1rem + 1.1vw, 1.8rem);
  line-height: 1.3;
  letter-spacing: -.02em;
  color: var(--fg);
  font-weight: 550;
  margin: 0 0 .7em;
}

.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(18px, 4vw, 56px);
}

.themes {
  list-style: none;
  margin: 34px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.themes li {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
}

.themes li>* {
  position: relative;
}

.themes span {
  font-weight: 700;
  font-size: .8rem;
  color: var(--accent);
}

.themes h2 {
  font-size: 1.2rem;
  margin: 10px 0 8px;
}

.themes p {
  margin: 0;
  font-size: .95rem;
}

.h2 {
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem);
  margin-bottom: 22px;
}

.tools-g {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.tool {
  display: flex;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  font-size: .92rem;
  font-weight: 550;
}

.tl {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  color: inherit;
  text-decoration: none;
}

.tl .ic {
  margin-left: auto;
  color: var(--mut);
  opacity: .6;
  flex: none;
  transition: transform .4s var(--ease), opacity .3s;
}

.tool:hover .tl .ic {
  opacity: 1;
  transform: translate3d(2px, -2px, 0);
}

.lg {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .08);
  overflow: hidden;
}

.lg b {
  font: 700 .78rem var(--sans);
  color: #4a5568;
  letter-spacing: .02em;
}

.lg img {
  position: absolute;
  inset: 7px;
  width: 28px;
  height: 28px;
  object-fit: contain;
  background: #fff;
}

.lg.org {
  width: 48px;
  height: 48px;
  border-radius: 14px;
}

.lg.org img {
  inset: 8px;
  width: 32px;
  height: 32px;
}

.lg.mono {
  background: linear-gradient(135deg, var(--g1), var(--g2));
  border-color: transparent;
}

.lg.mono b {
  color: #fff;
  font-size: .8rem;
}

.lg.wide {
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 112px;
  padding: 0 8px;
}

.lg.wide img {
  position: static;
  inset: auto;
  width: auto;
  height: auto;
  max-width: 100px;
  max-height: 30px;
  object-fit: contain;
}

.lg.wide:has(img) b {
  display: none;
}

.lg.org.wide {
  min-width: 96px;
  height: 48px;
}

.lg.org.wide img {
  max-width: 84px;
  max-height: 34px;
  width: auto;
  height: auto;
}

.tl:has(.wide img)>span:not(.lg) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.skills {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.sk {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
}

.sk h3 {
  margin-bottom: 12px;
}

.sk ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sk li {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--glow1);
  font-size: .85rem;
  color: var(--fg);
  transition: background-color .25s, color .25s;
}

.sk li:hover {
  background: var(--accent);
  color: var(--bg);
}

.projs {
  display: grid;
  gap: clamp(20px, 3vw, 34px);
}

.proj {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(20px, 3.5vw, 48px);
  align-items: center;
  padding: clamp(14px, 2vw, 22px);
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--card);
  scroll-margin-top: 100px;
}

.proj.rev figure {
  order: 2;
}

.proj figure {
  margin: 0;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
}

.proj img {
  width: 100%;
  height: auto;
  display: block;
}

.pb {
  padding: clamp(4px, 1.5vw, 18px);
}

.pst {
  font: 700 .74rem var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.proj h2 {
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.2rem);
  margin-bottom: 14px;
}

.role {
  font-size: .93rem;
  margin-bottom: .5em;
}

.role b {
  display: block;
  color: var(--fg);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-weight: 600;
  font-size: .92rem;
  text-decoration: none;
  color: var(--accent);
}

.more .ic {
  transition: transform .4s var(--ease);
}

.more:hover .ic {
  transform: translate3d(6px, 0, 0);
}

.pubbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.pubbar .filters {
  margin: 0;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.filters button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--mut);
  font: 500 .9rem var(--sans);
  cursor: pointer;
  transition: transform .3s var(--ease), color .2s, background-color .2s;
}

.filters button:hover {
  color: var(--fg);
  transform: translate3d(0, -2px, 0);
}

.filters button[aria-pressed="true"] {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.kfilter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 26px;
}

.kfilter span {
  font: 700 .72rem var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--mut);
  margin-right: 4px;
}

.kfilter button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--mut);
  font: 500 .85rem var(--sans);
  cursor: pointer;
  transition: color .2s, background-color .2s, transform .3s var(--ease);
}

.kfilter button:hover {
  color: var(--fg);
  transform: translate3d(0, -2px, 0);
}

.kfilter button[aria-pressed="true"] {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.panel {
  padding: clamp(20px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  scroll-margin-top: 100px;
}

.pubs,
.rows,
.orgs {
  list-style: none;
  margin: 0;
}

.rows,
.orgs {
  padding: 0;
}

.pubs {
  padding: clamp(8px, 2vw, 16px) clamp(20px, 3vw, 34px);
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.ph {
  font-size: .76rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.pub {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 18px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.pub:first-child {
  border-top: 0;
}

.py,
.rd {
  font: 600 .84rem var(--sans);
  color: var(--accent);
}

.pk {
  font: 700 .7rem var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--mut);
  margin: 0 0 4px;
}

.pt {
  color: var(--fg);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.4;
  margin: 0 0 4px;
}

.pm {
  font-size: .9rem;
  margin: 0 0 .4em;
}

.pub:target {
  box-shadow: 0 0 0 8px var(--card), 0 0 0 9px var(--accent);
  border-radius: 6px;
}

.cite {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--mut);
  font: 500 .78rem var(--sans);
  cursor: pointer;
  transition: color .2s, border-color .2s;
}

.cite:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.cite.done {
  color: var(--accent);
  border-color: var(--accent);
}

.pubbar .cite {
  margin: 0;
  min-height: 40px;
  padding: 0 16px;
  font-size: .85rem;
}

.row {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.row:first-child {
  border-top: 0;
}

.rd {
  display: block;
  margin-bottom: 8px;
}

.rb {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.sub {
  font-size: .9rem;
  margin: 2px 0 6px;
}

.row p:last-child {
  margin-bottom: 0;
  font-size: .95rem;
}

.orgs li a {
  display: grid;
  grid-template-columns: 104px 1fr 24px;
  align-items: center;
  gap: 16px;
  min-height: 68px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  transition: padding .4s var(--ease), color .3s;
}

.orgs li:first-child a {
  border-top: 0;
}

.orgs a:hover {
  padding-left: 12px;
  color: var(--accent);
}

.orgs small {
  display: block;
  color: var(--mut);
  font-size: .82rem;
}

.orgs .lg {
  justify-self: start;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: .88rem;
  font-weight: 550;
  text-decoration: none;
  transition: transform .3s var(--ease), border-color .3s, color .3s;
}

.chip:hover {
  transform: translate3d(0, -2px, 0);
  border-color: var(--accent);
  color: var(--accent);
}

.rlist {
  display: grid;
  gap: 22px;
}

.rcard {
  position: relative;
  overflow: hidden;
  padding: clamp(20px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--card);
  scroll-margin-top: 100px;
}

.rcard>* {
  position: relative;
}

.rcard header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 20px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.rcard header p {
  margin: 2px 0 0;
  font-size: .95rem;
  max-width: 60ch;
}

.rcard h2 {
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem);
}

.rbody {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(22px, 4vw, 56px);
}

.rcol h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 700 .72rem var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.rcol h3 span {
  padding: 0 8px;
  border-radius: 999px;
  background: var(--glow1);
  color: var(--fg);
  letter-spacing: 0;
}

.lcol.empty .llist {
  display: none;
}

.lcol.empty::after {
  content: "No links of this type here.";
  color: var(--mut);
  font-size: .9rem;
}

.llist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.lrow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  text-decoration: none;
  transition: transform .4s var(--ease), border-color .3s, background-color .3s;
}

.lrow:hover {
  transform: translate3d(4px, 0, 0);
  border-color: var(--accent);
}

.lrow .ic {
  margin-left: auto;
  color: var(--mut);
  flex: none;
}

.lt {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font-size: .93rem;
  font-weight: 550;
  line-height: 1.35;
}

.lt small {
  color: var(--mut);
  font-weight: 400;
  font-size: .78rem;
}

.kind {
  flex: none;
  min-width: 62px;
  text-align: center;
  padding: 2px 8px;
  border-radius: 8px;
  font: 700 .64rem var(--sans);
  letter-spacing: .08em;
  text-transform: uppercase;
  background: var(--glow1);
  color: var(--accent);
}

.k-docs {
  background: var(--glow2);
}

.k-tool,
.k-profile {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--mut);
}

.notes {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
  counter-reset: n;
}

.notes li {
  position: relative;
  padding-left: 38px;
  color: var(--mut);
  font-size: .95rem;
  line-height: 1.65;
  counter-increment: n;
}

.notes li::before {
  content: counter(n);
  position: absolute;
  left: 0;
  top: .1em;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--g1), var(--g2));
  color: #fff;
  font: 700 .72rem var(--sans);
}

.notes code {
  padding: 1px 7px;
  border-radius: 7px;
  background: var(--glow1);
  color: var(--fg);
  font: 500 .85em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: nowrap;
}

.xl {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.xl:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.contact {
  padding: clamp(22px, 4.5vw, 52px);
  border-radius: 32px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--glow1), var(--glow2)), var(--card);
}

.note {
  font-size: .88rem;
}

.cgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 5vw, 64px);
  align-items: start;
}

.cf {
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--bg);
}

.cf-h {
  font-size: 1.25rem;
  margin-bottom: 14px;
}

.cf-row {
  margin-bottom: 14px;
}

.cf label {
  display: block;
  margin-bottom: 6px;
  font: 600 .85rem var(--sans);
  color: var(--fg);
}

.cf input[type="text"],
.cf input[type="email"],
.cf textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--fg);
  font: 500 1rem var(--sans);
  outline: none;
  transition: border-color .2s;
}

.cf textarea {
  resize: vertical;
  min-height: 130px;
}

.cf input:focus,
.cf textarea:focus {
  border-color: var(--accent);
}

.cf .cf-q input {
  width: 110px;
}

.cf .hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

#cf-status {
  margin-top: 12px;
  min-height: 1.4em;
  color: var(--fg);
}

#cf-status.ok {
  color: var(--accent);
}

#cf-status.err {
  color: #e5484d;
}

.pager-sec {
  padding-bottom: 0;
}

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pager.one {
  grid-template-columns: 1fr;
}

.pg {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  text-decoration: none;
  transition: transform .5s var(--ease), border-color .3s, box-shadow .4s;
  min-width: 0;
}

.pg span {
  display: block;
  font: 700 .62rem var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--mut);
  line-height: 1.3;
}

.pg b {
  display: block;
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.3;
}

.pg .ic {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--accent);
  transition: transform .5s var(--ease);
}

.pg.prev .ic {
  transform: rotate(180deg);
}

.pg.next {
  justify-content: space-between;
}

.pg.next .ic {
  margin-left: auto;
}

.pg:hover {
  border-color: var(--accent);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .14);
  transform: translate3d(0, -2px, 0);
}

.pg.next:hover .ic {
  transform: translate3d(4px, 0, 0);
}

.pg.prev:hover .ic {
  transform: rotate(180deg) translate3d(4px, 0, 0);
}

.totop {
  position: fixed;
  right: clamp(14px, 3vw, 28px);
  bottom: clamp(14px, 3vw, 28px);
  z-index: 60;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(12px);
  color: var(--fg);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0, 12px, 0);
  transition: opacity .4s var(--ease), transform .4s var(--ease), border-color .3s;
}

.totop .ic {
  width: 18px;
  height: 18px;
}

.totop.show {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.totop:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.footer {
  margin-top: clamp(30px, 5vw, 60px);
  border-top: 1px solid var(--line);
  padding: 26px 0 20px;
}

.fbrand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.fbrand .brand {
  margin: 0;
}

.fbrand .soc {
  margin-left: 0;
}

.fbase {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.fbase p {
  margin: 0;
  font-size: .8rem;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

[hidden] {
  display: none!important;
}

.js .reveal,
.js .stag>* {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  transition: opacity .9s var(--ease), transform 1s var(--ease);
  transition-delay: var(--d, 0s);
  will-change: opacity, transform;
}

.js .reveal.in,
.js .stag>*.in {
  opacity: 1;
  transform: none;
  will-change: auto;
}

.js .reveal.in,
.js .stag>.in {
  transition-delay: var(--d, 0s);
}

.js .stag>.tool.in,
.js .stag>.sk.in,
.js .themes li.reveal.in,
.js .ntile.reveal.in,
.js .proj.reveal.in,
.js .rcard.reveal.in {
  transition: opacity .9s var(--ease), transform .5s var(--ease), border-color .3s, box-shadow .4s;
}

.js .stag>.tool.in:hover,
.js .stag>.sk.in:hover {
  transform: translate3d(0, -4px, 0);
  border-color: var(--accent);
}

.js .themes li.reveal.in:hover {
  transform: translate3d(0, -6px, 0);
  border-color: var(--accent);
}

.js .proj.reveal.in:hover,
.js .rcard.reveal.in:hover {
  border-color: var(--accent);
  box-shadow: 0 26px 60px rgba(0, 0, 0, .2);
}

@media (max-width: 1060px) {
  .hide-sm {
    display: none!important;
  }
  .ntiles,
  .themes {
    grid-template-columns: repeat(2, 1fr);
  }
  .ntile:last-child {
    grid-column: 1/-1;
  }
}


@media (max-width: 1000px) {
  .menu-btn {
    display: grid;
  }
  .bn {
    display: none;
  }
  #site-nav {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 22px;
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    transition: max-height .5s var(--ease), opacity .3s, visibility .5s;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .3);
  }
  #site-nav.open {
    max-height: 80vh;
    visibility: visible;
    opacity: 1;
  }
  .nav-list {
    flex-direction: column;
    gap: 0;
    padding: 8px;
  }
  .nl {
    width: 100%;
    min-height: 50px;
    font-size: 1rem;
    border-radius: 14px;
  }
  .nl::after {
    display: none;
  }
  .nl[aria-current] {
    box-shadow: inset 3px 0 var(--accent);
  }
}


@media (max-width: 860px) {
  .hero-g,
  .two,
  .grid2,
  .proj,
  .themes,
  .skills,
  .rbody,
  .cgrid {
    grid-template-columns: 1fr;
  }
  .proj.rev figure {
    order: 0;
  }
  .facts {
    grid-template-columns: repeat(2, 1fr);
  }
  .pub {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .rcard header {
    align-items: flex-start;
  }
  .recent a {
    grid-template-columns: 1fr 20px;
  }
  .recent .rd {
    grid-column: 1/-1;
    margin: 0;
  }
}


@media (max-width: 560px) {
  .ntiles {
    grid-template-columns: 1fr;
  }
  .ntile {
    min-height: 170px;
  }
  .tools-g {
    grid-template-columns: repeat(2, 1fr);
  }
  .orgs li a {
    grid-template-columns: 96px 1fr 22px;
    gap: 12px;
  }
  .pager {
    gap: 8px;
  }
  .pg {
    padding: 8px 12px;
    gap: 8px;
    border-radius: 12px;
  }
  .pg span {
    display: none;
  }
  .pg b {
    font-size: .85rem;
  }
  .pg .ic {
    width: 15px;
    height: 15px;
  }
  .pager.one .pg {
    justify-content: space-between;
  }
}


@media (prefers-contrast: more) {
  :root,
  html[data-theme="dark"] {
    --line: rgba(128, 128, 128, .6);
    --mut: currentColor;
  }
}


@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: .01ms!important;
    animation: none!important;
    scroll-behavior: auto!important;
  }
  .ani,
  .w {
    opacity: 1;
  }
  .js .reveal,
  .js .stag>* {
    opacity: 1;
    transform: none;
  }
  .progress {
    display: none;
  }
}


@media print {
  :root,
  html[data-theme="dark"] {
    --bg: #fff;
    --fg: #000;
    --mut: #333;
    --line: #bbb;
    --card: #fff;
    --accent: #0b5560;
  }
  body {
    animation: none;
    font-size: 11pt;
  }
  .bar,
  .progress,
  .glow,
  .footer,
  .pager-sec,
  .totop,
  .filters,
  .kfilter,
  .chips,
  .cta,
  .cf,
  .cite,
  .skip,
  .go,
  .pubbar {
    display: none!important;
  }
  .ani,
  .w,
  .reveal,
  .stag>* {
    opacity: 1!important;
    transform: none!important;
    animation: none!important;
  }
  .panel,
  .proj,
  .rcard,
  .tool,
  .sk,
  .themes li,
  .ntile,
  .recent {
    break-inside: avoid;
    box-shadow: none!important;
    background: #fff!important;
  }
  .grid2,
  .two,
  .proj,
  .rbody {
    grid-template-columns: 1fr!important;
  }
  .wrap {
    width: 100%;
  }
  a {
    text-decoration: none;
  }
  h1 {
    font-size: 24pt;
  }
  .phead {
    padding-top: 0;
  }
}

/* ---------------------------------------------------------------
   Home page: tighten the spacing around the pull quote
   --------------------------------------------------------------- */
.sec:has(+ .sec .quote) {
  padding-bottom: clamp(8px, 2vw, 24px);
}

.sec:has(.quote) {
  padding-block: 0;
}

.quote {
  padding: clamp(4px, 1vw, 12px) 0;
}

.sec:has(.quote) + .sec {
  padding-top: clamp(18px, 3vw, 40px);
}
