/* ---------------------------------------------------------------
   mahdi bokhamsin — personal link page
   plain css, no framework, no external requests
   --------------------------------------------------------------- */

/* ---------- fonts (self-hosted, woff2) ---------- */
@font-face {
  font-family: "Plex";
  src: url("/assets/fonts/plex-latin-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+2190-21BB, U+2212;
}
@font-face {
  font-family: "Plex";
  src: url("/assets/fonts/plex-latin-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+2190-21BB, U+2212;
}
@font-face {
  font-family: "Plex";
  src: url("/assets/fonts/plex-latin-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+2190-21BB, U+2212;
}
@font-face {
  font-family: "Plex";
  src: url("/assets/fonts/plex-ar-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: "Plex";
  src: url("/assets/fonts/plex-ar-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: "Plex";
  src: url("/assets/fonts/plex-ar-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}

/* ---------- design tokens ---------- */
:root {
  color-scheme: dark light;

  --ink:        #0b0d10;
  --surface:    #14171c;
  --surface-2:  #191d23;
  --line:       #262b33;
  --line-soft:  #1e232a;
  --text:       #edeff2;
  --muted:      #9aa3af;
  --accent:     #c8a96a;
  --accent-dim: #8b7647;
  --accent-wash: rgba(200, 169, 106, .10);

  --radius: 14px;
  --gap: 10px;
  --measure: 460px;
  --ease: cubic-bezier(.22, .68, .32, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    --ink:        #f6f5f2;
    --surface:    #ffffff;
    --surface-2:  #fdfdfc;
    --line:       #e3e0d9;
    --line-soft:  #ece9e2;
    --text:       #15181d;
    --muted:      #5b636e;
    --accent:     #8a6d2f;
    --accent-dim: #b39a63;
    --accent-wash: rgba(138, 109, 47, .08);
  }
}

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

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

body {
  margin: 0;
  min-height: 100svh;
  background-color: var(--ink);
  color: var(--text);
  font-family: "Plex", ui-sans-serif, system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ---------- background: two soft blobs + a little grain ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }

.blob {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .5;
}
.blob-a {
  width: 62vmax; height: 62vmax;
  top: -30vmax; left: -22vmax;
  background: radial-gradient(circle at 50% 50%, rgba(200, 169, 106, .30), transparent 66%);
  animation: drift-a 26s var(--ease) infinite alternate;
}
.blob-b {
  width: 54vmax; height: 54vmax;
  bottom: -26vmax; right: -20vmax;
  background: radial-gradient(circle at 50% 50%, rgba(94, 122, 154, .26), transparent 66%);
  animation: drift-b 32s var(--ease) infinite alternate;
}
@media (prefers-color-scheme: light) {
  .blob { opacity: .55; }
  .blob-a { background: radial-gradient(circle at 50% 50%, rgba(190, 158, 96, .34), transparent 66%); }
  .blob-b { background: radial-gradient(circle at 50% 50%, rgba(120, 145, 175, .26), transparent 66%); }
}

.grain {
  position: absolute; inset: 0;
  opacity: .16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  background-size: 140px 140px;
}

@keyframes drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(6vmax, 4vmax, 0) scale(1.08); }
}
@keyframes drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.05); }
  to   { transform: translate3d(-5vmax, -4vmax, 0) scale(1); }
}

/* ---------- layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(40px, 9vh, 76px) 20px calc(40px + env(safe-area-inset-bottom));
}

/* ---------- profile ---------- */
.profile { text-align: center; margin-bottom: 30px; }

.avatar { display: block; width: 140px; height: 140px; margin: 0 auto 20px; }
.avatar img {
  width: 140px; height: 140px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 1px solid var(--line);
  box-shadow: 0 0 0 5px var(--accent-wash), 0 18px 40px -22px rgba(0, 0, 0, .8);
}

.name {
  margin: 0;
  font-size: clamp(1.6rem, 6vw, 1.95rem);
  font-weight: 600;
  letter-spacing: -.018em;
  line-height: 1.2;
}

.handle {
  margin: 5px 0 0;
  font-size: .95rem;
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--accent);
}

.bio {
  margin: 16px auto 0;
  max-width: 40ch;
  font-size: .945rem;
  line-height: 1.62;
  color: var(--muted);
  text-wrap: pretty;
}

/* ---------- link cards ---------- */
.links ul { list-style: none; margin: 0; padding: 0; }
.links li + li { margin-top: var(--gap); }

.card {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 58px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform .2s var(--ease),
    border-color .2s var(--ease),
    background-color .2s var(--ease),
    box-shadow .2s var(--ease);
}

.card .ico {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 10px;
  background-color: var(--surface-2);
  border: 1px solid var(--line-soft);
  color: var(--muted);
  transition: color .2s var(--ease), border-color .2s var(--ease), background-color .2s var(--ease);
}
.card .ico svg { width: 19px; height: 19px; display: block; }

.card .label {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 8px;
  min-width: 0;
  font-size: .965rem;
  font-weight: 500;
  letter-spacing: -.004em;
}

/* each script gets its own isolated run so mixed labels never reorder */
.card .ar { unicode-bidi: isolate; font-size: 1.02em; line-height: 1.75; }
.card .en { unicode-bidi: isolate; }

.dot {
  display: inline-block;
  width: 3px; height: 3px;
  border-radius: 50%;
  background-color: var(--accent-dim);
  opacity: .75;
  flex: 0 0 auto;
}

.card .go {
  flex: 0 0 auto;
  display: grid; place-items: center;
  width: 20px; height: 20px;
  color: var(--muted);
  opacity: .55;
  transition: opacity .2s var(--ease), transform .2s var(--ease), color .2s var(--ease);
}
.card .go svg { width: 17px; height: 17px; display: block; }

/* hover / focus */
@media (hover: hover) {
  .card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-dim);
    background-color: var(--surface-2);
    box-shadow: 0 0 0 3px var(--accent-wash), 0 14px 28px -20px rgba(0, 0, 0, .9);
  }
  .card:hover .ico { color: var(--accent); border-color: var(--accent-dim); }
  .card:hover .go { opacity: 1; color: var(--accent); transform: translateX(2px); }
}

