*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  margin: 0;
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  position: relative;
  min-height: 100svh;
  min-height: 100dvh;
  display: grid;
  place-items: safe center;
  padding:
    max(1.25rem, env(safe-area-inset-top))
    max(1rem, env(safe-area-inset-right))
    max(1.25rem, env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
  font-family: Outfit, system-ui, sans-serif;
  background:
    radial-gradient(780px 380px at 50% 28%, #fbfcfe 0%, transparent 58%),
    radial-gradient(900px 520px at 50% 100%, #dce2ee 0%, transparent 62%),
    #e8ecf4;
  color: #16182a;
  -webkit-font-smoothing: antialiased;
}

html[lang="fa"] body {
  font-family: Vazirmatn, Outfit, Tahoma, sans-serif;
}

html[lang="fa"] h1 {
  font-family: Outfit, Vazirmatn, sans-serif;
}

.langs {
  display: flex;
  direction: ltr;
  justify-content: center;
  align-items: center;
  gap: 0.1rem;
  margin: 0 0 0.85rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.langs a {
  padding: 0.28rem 0.5rem;
  color: #8a91a4;
  text-decoration: none;
  border-radius: 4px;
}

.langs a:hover,
.langs a[aria-current="page"] {
  color: #16182a;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg svg {
  display: block;
  width: 100%;
  height: 100%;
}

main {
  position: relative;
  z-index: 1;
  width: min(28.5rem, 100%);
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.85rem 1.15rem 1.5rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 1.35rem;
  box-shadow:
    0 1px 1px rgba(22, 24, 42, 0.03),
    0 18px 50px rgba(22, 24, 42, 0.08);
  backdrop-filter: blur(10px);
}

.photo {
  width: clamp(6.75rem, 28vw, 8.75rem);
  height: clamp(6.75rem, 28vw, 8.75rem);
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  box-shadow:
    0 0 0 1px #d7dce8,
    0 10px 24px rgba(22, 24, 42, 0.1);
}

.photo img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
  object-position: center;
}

h1 {
  margin: 1.15rem 0 0;
  max-width: 100%;
  font-size: clamp(1.5rem, 6.4vw, 2.05rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
}

.place {
  margin: 0.4rem 0 0;
  max-width: 100%;
  padding-inline: 0.15rem;
  font-size: clamp(0.68rem, 2.7vw, 0.82rem);
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-wrap: balance;
  color: #6b7188;
}

.bio {
  margin: 1.05rem 0 0;
  max-width: 100%;
  font-size: clamp(0.9rem, 3.4vw, 0.98rem);
  font-weight: 400;
  line-height: 1.6;
  overflow-wrap: break-word;
  color: #3c4156;
}

.skills,
.work {
  margin-top: 1.25rem;
  width: 100%;
  max-width: 100%;
  padding-top: 1.1rem;
  border-top: 1px solid #eceff5;
}

.work {
  margin-top: 0.95rem;
  padding-top: 0.95rem;
}

.skills h2,
.work h2 {
  margin: 0 0 0.7rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6b7188;
}

.skills ul,
.work ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.skills li,
.work a {
  padding: 0.28rem 0.62rem;
  border: 1px solid #e4e8f0;
  border-radius: 5px;
  background: #f7f8fb;
  font-size: clamp(0.72rem, 2.6vw, 0.78rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: #1c2030;
}

.work a {
  display: inline-block;
  text-decoration: none;
}

.work a:hover {
  background: #fff;
  border-color: #c8cedc;
}

.mail {
  margin: 1.15rem 0 0;
  max-width: 100%;
}

.mail a {
  display: inline-block;
  max-width: 100%;
  color: #16182a;
  font-size: clamp(0.8rem, 3.6vw, 0.92rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.4;
  text-decoration: none;
  overflow-wrap: anywhere;
  border-bottom: 1px solid #c8cedc;
}

.mail a:hover {
  border-bottom-color: #16182a;
}

nav.social {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  margin-top: 1.35rem;
  padding: 0.28rem;
  max-width: 100%;
  background: #f4f6fa;
  border-radius: 999px;
}

nav.social a {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  min-width: 44px;
  min-height: 44px;
  color: #16182a;
  border-radius: 50%;
  transition: background 0.15s ease, color 0.15s ease;
}

nav.social a:hover {
  background: #fff;
  color: #0b0d18;
}

nav.social svg {
  display: block;
  width: 1.5rem;
  height: 1.5rem;
}

:focus-visible {
  outline: 2px solid #16182a;
  outline-offset: 3px;
}

html[lang="fa"] .place,
html[lang="fa"] .skills h2,
html[lang="fa"] .work h2 {
  letter-spacing: 0;
  text-transform: none;
}

html[lang="fa"] .place {
  font-size: clamp(0.78rem, 2.8vw, 0.9rem);
}

html[lang="fa"] .bio {
  line-height: 1.85;
}

@media (min-width: 480px) {
  body {
    padding:
      max(2.5rem, env(safe-area-inset-top))
      max(1.25rem, env(safe-area-inset-right))
      max(2.5rem, env(safe-area-inset-bottom))
      max(1.25rem, env(safe-area-inset-left));
  }

  main {
    padding: 2.4rem 1.7rem 1.9rem;
  }

  .place {
    letter-spacing: 0.08em;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  body {
    padding-block: 0.75rem;
    align-content: start;
  }

  .photo {
    width: 5.5rem;
    height: 5.5rem;
  }

  h1 {
    margin-top: 0.7rem;
  }

  .bio {
    margin-top: 0.7rem;
  }

  .skills,
  .work,
  nav.social {
    margin-top: 0.9rem;
  }
}
