:root {
  --yellow: #ffdc19;
  --black: #090909;
  --panel: #111111;
  --white: #f6f4ed;
  --grey: #9c9c96;
  --line: #31312e;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--white);
  background: var(--black);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(#ffffff08 1px, transparent 1px),
    linear-gradient(90deg, #ffffff08 1px, transparent 1px);
  background-size: 42px 42px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 78%);
  mask-image: linear-gradient(to bottom, #000, transparent 78%);
  animation: grid-drift 18s linear infinite alternate;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .025;
  background-image:
    radial-gradient(circle at 20% 30%, #fff 0 .55px, transparent .75px),
    radial-gradient(circle at 75% 65%, #fff 0 .45px, transparent .7px);
  background-size: 9px 9px, 13px 13px;
}

a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.topbar {
  width: min(100% - 28px, 540px);
  height: 80px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  border-bottom: 1px solid var(--line);
}
.share-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--white);
  background: transparent;
  font: 800 10px/1 Arial, sans-serif;
  letter-spacing: .13em;
  cursor: pointer;
}
.share-button b { color: var(--yellow); font-size: 17px; }
.share-button { animation: reveal-down .45s ease-out .05s both; }

.shell {
  width: min(100% - 28px, 540px);
  margin: 0 auto;
  padding: 50px 0 72px;
}
.identity { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; }
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 23px;
  color: var(--grey);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .13em;
  animation: reveal-up .5s ease-out .08s both;
}
.status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 18px #ffdc19aa;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .35; } }

.portrait-frame {
  position: relative;
  width: min(52vw, 190px);
  aspect-ratio: 1;
  margin: 0 auto 29px;
  border: 1px solid #494943;
  background: var(--yellow);
  box-shadow: 12px 12px 0 var(--yellow);
  animation: portrait-in .72s cubic-bezier(.2, .8, .2, 1) .12s both, portrait-float 5s ease-in-out .95s infinite;
}
.portrait-frame::before, .portrait-frame::after {
  content: "";
  position: absolute;
  z-index: 1;
  width: 22px;
  height: 22px;
  pointer-events: none;
}
.portrait-frame::before { inset: -6px auto auto -6px; border-top: 2px solid var(--yellow); border-left: 2px solid var(--yellow); }
.portrait-frame::after { inset: auto -18px -18px auto; border-right: 2px solid var(--white); border-bottom: 2px solid var(--white); }
.portrait-frame img { width: 100%; height: 100%; display: block; object-fit: cover; filter: contrast(1.05); }
.portrait-tag {
  position: absolute;
  right: -13px;
  bottom: 16px;
  padding: 6px 8px;
  color: var(--black);
  background: var(--white);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
}

.urdu-name {
  width: max-content;
  margin: 0 auto 8px;
  padding: 5px 10px 8px;
  color: var(--black);
  background: var(--yellow);
  font-family: "Noto Nastaliq Urdu", "Noto Naskh Arabic", "Segoe UI", Tahoma, sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}
.name-block { animation: reveal-up .58s cubic-bezier(.2, .8, .2, 1) .26s both; }
h1 {
  margin: 0;
  max-width: 520px;
  font-size: clamp(38px, 12vw, 70px);
  line-height: .89;
  letter-spacing: -.065em;
  text-transform: uppercase;
  text-align: center;
}
.handle { margin: 16px 0 0; color: var(--yellow); font: 800 11px/1.4 "Courier New", monospace; }
.intro { max-width: 470px; margin: 24px auto 0; color: #c8c7c0; font-size: 14px; line-height: 1.65; animation: reveal-up .55s ease-out .36s both; }
.meta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 19px; animation: reveal-up .55s ease-out .44s both; }
.meta-row span { padding: 6px 8px; border: 1px solid var(--line); color: var(--grey); font-size: 8px; font-weight: 800; letter-spacing: .1em; }

.links { margin-top: 54px; }
.section-kicker { display: flex; justify-content: space-between; margin: 0 0 12px; color: var(--grey); font-size: 9px; font-weight: 800; letter-spacing: .13em; animation: reveal-up .5s ease-out .5s both; }
.section-kicker span { color: var(--yellow); font-size: 17px; }
.link-card {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 32px;
  gap: 10px;
  align-items: center;
  min-height: 108px;
  margin-bottom: 11px;
  padding: 17px 15px;
  border: 1px solid var(--line);
  color: var(--white);
  background: var(--panel);
  text-decoration: none;
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
  animation: reveal-up .58s cubic-bezier(.2, .8, .2, 1) both;
}
.link-card:nth-of-type(1) { animation-delay: .58s; }
.link-card:nth-of-type(2) { animation-delay: .68s; }
.link-card::after { content: ""; position: absolute; left: 0; bottom: 0; width: 0; height: 3px; background: var(--yellow); transition: width .25s ease; }
.link-card.featured { color: var(--black); background: var(--yellow); border-color: var(--yellow); }
.link-card.project-link { min-height: 94px; opacity: .88; }
.link-card.featured::after { background: var(--black); }
.card-number { align-self: start; color: var(--grey); font: 700 9px/1 "Courier New", monospace; }
.featured .card-number { color: #4b4200; }
.card-copy { min-width: 0; }
.card-copy small { display: block; margin-bottom: 5px; color: var(--grey); font-size: 8px; font-weight: 900; letter-spacing: .14em; }
.featured .card-copy small { color: #4b4200; }
.card-copy strong { display: block; font-size: clamp(21px, 7vw, 29px); line-height: 1; letter-spacing: -.045em; }
.card-copy em { display: block; margin-top: 7px; overflow: hidden; color: var(--grey); font-size: 10px; font-style: normal; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.featured .card-copy em { color: #4b4200; }
.card-arrow { justify-self: end; font-size: 25px; font-weight: 400; transition: transform .2s ease; }
.note-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 15px;
  margin-top: 22px;
  padding: 18px;
  border: 1px dashed #4a4a44;
  animation: reveal-up .55s ease-out .78s both;
}
.asterisk { color: var(--yellow); font-size: 48px; line-height: .8; }
.note-card p { margin: 0; color: var(--grey); font-size: 11px; line-height: 1.55; }
.note-card strong { color: var(--white); font-size: 13px; }

footer {
  width: min(100% - 28px, 540px);
  margin: 0 auto;
  padding: 23px 0 32px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  color: #6f6f69;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .1em;
  animation: reveal-up .5s ease-out .85s both;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 10;
  padding: 11px 16px;
  color: var(--black);
  background: var(--yellow);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .12em;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 15px);
  transition: .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes reveal-up {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes reveal-down {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes portrait-in {
  from { opacity: 0; transform: scale(.88) rotate(-4deg); }
  70% { opacity: 1; transform: scale(1.025) rotate(1deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes portrait-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes grid-drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(12px, 8px, 0); }
}

@media (hover: hover) {
  .link-card:hover { transform: translateX(6px); border-color: var(--yellow); background: #181816; }
  .link-card.featured:hover { color: var(--white); background: var(--black); }
  .link-card:hover::after { width: 100%; }
  .link-card:hover .card-arrow { transform: translate(3px, -3px); }
  .share-button:hover { color: var(--black); background: var(--yellow); border-color: var(--yellow); }
  .share-button:hover b { color: var(--black); }
}
.link-card:active { transform: translate(3px, 2px); }
.link-card:focus-visible, .share-button:focus-visible { outline: 3px solid var(--yellow); outline-offset: 4px; }

@media (min-width: 800px) {
  body { padding: 24px 0; }
  .topbar { height: 84px; }
  .shell { display: block; padding: 62px 26px 82px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
  .identity { position: relative; top: auto; }
  .portrait-frame { width: 180px; }
  h1 { font-size: 58px; }
  .links { margin-top: 52px; }
  .link-card { min-height: 119px; padding: 20px; grid-template-columns: 34px minmax(0, 1fr) 40px; }
  .card-copy strong { font-size: 30px; }
  .card-copy em { font-size: 11px; }
}
@media (max-width: 370px) {
  .shell, .topbar, footer { width: min(100% - 20px, 540px); }
  .shell { padding-top: 38px; }
  .link-card { padding-inline: 12px; }
  .card-copy strong { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