.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-color: var(--accent-dim);
}

.card:active { transform: translateY(0) scale(.995); }

/* ---------- actions ---------- */
.actions { margin-top: 22px; display: flex; flex-direction: column; gap: var(--gap); }

.card-primary {
  border-color: var(--accent-dim);
  background-color: var(--accent-wash);
}
.card-primary .ico { color: var(--accent); border-color: var(--accent-dim); background-color: transparent; }
.card-primary .go { opacity: .8; color: var(--accent); }

.card-ghost { background-color: transparent; }

/* ---------- footer ---------- */
.foot { margin-top: 30px; text-align: center; }
.foot p { margin: 0; font-size: .82rem; color: var(--muted); }

/* ---------- entrance motion ---------- */
.rise {
  opacity: 0;
  transform: translateY(12px);
  animation: rise .4s var(--ease) forwards;
}
.d0  { animation-delay: 0ms;   }
.d1  { animation-delay: 60ms;  }
.d2  { animation-delay: 120ms; }
.d3  { animation-delay: 180ms; }
.d4  { animation-delay: 240ms; }
.d5  { animation-delay: 300ms; }
.d6  { animation-delay: 360ms; }
.d7  { animation-delay: 420ms; }
.d8  { animation-delay: 480ms; }
.d9  { animation-delay: 540ms; }
.d10 { animation-delay: 600ms; }
.d11 { animation-delay: 660ms; }
.d12 { animation-delay: 720ms; }

@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- reduced motion: everything static ---------- */
@media (prefers-reduced-motion: reduce) {
  .rise { opacity: 1; transform: none; animation: none; }
  .blob { animation: none; }
  .card, .card .ico, .card .go { transition: none; }
  .card:hover { transform: none; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}

/* ---------- small screens ---------- */
@media (max-width: 360px) {
  .wrap { padding-left: 14px; padding-right: 14px; }
  .card { gap: 11px; padding: 10px 12px; }
  .card .label { font-size: .93rem; }
  .avatar, .avatar img { width: 120px; height: 120px; }
}

/* ---------- print ---------- */
@media print {
  .bg { display: none; }
  .card { break-inside: avoid; }
}
